Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
fatty: resources compile
Browse files Browse the repository at this point in the history
  • Loading branch information
FauxFaux committed May 24, 2018
1 parent e06fb61 commit d6cb80c
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 37 deletions.
26 changes: 13 additions & 13 deletions windows/pageant.rc
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

#include "rcstuff.h"

#define APPNAME "Pageant"
#define APPDESC "PuTTY SSH authentication agent"
// region tray-fatty
// * removing duplicated definitions
// * change all the 2-based ids to 9-based
// endregion

200 ICON "pageant.ico"
201 ICON "pageants.ico"
900 ICON "pageant.ico"
901 ICON "pageants.ico"

210 DIALOG DISCARDABLE 0, 0, 140, 60
910 DIALOG DISCARDABLE 0, 0, 140, 60
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Pageant: Enter Passphrase"
FONT 8, "MS Shell Dlg"
Expand All @@ -22,7 +24,7 @@ BEGIN
PUSHBUTTON "&Cancel", IDCANCEL, 80, 42, 40, 14
END

211 DIALOG DISCARDABLE 0, 0, 330, 200
911 DIALOG DISCARDABLE 0, 0, 330, 200
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Pageant Key List"
FONT 8, "MS Shell Dlg"
Expand All @@ -36,7 +38,7 @@ BEGIN
END

/* Accelerators used: cl */
213 DIALOG DISCARDABLE 140, 40, 270, 106
913 DIALOG DISCARDABLE 140, 40, 270, 106
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About Pageant"
FONT 8, "MS Shell Dlg"
Expand All @@ -48,7 +50,7 @@ BEGIN
END

/* No accelerators used */
214 DIALOG DISCARDABLE 50, 50, 326, 231
914 DIALOG DISCARDABLE 50, 50, 326, 231
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "PuTTY Licence"
FONT 8, "MS Shell Dlg"
Expand All @@ -58,8 +60,6 @@ BEGIN
EDITTEXT 1000, 10, 10, 306, 192, ES_READONLY | ES_MULTILINE | ES_LEFT, WS_EX_STATICEDGE
END

#include "version.rc2"

#ifndef NO_MANIFESTS
1 RT_MANIFEST "pageant.mft"
#endif /* NO_MANIFESTS */
// region tray-fatty
// removing duplicated definitions
// endregion
5 changes: 5 additions & 0 deletions windows/putty.rc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

#include "win_res.rc2"

// region tray-fatty
#include "puttygen.rc"
#include "pageant.rc"
// endregion

#ifndef NO_MANIFESTS
1 RT_MANIFEST "putty.mft"
#endif /* NO_MANIFESTS */
24 changes: 12 additions & 12 deletions windows/puttygen.rc
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@

#include "rcstuff.h"

#define APPNAME "PuTTYgen"
#define APPDESC "PuTTY SSH key generation utility"
// region tray-fatty
// * removing duplicated definitions
// * change all the 2-based ids to 8-based
// endregion

200 ICON "puttygen.ico"
800 ICON "puttygen.ico"

201 DIALOG DISCARDABLE 0, 0, 318, 270
801 DIALOG DISCARDABLE 0, 0, 318, 270
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "PuTTY Key Generator"
FONT 8, "MS Shell Dlg"
BEGIN
END

210 DIALOG DISCARDABLE 0, 0, 140, 60
810 DIALOG DISCARDABLE 0, 0, 140, 60
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "PuTTYgen: Enter Passphrase"
FONT 8, "MS Shell Dlg"
Expand All @@ -29,7 +31,7 @@ BEGIN
END

/* Accelerators used: cl */
213 DIALOG DISCARDABLE 140, 40, 270, 106
813 DIALOG DISCARDABLE 140, 40, 270, 106
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About PuTTYgen"
FONT 8, "MS Shell Dlg"
Expand All @@ -41,7 +43,7 @@ BEGIN
END

/* No accelerators used */
214 DIALOG DISCARDABLE 50, 50, 326, 231
814 DIALOG DISCARDABLE 50, 50, 326, 231
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "PuTTY Licence"
FONT 8, "MS Shell Dlg"
Expand All @@ -51,8 +53,6 @@ BEGIN
EDITTEXT 1000, 10, 10, 306, 192, ES_READONLY | ES_MULTILINE | ES_LEFT, WS_EX_STATICEDGE
END

#include "version.rc2"

#ifndef NO_MANIFESTS
1 RT_MANIFEST "puttygen.mft"
#endif /* NO_MANIFESTS */
// region tray-fatty
// removing duplicated definitions
// endregion
24 changes: 19 additions & 5 deletions windows/winpgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,11 @@ static INT_PTR CALLBACK AboutProc(HWND hwnd,
return 0;
case 101:
EnableWindow(hwnd, 0);
DialogBox(hinst, MAKEINTRESOURCE(214), hwnd, LicenceProc);

// region tray-fatty
DialogBox(hinst, MAKEINTRESOURCE(814), hwnd, LicenceProc);
// endregion

EnableWindow(hwnd, 1);
SetActiveWindow(hwnd);
return 0;
Expand Down Expand Up @@ -682,8 +686,10 @@ void load_key_file(HWND hwnd,
struct PassphraseProcStruct pps;
pps.passphrase = &passphrase;
pps.comment = comment;
// region tray-fatty
dlgret = DialogBoxParam(
hinst, MAKEINTRESOURCE(210), NULL, PassphraseProc, (LPARAM)&pps);
hinst, MAKEINTRESOURCE(810), NULL, PassphraseProc, (LPARAM)&pps);
// endregion
if (!dlgret) {
ret = -2;
break;
Expand Down Expand Up @@ -824,10 +830,13 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwnd,
* if the help file isn't present.
*/
}

// region tray-fatty
SendMessage(hwnd,
WM_SETICON,
(WPARAM)ICON_BIG,
(LPARAM)LoadIcon(hinst, MAKEINTRESOURCE(200)));
(LPARAM)LoadIcon(hinst, MAKEINTRESOURCE(800)));
// endregion

state = snew(struct MainDlgState);
state->generation_thread_exists = FALSE;
Expand Down Expand Up @@ -1103,7 +1112,9 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwnd,
break;
case IDC_ABOUT:
EnableWindow(hwnd, 0);
DialogBox(hinst, MAKEINTRESOURCE(213), hwnd, AboutProc);
// region tray-fatty
DialogBox(hinst, MAKEINTRESOURCE(813), hwnd, AboutProc);
// endregion
EnableWindow(hwnd, 1);
SetActiveWindow(hwnd);
return 0;
Expand Down Expand Up @@ -1590,7 +1601,10 @@ int puttygen_main(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
}

random_ref();
ret = DialogBox(hinst, MAKEINTRESOURCE(201), NULL, MainDlgProc) != IDOK;

// region tray-fatty
ret = DialogBox(hinst, MAKEINTRESOURCE(801), NULL, MainDlgProc) != IDOK;
// endregion

cleanup_exit(ret);
return ret; /* just in case optimiser complains */
Expand Down
36 changes: 29 additions & 7 deletions windows/winpgnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
#endif
#endif

#define IDI_MAINICON 200
#define IDI_TRAYICON 201
// region tray-fatty
#define IDI_MAINICON 900
#define IDI_TRAYICON 901
// endregion

#define WM_SYSTRAY (WM_APP + 6)
#define WM_SYSTRAY2 (WM_APP + 7)
Expand Down Expand Up @@ -162,7 +164,11 @@ static INT_PTR CALLBACK AboutProc(HWND hwnd,
return 0;
case 101:
EnableWindow(hwnd, 0);
DialogBox(hinst, MAKEINTRESOURCE(214), hwnd, LicenceProc);

// region tray-fatty
DialogBox(hinst, MAKEINTRESOURCE(914), hwnd, LicenceProc);
// endregion

EnableWindow(hwnd, 1);
SetActiveWindow(hwnd);
return 0;
Expand Down Expand Up @@ -411,8 +417,12 @@ static void win_add_keyfile(Filename *filename)

pps.passphrase = &passphrase;
pps.comment = err;

// region tray-fatty
dlgret = DialogBoxParam(
hinst, MAKEINTRESOURCE(210), NULL, PassphraseProc, (LPARAM)&pps);
hinst, MAKEINTRESOURCE(910), NULL, PassphraseProc, (LPARAM)&pps);
// endregion

passphrase_box = NULL;

if (!dlgret)
Expand Down Expand Up @@ -676,7 +686,11 @@ static BOOL AddTrayIcon(HWND hwnd)
tnid.uID = 1; /* unique within this systray use */
tnid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
tnid.uCallbackMessage = WM_SYSTRAY;
tnid.hIcon = hicon = LoadIcon(hinst, MAKEINTRESOURCE(201));

// region tray-fatty
tnid.hIcon = hicon = LoadIcon(hinst, MAKEINTRESOURCE(901));
// endregion

strcpy(tnid.szTip, "Pageant (PuTTY authentication agent)");

res = Shell_NotifyIcon(NIM_ADD, &tnid);
Expand Down Expand Up @@ -859,7 +873,11 @@ static LRESULT CALLBACK WndProc(HWND hwnd,
break;
case IDM_VIEWKEYS:
if (!keylist) {
keylist = CreateDialog(hinst, MAKEINTRESOURCE(211), NULL, KeyListProc);

// region tray-fatty
keylist = CreateDialog(hinst, MAKEINTRESOURCE(911), NULL, KeyListProc);
// endregion

ShowWindow(keylist, SW_SHOWNORMAL);
}
/*
Expand Down Expand Up @@ -888,7 +906,11 @@ static LRESULT CALLBACK WndProc(HWND hwnd,
break;
case IDM_ABOUT:
if (!aboutbox) {
aboutbox = CreateDialog(hinst, MAKEINTRESOURCE(213), NULL, AboutProc);

// region tray-fatty
aboutbox = CreateDialog(hinst, MAKEINTRESOURCE(913), NULL, AboutProc);
// endregion

ShowWindow(aboutbox, SW_SHOWNORMAL);
/*
* Sometimes the window comes up minimised / hidden
Expand Down

0 comments on commit d6cb80c

Please sign in to comment.