Some fixes.
This commit is contained in:
@@ -40,7 +40,7 @@ function makeVersionString([string]$vmaj, [string]$vmin, [string]$vbld, [string]
|
||||
}
|
||||
|
||||
#region Initializing variables
|
||||
[string]$verMajor = [string]$verMinor = [string]$verBuild = [string]$verRevision = $null
|
||||
[string]$verMajor = [string]$verMinor = [string]$verBuild = [string]$verPatch = $null
|
||||
[string]$pn = [string]$pa = [string]$aboutBuild = [string]$pnf = [string]$pcf = $null
|
||||
[string]$buildDateTime = [string]$vs = [string]$vn = [string]$intName = [string]$origName = $null
|
||||
[int]$pys = [int]$spanDays = [int]$spanSecs = $null
|
||||
@@ -80,7 +80,7 @@ $config = (Get-IniContent -FilePath $iniFile)["Config"]
|
||||
$verMajor = $config.Major
|
||||
$verMinor = $config.Minor
|
||||
$verBuild = $config.Build
|
||||
$verRevision = $config.Revision
|
||||
$verPatch = $config.Patch
|
||||
$pys = $config.ProductYearStart
|
||||
$pn = $config.ProductName
|
||||
$pa = $config.ProductAutors
|
||||
@@ -109,11 +109,11 @@ $origName = "$pn.exe"
|
||||
$verMajor = getValue $verMajor
|
||||
$verMinor = getValue $verMinor
|
||||
$verBuild = getValue $verBuild
|
||||
$verRevision = getValue $verRevision
|
||||
$verPatch = getValue $verPatch
|
||||
#endregion
|
||||
|
||||
$vs = (makeVersionString $verMajor $verMinor $verBuild $verRevision)[0]
|
||||
$vn = (makeVersionString $verMajor $verMinor $verBuild $verRevision)[1]
|
||||
$vs = (makeVersionString $verMajor $verMinor $verBuild $verPatch)[0]
|
||||
$vn = (makeVersionString $verMajor $verMinor $verBuild $verPatch)[1]
|
||||
|
||||
# if ([string]::IsNullOrEmpty($gitVerStr)) { $pnf = "$pn v$vs" } else { $pnf = "$pn $gitVerStr" }
|
||||
if ($isGit) {
|
||||
@@ -154,7 +154,7 @@ else {
|
||||
# echo " verMajor: [$verMajor]"
|
||||
# echo " verMinor: [$verMinor]"
|
||||
# echo " verBuild: [$verBuild]"
|
||||
# echo " verRevision: [$verRevision]"
|
||||
# echo " verPatch: [$verPatch]"
|
||||
# echo ""
|
||||
# echo " aboutBuild: [$aboutBuild]"
|
||||
# echo " productNameFull: [$pnf]"
|
||||
|
||||
BIN
Version.ini
BIN
Version.ini
Binary file not shown.
@@ -14,15 +14,15 @@
|
||||
#define KEY_C 0x43
|
||||
#define KEY_V 0x56
|
||||
|
||||
#define BUF_LEN 1024
|
||||
#define MAX_WINTITLE_BUFFER_LENGTH 1024
|
||||
#define WM_WCW (WM_APP + 0x0F00)
|
||||
|
||||
// Global variables:
|
||||
HINSTANCE hInst; // Instance
|
||||
WCHAR szTitle[MAX_LOADSTRING]; // wCenterWindow's title
|
||||
WCHAR szClass[MAX_LOADSTRING]; // Window's class
|
||||
WCHAR szWinTitle[256];
|
||||
WCHAR szWinClass[256];
|
||||
WCHAR szTitle[MAX_LOADSTRING]{ 0 }; // wCenterWindow's title
|
||||
WCHAR szClass[MAX_LOADSTRING]{ 0 }; // Window's class
|
||||
WCHAR szWinTitle[256]{ 0 };
|
||||
WCHAR szWinClass[256]{ 0 };
|
||||
HANDLE hHeap = NULL, hUpdater = NULL;
|
||||
UINT dwUpdaterID = 0;
|
||||
HHOOK hMouseHook = NULL, hKbdHook = NULL; // Hook's handles
|
||||
@@ -157,7 +157,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
|
||||
HandlingTrayIcon();
|
||||
|
||||
hHeap = GetProcessHeap();
|
||||
szBuffer = HeapAlloc(hHeap, HEAP_ZERO_MEMORY, BUF_LEN);
|
||||
szBuffer = HeapAlloc(hHeap, HEAP_ZERO_MEMORY, MAX_WINTITLE_BUFFER_LENGTH);
|
||||
|
||||
MSG msg;
|
||||
BOOL bRet;
|
||||
@@ -204,7 +204,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
logger.Out(L"%s(%d): Loading context menu failed!", TEXT(__FUNCTION__), __LINE__);
|
||||
ShowError(IDS_ERR_MENU);
|
||||
PostQuitMessage(0);
|
||||
//PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
||||
}
|
||||
logger.Out(L"%s(%d): Context menu successfully loaded", TEXT(__FUNCTION__), __LINE__);
|
||||
|
||||
@@ -214,7 +213,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
logger.Out(L"%s(%d): Creating popup menu failed!", TEXT(__FUNCTION__), __LINE__);
|
||||
ShowError(IDS_ERR_POPUP);
|
||||
PostQuitMessage(0);
|
||||
//PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
||||
}
|
||||
logger.Out(L"%s(%d): Popup menu successfully created", TEXT(__FUNCTION__), __LINE__);
|
||||
|
||||
@@ -251,7 +249,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
ShowError(IDS_ERR_HOOK);
|
||||
PostQuitMessage(0);
|
||||
//PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
||||
}
|
||||
logger.Out(L"%s(%d): The mouse hook was successfully installed", TEXT(__FUNCTION__), __LINE__);
|
||||
#endif // !_DEBUG
|
||||
@@ -263,7 +260,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
ShowError(IDS_ERR_HOOK);
|
||||
PostQuitMessage(0);
|
||||
//PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
||||
}
|
||||
logger.Out(L"%s(%d): The keyboard hook was successfully installed", TEXT(__FUNCTION__), __LINE__);
|
||||
break;
|
||||
@@ -277,7 +273,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
logger.Out(L"%s(%d): Checking for updates is enabled, fCheckUpdates = %s", TEXT(__FUNCTION__), __LINE__, fCheckUpdates ? L"True" : L"False");
|
||||
|
||||
//hUpdater = CreateThread(NULL, 0, &Updater, nullptr, 0, nullptr);
|
||||
//hUpdater = (HANDLE)_beginthreadex(NULL, 0, &Updater, NULL, 0, &dwUpdaterID);
|
||||
if (NULL == hUpdater)
|
||||
{
|
||||
@@ -341,7 +336,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
logger.Out(L"%s(%d): Pressed the 'Exit' menuitem", TEXT(__FUNCTION__), __LINE__);
|
||||
|
||||
PostQuitMessage(0);
|
||||
//PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
||||
}
|
||||
|
||||
logger.Out(L"%s(%d): Exit from the WM_WCW message handler", TEXT(__FUNCTION__), __LINE__);
|
||||
@@ -515,7 +509,7 @@ BOOL IsWindowApprooved(HWND hFW)
|
||||
bool bApprooved = FALSE;
|
||||
if (hFW)
|
||||
{
|
||||
if (GetWindowTextW(hFW, (LPWSTR)szBuffer, BUF_LEN - sizeof(WCHAR)))
|
||||
if (GetWindowTextW(hFW, (LPWSTR)szBuffer, MAX_WINTITLE_BUFFER_LENGTH))
|
||||
{
|
||||
logger.Out(L"%s(%d): Window title: '%s'", TEXT(__FUNCTION__), __LINE__, (LPWSTR)szBuffer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user