Merge pull request #537 from RaiKoHoff/Dev_0702

Optimize icon resource handling - reducing size
This commit is contained in:
Rainer Kottenhoff 2018-07-04 09:38:03 +02:00 committed by GitHub
commit bf6097e709
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 22 additions and 11 deletions

View File

@ -125,10 +125,9 @@
#define IDS_MUI_TRANSL_AUTHOR 15031
#define IDR_MAINWND 16000
#define IDR_MAINWND128 16001
#define IDR_MAINWND48 16002
#define IDR_MAINWNDTB 16003
#define IDR_MAINWNDTB2 16004
#define IDR_MAINWND48 16001
#define IDR_MAINWNDTB 16002
#define IDR_MAINWNDTB2 16003
#define IDI_MUI_RUN 16100
#define IDI_MUI_STYLES 16101
@ -267,7 +266,6 @@
#define IDC_RICHEDITABOUT 18089
#define IDC_TRANSL_AUTH 18090
#define CMD_ESCAPE 20000
#define CMD_SHIFTESC 20001
#define CMD_SHIFTCTRLENTER 20002

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

View File

@ -444,12 +444,17 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam
{
WCHAR wch[256] = { L'\0' };
static HFONT hFontTitle;
static HICON hIcon = NULL;
switch (umsg)
{
case WM_INITDIALOG:
{
{
if (!hIcon) {
hIcon = LoadImage(g_hInstance, MAKEINTRESOURCE(IDR_MAINWND), IMAGE_ICON, 128, 128, LR_DEFAULTCOLOR);
}
SetDlgItemText(hwnd, IDC_VERSION, L"" VERSION_FILEVERSION_LONG);
if (hFontTitle) { DeleteObject(hFontTitle); }
@ -553,6 +558,18 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam
}
return true;
case WM_PAINT:
if (hIcon) {
RECT rt;
GetWindowRect(hwnd, &rt);
HDC hdc = GetWindowDC(hwnd);
DrawIconEx(hdc, 16, 32, hIcon, 128, 128, 0, NULL, DI_NORMAL);
ReleaseDC(hwnd, hdc);
}
return 0;
case WM_NOTIFY:
{
LPNMHDR pnmhdr = (LPNMHDR)lParam;

View File

@ -9611,7 +9611,7 @@ void ShowNotifyIcon(HWND hwnd,bool bAdd)
{
static HICON hIcon = NULL;
if (!hIcon) {
hIcon = LoadImage(g_hInstance, MAKEINTRESOURCE(IDR_MAINWND128), IMAGE_ICON,
hIcon = LoadImage(g_hInstance, MAKEINTRESOURCE(IDR_MAINWND), IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
}
NOTIFYICONDATA nid;

View File

@ -442,7 +442,6 @@
</ItemGroup>
<ItemGroup>
<Image Include="..\res\Notepad3.ico" />
<Image Include="..\res\Notepad3_128.ico" />
<Image Include="..\res\rizonesoft.bmp" />
<Image Include="..\res\Toolbar2.bmp" />
</ItemGroup>

View File

@ -234,9 +234,6 @@
<Image Include="..\res\Toolbar2.bmp">
<Filter>Resource Files</Filter>
</Image>
<Image Include="..\res\Notepad3_128.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="..\res\rizonesoft.bmp">
<Filter>Resource Files</Filter>
</Image>