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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
|
#include <windows.h>
#define IDC_CHECKBOX1 1500 // *** these are your control ID's but we will have to assign them to the checkbox windows below... ***
#define IDC_CHECKBOX2 1501 // *** these are your control ID's but we will have to assign them to the checkbox windows below... ***
#define IDC_CHECKBOX3 1502 // *** these are your control ID's but we will have to assign them to the checkbox windows below... ***
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
char szClassName[ ] = "EEbot V2";
HINSTANCE hInst;
HWND hCheckBox1, hCheckBox2, hCheckBox3; // *** You could use an array but it's easier to keep track of controls with unique identifiers ***
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nCmdShow)
{
hInst = hThisInstance;
HWND hwnd;
MSG messages;
WNDCLASSEX wincl;
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure;
wincl.style = CS_DBLCLKS;
wincl.cbSize = sizeof (WNDCLASSEX);
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL;
wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0;
wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
if (!RegisterClassEx (&wincl))
return 0;
hwnd = CreateWindowEx (
0,
szClassName,
"EEbot V2",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
350,
250,
HWND_DESKTOP,
NULL,
hThisInstance,
NULL
);
ShowWindow (hwnd, nCmdShow);
while (GetMessage (&messages, NULL, 0, 0))
{
TranslateMessage(&messages);
DispatchMessage(&messages);
}
return messages.wParam;
}
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_CREATE :
hCheckBox1 = CreateWindowEx (WS_EX_TRANSPARENT, TEXT("button"),
__TEXT("Hook Jump"),
WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
0, 0, 125, 20,
hwnd, 0,
hInst, NULL) ;
if(hCheckBox1)
{
// *** control was created ok, now we set the ID to match our predefined ones ***
::SetWindowLong(hCheckBox1,GWL_ID,IDC_CHECKBOX1); // *** set the control ID for CheckBox1 to IDC_CHECKBOX1 ***
} else {
// *** control creation failed, deal with it however you need to ***
}
hCheckBox2 = CreateWindowEx (WS_EX_TRANSPARENT, TEXT("button"),
__TEXT("Hook Jump 1x1"),
WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
0, 30, 125, 20,
hwnd, 0,
hInst, NULL);
if(hCheckBox2)
{
// *** control was created ok, now we set the ID to match our predefined ones ***
::SetWindowLong(hCheckBox2,GWL_ID,IDC_CHECKBOX2); // *** set the control ID for CheckBox1 to IDC_CHECKBOX1 ***
} else {
// *** control creation failed, deal with it however you need to ***
}
hCheckBox3 = CreateWindowEx (WS_EX_TRANSPARENT, TEXT("button"),
__TEXT("Dots"),
WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
0, 60, 125, 20,
hwnd, 0,
hInst, NULL);
if(hCheckBox3)
{
// *** control was created ok, now we set the ID to match our predefined ones ***
::SetWindowLong(hCheckBox3,GWL_ID,IDC_CHECKBOX3); // *** set the control ID for CheckBox1 to IDC_CHECKBOX1 ***
} else {
// *** control creation failed, deal with it however you need to ***
}
break;
case WM_COMMAND:
{
switch(LOWORD(wParam)) // *** Tells us which control ID sent a message ***
{
case IDC_CHECKBOX1: // *** user clicked box 1 ***
{
if(SendMessage(GetDlgItem(hwnd,IDC_CHECKBOX1),BM_GETCHECK,0,0) == BST_CHECKED)
{
MessageBox(hwnd,"Box is checked","You clicked CheckBox \"Hook Jump\"",0);
} else {
MessageBox(hwnd,"Box is unchecked","You clicked CheckBox \"Hook Jump\"",0);
}
} break;
case IDC_CHECKBOX2: // *** user clicked box 2 ***
{
if(SendMessage(GetDlgItem(hwnd,IDC_CHECKBOX2),BM_GETCHECK,0,0) == BST_CHECKED)
{
MessageBox(hwnd,"Box is checked","You clicked CheckBox \"Hook Jump 1x1\"",0);
} else {
MessageBox(hwnd,"Box is unchecked","You clicked CheckBox \"Hook Jump 1x1\"",0);
}
} break;
case IDC_CHECKBOX3: // *** user clicked box 3 ***
{
if(SendMessage(GetDlgItem(hwnd,IDC_CHECKBOX3),BM_GETCHECK,0,0) == BST_CHECKED)
{
MessageBox(hwnd,"Box is checked","You clicked CheckBox \"Dots\"",0);
} else {
MessageBox(hwnd,"Box is unchecked","You clicked CheckBox \"Dots\"",0);
}
} break;
}
} break;
case WM_DESTROY:
PostQuitMessage (0);
break;
default:
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
|