41 |
extern "C" void _SHFree (void *p); |
extern "C" void _SHFree (void *p); |
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
/* Insert a new item into the menu @hm at position @pos. */ |
46 |
|
void |
47 |
|
insert_menu_item (HMENU hm, int pos, UINT m_id, const char *text) |
48 |
|
{ |
49 |
|
MENUITEMINFO mi; |
50 |
|
|
51 |
|
memset (&mi, 0, sizeof mi); |
52 |
|
mi.cbSize = sizeof mi; |
53 |
|
mi.fType = MF_STRING; |
54 |
|
mi.dwTypeData = (char *)text; |
55 |
|
mi.cch = strlen (text); |
56 |
|
mi.wID = m_id; |
57 |
|
mi.fMask = MIIM_ID|MIIM_DATA| MIIM_TYPE; |
58 |
|
InsertMenuItem (hm, pos, FALSE, &mi); |
59 |
|
} |
60 |
|
|
61 |
|
|
62 |
static void |
static void |
63 |
set_menu_text_ext (HMENU menu, int by_pos, int m_uid, const char *text) |
set_menu_text_ext (HMENU menu, int by_pos, int m_uid, const char *text) |
64 |
{ |
{ |
126 |
id can be either FILE_OPEN or FILE_SAVE. |
id can be either FILE_OPEN or FILE_SAVE. |
127 |
The return value is the file name or NULL if cancel was chosen. */ |
The return value is the file name or NULL if cancel was chosen. */ |
128 |
const char * |
const char * |
129 |
get_filename_dlg (HWND hwnd, int id, const char * title, |
get_filename_dlg (HWND hwnd, int id, const char *title, |
130 |
const char * filter, const char * name) |
const char *filter, const char *name) |
131 |
{ |
{ |
132 |
static char file[512] = ""; |
static char file[512] = ""; |
133 |
OPENFILENAME open; |
OPENFILENAME open; |