Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cc2e5b5654 | |||
| 1929e3dc4f | |||
| 93ea96bca0 | |||
| 6fb8d35643 | |||
| 7d0e5ee0a7 | |||
| 146208bd03 | |||
| 342c6e3009 | |||
| bcf45417d8 | |||
| 2763bbd12d | |||
| a256184737 | |||
| 2510b74aa1 | |||
| 96940111aa | |||
| bad4d37e7a | |||
| fe10e4ec72 | |||
| 6edbf1f9c6 | |||
| 79acd5d110 | |||
| 4d503f6421 | |||
| dcf844ddd3 | |||
| 517cfdcc82 | |||
| 5c3e15b949 | |||
| 790ae9ab67 | |||
| 52364a228a | |||
|
|
73b91259c8 | ||
| cb01a4b815 | |||
| e15f08d521 | |||
| 28de2585a8 | |||
| 3cd3faea01 | |||
| 19660bb346 | |||
| b332c7476f |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,6 +6,7 @@
|
|||||||
*.user
|
*.user
|
||||||
*.userosscache
|
*.userosscache
|
||||||
*.sln.docstates
|
*.sln.docstates
|
||||||
|
[Vv]ersion.h
|
||||||
|
|
||||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||||
*.userprefs
|
*.userprefs
|
||||||
|
|||||||
24
README.md
24
README.md
@@ -1,12 +1,22 @@
|
|||||||
# wCenterWindow
|
## wCenterWindow
|
||||||
This program centers the current active window by a ```LCTRL + LWIN + C``` hotkey,
|
|
||||||
or pressing ```LCTRL + LWIN + MMB``` (Middle Mouse Button).
|
|
||||||
|
|
||||||
```LCTRL + LWIN + V``` - manual editing of size and position of the window.
|
This program centers the current active window by a `LCTRL + LWIN + C` hotkey,
|
||||||
|
or pressing `LCTRL + LWIN + MMB` (Middle Mouse Button).
|
||||||
|
|
||||||
You can use ```LCTRL + LWIN + I``` hotkey for hide/show trayicon.
|
`LCTRL + LWIN + V` - manual editing of size and position of the window.
|
||||||
You can also use commandline option ```/hide``` for hide trayicon at startup.
|
|
||||||
|
|
||||||
```Use workarea``` option means that the window is centered without a taskbar, otherwise, the full resolution of the monitor will be used.
|
You can use `LCTRL + LWIN + I` hotkey for hide/show trayicon.
|
||||||
|
You can also use commandline option `/hide` for hide trayicon at startup.
|
||||||
|
|
||||||
|
`Use workarea` option means that the window is centered without a taskbar, otherwise, the full resolution of the monitor will be used.
|
||||||
|
|
||||||
If some windows does not centers you should run wCenterWindow with administrative rights.
|
If some windows does not centers you should run wCenterWindow with administrative rights.
|
||||||
|
|
||||||
|
## Automatic startup
|
||||||
|
|
||||||
|
Usually, to start the application when Windows starts, it is enough to put the application's shortcut in the "Startup" folder -\
|
||||||
|
"C:\Users\[*Your user name*]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup". (The easiest way to get there - press 'WIN + R' and type 'shell:startup').\
|
||||||
|
However, in this case wCenterWindow will not be able to work with windows that are open with elevated privileges.
|
||||||
|
And if you enable the "Run as administrator" option in the shortcut, then wCenterWindow will not start. This is related to the security of Windows (maybe only in 10/11, I did not check).\
|
||||||
|
This behavior can be bypassed by creating a task in the Task Scheduler with the "Run with highest privileges" option.\
|
||||||
|
**Note:** If you run wCenterWindow via the Task Scheduler, I highly recommend enabling the "Delay task for" option for 15-30 seconds, otherwise you may get an error message "Can't create tray icon".
|
||||||
|
|||||||
81
Update_version.bat
Normal file
81
Update_version.bat
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
@ECHO OFF
|
||||||
|
SETLOCAL ENABLEDELAYEDEXPANSION
|
||||||
|
|
||||||
|
SET CURRENT_TIME=%TIME%
|
||||||
|
SET CURRENT_DATE=%DATE%
|
||||||
|
|
||||||
|
SET BUILDTIME=%CURRENT_TIME:~0,8%
|
||||||
|
SET BUILDDATE=%CURRENT_DATE%
|
||||||
|
SET BUILD_DATETIME=Build time: %BUILDDATE% %BUILDTIME%
|
||||||
|
SET CURRENT_YEAR=%CURRENT_DATE:~6,4%
|
||||||
|
|
||||||
|
SET BUILDSECS=0
|
||||||
|
SET GIT_COUNT=0
|
||||||
|
SET GIT_TIME=0
|
||||||
|
SET GIT_DATE=0
|
||||||
|
SET GIT_DATETIME=0
|
||||||
|
|
||||||
|
SET VerMajor=0
|
||||||
|
SET VerMinor=0
|
||||||
|
SET VerPatch=0
|
||||||
|
|
||||||
|
SET INT_NAME=0
|
||||||
|
SET PN=0
|
||||||
|
SET VS=0
|
||||||
|
SET VSF=0
|
||||||
|
SET PCF=0
|
||||||
|
SET PYS=0
|
||||||
|
SET PA=0
|
||||||
|
|
||||||
|
CD /D %~dp0
|
||||||
|
IF NOT EXIST "VersionInfo.h" (
|
||||||
|
ECHO Can't find file 'VersionInfo.h'
|
||||||
|
TIMEOUT /T 3
|
||||||
|
EXIT /B 1
|
||||||
|
)
|
||||||
|
COPY /Y "VersionInfo.h" "version.h" >nul
|
||||||
|
|
||||||
|
FOR /F "tokens=3" %%A IN ('FINDSTR /I /L /C:"define V_MAJOR" "version.h"') DO (SET "VerMajor=%%A")
|
||||||
|
FOR /F "tokens=3" %%A IN ('FINDSTR /I /L /C:"define V_MINOR" "version.h"') DO (SET "VerMinor=%%A")
|
||||||
|
FOR /F "tokens=3" %%A IN ('FINDSTR /I /L /C:"define V_PATCH" "version.h"') DO (SET "VerPatch=%%A")
|
||||||
|
FOR /F "tokens=3" %%A IN ('FINDSTR /I /L /C:"define PRODUCT_NAME" "version.h"') DO (SET "PN=%%~A")
|
||||||
|
FOR /F "tokens=3" %%A IN ('FINDSTR /I /L /C:"define PRODUCT_YEAR_START" "version.h"') DO (SET "PYS=%%A")
|
||||||
|
FOR /F "tokens=2*" %%A IN ('FINDSTR /I /L /C:"define PRODUCT_AUTHORS" "version.h"') DO (SET "PA=%%~B")
|
||||||
|
FOR /F "tokens=1-4 delims=:., " %%A IN ("%BUILDTIME%") DO (SET /A "BUILDSECS=%%A * 3600 + %%B * 60 + %%C")
|
||||||
|
FOR /F "delims=" %%A IN ('git rev-list --count HEAD') DO (SET /A GIT_COUNT=%%A)
|
||||||
|
FOR /F "tokens=1,2 delims= " %%A IN ('git log -1 --date=format:%%d.%%m.%%Y ^| find /I "Date:"') DO (SET "GIT_DATE=%%B")
|
||||||
|
FOR /F "tokens=2-4 delims=, " %%A IN ('git log -1 --date=format:"%%a,%%d-%%h-%%Y,%%T" ^| find /I "Date:"') DO (
|
||||||
|
SET "GIT_DATETIME=Git time: %%A, %%B %%C"
|
||||||
|
SET "GIT_TIME=%%C"
|
||||||
|
)
|
||||||
|
|
||||||
|
SET VSF=%VerMajor%.%VerMinor%.%VerPatch%.%GIT_COUNT%
|
||||||
|
SET VS=%VerMajor%.%VerMinor%.%VerPatch%
|
||||||
|
SET VNF=%VerMajor%,%VerMinor%,%VerPatch%,%GIT_COUNT%
|
||||||
|
SET VN=%VerMajor%,%VerMinor%,%VerPatch%
|
||||||
|
|
||||||
|
SET PNF=%PN% v%VS% (C++)
|
||||||
|
SET PCF=Copyright (C) %PYS%-%CURRENT_YEAR% by %PA%
|
||||||
|
|
||||||
|
SET INT_NAME=%PN%C++
|
||||||
|
SET ORIG_NAME=%PN%.exe
|
||||||
|
|
||||||
|
ECHO #define BUILD_DATE "%BUILDDATE%">> version.h
|
||||||
|
ECHO #define BUILD_TIME "%BUILDTIME%">> version.h
|
||||||
|
ECHO #define BUILD_DATETIME "%BUILD_DATETIME%">> version.h
|
||||||
|
ECHO #define GIT_DATE "%GIT_DATE%">> version.h
|
||||||
|
ECHO #define GIT_TIME "%GIT_TIME%">> version.h
|
||||||
|
ECHO #define GIT_DATETIME "%GIT_DATETIME%">> version.h
|
||||||
|
ECHO #define GIT_COUNT %GIT_COUNT% >> version.h
|
||||||
|
ECHO #define V_SECS %BUILDSECS% >> version.h
|
||||||
|
ECHO #define INTERNAL_NAME "%INT_NAME%">> version.h
|
||||||
|
ECHO #define ORIG_FILE_NAME "%ORIG_NAME%">> version.h
|
||||||
|
ECHO #define PRODUCT_NAME_FULL "%PNF%">> version.h
|
||||||
|
ECHO #define PRODUCT_COPYRIGHT "%PCF%">> version.h
|
||||||
|
ECHO #define VERSION_NUM %VN% >> version.h
|
||||||
|
ECHO #define VERSION_STR "%VS%">> version.h
|
||||||
|
ECHO #define VERSION_NUM_FULL %VNF% >> version.h
|
||||||
|
ECHO #define VERSION_STR_FULL "%VSF%">> version.h
|
||||||
|
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT
|
||||||
12
VersionInfo.h
Normal file
12
VersionInfo.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
// wCenterWindow
|
||||||
|
// version.h
|
||||||
|
//
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define V_MAJOR 2
|
||||||
|
#define V_MINOR 3
|
||||||
|
#define V_PATCH 4
|
||||||
|
#define PRODUCT_NAME "wCenterWindow"
|
||||||
|
#define PRODUCT_AUTHORS "W0LF aka 'dreamforce'"
|
||||||
|
#define PRODUCT_YEAR_START 2020
|
||||||
|
#define PRODUCT_DESCRIPTION "Centers windows by hotkey"
|
||||||
@@ -1,67 +1,61 @@
|
|||||||
// wCenterWindow, v2.3.3
|
// wCenterWindow
|
||||||
// Logger.cpp
|
// Logger.cpp
|
||||||
//
|
//
|
||||||
#include "framework.h"
|
#include "framework.h"
|
||||||
|
|
||||||
#define TS_LEN 30
|
#define TS_LEN 30
|
||||||
#define PATH_LEN 1024
|
|
||||||
|
|
||||||
std::wofstream logfile;
|
std::ofstream logfile;
|
||||||
extern WCHAR szTitle[];
|
extern WCHAR szTitle[];
|
||||||
extern LPVOID szBuffer;
|
extern LPVOID szBuffer;
|
||||||
namespace fs = std::filesystem;
|
|
||||||
|
|
||||||
std::wstring PrintTitle()
|
std::string GetTimeStamp()
|
||||||
{
|
|
||||||
wchar_t szWinTitle[2048];
|
|
||||||
StringCchPrintf(szWinTitle, 2048, L"%s", szBuffer);
|
|
||||||
return szWinTitle;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::wstring GetTimeStamp()
|
|
||||||
{
|
{
|
||||||
SYSTEMTIME lt;
|
SYSTEMTIME lt;
|
||||||
GetLocalTime(<);
|
GetLocalTime(<);
|
||||||
wchar_t ts[TS_LEN];
|
CHAR ts[TS_LEN];
|
||||||
StringCchPrintfW(ts, TS_LEN, L"%d-%02d-%02d %02d:%02d:%02d.%03d - ", lt.wYear, lt.wMonth, lt.wDay, lt.wHour, lt.wMinute, lt.wSecond, lt.wMilliseconds);
|
StringCchPrintfA(ts, TS_LEN, "%d-%02d-%02d %02d:%02d:%02d.%03d - ", lt.wYear, lt.wMonth, lt.wDay, lt.wHour, lt.wMinute, lt.wSecond, lt.wMilliseconds);
|
||||||
return ts;
|
return ts;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenLogFile()
|
void OpenLogFile()
|
||||||
{
|
{
|
||||||
wchar_t lpszPath[PATH_LEN]{};
|
WCHAR lpszPath[MAX_PATH + 1] = { 0 };
|
||||||
DWORD dwPathLength = GetModuleFileNameW(NULL, lpszPath, PATH_LEN);
|
DWORD dwPathLength = GetModuleFileNameW(NULL, lpszPath, MAX_PATH);
|
||||||
DWORD dwError = GetLastError();
|
DWORD dwError = GetLastError();
|
||||||
if (ERROR_INSUFFICIENT_BUFFER == dwError)
|
if (ERROR_INSUFFICIENT_BUFFER == dwError)
|
||||||
{
|
{
|
||||||
MessageBoxW(NULL, L"Path to logfile is too long! Working without logging.", (LPCWSTR)szTitle, MB_OK | MB_ICONWARNING);
|
MessageBoxW(NULL, L"Path to logfile is too long! Working without logging", (LPCWSTR)szTitle, MB_OK | MB_ICONWARNING);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NULL == dwPathLength)
|
if (NULL == dwPathLength)
|
||||||
{
|
{
|
||||||
MessageBoxW(NULL, L"Can't get module filename! Working without logging.", (LPCWSTR)szTitle, MB_OK | MB_ICONWARNING);
|
MessageBoxW(NULL, L"Can't get module filename! Working without logging", (LPCWSTR)szTitle, MB_OK | MB_ICONWARNING);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fs::path log_path = lpszPath;
|
std::filesystem::path log_path = lpszPath;
|
||||||
log_path.replace_extension(L".log");
|
log_path.replace_extension(L".log");
|
||||||
fs::path bak_path = log_path;
|
std::filesystem::path bak_path = log_path;
|
||||||
bak_path.replace_extension(L".bak");
|
bak_path.replace_extension(L".bak");
|
||||||
|
|
||||||
if (fs::exists(log_path)) fs::rename(log_path, bak_path);
|
if (std::filesystem::exists(log_path)) std::filesystem::rename(log_path, bak_path);
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
log_path = L"d:\\test.log";
|
log_path = L"d:\\test.log";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
logfile.open(log_path);
|
logfile.open(log_path);
|
||||||
if (logfile.is_open())
|
if (logfile.is_open())
|
||||||
{
|
{
|
||||||
diag_log(L"Start logging.");
|
logfile << std::boolalpha;
|
||||||
diag_log(L"Logfile:", log_path);
|
diag_log("Start logging");
|
||||||
diag_log(log_path, L"successfully opened.");
|
diag_log("Logfile: ", log_path);
|
||||||
|
diag_log("Logfile was successfully opened");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MessageBoxW(NULL, L"Can't open logfile! Working without logging.", (LPCWSTR)szTitle, MB_OK | MB_ICONWARNING);
|
MessageBoxW(NULL, L"Can't open logfile! Working without logging", (LPCWSTR)szTitle, MB_OK | MB_ICONWARNING);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -70,7 +64,7 @@ void CloseLogFile()
|
|||||||
{
|
{
|
||||||
if (logfile)
|
if (logfile)
|
||||||
{
|
{
|
||||||
diag_log(L"End logging.");
|
diag_log("End logging");
|
||||||
logfile.close();
|
logfile.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
// wCenterWindow, v2.3.3
|
// wCenterWindow
|
||||||
// Logger.h
|
// Logger.h
|
||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "framework.h"
|
#include "framework.h"
|
||||||
|
|
||||||
extern std::wofstream logfile;
|
extern std::ofstream logfile;
|
||||||
std::wstring GetTimeStamp();
|
std::string GetTimeStamp();
|
||||||
std::wstring PrintTitle();
|
|
||||||
|
|
||||||
template <typename T1>
|
template <typename T1>
|
||||||
void diag_log(T1 arg1)
|
void diag_log(T1 arg1)
|
||||||
@@ -17,43 +16,43 @@ void diag_log(T1 arg1)
|
|||||||
template <typename T1, typename T2>
|
template <typename T1, typename T2>
|
||||||
void diag_log(T1 arg1, T2 arg2)
|
void diag_log(T1 arg1, T2 arg2)
|
||||||
{
|
{
|
||||||
logfile << GetTimeStamp() << arg1 << ' ' << arg2 << std::endl;
|
logfile << GetTimeStamp() << arg1 << arg2 << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T1, typename T2, typename T3>
|
template <typename T1, typename T2, typename T3>
|
||||||
void diag_log(T1 arg1, T2 arg2, T3 arg3)
|
void diag_log(T1 arg1, T2 arg2, T3 arg3)
|
||||||
{
|
{
|
||||||
logfile << GetTimeStamp() << arg1 << ' ' << arg2 << ' ' << arg3 << std::endl;
|
logfile << GetTimeStamp() << arg1 << arg2 << arg3 << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T1, typename T2, typename T3, typename T4>
|
template <typename T1, typename T2, typename T3, typename T4>
|
||||||
void diag_log(T1 arg1, T2 arg2, T3 arg3, T4 arg4)
|
void diag_log(T1 arg1, T2 arg2, T3 arg3, T4 arg4)
|
||||||
{
|
{
|
||||||
logfile << GetTimeStamp() << arg1 << ' ' << arg2 << ' ' << arg3 << ' ' << arg4 << std::endl;
|
logfile << GetTimeStamp() << arg1 << arg2 << arg3 << arg4 << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T1, typename T2, typename T3, typename T4, typename T5>
|
template <typename T1, typename T2, typename T3, typename T4, typename T5>
|
||||||
void diag_log(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
|
void diag_log(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
|
||||||
{
|
{
|
||||||
logfile << GetTimeStamp() << arg1 << ' ' << arg2 << ' ' << arg3 << ' ' << arg4 << ' ' << arg5 << std::endl;
|
logfile << GetTimeStamp() << arg1 << arg2 << arg3 << arg4 << arg5 << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
|
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
|
||||||
void diag_log(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
|
void diag_log(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
|
||||||
{
|
{
|
||||||
logfile << GetTimeStamp() << arg1 << ' ' << arg2 << ' ' << arg3 << ' ' << arg4 << ' ' << arg5 << ' ' << arg6 << std::endl;
|
logfile << GetTimeStamp() << arg1 << arg2 << arg3 << arg4 << arg5 << arg6 << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
|
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
|
||||||
void diag_log(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7)
|
void diag_log(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7)
|
||||||
{
|
{
|
||||||
logfile << GetTimeStamp() << arg1 << ' ' << arg2 << ' ' << arg3 << ' ' << arg4 << ' ' << arg5 << ' ' << arg6 << ' ' << arg7 << std::endl;
|
logfile << GetTimeStamp() << arg1 << arg2 << arg3 << arg4 << arg5 << arg6 << arg7 << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
|
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
|
||||||
void diag_log(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8)
|
void diag_log(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8)
|
||||||
{
|
{
|
||||||
logfile << GetTimeStamp() << arg1 << ' ' << arg2 << ' ' << arg3 << ' ' << arg4 << ' ' << arg5 << ' ' << arg6 << ' ' << arg7 << ' ' << arg8 << std::endl;
|
logfile << GetTimeStamp() << arg1 << arg2 << arg3 << arg4 << arg5 << arg6 << arg7 << arg8 << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenLogFile();
|
void OpenLogFile();
|
||||||
|
|||||||
Binary file not shown.
@@ -1,9 +1,7 @@
|
|||||||
// header.h : include file for standard system include files,
|
// wCenterWindow
|
||||||
// or project specific include files
|
// framework.h
|
||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "targetver.h"
|
#include "targetver.h"
|
||||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||||
|
|
||||||
@@ -17,10 +15,5 @@
|
|||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
#include <CommCtrl.h>
|
#include <CommCtrl.h>
|
||||||
|
|
||||||
// C RunTime Header Files
|
|
||||||
//#include <stdlib.h>
|
|
||||||
//#include <malloc.h>
|
|
||||||
//#include <memory.h>
|
|
||||||
|
|
||||||
// Project Specific Header Files
|
// Project Specific Header Files
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
|
|||||||
@@ -13,12 +13,13 @@
|
|||||||
#define ID_POPUPMENU_EXIT 111
|
#define ID_POPUPMENU_EXIT 111
|
||||||
#define IDS_ABOUT 112
|
#define IDS_ABOUT 112
|
||||||
#define IDS_ERR_MAIN 113
|
#define IDS_ERR_MAIN 113
|
||||||
#define IDS_ERR_WND 114
|
#define IDS_ERR_CLASS 114
|
||||||
#define IDS_ERR_ICON 115
|
#define IDS_ERR_WND 115
|
||||||
#define IDS_ERR_MENU 116
|
#define IDS_ERR_ICON 116
|
||||||
#define IDS_ERR_POPUP 117
|
#define IDS_ERR_MENU 117
|
||||||
#define IDS_ERR_HOOK 118
|
#define IDS_ERR_POPUP 118
|
||||||
#define IDS_ERR_MAXMIN 119
|
#define IDS_ERR_HOOK 119
|
||||||
|
#define IDS_ERR_MAXMIN 120
|
||||||
#define IDS_RUNNING 121
|
#define IDS_RUNNING 121
|
||||||
#define IDR_MAINFRAME 128
|
#define IDR_MAINFRAME 128
|
||||||
#define IDD_MANUAL_EDITING 129
|
#define IDD_MANUAL_EDITING 129
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
// wCenterWindow, v2.3.3
|
// wCenterWindow
|
||||||
|
// wCenterWindow.cpp
|
||||||
//
|
//
|
||||||
// TODO: More verbose logs - partially done.
|
|
||||||
// TODO: More verbose error messages
|
|
||||||
// TODO: Window's title in logs (Impossible?)
|
|
||||||
|
|
||||||
#include "framework.h"
|
#include "framework.h"
|
||||||
#include "wCenterWindow.h"
|
#include "wCenterWindow.h"
|
||||||
|
|
||||||
@@ -11,7 +8,7 @@
|
|||||||
#define KEY_C 0x43
|
#define KEY_C 0x43
|
||||||
#define KEY_V 0x56
|
#define KEY_V 0x56
|
||||||
|
|
||||||
#define BUF_LEN 4096
|
#define BUF_LEN 1024
|
||||||
#define MAX_LOADSTRING 50
|
#define MAX_LOADSTRING 50
|
||||||
#define WM_WCW 0x8F00
|
#define WM_WCW 0x8F00
|
||||||
|
|
||||||
@@ -22,14 +19,15 @@ WCHAR szClass[MAX_LOADSTRING]; // Window's class
|
|||||||
WCHAR szAbout[MAX_LOADSTRING * 12]; // Description text
|
WCHAR szAbout[MAX_LOADSTRING * 12]; // Description text
|
||||||
WCHAR szWinTitle[256];
|
WCHAR szWinTitle[256];
|
||||||
WCHAR szWinClass[256];
|
WCHAR szWinClass[256];
|
||||||
WCHAR szWinCore[] = TEXT("Windows.UI.Core.CoreWindow");
|
WCHAR szWinCore[] = L"Windows.UI.Core.CoreWindow";
|
||||||
|
WCHAR szWorkerW[] = L"WorkerW";
|
||||||
HANDLE hHeap = NULL;
|
HANDLE hHeap = NULL;
|
||||||
HHOOK hMouseHook = NULL, hKbdHook = NULL; // Hook's handles
|
HHOOK hMouseHook = NULL, hKbdHook = NULL; // Hook's handles
|
||||||
HICON hIcon = NULL;
|
HICON hIcon = NULL;
|
||||||
HMENU hMenu = NULL, hPopup = NULL;
|
HMENU hMenu = NULL, hPopup = NULL;
|
||||||
HWND hWnd = NULL, hFgWnd = NULL, hTaskBar = NULL, hDesktop = NULL, hProgman = NULL;
|
HWND hWnd = NULL, hFgWnd = NULL, hTaskBar = NULL, hDesktop = NULL, hProgman = NULL;
|
||||||
BOOL bKPressed = FALSE, bMPressed = FALSE, bShowIcon = TRUE, bWorkArea = TRUE;
|
bool bKPressed = FALSE, bMPressed = FALSE, bShowIcon = TRUE, bWorkArea = TRUE;
|
||||||
BOOL bLCTRL = FALSE, bLWIN = FALSE, bKEYV = FALSE;
|
bool bLCTRL = FALSE, bLWIN = FALSE, bKEYV = FALSE;
|
||||||
|
|
||||||
RECT rcFW = { 0 };
|
RECT rcFW = { 0 };
|
||||||
NOTIFYICONDATAW nid = { 0 };
|
NOTIFYICONDATAW nid = { 0 };
|
||||||
@@ -44,26 +42,26 @@ static const GUID guid = { 0x2d7b7f30, 0x4b5f, 0x4380, { 0x98, 0x7, 0x57, 0xd7,
|
|||||||
// Forward declarations of functions included in this code module:
|
// Forward declarations of functions included in this code module:
|
||||||
VOID HandlingTrayIcon();
|
VOID HandlingTrayIcon();
|
||||||
VOID ShowError(UINT);
|
VOID ShowError(UINT);
|
||||||
BOOL CheckWindow(HWND);
|
bool IsWindowApprooved(HWND);
|
||||||
BOOL CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM);
|
BOOL CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM);
|
||||||
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||||
LRESULT CALLBACK KeyboardHookProc(int, WPARAM, LPARAM);
|
LRESULT CALLBACK KeyboardHookProc(int, WPARAM, LPARAM);
|
||||||
LRESULT CALLBACK MouseHookProc(int, WPARAM, LPARAM);
|
LRESULT CALLBACK MouseHookProc(int, WPARAM, LPARAM);
|
||||||
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
|
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
|
||||||
|
std::string ConvertWideToUtf8(const std::wstring&);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
VOID MoveWindowToMonitorCenter(HWND hwnd, BOOL bWorkArea, BOOL bResize)
|
VOID MoveWindowToMonitorCenter(HWND hwnd, BOOL bWorkArea, BOOL bResize)
|
||||||
{
|
{
|
||||||
//diag_log(L"Entering MoveWindowToMonitorCenter(): hwnd =", hwnd, L"Title:", (LPWSTR)szBuffer);
|
diag_log("Entering MoveWindowToMonitorCenter(), handle = 0x", hwnd);
|
||||||
diag_log(L"Entering MoveWindowToMonitorCenter(): hwnd =", hwnd);
|
|
||||||
|
|
||||||
RECT fgwrc = { 0 };
|
RECT fgwrc = { 0 };
|
||||||
GetWindowRect(hwnd, &fgwrc);
|
GetWindowRect(hwnd, &fgwrc);
|
||||||
LONG nWidth = fgwrc.right - fgwrc.left;
|
LONG nWidth = fgwrc.right - fgwrc.left;
|
||||||
LONG nHeight = fgwrc.bottom - fgwrc.top;
|
LONG nHeight = fgwrc.bottom - fgwrc.top;
|
||||||
|
|
||||||
diag_log(L"Moving window from x =", fgwrc.left, L"y =", fgwrc.top);
|
diag_log("Moving window from x = ", fgwrc.left, ", y = ", fgwrc.top);
|
||||||
|
|
||||||
MONITORINFO mi = { 0 };
|
MONITORINFO mi = { 0 };
|
||||||
mi.cbSize = sizeof(MONITORINFO);
|
mi.cbSize = sizeof(MONITORINFO);
|
||||||
@@ -97,34 +95,14 @@ VOID MoveWindowToMonitorCenter(HWND hwnd, BOOL bWorkArea, BOOL bResize)
|
|||||||
MoveWindow(hwnd, x, y, nWidth, nHeight, TRUE);
|
MoveWindow(hwnd, x, y, nWidth, nHeight, TRUE);
|
||||||
SendMessageW(hwnd, WM_EXITSIZEMOVE, NULL, NULL);
|
SendMessageW(hwnd, WM_EXITSIZEMOVE, NULL, NULL);
|
||||||
|
|
||||||
diag_log(L"Moving window to x =", x, L"y =", y);
|
diag_log("Moving window to x = ", x, ", y = ", y);
|
||||||
diag_log(L"Quiting MoveWindowToMonitorCenter()");
|
diag_log("Quiting MoveWindowToMonitorCenter()");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ATOM MyRegisterClass(HINSTANCE hInstance)
|
|
||||||
{
|
|
||||||
WNDCLASSEX wcex = { 0 };
|
|
||||||
wcex.cbSize = sizeof(WNDCLASSEX);
|
|
||||||
wcex.lpfnWndProc = WndProc;
|
|
||||||
wcex.hInstance = hInstance;
|
|
||||||
wcex.hIcon = LoadIconW(hInstance, MAKEINTRESOURCE(IDI_TRAYICON));
|
|
||||||
wcex.hCursor = LoadCursorW(nullptr, IDC_ARROW);
|
|
||||||
wcex.lpszClassName = szClass;
|
|
||||||
wcex.hIconSm = wcex.hIcon;
|
|
||||||
hIcon = wcex.hIcon;
|
|
||||||
return RegisterClassExW(&wcex);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
|
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
|
||||||
{
|
{
|
||||||
UNREFERENCED_PARAMETER(hPrevInstance);
|
|
||||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
|
||||||
|
|
||||||
OpenLogFile();
|
|
||||||
diag_log(L"Entering WinMain()");
|
|
||||||
|
|
||||||
hInst = hInstance;
|
hInst = hInstance;
|
||||||
|
|
||||||
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, _countof(szTitle));
|
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, _countof(szTitle));
|
||||||
@@ -136,8 +114,25 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
MyRegisterClass(hInstance);
|
OpenLogFile();
|
||||||
hWnd = CreateWindowExW(0, szClass, szTitle, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, hInstance, NULL);
|
diag_log("Entering WinMain()");
|
||||||
|
|
||||||
|
WNDCLASSEX wcex = { 0 };
|
||||||
|
wcex.cbSize = sizeof(WNDCLASSEX);
|
||||||
|
wcex.lpfnWndProc = WndProc;
|
||||||
|
wcex.hInstance = hInstance;
|
||||||
|
wcex.hIcon = LoadIconW(hInstance, MAKEINTRESOURCE(IDI_TRAYICON));
|
||||||
|
wcex.hCursor = LoadCursorW(nullptr, IDC_ARROW);
|
||||||
|
wcex.lpszClassName = szClass;
|
||||||
|
wcex.hIconSm = wcex.hIcon;
|
||||||
|
hIcon = wcex.hIcon;
|
||||||
|
if (!RegisterClassExW(&wcex))
|
||||||
|
{
|
||||||
|
ShowError(IDS_ERR_CLASS);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
hWnd = CreateWindowExW(0, szClass, szTitle, 0, 0, 0, 0, 0, NULL, NULL, hInstance, NULL);
|
||||||
if (!hWnd)
|
if (!hWnd)
|
||||||
{
|
{
|
||||||
ShowError(IDS_ERR_WND);
|
ShowError(IDS_ERR_WND);
|
||||||
@@ -146,11 +141,13 @@ 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);
|
||||||
|
std::string arg;
|
||||||
|
|
||||||
diag_log(L"Arguments:", nArgs - 1);
|
diag_log("Arguments: ", nArgs - 1);
|
||||||
for (int i = 1; i < nArgs; i++)
|
for (int i = 1; i < nArgs; i++)
|
||||||
{
|
{
|
||||||
diag_log(L"Argument", i, L":", szArglist[i]);
|
arg = ConvertWideToUtf8(szArglist[i]);
|
||||||
|
diag_log("Argument #", i, ": ", arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
(nArgs >= 2 && 0 == lstrcmpiW(szArglist[1], L"/hide")) ? bShowIcon = FALSE : bShowIcon = TRUE;
|
(nArgs >= 2 && 0 == lstrcmpiW(szArglist[1], L"/hide")) ? bShowIcon = FALSE : bShowIcon = TRUE;
|
||||||
@@ -186,7 +183,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
|
|||||||
if (hMenu) DestroyMenu(hMenu);
|
if (hMenu) DestroyMenu(hMenu);
|
||||||
Shell_NotifyIconW(NIM_DELETE, &nid);
|
Shell_NotifyIconW(NIM_DELETE, &nid);
|
||||||
|
|
||||||
diag_log(L"Quiting WinMain(), msg.wParam =", (int)msg.wParam);
|
diag_log("Quiting WinMain(), msg.wParam = ", (int)msg.wParam);
|
||||||
CloseLogFile();
|
CloseLogFile();
|
||||||
HeapFree(hHeap, NULL, szBuffer);
|
HeapFree(hHeap, NULL, szBuffer);
|
||||||
|
|
||||||
@@ -199,23 +196,24 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
{
|
{
|
||||||
|
diag_log("Recived WM_CREATE message");
|
||||||
hMenu = LoadMenuW(hInst, MAKEINTRESOURCE(IDR_MENU));
|
hMenu = LoadMenuW(hInst, MAKEINTRESOURCE(IDR_MENU));
|
||||||
if (!hMenu)
|
if (!hMenu)
|
||||||
{
|
{
|
||||||
diag_log(L"Loading context menu failed!");
|
diag_log("Loading context menu failed!");
|
||||||
ShowError(IDS_ERR_MENU);
|
ShowError(IDS_ERR_MENU);
|
||||||
SendMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
||||||
}
|
}
|
||||||
diag_log(L"Context menu successfully loaded");
|
diag_log("Context menu successfully loaded");
|
||||||
|
|
||||||
hPopup = GetSubMenu(hMenu, 0);
|
hPopup = GetSubMenu(hMenu, 0);
|
||||||
if (!hPopup)
|
if (!hPopup)
|
||||||
{
|
{
|
||||||
diag_log(L"Creating popup menu failed!");
|
diag_log("Creating popup menu failed!");
|
||||||
ShowError(IDS_ERR_POPUP);
|
ShowError(IDS_ERR_POPUP);
|
||||||
SendMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
||||||
}
|
}
|
||||||
diag_log(L"Popup menu successfully created");
|
diag_log("Popup menu successfully created");
|
||||||
|
|
||||||
mii.cbSize = sizeof(MENUITEMINFO);
|
mii.cbSize = sizeof(MENUITEMINFO);
|
||||||
mii.fMask = MIIM_STATE;
|
mii.fMask = MIIM_STATE;
|
||||||
@@ -234,23 +232,25 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
nid.dwStateMask = NIS_HIDDEN;
|
nid.dwStateMask = NIS_HIDDEN;
|
||||||
StringCchCopyW(nid.szTip, _countof(nid.szTip), szTitle);
|
StringCchCopyW(nid.szTip, _countof(nid.szTip), szTitle);
|
||||||
|
|
||||||
|
#ifndef _DEBUG
|
||||||
hMouseHook = SetWindowsHookExW(WH_MOUSE_LL, MouseHookProc, hInst, NULL);
|
hMouseHook = SetWindowsHookExW(WH_MOUSE_LL, MouseHookProc, hInst, NULL);
|
||||||
if (!hMouseHook)
|
if (!hMouseHook)
|
||||||
{
|
{
|
||||||
diag_log(L"Creating mouse hook failed!");
|
diag_log("Creating mouse hook failed!");
|
||||||
ShowError(IDS_ERR_HOOK);
|
ShowError(IDS_ERR_HOOK);
|
||||||
SendMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
||||||
}
|
}
|
||||||
diag_log(L"Mouse hook was successfully set");
|
diag_log("Mouse hook was successfully set");
|
||||||
|
#endif // !_DEBUG
|
||||||
|
|
||||||
hKbdHook = SetWindowsHookExW(WH_KEYBOARD_LL, KeyboardHookProc, hInst, NULL);
|
hKbdHook = SetWindowsHookExW(WH_KEYBOARD_LL, KeyboardHookProc, hInst, NULL);
|
||||||
if (!hKbdHook)
|
if (!hKbdHook)
|
||||||
{
|
{
|
||||||
diag_log(L"Creating keyboard hook failed!");
|
diag_log("Creating keyboard hook failed!");
|
||||||
ShowError(IDS_ERR_HOOK);
|
ShowError(IDS_ERR_HOOK);
|
||||||
SendMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
||||||
}
|
}
|
||||||
diag_log(L"Keyboard hook was successfully set");
|
diag_log("Keyboard hook was successfully set");
|
||||||
|
|
||||||
LoadStringW(hInst, IDS_ABOUT, szAbout, _countof(szAbout));
|
LoadStringW(hInst, IDS_ABOUT, szAbout, _countof(szAbout));
|
||||||
break;
|
break;
|
||||||
@@ -258,38 +258,55 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
case WM_WCW:
|
case WM_WCW:
|
||||||
{
|
{
|
||||||
if ((lParam == WM_RBUTTONDOWN || lParam == WM_LBUTTONDOWN) && wParam == IDI_TRAYICON)
|
if (IDI_TRAYICON == wParam && (WM_RBUTTONDOWN == lParam || WM_LBUTTONDOWN == lParam))
|
||||||
{
|
{
|
||||||
|
diag_log("Entering menu handler");
|
||||||
SetForegroundWindow(hWnd);
|
SetForegroundWindow(hWnd);
|
||||||
POINT pt;
|
POINT pt;
|
||||||
GetCursorPos(&pt);
|
GetCursorPos(&pt);
|
||||||
int idMenu = TrackPopupMenu(hPopup, TPM_RETURNCMD, pt.x, pt.y, 0, hWnd, NULL);
|
int idMenu = TrackPopupMenu(hPopup, TPM_RETURNCMD, pt.x, pt.y, 0, hWnd, NULL);
|
||||||
if (idMenu == ID_POPUPMENU_ICON)
|
if (ID_POPUPMENU_ICON == idMenu)
|
||||||
{
|
{
|
||||||
|
diag_log("Pressed 'Hide icon' menuitem");
|
||||||
bShowIcon = FALSE;
|
bShowIcon = FALSE;
|
||||||
HandlingTrayIcon();
|
HandlingTrayIcon();
|
||||||
}
|
}
|
||||||
if (idMenu == ID_POPUPMENU_AREA)
|
if (ID_POPUPMENU_AREA == idMenu)
|
||||||
{
|
{
|
||||||
|
diag_log("Pressed 'Use workarea' menuitem");
|
||||||
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);
|
||||||
diag_log(L"Changed 'Use workarea' option to", bWorkArea);
|
diag_log("Changed 'Use workarea' option to ", bWorkArea);
|
||||||
}
|
}
|
||||||
if (idMenu == ID_POPUPMENU_ABOUT && !bKPressed)
|
if (ID_POPUPMENU_ABOUT == idMenu && !bKPressed)
|
||||||
{
|
{
|
||||||
|
diag_log("Pressed 'About' menuitem");
|
||||||
bKPressed = TRUE;
|
bKPressed = TRUE;
|
||||||
diag_log(L"Opening 'About' dialog");
|
|
||||||
DialogBoxW(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, (DLGPROC)About);
|
DialogBoxW(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, (DLGPROC)About);
|
||||||
bKPressed = FALSE;
|
bKPressed = FALSE;
|
||||||
}
|
}
|
||||||
if (idMenu == ID_POPUPMENU_EXIT) SendMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
if (ID_POPUPMENU_EXIT == idMenu)
|
||||||
|
{
|
||||||
|
diag_log("Pressed 'Exit' menuitem");
|
||||||
|
PostMessageW(hWnd, WM_CLOSE, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
diag_log("Quiting menu handler");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case WM_QUERYENDSESSION:
|
||||||
|
{
|
||||||
|
diag_log("Recieved WM_QUERYENDSESSION message, lParam = ", lParam);
|
||||||
|
CloseLogFile();
|
||||||
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
{
|
{
|
||||||
|
diag_log("Recived WM_DESTROY message");
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -302,14 +319,13 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
if (wParam == WM_MBUTTONUP) bMPressed = FALSE;
|
if (WM_MBUTTONUP == wParam) bMPressed = FALSE;
|
||||||
if (wParam == WM_MBUTTONDOWN && bLCTRL && bLWIN && !bMPressed)
|
if (WM_MBUTTONDOWN == wParam && bLCTRL && bLWIN && !bMPressed)
|
||||||
{
|
{
|
||||||
diag_log(L"Pressed LCTRL + LWIN + MMB");
|
diag_log("Pressed LCTRL + LWIN + MMB");
|
||||||
bMPressed = TRUE;
|
bMPressed = TRUE;
|
||||||
hFgWnd = GetForegroundWindow();
|
hFgWnd = GetForegroundWindow();
|
||||||
BOOL bApproved = CheckWindow(hFgWnd);
|
if (IsWindowApprooved(hFgWnd)) MoveWindowToMonitorCenter(hFgWnd, bWorkArea, FALSE);
|
||||||
if (bApproved) MoveWindowToMonitorCenter(hFgWnd, bWorkArea, FALSE);
|
|
||||||
else hFgWnd = NULL;
|
else hFgWnd = NULL;
|
||||||
}
|
}
|
||||||
return CallNextHookEx(NULL, nCode, wParam, lParam);
|
return CallNextHookEx(NULL, nCode, wParam, lParam);
|
||||||
@@ -319,47 +335,45 @@ LRESULT CALLBACK KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
pkhs = (KBDLLHOOKSTRUCT*)lParam;
|
pkhs = (KBDLLHOOKSTRUCT*)lParam;
|
||||||
|
|
||||||
if (wParam == WM_KEYUP)
|
if (WM_KEYUP == wParam)
|
||||||
{
|
{
|
||||||
if (pkhs->vkCode == VK_LCONTROL) bLCTRL = FALSE;
|
if (VK_LCONTROL == pkhs->vkCode) bLCTRL = FALSE;
|
||||||
if (pkhs->vkCode == VK_LWIN) bLWIN = FALSE;
|
if (VK_LWIN == pkhs->vkCode) bLWIN = FALSE;
|
||||||
bKPressed = FALSE;
|
bKPressed = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wParam == WM_KEYDOWN)
|
if (WM_KEYDOWN == wParam)
|
||||||
{
|
{
|
||||||
if (pkhs->vkCode == VK_LCONTROL) bLCTRL = TRUE;
|
if (VK_LCONTROL == pkhs->vkCode) bLCTRL = TRUE;
|
||||||
if (pkhs->vkCode == VK_LWIN) bLWIN = TRUE;
|
if (VK_LWIN == pkhs->vkCode) bLWIN = TRUE;
|
||||||
|
|
||||||
if (bLCTRL && bLWIN && pkhs->vkCode == KEY_I && !bKPressed) // 'I' key
|
if (KEY_I == pkhs->vkCode && bLCTRL && bLWIN && !bKPressed) // 'I' key
|
||||||
{
|
{
|
||||||
diag_log(L"Pressed LCTRL + LWIN + I");
|
diag_log("Pressed LCTRL + LWIN + I");
|
||||||
bKPressed = TRUE;
|
bKPressed = TRUE;
|
||||||
bShowIcon = !bShowIcon;
|
bShowIcon = !bShowIcon;
|
||||||
HandlingTrayIcon();
|
HandlingTrayIcon();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bLCTRL && bLWIN && pkhs->vkCode == KEY_C && !bKPressed && !bKEYV) // 'C' key
|
if (KEY_C == pkhs->vkCode && bLCTRL && bLWIN && !bKPressed && !bKEYV) // 'C' key
|
||||||
{
|
{
|
||||||
diag_log(L"Pressed LCTRL + LWIN + C");
|
diag_log("Pressed LCTRL + LWIN + C");
|
||||||
bKPressed = TRUE;
|
bKPressed = TRUE;
|
||||||
hFgWnd = GetForegroundWindow();
|
hFgWnd = GetForegroundWindow();
|
||||||
BOOL bApproved = CheckWindow(hFgWnd);
|
if (IsWindowApprooved(hFgWnd)) MoveWindowToMonitorCenter(hFgWnd, bWorkArea, FALSE);
|
||||||
if (bApproved) MoveWindowToMonitorCenter(hFgWnd, bWorkArea, FALSE);
|
|
||||||
else hFgWnd = NULL;
|
else hFgWnd = NULL;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bLCTRL && bLWIN && pkhs->vkCode == KEY_V && !bKPressed && !bKEYV) // 'V' key
|
if (KEY_V == pkhs->vkCode && bLCTRL && bLWIN && !bKPressed && !bKEYV) // 'V' key
|
||||||
{
|
{
|
||||||
diag_log(L"Pressed LCTRL + LWIN + V");
|
diag_log("Pressed LCTRL + LWIN + V");
|
||||||
bKPressed = TRUE; bKEYV = TRUE;
|
bKPressed = TRUE; bKEYV = TRUE;
|
||||||
hFgWnd = GetForegroundWindow();
|
hFgWnd = GetForegroundWindow();
|
||||||
BOOL bApproved = CheckWindow(hFgWnd);
|
if (IsWindowApprooved(hFgWnd))
|
||||||
if (bApproved)
|
|
||||||
{
|
{
|
||||||
diag_log(L"Opening 'Manual editing' dialog");
|
diag_log("Opening 'Manual editing' dialog");
|
||||||
DialogBoxW(hInst, MAKEINTRESOURCE(IDD_MANUAL_EDITING), hFgWnd, (DLGPROC)DlgProc);
|
DialogBoxW(hInst, MAKEINTRESOURCE(IDD_MANUAL_EDITING), hFgWnd, (DLGPROC)DlgProc);
|
||||||
SetForegroundWindow(hFgWnd);
|
SetForegroundWindow(hFgWnd);
|
||||||
}
|
}
|
||||||
@@ -378,6 +392,7 @@ BOOL CALLBACK DlgProc(HWND hDlg, UINT dlgmsg, WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
{
|
{
|
||||||
|
diag_log("Initializing 'Manual editing' dialog");
|
||||||
SetWindowTextW(hDlg, szTitle);
|
SetWindowTextW(hDlg, szTitle);
|
||||||
GetWindowTextW(hFgWnd, szWinTitle, _countof(szWinTitle));
|
GetWindowTextW(hFgWnd, szWinTitle, _countof(szWinTitle));
|
||||||
GetClassNameW(hFgWnd, szWinClass, _countof(szWinClass));
|
GetClassNameW(hFgWnd, szWinClass, _countof(szWinClass));
|
||||||
@@ -395,11 +410,13 @@ BOOL CALLBACK DlgProc(HWND hDlg, UINT dlgmsg, WPARAM wParam, LPARAM lParam)
|
|||||||
UpdateWindow(hDlg);
|
UpdateWindow(hDlg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
switch (LOWORD(wParam))
|
switch (LOWORD(wParam))
|
||||||
{
|
{
|
||||||
case IDC_BUTTON_SET:
|
case IDC_BUTTON_SET:
|
||||||
{
|
{
|
||||||
|
diag_log("Pressed 'Set' button");
|
||||||
x = GetDlgItemInt(hDlg, IDC_EDIT_X, NULL, TRUE);
|
x = GetDlgItemInt(hDlg, IDC_EDIT_X, NULL, TRUE);
|
||||||
y = GetDlgItemInt(hDlg, IDC_EDIT_Y, NULL, TRUE);
|
y = GetDlgItemInt(hDlg, IDC_EDIT_Y, NULL, TRUE);
|
||||||
w = GetDlgItemInt(hDlg, IDC_EDIT_WIDTH, NULL, FALSE);
|
w = GetDlgItemInt(hDlg, IDC_EDIT_WIDTH, NULL, FALSE);
|
||||||
@@ -407,14 +424,15 @@ BOOL CALLBACK DlgProc(HWND hDlg, UINT dlgmsg, WPARAM wParam, LPARAM lParam)
|
|||||||
SendMessageW(hFgWnd, WM_ENTERSIZEMOVE, NULL, NULL);
|
SendMessageW(hFgWnd, WM_ENTERSIZEMOVE, NULL, NULL);
|
||||||
MoveWindow(hFgWnd, x, y, w, h, TRUE);
|
MoveWindow(hFgWnd, x, y, w, h, TRUE);
|
||||||
SendMessageW(hFgWnd, WM_EXITSIZEMOVE, NULL, NULL);
|
SendMessageW(hFgWnd, WM_EXITSIZEMOVE, NULL, NULL);
|
||||||
|
diag_log("Window with handle 0x", hFgWnd, " was moved to x = ", x, ", y = ", y);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IDCANCEL:
|
case IDCANCEL:
|
||||||
case IDC_BUTTON_CLOSE:
|
case IDC_BUTTON_CLOSE:
|
||||||
{
|
{
|
||||||
|
diag_log("Closing 'Manual editing' dialog");
|
||||||
EndDialog(hDlg, LOWORD(wParam));
|
EndDialog(hDlg, LOWORD(wParam));
|
||||||
diag_log(L"Closing 'Manual editing' dialog");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -422,43 +440,46 @@ BOOL CALLBACK DlgProc(HWND hDlg, UINT dlgmsg, WPARAM wParam, LPARAM lParam)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL CheckWindow(HWND hFW)
|
bool IsWindowApprooved(HWND hFW)
|
||||||
{
|
{
|
||||||
diag_log(L"Entering CheckWindow(), hwnd=", hFW);
|
diag_log("Entering IsWindowApprooved(), handle = 0x", hFW);
|
||||||
GetClassNameW(hFW, szWinClass, _countof(szWinClass));
|
bool bApprooved = FALSE;
|
||||||
if (hFW)
|
if (hFW)
|
||||||
{
|
{
|
||||||
if (wcscmp(szWinClass, szWinCore) != 0)
|
GetClassNameW(hFW, szWinClass, _countof(szWinClass));
|
||||||
{
|
if (GetWindowTextW(hFW, (LPWSTR)szBuffer, BUF_LEN - sizeof(WCHAR))) diag_log("Title: '", ConvertWideToUtf8((LPWSTR)szBuffer), "'");
|
||||||
if (hFW != hDesktop && hFW != hTaskBar && hFW != hProgman)
|
if (IsIconic(hFW)) diag_log("Window is iconic");
|
||||||
|
if (IsZoomed(hFW)) diag_log("Window is maximized");
|
||||||
|
if ((wcscmp(szWinClass, szWinCore) != 0) &&
|
||||||
|
(wcscmp(szWinClass, szWorkerW) != 0) &&
|
||||||
|
(hFW != hDesktop && hFW != hTaskBar && hFW != hProgman))
|
||||||
{
|
{
|
||||||
if (!IsIconic(hFW) && !IsZoomed(hFW))
|
if (!IsIconic(hFW) && !IsZoomed(hFW))
|
||||||
{
|
{
|
||||||
GetWindowTextW(hFW, (LPWSTR)szBuffer, BUF_LEN - sizeof(WCHAR));
|
diag_log("Window is approved");
|
||||||
diag_log(L"Window with hwnd=", hFW, L"is approved");
|
bApprooved = TRUE;
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
else ShowError(IDS_ERR_MAXMIN);
|
else ShowError(IDS_ERR_MAXMIN);
|
||||||
}
|
}
|
||||||
|
else diag_log("The window belongs to the Windows environment");
|
||||||
}
|
}
|
||||||
}
|
if (!bApprooved) diag_log("Window is not approved!");
|
||||||
diag_log(L"Window with hwnd=", hFW, L"is not approved!");
|
diag_log("Quiting IsWindowApprooved()");
|
||||||
diag_log(L"Quiting CheckWindow()");
|
return bApprooved;
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID HandlingTrayIcon()
|
VOID HandlingTrayIcon()
|
||||||
{
|
{
|
||||||
diag_log(L"Entering HandlingTrayIcon(), bShowIcon =", bShowIcon);
|
diag_log("Entering HandlingTrayIcon(), bShowIcon = ", bShowIcon);
|
||||||
if (bShowIcon)
|
if (bShowIcon)
|
||||||
{
|
{
|
||||||
BOOL bResult1 = Shell_NotifyIconW(NIM_ADD, &nid);
|
bool bResult1 = Shell_NotifyIconW(NIM_ADD, &nid);
|
||||||
diag_log(L"Shell_NotifyIconW(NIM_ADD):", bResult1);
|
diag_log("Shell_NotifyIconW(NIM_ADD): ", bResult1);
|
||||||
BOOL bResult2 = Shell_NotifyIconW(NIM_SETVERSION, &nid);
|
bool bResult2 = Shell_NotifyIconW(NIM_SETVERSION, &nid);
|
||||||
diag_log(L"Shell_NotifyIconW(NIM_SETVERSION):", bResult2);
|
diag_log("Shell_NotifyIconW(NIM_SETVERSION): ", bResult2);
|
||||||
if (!bResult1 || !bResult2)
|
if (!bResult1 || !bResult2)
|
||||||
{
|
{
|
||||||
diag_log(L"Error creating trayicon.");
|
diag_log("Error creating trayicon!");
|
||||||
ShowError(IDS_ERR_ICON);
|
ShowError(IDS_ERR_ICON);
|
||||||
bShowIcon = FALSE;
|
bShowIcon = FALSE;
|
||||||
}
|
}
|
||||||
@@ -467,14 +488,14 @@ VOID HandlingTrayIcon()
|
|||||||
{
|
{
|
||||||
Shell_NotifyIconW(NIM_DELETE, &nid);
|
Shell_NotifyIconW(NIM_DELETE, &nid);
|
||||||
}
|
}
|
||||||
diag_log(L"Quiting HandlingTrayIcon()");
|
diag_log("Quiting HandlingTrayIcon()");
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID ShowError(UINT uID)
|
VOID ShowError(UINT uID)
|
||||||
{
|
{
|
||||||
WCHAR szErrorText[MAX_LOADSTRING]; // Error's text
|
WCHAR szErrorText[MAX_LOADSTRING]; // Error's text
|
||||||
LoadStringW(hInst, uID, szErrorText, _countof(szErrorText));
|
LoadStringW(hInst, uID, szErrorText, _countof(szErrorText));
|
||||||
MessageBoxW(hWnd, szErrorText, szTitle, MB_OK | MB_ICONERROR | MB_TOPMOST);
|
MessageBoxW(NULL, szErrorText, szTitle, MB_OK | MB_ICONERROR | MB_TOPMOST);
|
||||||
}
|
}
|
||||||
|
|
||||||
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
@@ -488,6 +509,7 @@ INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
{
|
{
|
||||||
|
diag_log("Initializing 'About' dialog");
|
||||||
SetDlgItemTextW(hDlg, IDC_ABOUTHELP, szAbout);
|
SetDlgItemTextW(hDlg, IDC_ABOUTHELP, szAbout);
|
||||||
return (INT_PTR)TRUE;
|
return (INT_PTR)TRUE;
|
||||||
break;
|
break;
|
||||||
@@ -501,20 +523,30 @@ INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
PNMLINK pNMLink = (PNMLINK)pNMHdr;
|
PNMLINK pNMLink = (PNMLINK)pNMHdr;
|
||||||
LITEM item = pNMLink->item;
|
LITEM item = pNMLink->item;
|
||||||
ShellExecuteW(NULL, L"open", item.szUrl, NULL, NULL, SW_SHOW);
|
ShellExecuteW(NULL, L"open", item.szUrl, NULL, NULL, SW_SHOW);
|
||||||
diag_log(L"Pressed donation link");
|
diag_log("Pressed donation link");
|
||||||
return (INT_PTR)TRUE;
|
return (INT_PTR)TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
|
{
|
||||||
|
if (IDOK == LOWORD(wParam) || IDCANCEL == LOWORD(wParam))
|
||||||
{
|
{
|
||||||
EndDialog(hDlg, LOWORD(wParam));
|
EndDialog(hDlg, LOWORD(wParam));
|
||||||
diag_log(L"Closing 'About' dialog");
|
diag_log("Closing 'About' dialog");
|
||||||
return (INT_PTR)TRUE;
|
return (INT_PTR)TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return (INT_PTR)FALSE;
|
return (INT_PTR)FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string ConvertWideToUtf8(const std::wstring& wstr)
|
||||||
|
{
|
||||||
|
int count = WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), wstr.length(), NULL, 0, NULL, NULL);
|
||||||
|
std::string str(count, 0);
|
||||||
|
WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), -1, &str[0], count, NULL, NULL);
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,13 +3,6 @@
|
|||||||
|
|
||||||
<description>Centers windows by hotkey (C++)</description>
|
<description>Centers windows by hotkey (C++)</description>
|
||||||
|
|
||||||
<assemblyIdentity
|
|
||||||
version="2.3.3.0"
|
|
||||||
processorArchitecture="x86"
|
|
||||||
name="W0LF.wCenterWindow.C++"
|
|
||||||
type="win32">
|
|
||||||
</assemblyIdentity>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity
|
<assemblyIdentity
|
||||||
@@ -32,11 +25,18 @@
|
|||||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||||
<!--ID Windows 8.1 -->
|
<!--ID Windows 8.1 -->
|
||||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||||
<!--ID Windows 10 -->
|
<!--ID Windows 10/11 -->
|
||||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||||
</application>
|
</application>
|
||||||
</compatibility>
|
</compatibility>
|
||||||
|
|
||||||
|
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<windowsSettings> <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware> </windowsSettings>
|
||||||
|
<windowsSettings> <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2,PerMonitor</dpiAwareness> </windowsSettings>
|
||||||
|
<windowsSettings> <longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware> </windowsSettings>
|
||||||
|
<windowsSettings> <heapType xmlns="http://schemas.microsoft.com/SMI/2020/WindowsSettings">SegmentHeap</heapType> </windowsSettings>
|
||||||
|
</application>
|
||||||
|
|
||||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
<security>
|
<security>
|
||||||
<requestedPrivileges>
|
<requestedPrivileges>
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// wCenterWindow
|
||||||
|
// wCenterWindow.h
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|||||||
Binary file not shown.
@@ -98,8 +98,13 @@
|
|||||||
<AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
<Manifest>
|
<Manifest>
|
||||||
<AdditionalManifestFiles>$(ProjectName).manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
<AdditionalManifestFiles>%(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
<ManifestFromManagedAssembly>
|
||||||
|
</ManifestFromManagedAssembly>
|
||||||
</Manifest>
|
</Manifest>
|
||||||
|
<PreBuildEvent>
|
||||||
|
<Command>"$(SolutionDir)Update_version.bat"</Command>
|
||||||
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
@@ -120,8 +125,11 @@
|
|||||||
<AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
<Manifest>
|
<Manifest>
|
||||||
<AdditionalManifestFiles>$(ProjectName).manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
<AdditionalManifestFiles>%(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
</Manifest>
|
</Manifest>
|
||||||
|
<PreBuildEvent>
|
||||||
|
<Command>"$(SolutionDir)Update_version.bat"</Command>
|
||||||
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
@@ -136,6 +144,12 @@
|
|||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<AdditionalManifestFiles>%(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
</Manifest>
|
||||||
|
<PreBuildEvent>
|
||||||
|
<Command>"$(SolutionDir)Update_version.bat"</Command>
|
||||||
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
@@ -155,6 +169,12 @@
|
|||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<AdditionalManifestFiles>%(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
</Manifest>
|
||||||
|
<PreBuildEvent>
|
||||||
|
<Command>"$(SolutionDir)Update_version.bat"</Command>
|
||||||
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="framework.h" />
|
<ClInclude Include="framework.h" />
|
||||||
@@ -175,7 +195,10 @@
|
|||||||
<Image Include="wCenterWindow.ico" />
|
<Image Include="wCenterWindow.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Manifest Include="wCenterWindow.manifest" />
|
<Manifest Include="wCenterWindow.exe.manifest" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="..\README.md" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
|||||||
@@ -53,8 +53,11 @@
|
|||||||
</Image>
|
</Image>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Manifest Include="wCenterWindow.manifest">
|
<Manifest Include="wCenterWindow.exe.manifest">
|
||||||
<Filter>Resource Files</Filter>
|
<Filter>Resource Files</Filter>
|
||||||
</Manifest>
|
</Manifest>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="..\README.md" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
Reference in New Issue
Block a user