1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
//Standard procedure for edit box.
LRESULT (CALLBACK *oldeditproc)(HWND, UINT, WPARAM, LPARAM);
//Procedure for edit box (New playlist).
LRESULT CALLBACK editproc(HWND hedit, UINT message, WPARAM wparam, LPARAM lparam) {
switch (message) {
//If a key is pressed:
case WM_KEYDOWN:
//If enter is pressed:
if(wparam == VK_RETURN) {
//Recieve handle for the dialogbox and send mouseclick message so it presses the OK button.
HWND dlg = FindWindow(NULL, L"New Playlist");
PostMessage(dlg, WM_LBUTTONDOWN, 0, MAKELPARAM(120,50));
}
}
//Standard procedure.
return CallWindowProc(oldeditproc, hedit, message, wparam, lparam);
}
|