Handle to Existing Window

BlitzPlus Forums/BlitzPlus Programming/Handle to Existing Window

Jay Mattis(Posted 2003) [#1]
Is there any way to get a Blitz Window Gadget handle to another window if you have the HWND? Either that, or is there a way to create a canvas on another window if you have the HWND?


cbmeeks(Posted 2003) [#2]
Do you mean another window OUTSIDE B+??

cb


Jay Mattis(Posted 2003) [#3]
That's exactly what I mean.


Jay Mattis(Posted 2003) [#4]
You know what? Does anyone know the Windows API commands to get the X and Y position of a window and its width and height as well?


EOF(Posted 2003) [#5]
Does anyone know the Windows API commands to get the X and Y position of a window and its width and height as well?
No API calls needed. Since everything in BlitPlus is a gadget (including windows) use:

; window x/y/w/h

win=CreateWindow("Move/Resize me",280,30,250,190,Desktop(),11)

Repeat
	wx=GadgetX(win) : wy=GadgetY(win)
	ww=GadgetWidth(win) : wh=GadgetHeight(win)
	SetStatusText win,"x="+wx+"  y="+wy+"    width="+ww+"  height="+wh
Until WaitEvent()=$803

End



Jay Mattis(Posted 2003) [#6]
No, I mean the x, y, width, and height of a windows window, not necessarily a window created with BlitzPlus, but a window created by any program. I have the windows hwnd.


SSS(Posted 2003) [#7]
BOOL GetWindowRect(
HWND hWnd, // handle to window
LPRECT lpRect // address of structure for window coordinates
);


but you need to know the hwnd... and youll need to write a dll to do that :D... i have a dll which can do that but i wont have time to give it to you until, a week friday