#include <windows.h>
int WINAPI WinMain( HINSTANCE, HINSTANCE, DWORD, DWORD Command )
{
MSG msg;
WNDCLASS wc;
HWND WndMain;
wc.style = 0;
wc.lpfnWndProc = (WNDPROC) MainWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hinstance;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = MAKEINTRESOURCE(IDM_MYMENURESOURCE);
wc.lpszClassName = "MainWClass";
if (!RegisterClass(&wc))
return FALSE;
WndMain = CreateWindow("MainWClass", "Sample Application",
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hinstance,
NULL);
HMENU NewMenu = CreateMenu();
HMENU FileMenu = CreatePopupMenu();
AppendMenu( FileMenu, MF_STRING, ID_APP_EXIT, "E&xit" );
AppendMenu( NewMenu, MF_STRING, FileMenu, "&File" );
SetMenu( &NewMenu );
ShowWindow(WndMain, Command);
UpdateWindow(WndMain);
// Start the main message loop.
while (GetMessage(&msg, NULL, 0, 0) != 0 && GetMessage(&msg, (HWND) NULL, 0, 0) != -1)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
that works... and the setup of the function is
AppendMenu( Integer Handle, Integer Flags, Integer Identification/Position, String Text / Integer Bitmap Handle / Integer Owner Draw Function Callback )
So in this case
AppendMenu( Handle, Flag, Ident, Text ) / AppendMenu( Integer, Integer, Integer, String )
it *SHOULD* work, if you think you can get it working then post the working code.