How can I get the height of a statusbar?
How can I get the height of a statusbar?
How can I get the height of a statusbar? (I can't get my editorgadget to resize properly.)
			
			
									
									
						- utopiomania
 - Addict

 - Posts: 1655
 - Joined: Tue May 10, 2005 10:00 pm
 - Location: Norway
 
I use this..
			
			
									
									
						Code: Select all
    ;Statusbar
    hStatus = CreateStatusBar(#IdStatus, WindowID())
    If hStatus
      ;Get the statusbar height
      SendMessage_(hStatus, #SB_GETRECT, 0, @Value.RECT)
      SbHeight = Value\bottom - Value\top + 1or
			
			
									
									Code: Select all
GetWindowRect_(statusbar_h,@rect)
ProcedureReturn (rect\bottom-rect\top)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
						( The path to enlightenment and the PureBasic Survival Guide right here... )
- utopiomania
 - Addict

 - Posts: 1655
 - Joined: Tue May 10, 2005 10:00 pm
 - Location: Norway
 
@blueznl, I'm not shure, but  will be one pixel too small, or am I wrong ?
			
			
									
									
						Code: Select all
rect\bottom - rect\topgood one, could be 
i'm not on a machine where i can check it, unfortunately
			
			
									
									i'm not on a machine where i can check it, unfortunately
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
						( The path to enlightenment and the PureBasic Survival Guide right here... )
- utopiomania
 - Addict

 - Posts: 1655
 - Joined: Tue May 10, 2005 10:00 pm
 - Location: Norway
 
Seems these two methods are not returning the same rectangle coordinates.
SB_GETRECT with SendMessage() retrieves the bounding rectangle of a part in a status window.
GetWindowRect_() retrieves the dimensions of the bounding rectangle of the specified window.
All according to Microsoft, but using GetRect_() and rect\bottom-rect\top returns one pixel
too many (23,20 pixels), contrary to what I expected.
Using SB_GETRECT and Value\bottom - Value\top + 1 returns the correct height (22,19) judged
from a few screendumps both with and without XP skins enabled.
			
			
									
									
						SB_GETRECT with SendMessage() retrieves the bounding rectangle of a part in a status window.
GetWindowRect_() retrieves the dimensions of the bounding rectangle of the specified window.
All according to Microsoft, but using GetRect_() and rect\bottom-rect\top returns one pixel
too many (23,20 pixels), contrary to what I expected.
Using SB_GETRECT and Value\bottom - Value\top + 1 returns the correct height (22,19) judged
from a few screendumps both with and without XP skins enabled.

