|
-
January 11th, 2009, 07:59 AM
#1
GetMenuBarInfo: no result
Hi,
need to know the size of my menubar, but got a problem with GetMenuBarInfo:
after the function call MENUBARINFO.rcBar is not initialized, and the returncode = false.
The errorcode returnde by GetLastError = 0.
I think I'm using a wrong argument, but which one?
HWND hWnd = <handle of the TopWindow that owns the menuBar>
LONG lObject = OBJID_MENU
LONG lItem = 0
MENUBAR.cbSize = sizeof(MENUBAR)
What could be wrong? Do I have to use the windowhandle of the menuBar instead of the TopLevelWindow? And if so, how to get it?
Thanks in advance
Best regards
testalucida
-
January 11th, 2009, 08:45 AM
#2
Re: GetMenuBarInfo: no result
What is MENUBAR?
Show your actual code.
Victor Nijegorodov
-
January 11th, 2009, 10:39 AM
#3
Re: GetMenuBarInfo: no result
sorry, should be: MENUBARINFO
static RECT & GetMenuBarSize( HWND owner, RECT & rect ) {
MENUBARINFO mbi;
mbi.cbSize = sizeof( MENUBARINFO );
bool bOk = GetMenuBarInfo( owner, OBJID_MENU, (LONG)0, &mbi ); //returns false
DWORD err = GetLastError(); // returns 0
rect = mbi.rcBar;
return rect;
}
-
January 12th, 2009, 03:52 AM
#4
Re: GetMenuBarInfo: no result
Hm... A little strange function...
And how are you using it? And what is the value of HWND owner? How do you obtain it?
Victor Nijegorodov
-
January 12th, 2009, 04:45 AM
#5
Re: GetMenuBarInfo: no result
True, I tink getMenuBaMInfo has a null owner. set a brak point and see the value clear.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|