Screen / status bar size under Windows XP

forum.advanced.programming (1998-2005)
Stefaan Vanassche

Screen / status bar size under Windows XP

Post by Stefaan Vanassche » 22 Mar 2005, 13:02

 Posted by:  Stefaan Vanassche 

Hi,

there seems to be a problem with the screen size under Windows XP. When we
run our application under Windows XP push buttons on the lower part of the
screen are only partially shown. It seems to be a problem with the status
bar or screen size under Windows XP. In previous versions of Windows we did
not experience the problem. Does this sound familiar to anyone?

Best regards,

Stefaan Vanassche
You do not have the required permissions to view the files attached to this post.

As

Re: Screen / status bar size under Windows XP

Post by As » 22 Mar 2005, 15:51

 Posted by:  As 

Try

Code: Select all

On SAM_Create
  If GetSystemMetrics( SM_CYCAPTION ) > 19
      Call SalGetWindowSize( hWndForm, nX, nY )
      Call SalSetWindowSize( hWndForm, nX, nY - SalPixelsToFormUnits( hWndForm, 19, FALSE ) + SalPixelsToFormUnits( hWndForm, nSM_CYCAPTION, FALSE ))

Ifo

Re: Screen / status bar size under Windows XP

Post by Ifo » 22 Mar 2005, 16:06

 Posted by:  Ifo 


Hi Stefaan,
this issue is due to titlebar size - XP has a little
bigger titlebar. Older Team developer versions calculate
fixed title size and wrongly calculate window size.
We tested TD2005 - worked fine. With TD1.5.1 (that we
currently use) we added adjusting code to SAM_Create
section of every window. Exactly said, adjustation is
made in our derived classes.

HTH
Ifo, tangram software, Slovakia

--------------- Example ------------------
! Place this call in every window or their base class

Code: Select all

On SAM_Create
	Call WindowHeightAdjust( hWndForm )
....
Constants:
   Number: SM_CYCAPTION		= 4
....
Internal Functions:
   Function: WindowHeightAdjust
	Returns
		Boolean:
	Parameters
		Window Handle: hWindow
	Static Variables
	Local variables
		Number: nCaption
		Number: nDelta
		Number: nWidth
		Number: nHeight
	Actions
		Set nCaption = GetSystemMetrics( SM_CYCAPTION )
		! standard caption size is 19 pixels
		Set nDelta = nCaption - 19
		If not nDelta
			Return TRUE
		If not SalGetWindowSize( hWindow, nWidth, nHeight )
			Return FALSE
		Set nHeight = SalFormUnitsToPixels( hWindow, nHeight, TRUE )
		Set nHeight = nHeight + nDelta
		Set nHeight = SalPixelsToFormUnits( hWindow, nHeight, TRUE )
		If not SalSetWindowSize( hWindow, nWidth, nHeight )
			Return FALSE
		Return TRUE
....
! Windows API function defined in user32.dll
External Functions:
   Library name: user32.dll
     Function: GetSystemMetrics
	Description:
	Export Ordinal: 0
	Returns
		Number: INT
	Parameters
		Number: INT

Return to “advanced.programming”

Who is online

Users browsing this forum: [Ccbot] and 0 guests