Anyone know how to set the focus to a button on a form?
Or maybe how to change the tabstop order?
Printable View
Anyone know how to set the focus to a button on a form?
Or maybe how to change the tabstop order?
Code:SendMessage(handleofbutton,WM_SETFOCUS,0,0);
You shouldnt use SendMessage, you should use SetFocus(hWnd).
How is there an easy way to get the hWnd of a button on my form??
hControl= GetDlgItem(hDialog, BUTTON_ID);
Thanks
Couldn't you use FindWindow to get a window's handle?
Code:hWin = FindWindow(NULL,"Caption");
What if two windows have the same caption?
You get the first window created (I think). Anyway, you'll always have the handle, because if it's a dialogue, use GetDlgItem, and if it's window, you'd have received the handle in the call to CreateWindowEx.