UserForm determine WinXP windows style

  • Thread starter Thread starter Reinhard Thomann
  • Start date Start date
R

Reinhard Thomann

my application resizes the height of aUserForm.
I have problems with Windows XP, because the height of the title bar
(caption) differs if XP or Classic-style is selected in display settings.

I need a function to determine the real height of a UserForm or windows
style (XP or classic) to react with suitable UserForm height values.

TIA
Reinhard Thomann
 
Good question, Reinhard: wish I had the answer, but I think it will be
something you need to get through the Windows API library. Have not found
the proper call yet, but I will at least give you a link where you can go do
some research
http://msdn.microsoft.com/library/d...-us/winprog/winprog/functions_by_category.asp
This shows how to access and set various Windows settings through your code.
Perhaps someone else out there already knows the proper call to find if
WIndows is using the XP or "regular" window style.
 
Many thanks, i got the answer:-)
Reinhard

Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As
Long) As Long
Private Const mlSM_CYSIZE = 31

Function bIsXPStyle() As Boolean
On Error Resume Next
bIsXPStyle = (CLng(GetSystemMetrics(mlSM_CYSIZE)) >= 25)
End Function
 
Back
Top