Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a4af63ed34 | |||
|
|
f394d436cf |
12
README.md
12
README.md
@@ -1,6 +1,12 @@
|
|||||||
# wCenterWindow
|
# wCenterWindow
|
||||||
This program centers the current active window by a 'LCTRL + LWIN + C' hotkey.
|
This program centers the current active window by a ```LCTRL + LWIN + C``` hotkey,
|
||||||
|
or pressing ```LCTRL + LWIN + MMB``` (Middle Mouse Button).
|
||||||
|
|
||||||
'LCTRL + LWIN + I' hotkey - hide tray icon.
|
```LCTRL + LWIN + V``` - manual editing of size and position of the window.
|
||||||
|
|
||||||
You can also use commandline option '/hide' for hide trayicon at startup.
|
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.
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 15
|
# Visual Studio Version 16
|
||||||
VisualStudioVersion = 15.0.28307.1082
|
VisualStudioVersion = 16.0.31112.23
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wCenterWindow", "wCenterWindow\wCenterWindow.vcxproj", "{2494B3F2-585E-4A2E-A013-20A15AE25B9E}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wCenterWindow", "wCenterWindow\wCenterWindow.vcxproj", "{F1A1603A-F5D0-47B8-8E4B-CF17747BCFBA}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -13,19 +13,19 @@ Global
|
|||||||
Release|x86 = Release|x86
|
Release|x86 = Release|x86
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{2494B3F2-585E-4A2E-A013-20A15AE25B9E}.Debug|x64.ActiveCfg = Debug|x64
|
{F1A1603A-F5D0-47B8-8E4B-CF17747BCFBA}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{2494B3F2-585E-4A2E-A013-20A15AE25B9E}.Debug|x64.Build.0 = Debug|x64
|
{F1A1603A-F5D0-47B8-8E4B-CF17747BCFBA}.Debug|x64.Build.0 = Debug|x64
|
||||||
{2494B3F2-585E-4A2E-A013-20A15AE25B9E}.Debug|x86.ActiveCfg = Debug|Win32
|
{F1A1603A-F5D0-47B8-8E4B-CF17747BCFBA}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
{2494B3F2-585E-4A2E-A013-20A15AE25B9E}.Debug|x86.Build.0 = Debug|Win32
|
{F1A1603A-F5D0-47B8-8E4B-CF17747BCFBA}.Debug|x86.Build.0 = Debug|Win32
|
||||||
{2494B3F2-585E-4A2E-A013-20A15AE25B9E}.Release|x64.ActiveCfg = Release|x64
|
{F1A1603A-F5D0-47B8-8E4B-CF17747BCFBA}.Release|x64.ActiveCfg = Release|x64
|
||||||
{2494B3F2-585E-4A2E-A013-20A15AE25B9E}.Release|x64.Build.0 = Release|x64
|
{F1A1603A-F5D0-47B8-8E4B-CF17747BCFBA}.Release|x64.Build.0 = Release|x64
|
||||||
{2494B3F2-585E-4A2E-A013-20A15AE25B9E}.Release|x86.ActiveCfg = Release|Win32
|
{F1A1603A-F5D0-47B8-8E4B-CF17747BCFBA}.Release|x86.ActiveCfg = Release|Win32
|
||||||
{2494B3F2-585E-4A2E-A013-20A15AE25B9E}.Release|x86.Build.0 = Release|Win32
|
{F1A1603A-F5D0-47B8-8E4B-CF17747BCFBA}.Release|x86.Build.0 = Release|Win32
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {34E34C1F-8A53-40DA-BA24-78C20152D64C}
|
SolutionGuid = {83F3F9B6-B00E-4705-9C92-19308AAC038B}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|||||||
17
wCenterWindow/framework.h
Normal file
17
wCenterWindow/framework.h
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
// header.h : include file for standard system include files,
|
||||||
|
// or project specific include files
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "targetver.h"
|
||||||
|
//#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||||
|
// Windows Header Files
|
||||||
|
#include <windows.h>
|
||||||
|
#include <strsafe.h>
|
||||||
|
#include <CommCtrl.h>
|
||||||
|
// C RunTime Header Files
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <memory.h>
|
||||||
|
#include <tchar.h>
|
||||||
@@ -1,19 +1,47 @@
|
|||||||
#pragma once
|
//{{NO_DEPENDENCIES}}
|
||||||
|
// Microsoft Visual C++ generated include file.
|
||||||
#define IDS_APP_TITLE 100
|
// Used by wCenterWindow.rc
|
||||||
#define IDS_CLASSNAME 101
|
//
|
||||||
#define IDS_ABOUT 102
|
#define IDS_CLASSNAME 102
|
||||||
#define IDI_TRAYICON 103
|
#define IDS_APP_TITLE 103
|
||||||
#define IDR_MENU 104
|
#define IDD_ABOUTBOX 104
|
||||||
#define ID_POPUPMENU_ICON 105
|
#define IDI_TRAYICON 105
|
||||||
#define ID_POPUPMENU_AREA 106
|
#define IDR_MENU 106
|
||||||
#define ID_POPUPMENU_ABOUT 107
|
#define ID_POPUPMENU_ICON 107
|
||||||
#define ID_POPUPMENU_EXIT 108
|
#define ID_POPUPMENU_AREA 108
|
||||||
#define IDS_ERR_MAIN 109
|
#define ID_POPUPMENU_ABOUT 110
|
||||||
#define IDS_ERR_WND 110
|
#define ID_POPUPMENU_EXIT 111
|
||||||
#define IDS_ERR_ICON 111
|
#define IDS_ABOUT 112
|
||||||
#define IDS_ERR_MENU 112
|
#define IDS_ERR_MAIN 113
|
||||||
#define IDS_ERR_POPUP 113
|
#define IDS_ERR_WND 114
|
||||||
#define IDS_ERR_HOOK 114
|
#define IDS_ERR_ICON 115
|
||||||
#define IDS_RUNNING 115
|
#define IDS_ERR_MENU 116
|
||||||
|
#define IDS_ERR_POPUP 117
|
||||||
|
#define IDS_ERR_HOOK 118
|
||||||
|
#define IDS_ERR_MAXMIN 119
|
||||||
|
#define IDS_RUNNING 121
|
||||||
|
#define IDR_MAINFRAME 128
|
||||||
|
#define IDD_MANUAL_EDITING 129
|
||||||
|
#define IDC_EDIT_X 1000
|
||||||
|
#define IDC_EDIT_Y 1001
|
||||||
|
#define IDC_EDIT_WIDTH 1002
|
||||||
|
#define IDC_EDIT_HEIGHT 1003
|
||||||
|
#define IDC_EDIT_TITLE 1004
|
||||||
|
#define IDC_EDIT_CLASS 1005
|
||||||
|
#define IDC_BUTTON_SET 1006
|
||||||
|
#define IDC_BUTTON_CLOSE 1007
|
||||||
|
#define IDC_ABOUTHELP 1008
|
||||||
|
#define IDC_DONATIONLINK 1009
|
||||||
#define IDC_STATIC -1
|
#define IDC_STATIC -1
|
||||||
|
|
||||||
|
// Next default values for new objects
|
||||||
|
//
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
#define _APS_NO_MFC 1
|
||||||
|
#define _APS_NEXT_RESOURCE_VALUE 130
|
||||||
|
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||||
|
#define _APS_NEXT_CONTROL_VALUE 1010
|
||||||
|
#define _APS_NEXT_SYMED_VALUE 122
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|||||||
6
wCenterWindow/targetver.h
Normal file
6
wCenterWindow/targetver.h
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
// // Including SDKDDKVer.h defines the highest available Windows platform.
|
||||||
|
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
|
||||||
|
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
|
||||||
|
#include <SDKDDKVer.h>
|
||||||
@@ -1,38 +1,105 @@
|
|||||||
// wCenterWindow, v2.1
|
// wCenterWindow, v2.2
|
||||||
|
//
|
||||||
|
|
||||||
#include <windows.h>
|
#include "framework.h"
|
||||||
#include <strsafe.h>
|
#include "wCenterWindow.h"
|
||||||
#include "resource.h"
|
|
||||||
#include "S:\MyFunctions\MoveWindowToMonitorCenter.h"
|
|
||||||
|
|
||||||
#define MAX_LOADSTRING 32
|
#define KEY_I 0x49
|
||||||
|
#define KEY_C 0x43
|
||||||
|
#define KEY_V 0x56
|
||||||
|
|
||||||
|
#define MAX_LOADSTRING 50
|
||||||
#define WM_WCW 0x8F00
|
#define WM_WCW 0x8F00
|
||||||
|
|
||||||
// Global variables:
|
// Global variables:
|
||||||
HINSTANCE hInst; // Instance
|
HINSTANCE hInst; // Instance
|
||||||
CHAR szTitle[MAX_LOADSTRING]; // Window's title
|
TCHAR szTitle[MAX_LOADSTRING]; // Window's title
|
||||||
CHAR szClass[MAX_LOADSTRING]; // Window's class
|
TCHAR szClass[MAX_LOADSTRING]; // Window's class
|
||||||
CHAR szAbout[MAX_LOADSTRING * 14]; // Description text
|
TCHAR szAbout[MAX_LOADSTRING * 12]; // Description text
|
||||||
HHOOK KeyboardHook;
|
TCHAR szWinTitle[256];
|
||||||
HICON hIcon;
|
TCHAR szWinClass[256];
|
||||||
HMENU hMenu, hPopup;
|
TCHAR szWinCore[] = TEXT("Windows.UI.Core.CoreWindow");
|
||||||
HWND hWnd, hTaskBar, hDesktop, hProgman;
|
HHOOK hMouseHook = NULL, hKbdHook = NULL; // Hook's handles
|
||||||
BOOL bPressed = FALSE, bShowIcon = TRUE, bWorkArea = TRUE;
|
HICON hIcon = NULL;
|
||||||
BOOL bLCTRL = FALSE, bLWIN = FALSE, bKEYI = FALSE, bKEYC = FALSE;
|
HMENU hMenu = NULL, hPopup = NULL;
|
||||||
|
HWND hWnd = NULL, hFgWnd = NULL, hTaskBar = NULL, hDesktop = NULL, hProgman = NULL;
|
||||||
|
BOOL bKPressed = FALSE, bMPressed = FALSE, bShowIcon = TRUE, bWorkArea = TRUE;
|
||||||
|
BOOL bLCTRL = FALSE, bLWIN = FALSE, bKEYV = FALSE;
|
||||||
|
|
||||||
|
RECT rcFW = { 0 };
|
||||||
NOTIFYICONDATA nid = { 0 };
|
NOTIFYICONDATA nid = { 0 };
|
||||||
LPKBDLLHOOKSTRUCT pkhs;
|
LPKBDLLHOOKSTRUCT pkhs;
|
||||||
MENUITEMINFO mii;
|
MENUITEMINFO mii;
|
||||||
POINT ptMousePos;
|
|
||||||
|
|
||||||
// Function's prototypes
|
// Forward declarations of functions included in this code module:
|
||||||
ATOM MyRegisterClass(HINSTANCE);
|
|
||||||
VOID HandlingTrayIcon();
|
VOID HandlingTrayIcon();
|
||||||
VOID ShowError(UINT);
|
VOID ShowError(UINT);
|
||||||
|
BOOL CheckWindow(HWND);
|
||||||
|
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);
|
||||||
|
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
|
||||||
|
|
||||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
|
||||||
|
|
||||||
|
ATOM MyRegisterClass(HINSTANCE hInstance)
|
||||||
|
{
|
||||||
|
WNDCLASSEX wcex = { 0 };
|
||||||
|
wcex.cbSize = sizeof(WNDCLASSEX);
|
||||||
|
wcex.lpfnWndProc = WndProc;
|
||||||
|
wcex.hInstance = hInstance;
|
||||||
|
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_TRAYICON));
|
||||||
|
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
||||||
|
wcex.lpszClassName = szClass;
|
||||||
|
wcex.hIconSm = wcex.hIcon;
|
||||||
|
hIcon = wcex.hIcon;
|
||||||
|
return RegisterClassEx(&wcex);
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID MoveWindowToMonitorCenter(HWND hwnd, BOOL bWorkArea, BOOL bResize)
|
||||||
|
{
|
||||||
|
RECT fgwrc;
|
||||||
|
GetWindowRect(hwnd, &fgwrc);
|
||||||
|
LONG nWidth = fgwrc.right - fgwrc.left;
|
||||||
|
LONG nHeight = fgwrc.bottom - fgwrc.top;
|
||||||
|
|
||||||
|
MONITORINFO mi;
|
||||||
|
mi.cbSize = sizeof(MONITORINFO);
|
||||||
|
GetMonitorInfo(MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST), &mi);
|
||||||
|
RECT area;
|
||||||
|
if (bWorkArea)
|
||||||
|
{
|
||||||
|
area.bottom = mi.rcWork.bottom;
|
||||||
|
area.left = mi.rcWork.left;
|
||||||
|
area.right = mi.rcWork.right;
|
||||||
|
area.top = mi.rcWork.top;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
area.bottom = mi.rcMonitor.bottom;
|
||||||
|
area.left = mi.rcMonitor.left;
|
||||||
|
area.right = mi.rcMonitor.right;
|
||||||
|
area.top = mi.rcMonitor.top;
|
||||||
|
}
|
||||||
|
|
||||||
|
int aw = area.right - area.left;
|
||||||
|
int ah = area.bottom - area.top;
|
||||||
|
if (nWidth > aw && bResize) nWidth = aw;
|
||||||
|
if (nHeight > ah && bResize) nHeight = ah;
|
||||||
|
if (area.left < 0) aw = -aw;
|
||||||
|
if (area.top < 0) ah = -ah;
|
||||||
|
int x = (aw - nWidth) / 2;
|
||||||
|
int y = (ah - nHeight) / 2;
|
||||||
|
|
||||||
|
SendMessage(hwnd, WM_ENTERSIZEMOVE, NULL, NULL);
|
||||||
|
MoveWindow(hwnd, x, y, nWidth, nHeight, TRUE);
|
||||||
|
SendMessage(hwnd, WM_EXITSIZEMOVE, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
|
||||||
{
|
{
|
||||||
UNREFERENCED_PARAMETER(hPrevInstance);
|
UNREFERENCED_PARAMETER(hPrevInstance);
|
||||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
UNREFERENCED_PARAMETER(lpCmdLine);
|
||||||
@@ -58,12 +125,12 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
|||||||
|
|
||||||
int nArgs = 0;
|
int nArgs = 0;
|
||||||
LPWSTR* szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
|
LPWSTR* szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
|
||||||
(nArgs >= 2 && 0 == lstrcmpiW(szArglist[1], L"/hide")) ? bShowIcon = FALSE : bShowIcon = TRUE;
|
(nArgs >= 2 && 0 == lstrcmpiW(szArglist[1], TEXT("/hide"))) ? bShowIcon = FALSE : bShowIcon = TRUE;
|
||||||
LocalFree(szArglist);
|
LocalFree(szArglist);
|
||||||
HandlingTrayIcon();
|
HandlingTrayIcon();
|
||||||
|
|
||||||
hTaskBar = FindWindow("Shell_TrayWnd", NULL);
|
hTaskBar = FindWindow(TEXT("Shell_TrayWnd"), NULL);
|
||||||
hProgman = FindWindow("Progman", NULL);
|
hProgman = FindWindow(TEXT("Progman"), NULL);
|
||||||
hDesktop = GetDesktopWindow();
|
hDesktop = GetDesktopWindow();
|
||||||
|
|
||||||
MSG msg;
|
MSG msg;
|
||||||
@@ -82,21 +149,13 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
|||||||
DispatchMessage(&msg);
|
DispatchMessage(&msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (int)msg.wParam;
|
|
||||||
}
|
|
||||||
|
|
||||||
ATOM MyRegisterClass(HINSTANCE hInstance)
|
if (hMouseHook) UnhookWindowsHookEx(hMouseHook);
|
||||||
{
|
if (hKbdHook) UnhookWindowsHookEx(hKbdHook);
|
||||||
WNDCLASSEX wcex = { 0 };
|
if (hMenu) DestroyMenu(hMenu);
|
||||||
wcex.cbSize = sizeof(WNDCLASSEX);
|
Shell_NotifyIcon(NIM_DELETE, &nid);
|
||||||
wcex.lpfnWndProc = WndProc;
|
|
||||||
wcex.hInstance = hInstance;
|
return (int)msg.wParam;
|
||||||
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_TRAYICON));
|
|
||||||
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
|
||||||
wcex.lpszClassName = szClass;
|
|
||||||
wcex.hIconSm = wcex.hIcon;
|
|
||||||
hIcon = wcex.hIcon;
|
|
||||||
return RegisterClassEx(&wcex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
@@ -134,8 +193,15 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
nid.dwInfoFlags = NIIF_INFO;
|
nid.dwInfoFlags = NIIF_INFO;
|
||||||
StringCchCopy(nid.szTip, _countof(nid.szTip), szTitle);
|
StringCchCopy(nid.szTip, _countof(nid.szTip), szTitle);
|
||||||
|
|
||||||
KeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardHookProc, hInst, NULL);
|
hMouseHook = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProc, hInst, NULL);
|
||||||
if (!KeyboardHook)
|
if (!hMouseHook)
|
||||||
|
{
|
||||||
|
ShowError(IDS_ERR_HOOK);
|
||||||
|
SendMessage(hWnd, WM_CLOSE, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
hKbdHook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardHookProc, hInst, NULL);
|
||||||
|
if (!hKbdHook)
|
||||||
{
|
{
|
||||||
ShowError(IDS_ERR_HOOK);
|
ShowError(IDS_ERR_HOOK);
|
||||||
SendMessage(hWnd, WM_CLOSE, NULL, NULL);
|
SendMessage(hWnd, WM_CLOSE, NULL, NULL);
|
||||||
@@ -147,7 +213,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
case WM_WCW:
|
case WM_WCW:
|
||||||
{
|
{
|
||||||
if (lParam == WM_RBUTTONDOWN && wParam == IDI_TRAYICON)
|
if ((lParam == WM_RBUTTONDOWN || lParam == WM_LBUTTONDOWN) && wParam == IDI_TRAYICON)
|
||||||
{
|
{
|
||||||
SetForegroundWindow(hWnd);
|
SetForegroundWindow(hWnd);
|
||||||
POINT pt;
|
POINT pt;
|
||||||
@@ -164,10 +230,11 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
bWorkArea ? mii.fState = MFS_CHECKED : mii.fState = MFS_UNCHECKED;
|
bWorkArea ? mii.fState = MFS_CHECKED : mii.fState = MFS_UNCHECKED;
|
||||||
SetMenuItemInfo(hPopup, ID_POPUPMENU_AREA, FALSE, &mii);
|
SetMenuItemInfo(hPopup, ID_POPUPMENU_AREA, FALSE, &mii);
|
||||||
}
|
}
|
||||||
if (idMenu == ID_POPUPMENU_ABOUT && !bPressed)
|
if (idMenu == ID_POPUPMENU_ABOUT && !bKPressed)
|
||||||
{
|
{
|
||||||
bPressed = TRUE;
|
bKPressed = TRUE;
|
||||||
if (MessageBox(hWnd, szAbout, szTitle, MB_OK | MB_TOPMOST | MB_ICONINFORMATION) == IDOK) bPressed = FALSE;
|
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, (DLGPROC)About);
|
||||||
|
bKPressed = FALSE;
|
||||||
}
|
}
|
||||||
if (idMenu == ID_POPUPMENU_EXIT) SendMessage(hWnd, WM_CLOSE, NULL, NULL);
|
if (idMenu == ID_POPUPMENU_EXIT) SendMessage(hWnd, WM_CLOSE, NULL, NULL);
|
||||||
}
|
}
|
||||||
@@ -176,9 +243,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
{
|
{
|
||||||
if (KeyboardHook) UnhookWindowsHookEx(KeyboardHook);
|
|
||||||
if (hMenu) DestroyMenu(hMenu);
|
|
||||||
Shell_NotifyIcon(NIM_DELETE, &nid);
|
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -189,6 +253,19 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
if (wParam == WM_MBUTTONUP) bMPressed = FALSE;
|
||||||
|
if (wParam == WM_MBUTTONDOWN && bLCTRL && bLWIN && !bMPressed)
|
||||||
|
{
|
||||||
|
bMPressed = TRUE;
|
||||||
|
hFgWnd = GetForegroundWindow();
|
||||||
|
BOOL bApproved = CheckWindow(hFgWnd);
|
||||||
|
if (bApproved) MoveWindowToMonitorCenter(hFgWnd, bWorkArea, FALSE);
|
||||||
|
else hFgWnd = NULL;
|
||||||
|
}
|
||||||
|
return CallNextHookEx(NULL, nCode, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
LRESULT CALLBACK KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
@@ -198,7 +275,7 @@ LRESULT CALLBACK KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
if (pkhs->vkCode == VK_LCONTROL) bLCTRL = FALSE;
|
if (pkhs->vkCode == VK_LCONTROL) bLCTRL = FALSE;
|
||||||
if (pkhs->vkCode == VK_LWIN) bLWIN = FALSE;
|
if (pkhs->vkCode == VK_LWIN) bLWIN = FALSE;
|
||||||
bPressed = FALSE;
|
bKPressed = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wParam == WM_KEYDOWN)
|
if (wParam == WM_KEYDOWN)
|
||||||
@@ -206,39 +283,105 @@ LRESULT CALLBACK KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam)
|
|||||||
if (pkhs->vkCode == VK_LCONTROL) bLCTRL = TRUE;
|
if (pkhs->vkCode == VK_LCONTROL) bLCTRL = TRUE;
|
||||||
if (pkhs->vkCode == VK_LWIN) bLWIN = TRUE;
|
if (pkhs->vkCode == VK_LWIN) bLWIN = TRUE;
|
||||||
|
|
||||||
if (bLCTRL && bLWIN && pkhs->vkCode == 0x49 && !bPressed) // 'I' key
|
if (bLCTRL && bLWIN && pkhs->vkCode == KEY_I && !bKPressed) // 'I' key
|
||||||
{
|
{
|
||||||
bPressed = TRUE;
|
bKPressed = TRUE;
|
||||||
bShowIcon = !bShowIcon;
|
bShowIcon = !bShowIcon;
|
||||||
HandlingTrayIcon();
|
HandlingTrayIcon();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bLCTRL && bLWIN && pkhs->vkCode == 0x43 && !bPressed) // 'C' key
|
if (bLCTRL && bLWIN && pkhs->vkCode == KEY_C && !bKPressed && !bKEYV) // 'C' key
|
||||||
{
|
{
|
||||||
bPressed = TRUE;
|
bKPressed = TRUE;
|
||||||
HWND hFgWnd = GetForegroundWindow();
|
hFgWnd = GetForegroundWindow();
|
||||||
|
BOOL bApproved = CheckWindow(hFgWnd);
|
||||||
|
if (bApproved) MoveWindowToMonitorCenter(hFgWnd, bWorkArea, FALSE);
|
||||||
|
else hFgWnd = NULL;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (hFgWnd)
|
if (bLCTRL && bLWIN && pkhs->vkCode == KEY_V && !bKPressed && !bKEYV) // 'V' key
|
||||||
{
|
{
|
||||||
if (hFgWnd != hDesktop && hFgWnd != hTaskBar && hFgWnd != hProgman)
|
bKPressed = TRUE; bKEYV = TRUE;
|
||||||
{
|
hFgWnd = GetForegroundWindow();
|
||||||
if (!IsIconic(hFgWnd) && !IsZoomed(hFgWnd))
|
BOOL bApproved = CheckWindow(hFgWnd);
|
||||||
{
|
if (bApproved) DialogBox(hInst, MAKEINTRESOURCE(IDD_MANUAL_EDITING), hWnd, (DLGPROC)DlgProc);
|
||||||
RECT fgwrc;
|
else hFgWnd = NULL;
|
||||||
GetWindowRect(hFgWnd, &fgwrc);
|
bKEYV = FALSE;
|
||||||
LONG fgWidth = fgwrc.right - fgwrc.left;
|
|
||||||
LONG fgHeight = fgwrc.bottom - fgwrc.top;
|
|
||||||
MoveWindowToMonitorCenter(hFgWnd, fgWidth, fgHeight, bWorkArea, FALSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CallNextHookEx(NULL, nCode, wParam, lParam);
|
return CallNextHookEx(NULL, nCode, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL CALLBACK DlgProc(HWND hDlg, UINT dlgmsg, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
int x, y, w, h;
|
||||||
|
switch (dlgmsg)
|
||||||
|
{
|
||||||
|
case WM_INITDIALOG:
|
||||||
|
{
|
||||||
|
SetWindowText(hDlg, szTitle);
|
||||||
|
GetWindowText(hFgWnd, szWinTitle, _countof(szWinTitle));
|
||||||
|
GetClassName(hFgWnd, szWinClass, _countof(szWinClass));
|
||||||
|
GetWindowRect(hFgWnd, &rcFW);
|
||||||
|
x = rcFW.left;
|
||||||
|
y = rcFW.top;
|
||||||
|
w = rcFW.right - rcFW.left;
|
||||||
|
h = rcFW.bottom - rcFW.top;
|
||||||
|
SetDlgItemInt(hDlg, IDC_EDIT_X, x, TRUE);
|
||||||
|
SetDlgItemInt(hDlg, IDC_EDIT_Y, y, TRUE);
|
||||||
|
SetDlgItemInt(hDlg, IDC_EDIT_WIDTH, w, FALSE);
|
||||||
|
SetDlgItemInt(hDlg, IDC_EDIT_HEIGHT, h, FALSE);
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_TITLE, szWinTitle);
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_CLASS, szWinClass);
|
||||||
|
UpdateWindow(hDlg);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case WM_COMMAND:
|
||||||
|
switch (LOWORD(wParam))
|
||||||
|
{
|
||||||
|
case IDC_BUTTON_SET:
|
||||||
|
{
|
||||||
|
x = GetDlgItemInt(hDlg, IDC_EDIT_X, NULL, TRUE);
|
||||||
|
y = GetDlgItemInt(hDlg, IDC_EDIT_Y, NULL, TRUE);
|
||||||
|
w = GetDlgItemInt(hDlg, IDC_EDIT_WIDTH, NULL, FALSE);
|
||||||
|
h = GetDlgItemInt(hDlg, IDC_EDIT_HEIGHT, NULL, FALSE);
|
||||||
|
SendMessage(hFgWnd, WM_ENTERSIZEMOVE, NULL, NULL);
|
||||||
|
MoveWindow(hFgWnd, x, y, w, h, TRUE);
|
||||||
|
SendMessage(hFgWnd, WM_EXITSIZEMOVE, NULL, NULL);
|
||||||
|
return TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case IDCANCEL:
|
||||||
|
case IDC_BUTTON_CLOSE:
|
||||||
|
{
|
||||||
|
EndDialog(hDlg, LOWORD(wParam));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL CheckWindow(HWND hFW)
|
||||||
|
{
|
||||||
|
GetClassName(hFW, szWinClass, _countof(szWinClass));
|
||||||
|
if (hFW)
|
||||||
|
{
|
||||||
|
if (_tcscmp(szWinClass, szWinCore) != 0)
|
||||||
|
{
|
||||||
|
if (hFW != hDesktop && hFW != hTaskBar && hFW != hProgman)
|
||||||
|
{
|
||||||
|
if (!IsIconic(hFW) && !IsZoomed(hFW)) return TRUE;
|
||||||
|
else ShowError(IDS_ERR_MAXMIN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
VOID HandlingTrayIcon()
|
VOID HandlingTrayIcon()
|
||||||
{
|
{
|
||||||
if (bShowIcon)
|
if (bShowIcon)
|
||||||
@@ -257,7 +400,53 @@ VOID HandlingTrayIcon()
|
|||||||
|
|
||||||
VOID ShowError(UINT uID)
|
VOID ShowError(UINT uID)
|
||||||
{
|
{
|
||||||
CHAR szErrorText[MAX_LOADSTRING]; // Error's text
|
TCHAR szErrorText[MAX_LOADSTRING]; // Error's text
|
||||||
LoadString(hInst, uID, szErrorText, _countof(szErrorText));
|
LoadString(hInst, uID, szErrorText, _countof(szErrorText));
|
||||||
MessageBox(hWnd, szErrorText, szTitle, MB_OK | MB_ICONERROR);
|
MessageBox(hWnd, szErrorText, szTitle, MB_OK | MB_ICONERROR | MB_TOPMOST);
|
||||||
|
}
|
||||||
|
|
||||||
|
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
INITCOMMONCONTROLSEX icex;
|
||||||
|
icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
|
||||||
|
icex.dwICC = ICC_LINK_CLASS;
|
||||||
|
InitCommonControlsEx(&icex);
|
||||||
|
|
||||||
|
switch (message)
|
||||||
|
{
|
||||||
|
case WM_INITDIALOG:
|
||||||
|
{
|
||||||
|
SetDlgItemText(hDlg, IDC_ABOUTHELP, szAbout);
|
||||||
|
return (INT_PTR)TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case WM_NOTIFY:
|
||||||
|
{
|
||||||
|
LPNMHDR pNMHdr = (LPNMHDR)lParam;
|
||||||
|
switch (pNMHdr->code)
|
||||||
|
{
|
||||||
|
case NM_CLICK:
|
||||||
|
case NM_RETURN:
|
||||||
|
if (pNMHdr->idFrom == IDC_DONATIONLINK)
|
||||||
|
{
|
||||||
|
PNMLINK pNMLink = (PNMLINK)pNMHdr;
|
||||||
|
LITEM item = pNMLink->item;
|
||||||
|
ShellExecute(NULL, L"open", item.szUrl, NULL, NULL, SW_SHOW);
|
||||||
|
return (INT_PTR)TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case WM_COMMAND:
|
||||||
|
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
|
||||||
|
{
|
||||||
|
EndDialog(hDlg, LOWORD(wParam));
|
||||||
|
return (INT_PTR)TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (INT_PTR)FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
3
wCenterWindow/wCenterWindow.h
Normal file
3
wCenterWindow/wCenterWindow.h
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "resource.h"
|
||||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
<Configuration>Debug</Configuration>
|
<Configuration>Debug</Configuration>
|
||||||
@@ -19,37 +19,38 @@
|
|||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<VCProjectVersion>15.0</VCProjectVersion>
|
<VCProjectVersion>16.0</VCProjectVersion>
|
||||||
<ProjectGuid>{2494B3F2-585E-4A2E-A013-20A15AE25B9E}</ProjectGuid>
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<ProjectGuid>{f1a1603a-f5d0-47b8-8e4b-cf17747bcfba}</ProjectGuid>
|
||||||
<RootNamespace>wCenterWindow</RootNamespace>
|
<RootNamespace>wCenterWindow</RootNamespace>
|
||||||
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<PlatformToolset>v141</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<PlatformToolset>v141</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<PlatformToolset>v141</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<PlatformToolset>v141</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
<ImportGroup Label="ExtensionSettings">
|
<ImportGroup Label="ExtensionSettings">
|
||||||
@@ -69,37 +70,42 @@
|
|||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup />
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<CopyCppRuntimeToOutputDir>false</CopyCppRuntimeToOutputDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
</Link>
|
<AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
</Link>
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<AdditionalManifestFiles>$(ProjectName).manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
</Manifest>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>MaxSpeed</Optimization>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@@ -107,35 +113,59 @@
|
|||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<UACExecutionLevel>HighestAvailable</UACExecutionLevel>
|
|
||||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<AdditionalManifestFiles>$(ProjectName).manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
</Manifest>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>MaxSpeed</Optimization>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\..\..\MyFunctions\MoveWindowToMonitorCenter.cpp" />
|
<ClInclude Include="framework.h" />
|
||||||
|
<ClInclude Include="Resource.h" />
|
||||||
|
<ClInclude Include="targetver.h" />
|
||||||
|
<ClInclude Include="wCenterWindow.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
<ClCompile Include="wCenterWindow.cpp" />
|
<ClCompile Include="wCenterWindow.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\..\..\MyFunctions\MoveWindowToMonitorCenter.h" />
|
<ResourceCompile Include="wCenterWindow.rc" />
|
||||||
<ClInclude Include="resource.h" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="wCenterWindow.rc" />
|
<Image Include="small.ico" />
|
||||||
|
<Image Include="wCenterWindow.ico" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Manifest Include="wCenterWindow.manifest" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
|||||||
@@ -3,36 +3,52 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Filter Include="Source Files">
|
<Filter Include="Source Files">
|
||||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Header Files">
|
<Filter Include="Header Files">
|
||||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Resource Files">
|
<Filter Include="Resource Files">
|
||||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
</Filter>
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="framework.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="targetver.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Resource.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="wCenterWindow.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="wCenterWindow.cpp">
|
<ClCompile Include="wCenterWindow.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\..\MyFunctions\MoveWindowToMonitorCenter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="resource.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\MyFunctions\MoveWindowToMonitorCenter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="wCenterWindow.rc">
|
<ResourceCompile Include="wCenterWindow.rc">
|
||||||
<Filter>Resource Files</Filter>
|
<Filter>Resource Files</Filter>
|
||||||
</ResourceCompile>
|
</ResourceCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="small.ico">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</Image>
|
||||||
|
<Image Include="wCenterWindow.ico">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</Image>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Manifest Include="wCenterWindow.manifest">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</Manifest>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
</Project>
|
</Project>
|
||||||
Reference in New Issue
Block a user