Dialog Box (1).
By SalimMeghani
- 335 reads
// Mesage handler for about box.
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
break;
}
return FALSE;
}
// Subclassing Dialog box, so that input can be customised.
LRESULT CALLBACK EditSubclassProc(HWND hwnd, UINT UMsg, WPARAM wParam, LPARAM lParam)
{
if (UMsg==WM_GETDLGCODE)
{
return DLGC_WANTALLKEYS;
}
if (UMsg==WM_KEYDOWN)
{
if (wParam==VK_UP)
{
UMsg=WM_CHAR;
setcursor=2;
scrolled=0;
wParam='Ç';
}
}
if (UMsg==WM_KEYDOWN)
{
if (wParam==VK_DOWN)
{
UMsg=WM_CHAR;
setcursor=3;
wParam='Ç';
scrolled=0;
}
}
if (UMsg==WM_KEYDOWN)
{
if (wParam==VK_LEFT)
{
UMsg=WM_CHAR;
setcursor=4;
wParam='Ç';
scrolled=0;
}
}
if (UMsg==WM_KEYDOWN)
{
if (wParam==VK_RIGHT && scrolled)
{
UMsg=WM_CHAR;
setcursor=5;
scrolled=0;
wParam='Ç';
}
}
//
//
if (UMsg==WM_CHAR)
{
if (wParam=='\r')
{
UMsg=WM_CHAR;
setcursor=1;
wParam='Ç';
scrolled=0;
}
}
return CallWindowProc(wpOrigEditProc, hwnd, UMsg, wParam, lParam);
}
- Log in to post comments