Hi all,
how can i create a menu, this does not work, SHCreateMenuBar return NULL:
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpszCmdLine, int nCmdShow)
{
.
.
.
return DialogBox(hInstance, MAKEINTRESOURCE(DLG_MAIN), NULL, (DLGPROC)MainDlgProc);
}
static LRESULT CALLBACK MainDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_INITDIALOG:
{
SHINITDLGINFO shidi;
/*
* Create a Done button and size the dialog.
*/
shidi.dwMask = SHIDIM_FLAGS;
shidi.dwFlags = SHIDIF_DONEBUTTON|SHIDIF_SIPDOWN|SHIDIF_SIZEDLGFULLSCREEN;
shidi.hDlg = hwndDlg;
SHInitDialog(&shidi);
SHMENUBARINFO mbi;
memset(&mbi, 0, sizeof(SHMENUBARINFO));
mbi.cbSize = sizeof(SHMENUBARINFO);
mbi.hwndParent = hwndDlg;
mbi.nToolBarId =IDR_MENU ;
mbi.hInstRes =hInst;
SHCreateMenuBar(&mbi)
.
.
.
Is there any code snip?
KDB