Mayflower1
asked on
Cursor Positioning
Hi all,
I have created a dialog box with few edit controls in it. When the application runs the cursor parks on OK button. I want it to park on one of the edit controls. How should I do that?
Thanks
I have created a dialog box with few edit controls in it. When the application runs the cursor parks on OK button. I want it to park on one of the edit controls. How should I do that?
Thanks
GoToDlgCtrl(GetDlgItem(IDC _EDIT1)) ;
If you do use GoToDlgCtrl you will need to do it in the OnInitDialog handler and change the handler to return FALSE.
Like I said, it may be easier to just change the tab order.
Like I said, it may be easier to just change the tab order.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you mean the mouse cursor, first you have to disable the code that is currently moving it, and then call SetCursorPos with the position you want in a place that gets called automatically right after the window is displayed for the first time. Offhand, I'd think in the WM_ONERASEBACKGROUND handler with a bool to detect whether this is the first time it is called.