it includes Menu.h which is
#define MENU_OPEN 11
#define MENU_SAVE 12
#define MENU_EXIT 13
#define OPTION_BACKGROUND 21
#define ABOUT 3
#define ABOUT_OK 31
My Window procedure is here
LRESULT CALLBACK WndProc(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam)
{
switch(Msg)
{
case WM_CREATE:
{
HMENU Menu,SubMenu;
Menu = CreateMenu();
SubMenu = CreatePopupMenu();
AppendMenu(Menu,MF_STRING|MF_POPUP,(UINT) SubMenu,"&File");
AppendMenu(SubMenu,MF_STRING,MENU_OPEN,"O&pen");
AppendMenu(SubMenu,MF_STRING,MENU_SAVE,"S&ave");
AppendMenu(SubMenu,MF_STRING,MENU_EXIT,"E&xit");
SubMenu = CreatePopupMenu();
AppendMenu(Menu,MF_STRING|MF_POPUP,(UINT) SubMenu,"&Options");
AppendMenu(SubMenu,MF_STRING,OPTION_BACKGROUND,"Background");
SubMenu = CreatePopupMenu();
AppendMenu(Menu,MF_STRING|MF_POPUP,(UINT) SubMenu,"&About");
SetMenu(hWnd,Menu);
}
break;
case WM_COMMAND:
{
switch(LOWORD(wParam))
{
case MENU_EXIT:
if(MessageBox(NULL,"Are you sure you want to leave ?","Closing ...",MB_YESNO) == IDYES)
DestroyWindow(hWnd);
break;
case ABOUT:
{
//HELP !
}
}
break;
case WM_CLOSE:
if(MessageBox(NULL,"Are you sure you want to leave ?","Closing ...",MB_YESNO) == IDYES)
DestroyWindow(hWnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default :
return DefWindowProc(hWnd,Msg,wParam,lParam);
break;
}
return 0;
}
My dialog Procedure is here
bool CALLBACK DlgProc(HWDN hWnd,UINT Msg,WPARAM wParam,LPARAM lParam)
{
switch(Msg)
{
case WM_INITDIALOG:
return true;
break;
case WM_COMMAND :
{
switch(LOWORD(WPARAM))
{
case ABOUT_OK:
EndDialog(hWnd,ABOUT_OK);
break;
}
}
default :
return false;
break;
}
return true;
}
My question is what kind of variable i use to creat dialogs ?? like for menu is use HMENU for icon HICON and etc... if there's another way please help me out. thx
[edited by - Metal Typhoon on May 31, 2002 1:38:13 AM]