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
|
#include "Header.h"
BOOL CALLBACK TriggerDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
{
HWND hCombo = GetDlgItem(hWnd, IDC_COMBO_TRIGGER);
SendMessage(hCombo, CB_ADDSTRING, NULL, (LPARAM)"Time");
SendMessage(hCombo, CB_ADDSTRING, NULL, (LPARAM)"Joystick Input");
SendMessage(hCombo, CB_ADDSTRING, NULL, (LPARAM)"Keyboard Input");
SendMessage(hCombo, CB_SETCURSEL, 0, NULL);
static HWND current = GetDlgItem(hWnd, IDC_EDIT_TIME);
break;
}
case WM_DESTROY:
{
break;
}
case WM_COMMAND:
{
switch (LOWORD(wParam))
{
case IDC_COMBO_TRIGGER:
{
if(HIWORD(wParam) == CBN_SELENDOK)
{
int sel = SendMessage((HWND)lParam, CB_GETCURSEL, NULL, NULL);
if(sel == CB_ERR)
break;
static HWND current;
string help[] = { "milliseconds", "Joystick Trigger", "Keyboard Button" };
SendMessage(GetDlgItem(hWnd, IDC_INPUT_HELP), WM_SETTEXT, NULL, (LPARAM)help[sel].c_str());
if(current == NULL)
MessageBox(hWnd, "null", NULL, NULL);
if(sel == 0)
{
//time, show editbox for milliseconds
ShowWindow(GetDlgItem(hWnd, IDC_EDIT_TIME), TRUE);
}
else if(sel == 1)
{
//joystick, show combobox with available joystick triggers
}
else if(sel == 2)
{
//keyboard, process keyboard input
}
}
break;
}
}
break;
}
}
return FALSE;
}
|