0

I need to obtain the total width in pixels of the window/system menu (minimize, maximize and close) in C using basic WINAPI. I came across the WM_GETTITLEBARINFOEX message which is good for me, but unfortunately it is supported starting with Vista and my application has to support also XP and 2003. Can anyone tell me how I can make this work? Any suggestions are welcome.

Thanks in advance!

alp
  • 3
  • 2
  • 1
    WM_GETTITLEBARINFOEX doesn't give the width of the system menu, it gives the size and position of some of the elements in the title bar. Is that really what you're after? The system menu (now often called the window menu) is the drop down menu you get when you click the window icon (typically to the left of the title). – Adrian McCarthy Sep 15 '11 at 20:57
  • Yes, maybe I didn't get the terminology right, but I need the size of the buttons from the title bar. – alp Sep 15 '11 at 21:20

1 Answers1

2

You say system menu, but as Adrian mentioned, WM_GETTITLEBARINFOEX retrieves information about the title bar buttons. If that's what you actually want, you can probably use GetSystemMetrics(SM_CXSIZE) on anything < Vista.

SM_CXSIZE = The width of a button in a window caption or title bar, in pixels.

pezcode
  • 5,490
  • 2
  • 24
  • 37
  • Great, I'll give this a try. I just probably need to multiply by the number of buttons. – alp Sep 15 '11 at 21:23