[go: up one dir, main page]

Menu

[r1]: / Dialog.h  Maximize  Restore  History

Download this file

60 lines (48 with data), 1.6 kB

 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
// Dialog.h: interface for the Dialog class.
//
//////////////////////////////////////////////////////////////////////
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "resizer.h"
//#define _AFX_NOFORCE_LIBS
//#include <afxtempl.h>
typedef struct EVENT_HANDLER {
UINT uMsg;
DLGPROC handler;
} EVENT_HANDLER;
//LRESULT CallOldWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
class Dialog
{
public:
void IP_SetValue(int CtlID, DWORD addr);
DWORD IP_GetValue(int CtlID, bool reverse = false);
LRESULT SendCtlMsg(int id, UINT uMsg, WPARAM wParam, LPARAM lParam);
void Hide();
bool EnableItem(int itemID, bool enable);
HWND Handle();
bool Ready();
Dialog(int ResID, EVENT_HANDLER *proc);
virtual ~Dialog();
HICON SetIconFromRes(int IconID);
int Show(bool modal=true);
HWND GetItem(int CtlID);
void SetItemText(int CtlID, LPCTSTR txt);
LPTSTR GetItemText(int CtlID);
DWORD GetItemText(int CtlID, LPTSTR txt, DWORD buflen);
bool SubclassItem(int CtlID, WNDPROC handler);
static LRESULT CallOldWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
//DWORD Dialog::GetItemCheckState(int CtlID);
bool BtnGetCheck(int CtlID);
bool BtnSetCheck(int CtlID, bool value);
void SpinSetRange(int CtlID, long min, long max);
long SpinGetValue(int CtlID);
long SpinSetValue(int CtlID, long value);
CResizer resizer;
private:
bool cancel;
HWND hWnd;
DWORD procCount;
EVENT_HANDLER *procUser;
static BOOL CALLBACK LocalDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
};