21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#include <commctrl.h>
#include <richedit.h>
#include <mmsystem.h>
/* From MSDN: In the WM_SYSCOMMAND message, the four low-order bits of
* wParam are used by Windows, and should be masked off, so we shouldn't
* attempt to store information in them. Hence all these identifiers have
* the low 4 bits clear. */
#define IDM_SHOWLOG 0x0010
#define IDM_NEWSESS 0x0020
#define IDM_DUPSESS 0x0030
#define IDM_RESTART 0x0040
#define IDM_RECONF 0x0050
#define IDM_CLRSB 0x0060
#define IDM_RESET 0x0070
#define IDM_HELP 0x0140
#define IDM_ABOUT 0x0150
#define IDM_SAVEDSESS 0x0160
#define IDM_COPYALL 0x0170
#define IDM_FULLSCREEN 0x0180
#define IDM_PASTE 0x0190
#define IDM_SESSLGP 0x0250 /* log type printable */
#define IDM_SESSLGA 0x0260 /* log type all chars */
#define IDM_SESSLGE 0x0270 /* log end */
#define IDM_SPECIAL_MIN 0x0400
#define IDM_SPECIAL_MAX 0x0800
#define IDM_SAVED_MIN 0x1000
#define IDM_SAVED_MAX 0x2000
/* Maximum number of sessions on saved-session submenu */
#define MENU_SAVED_MAX (IDM_SAVED_MAX-IDM_SAVED_MIN)
#define WM_IGNORE_CLIP (WM_XUSER + 2)
#define WM_FULLSCR_ON_MAX (WM_XUSER + 3)
#define WM_AGENT_CALLBACK (WM_XUSER + 4)
/* Needed for Chinese support and apparently not always defined. */
#ifndef VK_PROCESSKEY
|
|
<
<
<
<
|
>
|
|
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#include <commctrl.h>
#include <richedit.h>
#include <mmsystem.h>
/* From MSDN: In the WM_SYSCOMMAND message, the four low-order bits of
* wParam are used by Windows, and should be masked off, so we shouldn't
* attempt to store information in them. Hence all these identifiers have
* the low 4 bits clear. Also, identifiers should < 0xF000. */
#define IDM_SHOWLOG 0x0010
#define IDM_NEWSESS 0x0020
#define IDM_DUPSESS 0x0030
#define IDM_RESTART 0x0040
#define IDM_RECONF 0x0050
#define IDM_CLRSB 0x0060
#define IDM_RESET 0x0070
#define IDM_HELP 0x0140
#define IDM_ABOUT 0x0150
#define IDM_SAVEDSESS 0x0160
#define IDM_COPYALL 0x0170
#define IDM_FULLSCREEN 0x0180
#define IDM_PASTE 0x0190
#define IDM_SPECIAL_MIN 0x0400
#define IDM_SPECIAL_MAX 0x0800
#define IDM_SAVED_MIN 0x1000
#define IDM_SAVED_MAX 0x5000
#define MENU_SAVED_STEP 16
/* Maximum number of sessions on saved-session submenu */
#define MENU_SAVED_MAX ((IDM_SAVED_MAX-IDM_SAVED_MIN) / MENU_SAVED_STEP)
#define WM_IGNORE_CLIP (WM_XUSER + 2)
#define WM_FULLSCR_ON_MAX (WM_XUSER + 3)
#define WM_AGENT_CALLBACK (WM_XUSER + 4)
/* Needed for Chinese support and apparently not always defined. */
#ifndef VK_PROCESSKEY
|
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
|
s = CreateMenu();
get_sesslist(&sesslist, TRUE);
/* skip sesslist.sessions[0] == Default Settings */
for (i = 1;
i < ((sesslist.nsessions <= MENU_SAVED_MAX+1) ? sesslist.nsessions
: MENU_SAVED_MAX+1);
i++)
AppendMenu(s, MF_ENABLED, IDM_SAVED_MIN + i-1,
sesslist.sessions[i]);
for (j = 0; j < lenof(popup_menus); j++) {
m = popup_menus[j].menu;
AppendMenu(m, MF_SEPARATOR, 0, 0);
popup_menus[j].specials_submenu_pos = GetMenuItemCount(m);
|
|
|
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
|
s = CreateMenu();
get_sesslist(&sesslist, TRUE);
/* skip sesslist.sessions[0] == Default Settings */
for (i = 1;
i < ((sesslist.nsessions <= MENU_SAVED_MAX+1) ? sesslist.nsessions
: MENU_SAVED_MAX+1);
i++)
AppendMenu(s, MF_ENABLED, IDM_SAVED_MIN + (i-1)*MENU_SAVED_STEP,
sesslist.sessions[i]);
for (j = 0; j < lenof(popup_menus); j++) {
m = popup_menus[j].menu;
AppendMenu(m, MF_SEPARATOR, 0, 0);
popup_menus[j].specials_submenu_pos = GetMenuItemCount(m);
|
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
|
*p = cfg; /* structure copy */
UnmapViewOfFile(p);
}
}
sprintf(c, "putty &%p", filemap);
cl = c;
} else if (wParam == IDM_SAVEDSESS) {
unsigned int sessno = lParam - IDM_SAVED_MIN + 1;
if (sessno < sesslist.nsessions) {
char *session = sesslist.sessions[sessno];
/* XXX spaces? quotes? "-load"? */
cl = dupprintf("putty @%s", session);
freecl = TRUE;
} else
break;
|
|
>
|
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
|
*p = cfg; /* structure copy */
UnmapViewOfFile(p);
}
}
sprintf(c, "putty &%p", filemap);
cl = c;
} else if (wParam == IDM_SAVEDSESS) {
unsigned int sessno = ((lParam - IDM_SAVED_MIN)
/ MENU_SAVED_STEP) + 1;
if (sessno < sesslist.nsessions) {
char *session = sesslist.sessions[sessno];
/* XXX spaces? quotes? "-load"? */
cl = dupprintf("putty @%s", session);
freecl = TRUE;
} else
break;
|