09-07-2019, 11:04 AM
Sorry for this really stupid question but I can't figure this out.
I am trying to position the mouse pointer to the topleft corner of an inputfield after the dialog has been rendered.
If I remove "hDlg" from below, then it works spot on. But if I add it to enforce from dialog area it does not work.
I tried to get titlebar-height and add to 'y' but still isn't correct.
(using latest version of windows 10)
Function control_position_test
I am trying to position the mouse pointer to the topleft corner of an inputfield after the dialog has been rendered.
If I remove "hDlg" from below, then it works spot on. But if I add it to enforce from dialog area it does not work.
I tried to get titlebar-height and add to 'y' but still isn't correct.
(using latest version of windows 10)
Function control_position_test
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Edit 0x54030080 0x200 55 49 96 13 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2040601 "*" "" "" ""
str controls = "3"
str e3
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
#sub DlgProc
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,case WM_PAINT
,,;; Get the XY of inputfield and move mouse to it's topright corner
,,;; Below only works when 'hDlg' is removed (by removing: using screen area)
,,int x y cx cy
,,GetWinXY id(3 hDlg) x y cx cy hDlg
,,mou x y hDlg
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1