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
|
INT_PTR CALLBACK DialogProc(__in HWND hwndDlg,__in UINT uMsg,__in WPARAM wParam,__in LPARAM lParam,__in HWND hwnd,__in UINT IDT_TIMER1,__in UINT IDT_TIMER2,__in UINT IDT_TIMER3,__in UINT IDT_TIMER4)
{
int checked;
switch(uMsg)
{
case WM_INITDIALOG: //To initiate the dialog box
return TRUE;
case WM_COMMAND: //This is where you run your control. The control will let you connect with the checkboxes.
switch(LOWORD(wParam))
{
case IDC_CHECK1:
checked = IsDlgButtonChecked(hwndDlg, IDC_CHECK1);//check if the check box is checked.
if (checked)
{
SetTimer(hwnd, IDT_TIMER2, 1000, NULL);
MovementL(checked);
}
else KillTimer(hwnd, IDT_TIMER2);
break;
case IDC_CHECK2:
checked = IsDlgButtonChecked(hwndDlg, IDC_CHECK2);//check if the check box is checked.
if (checked)
{
SetTimer(hwnd, IDT_TIMER4, 1000, NULL);
MovementR(checked);//if checkbox checked, read and execute.
}
else KillTimer(hwnd, IDT_TIMER4);
break;
case IDC_CHECK3:
checked = IsDlgButtonChecked(hwndDlg, IDC_CHECK3);//check if the check box is checked.
if (checked)
{
SetTimer(hwnd, IDT_TIMER1, 30000, NULL);
Attack(checked);//if checkbox checked, read and execute.
}
else KillTimer(hwnd, IDT_TIMER1);
break;
case IDC_CHECK4:
checked = IsDlgButtonChecked(hwndDlg, IDC_CHECK4);//check if the check box is checked.
if (checked)
{
SetTimer(hwnd, IDT_TIMER3, 30000, NULL);
Attack(checked);//if checkbox checked, read and execute.
}
else KillTimer(hwnd, IDT_TIMER3);
break;
}
break;
case WM_TIMER:
switch (LOWORD(wParam))
{
case IDT_TIMER1:
CheckDlgButton(hwnd, IDC_CHECK3, BST_UNCHECKED);
CheckDlgButton(hwnd, IDC_CHECK1, BST_CHECKED);
break;
case IDT_TIMER2:
CheckDlgButton(hwnd, IDC_CHECK1, BST_UNCHECKED);
CheckDlgButton(hwnd, IDC_CHECK4, BST_CHECKED);
break;
case IDT_TIMER3:
CheckDlgButton(hwnd, IDC_CHECK4, BST_UNCHECKED);
CheckDlgButton(hwnd, IDC_CHECK2, BST_CHECKED);
break;
case IDT_TIMER4:
CheckDlgButton(hwnd, IDC_CHECK2, BST_UNCHECKED);
CheckDlgButton(hwnd, IDC_CHECK3, BST_CHECKED);
break;
}
break;
|