Merge pull request #110 from tesselode/fixes
[wdl/wdl-ol.git] / WDL / win32_helpers.h
blobd81056b5310366207e1593772e30c2e3aeeeadb3
1 #ifndef _WDL_WIN32_HELPERS_H_
2 #define _WDL_WIN32_HELPERS_H_
5 static HMENU InsertSubMenu(HMENU hMenu, int pos, const char *name, int flags=0)
7 HMENU sub = NULL;
8 if (hMenu)
10 sub = CreatePopupMenu();
11 InsertMenu(hMenu,pos,flags|MF_BYPOSITION|(sub?MF_POPUP:0)|MF_STRING,(UINT_PTR)sub, name);
13 return sub;
16 static void InsertMenuString(HMENU hMenu, int pos, const char *name, int idx, int flags=0)
18 if (hMenu) InsertMenu(hMenu,pos,flags|MF_BYPOSITION|MF_STRING, idx, name);
21 static void InsertMenuSeparator(HMENU hMenu, int pos)
23 if (hMenu) InsertMenu(hMenu,pos,MF_BYPOSITION|MF_SEPARATOR, 0, NULL);
26 #endif