Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get Window Function
#1
Hello,

Is it possible to modify the GetWindow function so that when the shift key is pressed on the window of choice it returns the Window Name rather than the handle?

Kind Regards
Matt

Function getWindow
Code:
Copy      Help
;/
function# int&w [RECT&r]

;Allows the user to capture handle of a window or control in screen, and optionally a rectangle in it.
;Returns:
;;;0 not captured. User pressed Esc. w and r not changed.
;;;1 captured only window.
;;;2 captured window and rectangle.

;w - variable that receives window handle.
;r - variable that receives rectangle in the window, in client coordinates. Optional.

;REMARKS
;User selects the window with mouse and Shift.

;Added in: QM 2.3.4.


if(&r) _s="[]You can Shift+move mouse to draw rectangle."
OnScreenDisplay F"Move mouse to a window or control, and press Shift.{_s}" -1 0 0 "" 12 0x800000 5|8 "CWAR"

int R=__CaptureWindowAndRect(w r)

OsdHide "CWAR"

ret R
#2
No need to modify the function try this


Code:
Copy      Help
int w w1
str txt
getWindow(&w)
if IsChildWindow(w)
,w1=GetAncestor(w 3)
,txt.getwintext(w1)
,out txt
else
,txt.getwintext(w)
,out txt
#3
Kevin Wrote:No need to modify the function try this


Code:
Copy      Help
int w w1
str txt
getWindow(&w)
if IsChildWindow(w)
,w1=GetAncestor(w 3)
,txt.getwintext(w1)
,out txt
else
,txt.getwintext(w)
,out txt

Kevin, you are a champ, thankyou!!


Forum Jump:


Users browsing this thread: 1 Guest(s)