The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Control position (X/Y) in QM dialog
#1
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.
Code:
Copy      Help
GetWinXY id(3 hDlg) x y cx cy hDlg
mou x y hDlg

(using latest version of windows 10)

Function control_position_test
Code:
Copy      Help
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


Messages In This Thread
Control position (X/Y) in QM dialog - by r0n - 09-07-2019, 11:04 AM
RE: Control position (X/Y) in QM dialog - by r0n - 09-07-2019, 11:48 AM
RE: Control position (X/Y) in QM dialog - by r0n - 09-08-2019, 04:01 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)