Print Page | Close Window

Menu won't draw.

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=24642
Printed Date: 22 May 2026 at 4:26pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Menu won't draw.
Posted By: rdhd
Subject: Menu won't draw.
Date Posted: 22 May 2026 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:




Replies:
Posted By: rdhd
Date Posted: 22 May 2026 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.


Posted By: rdhd
Date Posted: 22 May 2026 at 2:53pm


Posted By: rdhd
Date Posted: 22 May 2026 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.


Posted By: rdhd
Date Posted: 22 May 2026 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.


Posted By: rdhd
Date Posted: 22 May 2026 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?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net