Restored from previous forum. Originally posted by crown.
does someone has an example on the GetWindowPlacement_
i need to get the position of a window on the desktop
used it before in vb, but don`t know how to do it in pb...
(registered PureBasic user)
GetWindowPlacement_
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> i need to get the position of a window on the desktop
Open the Calculator and then run this...
PB - Registered PureBasic Coder
> i need to get the position of a window on the desktop
Open the Calculator and then run this...
Code: Select all
r=FindWindow_(0,"Calculator") ; Is Calculator running?
If r=0 ; 0 = Nope!
Debug "Calculator not running!"
Else
GetWindowRect_(r,win.RECT) ; Get Calculator's dimensions.
x=win\left : y=win\top ; Get X and Y positions of Calculator.
w=win\right-win\left : h=win\bottom-win\top ; Get width and height.
Debug "X="+Str(x)+", Y="+Str(y)
Debug "W="+Str(w)+", H="+Str(h)
EndIf
PB - Registered PureBasic Coder
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
cya,
...Danilo
(registered PureBasic user)
Code: Select all
OpenWindow(1,200,300,400,100,#PB_Window_SystemMenu,"")GetWindowPlacement_(WindowID(),struct.WINDOWPLACEMENT)
;
; now the members of struct.WINDOWPLACEMENT are filled...Danilo
(registered PureBasic user)
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm