12-27-2009, 09:30 PM
Is there a simple - smart way to position mouse pointer to a dialog control when starting the dialog.
Thanks in advance
Thanks in advance
Initial mouse pointer positioning on a dialog control
|
12-27-2009, 09:30 PM
Is there a simple - smart way to position mouse pointer to a dialog control when starting the dialog.
Thanks in advance
12-27-2009, 09:35 PM
Under WM_INITDIALOG:
GetWinXY or GetWindowRect mou
12-27-2009, 09:38 PM
Dear Gintaras,
Many thanks indeed. Regards Simos
In the example it follows, I try to position the cursor at a certain point on the dialog window, for example (10, 10), when the dialog starts. I am afraid it fails. No problem if the dialog is already visible. Any advice is mostly welcome and appreciated. Best regards.
Function Dialog55 ;Dialog to test Dlg_GoToCtrl
02-02-2019, 04:08 PM
Here works. Windows 10. Not tested on XP. If dialog is in wrong position when it receives WM_INITDIALOG, other good message for it is WM_SHOWWINDOW with wParam 1:
case WM_SHOWWINDOW if(wParam=1) mou 10 10 hDlg Or use timer.
02-02-2019, 05:12 PM
Many thanks , indeed!
02-03-2019, 11:49 AM
Let me report my last findings. I am using XP.
(i) WM_PAINT should not be used, inasmuch as it may be called several times during a dialog session. It is implied ttat an additional control could solve this problem. (ii) WM_SHOWWINDOW although it is triggered it does not position the cursor (mou does not work). (iii) Timer is working perfectly. Best regards. |
« Next Oldest | Next Newest »
|