Topics

Problem with Property Sheet

 

Is there a way to find out the coordinates of a property sheet, so that I can put it back in the same place? This line will place it at, say 600,300, but I want to have my program put it back where it was when it was last closed.

       SYS "SetWindowPos",!Sheet%(SheetOpen%),0,600,300,0,0,5 :REM move it to 600,300

Thanks.

Alan Roberts

--
Alan Roberts - Mugswell, Surrey
+44 (0)1737832586
+44 (0)7749387934

Hans van der Hoeven
 

you need to use the GetWindowRect function
https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-getwindowrect
to find out the location and size of the window.

Hans.

-----Oorspronkelijk bericht-----
Van: bb4w@groups.io <bb4w@groups.io> Namens alan836975 via Groups.Io
Verzonden: vrijdag 26 april 2019 19:44
Aan: bb4w@groups.io
Onderwerp: [bb4w] Problem with Property Sheet

Is there a way to find out the coordinates of a property sheet, so that I can put it back in the same place? This line will place it at, say 600,300, but I want to have my program put it back where it was when it was last closed.

SYS "SetWindowPos",!Sheet%(SheetOpen%),0,600,300,0,0,5 :REM move it to 600,300

Thanks.

Alan Roberts

--
Alan Roberts - Mugswell, Surrey
+44 (0)1737832586
+44 (0)7749387934

 

Thanks, I'll see if I can understand it. But I've never had much success in decoding those notes.

--
Alan Roberts - Mugswell, Surrey
+44 (0)1737832586
+44 (0)7749387934

Hans van der Hoeven
 

Maybe this helps: This little program uses that function and shows the size and location of itself in it's window:

DIM Myrect{l%,t%,r%,b%} : REM Structure to receive current client window size.
Left%=-10
Height%=-10
Width%=-10
REPEAT
SYS"GetWindowRect",@hwnd%,Myrect{} : REM Read size and place of window.
WAIT 10
IF Left%<> Myrect.l% OR Height%<> Myrect.b%-Myrect.t% OR Width%<> Myrect.r%-Myrect.l% THEN
CLS
PRINT"Resize or move me."
PRINT "Left "+STR$(Myrect.l%)
PRINT "Top "+STR$(Myrect.t%)
PRINT "Right "+STR$(Myrect.r%)
PRINT "Bottom "+STR$(Myrect.b%)
PRINT "Height "+STR$(Myrect.b%-Myrect.t%)
PRINT "Width "+STR$(Myrect.r%-Myrect.l%)
Left%=Myrect.l%
Height%=Myrect.b%-Myrect.t%
Width%=Myrect.r%-Myrect.l%
ENDIF
UNTIL FALSE


Hans.

-----Oorspronkelijk bericht-----
Van: bb4w@groups.io <bb4w@groups.io> Namens alan836975 via Groups.Io
Verzonden: zondag 28 april 2019 13:56
Aan: bb4w@groups.io
Onderwerp: Re: [bb4w] Problem with Property Sheet

Thanks, I'll see if I can understand it. But I've never had much success in decoding those notes.

--
Alan Roberts - Mugswell, Surrey
+44 (0)1737832586
+44 (0)7749387934