![]() |
Menu won't draw. |
Post Reply
|
| Author | |
rdhd
Senior Member
Joined: 13 August 2007 Location: United States Status: Offline Points: 973 |
Post Options
Thanks(0)
Quote Reply
Topic: Menu won't draw.Posted: 3 hours 52 minutes ago at 2:50pm |
|
The menu added to a window won't draw when a skin is active. I have debugged and see CXTPSkinManagerSchema::CalcFrameBorders is called but it isn't calculating any width. All the relevant menu methods seem to get called. The class being used for the window is CXTPSkinObjectApplicationFrame. Here is the minimum code: static const TCHAR s_szAddInManagerDialogClass[] = TEXT("AddInManagerDialogClass"); static const TCHAR s_szAddInManagerMenuText[] = TEXT("Item 1"); static const UINT s_nAddInManagerMenuItem = 1001; HWND hDialog; WNDCLASSEX wc = { 0 }; wc.cbSize = sizeof(WNDCLASSEX); wc.lpfnWndProc = AddInManagerWndProc; wc.hInstance = GetModuleHandle(NULL); wc.lpszClassName = s_szAddInManagerDialogClass; wc.cbWndExtra = DLGWINDOWEXTRA; if (!RegisterClassEx(&wc) && GetLastError() != ERROR_CLASS_ALREADY_EXISTS) { return HRESULT_FROM_WIN32(GetLastError()); } hDialog = CreateWindowEx(WS_EX_CLIENTEDGE, s_szAddInManagerDialogClass, TEXT("Dialog with menu"), WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 500, 300, NULL, NULL, GetModuleHandle(NULL), NULL); if (!hDialog) { return HRESULT_FROM_WIN32(GetLastError()); } HMENU hMenu = ::CreateMenu(); HMENU hSubMenu = ::CreatePopupMenu(); AppendMenu(hSubMenu, MF_OWNERDRAW, s_nAddInManagerMenuItem, s_szAddInManagerMenuText); AppendMenu(hMenu, MF_POPUP, (UINT_PTR)hSubMenu, TEXT("Menu")); SetMenu(hDialog, hMenu); DrawMenuBar(hDialog); If I turn off the skin (I added code to draw the menu items to make sure it wasn't a black on black issue: |
|
![]() |
|
rdhd
Senior Member
Joined: 13 August 2007 Location: United States Status: Offline Points: 973 |
Post Options
Thanks(0)
Quote Reply
Posted: 3 hours 50 minutes ago at 2:52pm |
|
Sorry, ignore "I have debugged and see CXTPSkinManagerSchema::CalcFrameBorders is called but it isn't calculating any width." The width isn't being used. The system menu does draw but the menu added to the window doesn't.
|
|
![]() |
|
rdhd
Senior Member
Joined: 13 August 2007 Location: United States Status: Offline Points: 973 |
Post Options
Thanks(0)
Quote Reply
Posted: 3 hours 49 minutes ago at 2:53pm |
|
|
|
![]() |
|
rdhd
Senior Member
Joined: 13 August 2007 Location: United States Status: Offline Points: 973 |
Post Options
Thanks(0)
Quote Reply
Posted: 3 hours 44 minutes ago at 2:58pm |
|
Sorry as I hack thru this website. Pasted images show up in the page but when I "Post Reply" I see nothing. Hope this shows up. Left side is what I see when clicking "Menu". Right side has the skin and nothing shows up when I click "Menu". System menu shows up just fine.
|
|
![]() |
|
rdhd
Senior Member
Joined: 13 August 2007 Location: United States Status: Offline Points: 973 |
Post Options
Thanks(0)
Quote Reply
Posted: 3 hours 41 minutes ago at 3:01pm |
|
Seems to be perhaps the wrong skin class? I have found that no matter where I click in the "Menu" bar area the StartMenuState function is called and the only menu it supports seems to be the system menu.
|
|
![]() |
|
rdhd
Senior Member
Joined: 13 August 2007 Location: United States Status: Offline Points: 973 |
Post Options
Thanks(0)
Quote Reply
Posted: 3 hours 25 minutes ago at 3:17pm |
|
Changing the window class to "#32770" didn't help. Class handler is still CXTPSkinObjectApplicationFrame. I'm beginning to think CJ skin system simply doesn't handle this OS SetMenu call and/or the creation of the menu. How about it CJ, what's my option here? I don't actually own the code that is failing whenever a skin is present. Do I have to have the actual programmers give me window class names to exclude from skinning?
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |