Changed control for help text from static to EditText.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
// wLogger v3.0 (Edited version from RBTray project [https://github.com/benbuck/rbtray])
|
// wLogger v3.1 (Edited version from RBTray project [https://github.com/benbuck/rbtray])
|
||||||
// logger.h
|
// logger.h
|
||||||
// Usage: LOG_TO_FILE(L"%s(%d): Log message", TEXT(__FUNCTION__), __LINE__);
|
// Usage: LOG_TO_FILE(L"%s(%d): Log message", TEXT(__FUNCTION__), __LINE__);
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#define IDC_ABOUT_PROGNAME 1010
|
#define IDC_ABOUT_PROGNAME 1010
|
||||||
#define IDC_ABOUT_COPYRIGHT 1011
|
#define IDC_ABOUT_COPYRIGHT 1011
|
||||||
#define IDC_ABOUT_BUILDTIME 1012
|
#define IDC_ABOUT_BUILDTIME 1012
|
||||||
|
#define IDC_ABOUTEDIT 1013
|
||||||
#define IDC_STATIC -1
|
#define IDC_STATIC -1
|
||||||
|
|
||||||
// Next default values for new objects
|
// Next default values for new objects
|
||||||
@@ -45,7 +46,7 @@
|
|||||||
#define _APS_NO_MFC 1
|
#define _APS_NO_MFC 1
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 130
|
#define _APS_NEXT_RESOURCE_VALUE 130
|
||||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1013
|
#define _APS_NEXT_CONTROL_VALUE 1014
|
||||||
#define _APS_NEXT_SYMED_VALUE 122
|
#define _APS_NEXT_SYMED_VALUE 122
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
|
|||||||
}
|
}
|
||||||
|
|
||||||
OpenLogFile();
|
OpenLogFile();
|
||||||
|
|
||||||
LOG_TO_FILE(L"Entering the %s() function", TEXT(__FUNCTION__));
|
LOG_TO_FILE(L"Entering the %s() function", TEXT(__FUNCTION__));
|
||||||
|
|
||||||
WNDCLASSEX wcex = { 0 };
|
WNDCLASSEX wcex = { 0 };
|
||||||
@@ -135,7 +136,9 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
|
|||||||
|
|
||||||
int nArgs = 0;
|
int nArgs = 0;
|
||||||
LPWSTR* szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
|
LPWSTR* szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
|
||||||
|
|
||||||
LOG_TO_FILE(L"Arguments count: %d", nArgs - 1);
|
LOG_TO_FILE(L"Arguments count: %d", nArgs - 1);
|
||||||
|
|
||||||
for (int i = 1; i < nArgs; i++)
|
for (int i = 1; i < nArgs; i++)
|
||||||
{
|
{
|
||||||
LOG_TO_FILE(L"Argument %d: %s", i, szArglist[i]);
|
LOG_TO_FILE(L"Argument %d: %s", i, szArglist[i]);
|
||||||
@@ -172,6 +175,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
|
|||||||
DestroyIcon(hIcon);
|
DestroyIcon(hIcon);
|
||||||
|
|
||||||
LOG_TO_FILE(L"Exit from the %s() function, msg.wParam = %d", TEXT(__FUNCTION__), (int)msg.wParam);
|
LOG_TO_FILE(L"Exit from the %s() function, msg.wParam = %d", TEXT(__FUNCTION__), (int)msg.wParam);
|
||||||
|
|
||||||
CloseLogFile();
|
CloseLogFile();
|
||||||
HeapFree(hHeap, NULL, szBuffer);
|
HeapFree(hHeap, NULL, szBuffer);
|
||||||
|
|
||||||
@@ -223,6 +227,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
if (!hMouseHook)
|
if (!hMouseHook)
|
||||||
{
|
{
|
||||||
LOG_TO_FILE(L"%s(%d): Mouse hook creation failed!", TEXT(__FUNCTION__), __LINE__);
|
LOG_TO_FILE(L"%s(%d): Mouse hook creation failed!", TEXT(__FUNCTION__), __LINE__);
|
||||||
|
|
||||||
ShowError(IDS_ERR_HOOK);
|
ShowError(IDS_ERR_HOOK);
|
||||||
PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
||||||
}
|
}
|
||||||
@@ -233,6 +238,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
if (!hKbdHook)
|
if (!hKbdHook)
|
||||||
{
|
{
|
||||||
LOG_TO_FILE(L"%s(%d): Keyboard hook creation failed!", TEXT(__FUNCTION__), __LINE__);
|
LOG_TO_FILE(L"%s(%d): Keyboard hook creation failed!", TEXT(__FUNCTION__), __LINE__);
|
||||||
|
|
||||||
ShowError(IDS_ERR_HOOK);
|
ShowError(IDS_ERR_HOOK);
|
||||||
PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
||||||
}
|
}
|
||||||
@@ -253,12 +259,14 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
if (ID_POPUPMENU_ICON == idMenu)
|
if (ID_POPUPMENU_ICON == idMenu)
|
||||||
{
|
{
|
||||||
LOG_TO_FILE(L"%s(%d): Pressed the 'Hide icon' menuitem", TEXT(__FUNCTION__), __LINE__);
|
LOG_TO_FILE(L"%s(%d): Pressed the 'Hide icon' menuitem", TEXT(__FUNCTION__), __LINE__);
|
||||||
|
|
||||||
bShowIcon = FALSE;
|
bShowIcon = FALSE;
|
||||||
HandlingTrayIcon();
|
HandlingTrayIcon();
|
||||||
}
|
}
|
||||||
if (ID_POPUPMENU_AREA == idMenu)
|
if (ID_POPUPMENU_AREA == idMenu)
|
||||||
{
|
{
|
||||||
LOG_TO_FILE(L"%s(%d): Pressed the 'Use workarea' menuitem", TEXT(__FUNCTION__), __LINE__);
|
LOG_TO_FILE(L"%s(%d): Pressed the 'Use workarea' menuitem", TEXT(__FUNCTION__), __LINE__);
|
||||||
|
|
||||||
bWorkArea = !bWorkArea;
|
bWorkArea = !bWorkArea;
|
||||||
bWorkArea ? mii.fState = MFS_CHECKED : mii.fState = MFS_UNCHECKED;
|
bWorkArea ? mii.fState = MFS_CHECKED : mii.fState = MFS_UNCHECKED;
|
||||||
SetMenuItemInfoW(hPopup, ID_POPUPMENU_AREA, FALSE, &mii);
|
SetMenuItemInfoW(hPopup, ID_POPUPMENU_AREA, FALSE, &mii);
|
||||||
@@ -267,6 +275,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
if (ID_POPUPMENU_ABOUT == idMenu && !bKPressed)
|
if (ID_POPUPMENU_ABOUT == idMenu && !bKPressed)
|
||||||
{
|
{
|
||||||
LOG_TO_FILE(L"%s(%d): Pressed the 'About' menuitem", TEXT(__FUNCTION__), __LINE__);
|
LOG_TO_FILE(L"%s(%d): Pressed the 'About' menuitem", TEXT(__FUNCTION__), __LINE__);
|
||||||
|
|
||||||
bKPressed = TRUE;
|
bKPressed = TRUE;
|
||||||
DialogBoxW(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, (DLGPROC)About);
|
DialogBoxW(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, (DLGPROC)About);
|
||||||
bKPressed = FALSE;
|
bKPressed = FALSE;
|
||||||
@@ -274,6 +283,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
if (ID_POPUPMENU_EXIT == idMenu)
|
if (ID_POPUPMENU_EXIT == idMenu)
|
||||||
{
|
{
|
||||||
LOG_TO_FILE(L"%s(%d): Pressed the 'Exit' menuitem", TEXT(__FUNCTION__), __LINE__);
|
LOG_TO_FILE(L"%s(%d): Pressed the 'Exit' menuitem", TEXT(__FUNCTION__), __LINE__);
|
||||||
|
|
||||||
PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,6 +295,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
case WM_QUERYENDSESSION:
|
case WM_QUERYENDSESSION:
|
||||||
{
|
{
|
||||||
LOG_TO_FILE(L"%s(%d): Recieved the WM_QUERYENDSESSION message, lParam = 0x%08X", TEXT(__FUNCTION__), __LINE__, (long)lParam);
|
LOG_TO_FILE(L"%s(%d): Recieved the WM_QUERYENDSESSION message, lParam = 0x%08X", TEXT(__FUNCTION__), __LINE__, (long)lParam);
|
||||||
|
|
||||||
CloseLogFile();
|
CloseLogFile();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
@@ -293,6 +304,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
{
|
{
|
||||||
LOG_TO_FILE(L"%s(%d): Recieved the WM_DESTROY message", TEXT(__FUNCTION__), __LINE__);
|
LOG_TO_FILE(L"%s(%d): Recieved the WM_DESTROY message", TEXT(__FUNCTION__), __LINE__);
|
||||||
|
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -309,6 +321,7 @@ LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam)
|
|||||||
if (WM_MBUTTONDOWN == wParam && bLCTRL && bLWIN && !bMPressed)
|
if (WM_MBUTTONDOWN == wParam && bLCTRL && bLWIN && !bMPressed)
|
||||||
{
|
{
|
||||||
LOG_TO_FILE(L"%s(%d): Pressed LCTRL + LWIN + MMB", TEXT(__FUNCTION__), __LINE__);
|
LOG_TO_FILE(L"%s(%d): Pressed LCTRL + LWIN + MMB", TEXT(__FUNCTION__), __LINE__);
|
||||||
|
|
||||||
bMPressed = TRUE;
|
bMPressed = TRUE;
|
||||||
hFgWnd = GetForegroundWindow();
|
hFgWnd = GetForegroundWindow();
|
||||||
if (IsWindowApprooved(hFgWnd)) MoveWindowToMonitorCenter(hFgWnd, bWorkArea, FALSE);
|
if (IsWindowApprooved(hFgWnd)) MoveWindowToMonitorCenter(hFgWnd, bWorkArea, FALSE);
|
||||||
@@ -335,6 +348,7 @@ LRESULT CALLBACK KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam)
|
|||||||
if (KEY_I == pkhs->vkCode && bLCTRL && bLWIN && !bKPressed) // 'I' key
|
if (KEY_I == pkhs->vkCode && bLCTRL && bLWIN && !bKPressed) // 'I' key
|
||||||
{
|
{
|
||||||
LOG_TO_FILE(L"%s(%d): Pressed LCTRL + LWIN + I", TEXT(__FUNCTION__), __LINE__);
|
LOG_TO_FILE(L"%s(%d): Pressed LCTRL + LWIN + I", TEXT(__FUNCTION__), __LINE__);
|
||||||
|
|
||||||
bKPressed = TRUE;
|
bKPressed = TRUE;
|
||||||
bShowIcon = !bShowIcon;
|
bShowIcon = !bShowIcon;
|
||||||
HandlingTrayIcon();
|
HandlingTrayIcon();
|
||||||
@@ -344,6 +358,7 @@ LRESULT CALLBACK KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam)
|
|||||||
if (KEY_C == pkhs->vkCode && bLCTRL && bLWIN && !bKPressed && !bKEYV) // 'C' key
|
if (KEY_C == pkhs->vkCode && bLCTRL && bLWIN && !bKPressed && !bKEYV) // 'C' key
|
||||||
{
|
{
|
||||||
LOG_TO_FILE(L"%s(%d): Pressed LCTRL + LWIN + C", TEXT(__FUNCTION__), __LINE__);
|
LOG_TO_FILE(L"%s(%d): Pressed LCTRL + LWIN + C", TEXT(__FUNCTION__), __LINE__);
|
||||||
|
|
||||||
bKPressed = TRUE;
|
bKPressed = TRUE;
|
||||||
hFgWnd = GetForegroundWindow();
|
hFgWnd = GetForegroundWindow();
|
||||||
if (IsWindowApprooved(hFgWnd)) MoveWindowToMonitorCenter(hFgWnd, bWorkArea, FALSE);
|
if (IsWindowApprooved(hFgWnd)) MoveWindowToMonitorCenter(hFgWnd, bWorkArea, FALSE);
|
||||||
@@ -354,11 +369,13 @@ LRESULT CALLBACK KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam)
|
|||||||
if (KEY_V == pkhs->vkCode && bLCTRL && bLWIN && !bKPressed && !bKEYV) // 'V' key
|
if (KEY_V == pkhs->vkCode && bLCTRL && bLWIN && !bKPressed && !bKEYV) // 'V' key
|
||||||
{
|
{
|
||||||
LOG_TO_FILE(L"%s(%d): Pressed LCTRL + LWIN + V", TEXT(__FUNCTION__), __LINE__);
|
LOG_TO_FILE(L"%s(%d): Pressed LCTRL + LWIN + V", TEXT(__FUNCTION__), __LINE__);
|
||||||
|
|
||||||
bKPressed = TRUE; bKEYV = TRUE;
|
bKPressed = TRUE; bKEYV = TRUE;
|
||||||
hFgWnd = GetForegroundWindow();
|
hFgWnd = GetForegroundWindow();
|
||||||
if (IsWindowApprooved(hFgWnd))
|
if (IsWindowApprooved(hFgWnd))
|
||||||
{
|
{
|
||||||
LOG_TO_FILE(L"%s(%d): Opening the 'Manual editing' dialog", TEXT(__FUNCTION__), __LINE__);
|
LOG_TO_FILE(L"%s(%d): Opening the 'Manual editing' dialog", TEXT(__FUNCTION__), __LINE__);
|
||||||
|
|
||||||
DialogBoxW(hInst, MAKEINTRESOURCE(IDD_MANUAL_EDITING), hFgWnd, (DLGPROC)DlgProc);
|
DialogBoxW(hInst, MAKEINTRESOURCE(IDD_MANUAL_EDITING), hFgWnd, (DLGPROC)DlgProc);
|
||||||
SetForegroundWindow(hFgWnd);
|
SetForegroundWindow(hFgWnd);
|
||||||
}
|
}
|
||||||
@@ -413,6 +430,7 @@ BOOL CALLBACK DlgProc(HWND hDlg, UINT dlgmsg, WPARAM wParam, LPARAM lParam)
|
|||||||
SendMessageW(hFgWnd, WM_EXITSIZEMOVE, NULL, NULL);
|
SendMessageW(hFgWnd, WM_EXITSIZEMOVE, NULL, NULL);
|
||||||
|
|
||||||
LOG_TO_FILE(L"%s(%d): Window with handle 0x%08X was moved to %d, %d", TEXT(__FUNCTION__), __LINE__, hFgWnd, x, y);
|
LOG_TO_FILE(L"%s(%d): Window with handle 0x%08X was moved to %d, %d", TEXT(__FUNCTION__), __LINE__, hFgWnd, x, y);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -457,6 +475,7 @@ BOOL IsWindowApprooved(HWND hFW)
|
|||||||
if (!IsIconic(hFW) && !IsZoomed(hFW))
|
if (!IsIconic(hFW) && !IsZoomed(hFW))
|
||||||
{
|
{
|
||||||
LOG_TO_FILE(L"%s(%d): The window is approved!", TEXT(__FUNCTION__), __LINE__);
|
LOG_TO_FILE(L"%s(%d): The window is approved!", TEXT(__FUNCTION__), __LINE__);
|
||||||
|
|
||||||
bApprooved = TRUE;
|
bApprooved = TRUE;
|
||||||
}
|
}
|
||||||
else ShowError(IDS_ERR_MAXMIN);
|
else ShowError(IDS_ERR_MAXMIN);
|
||||||
@@ -473,6 +492,7 @@ BOOL IsWindowApprooved(HWND hFW)
|
|||||||
}
|
}
|
||||||
|
|
||||||
LOG_TO_FILE(L"Exit from the %s() function", TEXT(__FUNCTION__));
|
LOG_TO_FILE(L"Exit from the %s() function", TEXT(__FUNCTION__));
|
||||||
|
|
||||||
return bApprooved;
|
return bApprooved;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -540,7 +560,7 @@ INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
SetDlgItemTextW(hDlg, IDC_ABOUT_PROGNAME, szAboutProgName);
|
SetDlgItemTextW(hDlg, IDC_ABOUT_PROGNAME, szAboutProgName);
|
||||||
SetDlgItemTextW(hDlg, IDC_ABOUT_COPYRIGHT, szAboutCopyright);
|
SetDlgItemTextW(hDlg, IDC_ABOUT_COPYRIGHT, szAboutCopyright);
|
||||||
SetDlgItemTextW(hDlg, IDC_ABOUT_BUILDTIME, szAboutBuildTime);
|
SetDlgItemTextW(hDlg, IDC_ABOUT_BUILDTIME, szAboutBuildTime);
|
||||||
SetDlgItemTextW(hDlg, IDC_ABOUTHELP, szAboutHelp);
|
SetDlgItemTextW(hDlg, IDC_ABOUTEDIT, szAboutHelp);
|
||||||
#ifdef NO_DONATION
|
#ifdef NO_DONATION
|
||||||
HWND hLink = GetDlgItem(hDlg, IDC_DONATIONLINK);
|
HWND hLink = GetDlgItem(hDlg, IDC_DONATIONLINK);
|
||||||
if (hLink) DestroyWindow(hLink);
|
if (hLink) DestroyWindow(hLink);
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user