Posts: 5
Threads: 2
Joined: Jun 2015
Some dialogs of the toolbar have a test-button which surrond the window or the control with a flashing rectangle. I guess there is a simple function behind this button. I have search for it, but not find it :roll: . Anybody knows which function this is? Or I need to write the code by myself?
Posts: 12,073
Threads: 140
Joined: Dec 2002
Macro
Macro2176
;simplest, black rectangle
RECT r; SetRect &r 400 300 500 350
rep 3
,OnScreenRect 1 r
,0.3
,OnScreenRect 3
,0.3
OnScreenRect 2
;red rectangle
RECT rr; SetRect &rr 400 300 500 350
__OnScreenRect osr
osr.SetStyle(0xff)
rep 3
,osr.Show(1 rr)
,0.3
,osr.Show(3)
,0.3
osr.Show(2)
;filled rectangle
osr.SetStyle(0xff0000 1)
rep 3
,osr.Show(1 rr)
,0.3
,osr.Show(3)
,0.3
osr.Show(2)
Posts: 5
Threads: 2
Joined: Jun 2015
Thanks for answer.
But I not write clear what I mean: I really want same functionalty like the test-button. A function which takes a window-/control-handle and highlights the window/control.
My idea is:
I want this as "debugging" feature. Each time my macro searched for a window/control, the macro should highlight the detected window/control.
This functionality is useful because the macros have sometimes a different behavior if run as exe or run in qm. Sometimes the macro-exe detect the wrong control (this is the matter of the application for which I write the macro). So when I test the macro, I immediatly can notice which control is detected.
I am just a beginner for qm and the first time it is hard to find immediately all functionality. Anyway qm is great tool
.
Posts: 12,073
Threads: 140
Joined: Dec 2002
Function
ShowWindowRect
;/
function hwnd
;Three times shows black rectangle around window or control.
;hwnd - window or control handle.
;EXAMPLE
;int w=win("Quick Macros" "QM_Editor")
;int c=id(2053 w) ;;tool bar
;ShowWindowRect c
RECT r; GetWindowRect hwnd &r
rep(3) OnScreenRect 1 r; 0.3; OnScreenRect 3; 0.3
OnScreenRect 2
Posts: 5
Threads: 2
Joined: Jun 2015
Thanks for this.
You call the Windows API!
This I have missed.