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
|
static LRESULT CALLBACK mainClass::WndProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam) {
bool checked = true;
HWND text, button, selection1, selection2;
//hwnd is parent window
switch (msg) {
case WM_CREATE: {
text = CreateWindow("STATIC", "Please select options from below:", WS_VISIBLE | WS_CHILD, 20, 20, 300, 25, hwnd, NULL, NULL, NULL);
case WM_COMMAND: {
int i = wParam;
if (i == 0) //LOWORD(wParam)
{
for (int j = 0; j != vectorSize; j++)
{
if (IsDlgButtonChecked(hwnd, j + 1) == true)
{
check.push_back(j);//member variable
}
}
}
case WM_DESTROY: {
PostQuitMessage(0);
break;
}
}
return DefWindowProcW(hwnd, msg, wParam, lParam);
}
|