-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppDialog.h
64 lines (51 loc) · 1.59 KB
/
AppDialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef __APP_DIALOG_H__
#define __APP_DIALOG_H__
#define STR_MAX 80
#define RESIZE_NONE 0
#define RESIZE_X 8
#define RESIZE_Y 4
#define RESIZE_W 2
#define RESIZE_H 1
typedef struct resize_info
{
int id;
UINT flags;
} RESIZE_INFO;
class CAppDialog
{
protected:
HINSTANCE m_hInst;
public:
CAppDialog(HINSTANCE hInst);
SIZE m_InitialSize;
SIZE m_oldSize;
int m_iResizeCount;
const RESIZE_INFO* m_pResizeInfo;
HWND m_hWnd;
TCHAR m_szAppName[STR_MAX];
BOOL DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
virtual BOOL OnGetMinMaxInfo(LPMINMAXINFO pInfo);
virtual BOOL OnSize(WPARAM wParam, LPARAM lParam);
virtual BOOL OnInitDialog(WPARAM wParam, LPARAM lParam);
virtual BOOL OnDrawItem(WPARAM wParam, LPDRAWITEMSTRUCT lParam);
virtual BOOL OnCommand(WPARAM wId);
virtual BOOL OnNotify(WPARAM wId, LPNMHDR nmhdr);
BOOL CreateDialogBox(LPCTSTR pszResource, HWND hParent);
void MsgBox(UINT type, UINT id, ...);
void OnClose();
void SleepYield(DWORD msec);
BOOL ShowWindow(int nCmdShow);
int Run();
protected:
HWND m_hListView;
HWND m_hCombo;
HWND m_hProgress;
void ShowProgress(UINT done, UINT total);
BOOL SendBytes(LPVOID pBuffer, UINT count);
void DoSend(void);
BOOL DoLoopback(void);
void FillCombo(LPCTSTR pszFilename);
void ClearLog(void);
void GetCellRect(int col, LPCRECT pItemRect, LPRECT pCellRect);
};
#endif // __APP_DIALOG_H__