00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
#pragma once
00023
00024
#include <string>
00025
#include <vector>
00026
#include <list>
00027
#include <io.h>
00028
#include "WinApp.h"
00029
00030
00031
enum {
00032
WM_SHELLNOTIFY = WM_USER + 100,
00033
WM_SHOW_SETTINGS,
00034
WM_CHANGE_ICON,
00035 };
00036
00037
00038
class Database;
00039
class Query;
00040
class FinderSocket;
00041
class FinderHandler;
00042
00043 class MyApp :
public WinApp
00044 {
00045
public:
00046
MyApp(HINSTANCE, HINSTANCE, Database& );
00047
~MyApp();
00048
00049 Database&
GetDatabase() {
return m_db; }
00050
00051
int Init(LPSTR lpCmdLine,
int nCmdShow);
00052
00053
void SetDialogData();
00054
void GetDialogData();
00055
void ShowTaskBar(BOOL show);
00056
00057 void SetQuit(
bool x =
true) {
m_quit = x; }
00058 int GetLocalPort() {
return m_local_port; }
00059 bool BindLocal() {
return m_bind_local; }
00060
00061
void check_thread_status();
00062
void view_thread_status(FinderSocket& );
00063
void settings_form(FinderSocket& );
00064
00065
void reg_minder(
FinderHandler& ,
const std::string& cmd);
00066
void minion_connect(
FinderHandler& h);
00067 int GetMinionPort() {
return m_minion_port; }
00068
void ApplyChanges();
00069 bool NoMinder() {
return m_no_minder; }
00070
00071 bool CreateTop() {
return m_create_top; }
00072 void SetCreateTop(
bool x =
true) {
m_create_top = x; }
00073
00074
void SetValues(
int local_port,
00075
bool bind_local,
const std::string& minder_host,
int minder_port,
00076
bool no_minder,
bool create_top,
00077
const std::string& join_group,
bool use_password,
const std::string& group_password);
00078
void SetDrop(
bool x =
true);
00079
00080 BOOL ShowBalloonTip(
const std::string& title,
00081
const std::string& msg);
00082
void ChangeIcon(
int id);
00083
int MemoryUsage();
00084
00085
private:
00086 Database&
m_db;
00087 bool m_quit;
00088
00089 int m_local_port;
00090 bool m_bind_local;
00091 std::string
m_minder_host;
00092 int m_minder_port;
00093 int m_minion_port;
00094 bool m_no_minder;
00095 std::string
m_new_minder_host;
00096 int m_new_minder_port;
00097 bool m_new_no_minder;
00098 bool m_create_top;
00099 std::string
m_join_group;
00100 bool m_use_password;
00101 std::string
m_group_password;
00102 std::string
m_new_join_group;
00103 bool m_new_use_password;
00104 std::string
m_new_group_password;
00105 };
00106
00107 extern MyApp *
g_app;
00108 extern HWND
g_hwndMain;
00109
00110