8 Commits
v1.5 ... v2.2

Author SHA1 Message Date
a4af63ed34 Version 2.2
Added manual editing of size and position of the widow.
Added centering the window by middle mouse button.
Updated project from Visual Studio 2017 to 2019.
2021-04-30 23:07:44 +03:00
W0LF
f394d436cf Update README.md 2020-05-03 18:57:37 +03:00
W0LF
bdb2ebd295 Delete wCenterWindow.h 2020-05-03 18:50:05 +03:00
W0LF
bd5d845ec1 Delete targetver.h 2020-05-03 18:49:07 +03:00
W0LF
a6c866d1dd Delete framework.h 2020-05-03 18:48:50 +03:00
W0LF
38a570310f Delete Resource.h 2020-05-03 18:48:32 +03:00
W0LF
4a96fef1c7 new version 2020-05-03 18:47:31 +03:00
W0LF
0f47ebae9e new version 2020-05-03 18:45:44 +03:00
12 changed files with 782 additions and 542 deletions

View File

@@ -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.

View File

@@ -1,31 +1,31 @@
 
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.1000 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", "{6A775901-6C34-4E96-B359-C11C76A520BB}" 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
Debug|x64 = Debug|x64 Debug|x64 = Debug|x64
Debug|x86 = Debug|x86 Debug|x86 = Debug|x86
Release|x64 = Release|x64 Release|x64 = Release|x64
Release|x86 = Release|x86 Release|x86 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6A775901-6C34-4E96-B359-C11C76A520BB}.Debug|x64.ActiveCfg = Debug|x64 {F1A1603A-F5D0-47B8-8E4B-CF17747BCFBA}.Debug|x64.ActiveCfg = Debug|x64
{6A775901-6C34-4E96-B359-C11C76A520BB}.Debug|x64.Build.0 = Debug|x64 {F1A1603A-F5D0-47B8-8E4B-CF17747BCFBA}.Debug|x64.Build.0 = Debug|x64
{6A775901-6C34-4E96-B359-C11C76A520BB}.Debug|x86.ActiveCfg = Debug|Win32 {F1A1603A-F5D0-47B8-8E4B-CF17747BCFBA}.Debug|x86.ActiveCfg = Debug|Win32
{6A775901-6C34-4E96-B359-C11C76A520BB}.Debug|x86.Build.0 = Debug|Win32 {F1A1603A-F5D0-47B8-8E4B-CF17747BCFBA}.Debug|x86.Build.0 = Debug|Win32
{6A775901-6C34-4E96-B359-C11C76A520BB}.Release|x64.ActiveCfg = Release|x64 {F1A1603A-F5D0-47B8-8E4B-CF17747BCFBA}.Release|x64.ActiveCfg = Release|x64
{6A775901-6C34-4E96-B359-C11C76A520BB}.Release|x64.Build.0 = Release|x64 {F1A1603A-F5D0-47B8-8E4B-CF17747BCFBA}.Release|x64.Build.0 = Release|x64
{6A775901-6C34-4E96-B359-C11C76A520BB}.Release|x86.ActiveCfg = Release|Win32 {F1A1603A-F5D0-47B8-8E4B-CF17747BCFBA}.Release|x86.ActiveCfg = Release|Win32
{6A775901-6C34-4E96-B359-C11C76A520BB}.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 = {CAD0B026-63B6-4645-9B26-22CD0E1049B7} SolutionGuid = {83F3F9B6-B00E-4705-9C92-19308AAC038B}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -1,28 +0,0 @@
// resource.h
#define IDS_APP_TITLE 100
#define IDS_CLASSNAME 101
#define IDS_ABOUT 102
#define IDI_TRAYICON 103
#define IDR_MENU 104
#define ID_POPUPMENU_ICON 105
#define ID_POPUPMENU_ABOUT 106
#define ID_POPUPMENU_EXIT 107
#define IDS_ERR_MAIN 108
#define IDS_ERR_WND 109
#define IDS_ERR_ICON 110
#define IDS_ERR_MENU 111
#define IDS_ERR_POPUP 112
#define IDS_ERR_HOOK 113
#define IDS_RUNNING 114
#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 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif

View File

@@ -1,14 +1,16 @@
// header.h: включаемый файл для стандартных системных включаемых файлов // header.h : include file for standard system include files,
// или включаемые файлы для конкретного проекта // or project specific include files
//
#pragma once #pragma once
#include "targetver.h" #include "targetver.h"
#define WIN32_LEAN_AND_MEAN // Исключите редко используемые компоненты из заголовков Windows //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Файлы заголовков Windows // Windows Header Files
#include <windows.h> #include <windows.h>
#include <strsafe.h> #include <strsafe.h>
#include <shellapi.h> #include <CommCtrl.h>
// Файлы заголовков среды выполнения C // C RunTime Header Files
#include <stdlib.h> #include <stdlib.h>
#include <malloc.h> #include <malloc.h>
#include <memory.h> #include <memory.h>

47
wCenterWindow/resource.h Normal file
View File

@@ -0,0 +1,47 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by wCenterWindow.rc
//
#define IDS_CLASSNAME 102
#define IDS_APP_TITLE 103
#define IDD_ABOUTBOX 104
#define IDI_TRAYICON 105
#define IDR_MENU 106
#define ID_POPUPMENU_ICON 107
#define ID_POPUPMENU_AREA 108
#define ID_POPUPMENU_ABOUT 110
#define ID_POPUPMENU_EXIT 111
#define IDS_ABOUT 112
#define IDS_ERR_MAIN 113
#define IDS_ERR_WND 114
#define IDS_ERR_ICON 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
// 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

View File

@@ -1,2 +1,6 @@
#pragma once #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> #include <SDKDDKVer.h>

View File

@@ -1,256 +1,452 @@
// wCenterWindow.cpp : Определяет точку входа для приложения. // wCenterWindow, v2.2
//
#include "framework.h"
#include "wCenterWindow.h" #include "framework.h"
#include "wCenterWindow.h"
#define MAX_LOADSTRING 32
#define WM_WCW WM_USER + 0x7F00 #define KEY_I 0x49
#define KEY_C 0x43
// Глобальные переменные: #define KEY_V 0x56
HINSTANCE hInst; // Текущий экземпляр
WCHAR szTitle[MAX_LOADSTRING]; // Текст строки заголовка #define MAX_LOADSTRING 50
WCHAR szClass[MAX_LOADSTRING]; // Имя класса главного окна #define WM_WCW 0x8F00
WCHAR szAbout[MAX_LOADSTRING * 9]; // Текст описания
HHOOK KeyboardHook; // Global variables:
HICON hIcon; HINSTANCE hInst; // Instance
HMENU hMenu, hPopup; TCHAR szTitle[MAX_LOADSTRING]; // Window's title
HWND hWnd; TCHAR szClass[MAX_LOADSTRING]; // Window's class
NOTIFYICONDATA nid = { 0 }; TCHAR szAbout[MAX_LOADSTRING * 12]; // Description text
KBDLLHOOKSTRUCT *pkhs; TCHAR szWinTitle[256];
BOOL pressed = FALSE, showIcon = TRUE; TCHAR szWinClass[256];
BOOL bLCTRL = FALSE, bLWIN = FALSE, bKEYI = FALSE, bKEYC = FALSE; TCHAR szWinCore[] = TEXT("Windows.UI.Core.CoreWindow");
int dtCenterX, dtCenterY; HHOOK hMouseHook = NULL, hKbdHook = NULL; // Hook's handles
HICON hIcon = NULL;
// Прототипы функций HMENU hMenu = NULL, hPopup = NULL;
ATOM MyRegisterClass(HINSTANCE); HWND hWnd = NULL, hFgWnd = NULL, hTaskBar = NULL, hDesktop = NULL, hProgman = NULL;
VOID HandlingTrayIcon(); BOOL bKPressed = FALSE, bMPressed = FALSE, bShowIcon = TRUE, bWorkArea = TRUE;
VOID ShowError(UINT); BOOL bLCTRL = FALSE, bLWIN = FALSE, bKEYV = FALSE;
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK KeyboardHookProc(int, WPARAM, LPARAM); RECT rcFW = { 0 };
NOTIFYICONDATA nid = { 0 };
// Точка входа LPKBDLLHOOKSTRUCT pkhs;
int APIENTRY wWinMain(_In_ HINSTANCE hInstance, MENUITEMINFO mii;
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine, // Forward declarations of functions included in this code module:
_In_ int nCmdShow) VOID HandlingTrayIcon();
{ VOID ShowError(UINT);
UNREFERENCED_PARAMETER(hPrevInstance); BOOL CheckWindow(HWND);
UNREFERENCED_PARAMETER(lpCmdLine); BOOL CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
hInst = hInstance; LRESULT CALLBACK KeyboardHookProc(int, WPARAM, LPARAM);
LRESULT CALLBACK MouseHookProc(int, WPARAM, LPARAM);
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, _countof(szTitle)); INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
LoadStringW(hInstance, IDS_CLASSNAME, szClass, _countof(szClass));
if (FindWindow(szClass, NULL))
{ ATOM MyRegisterClass(HINSTANCE hInstance)
ShowError(IDS_RUNNING); {
return FALSE; WNDCLASSEX wcex = { 0 };
} wcex.cbSize = sizeof(WNDCLASSEX);
wcex.lpfnWndProc = WndProc;
MyRegisterClass(hInstance); wcex.hInstance = hInstance;
hWnd = CreateWindowExW(0, szClass, szTitle, 0, 0, 0, 0, 0, NULL, NULL, hInstance, NULL); wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_TRAYICON));
if (!hWnd) wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
{ wcex.lpszClassName = szClass;
ShowError(IDS_ERR_WND); wcex.hIconSm = wcex.hIcon;
return FALSE; hIcon = wcex.hIcon;
} return RegisterClassEx(&wcex);
}
nid.cbSize = sizeof(NOTIFYICONDATA);
nid.hWnd = hWnd; VOID MoveWindowToMonitorCenter(HWND hwnd, BOOL bWorkArea, BOOL bResize)
nid.uVersion = NOTIFYICON_VERSION; {
nid.uCallbackMessage = WM_WCW; RECT fgwrc;
nid.hIcon = hIcon; GetWindowRect(hwnd, &fgwrc);
nid.uID = IDI_TRAYICON; LONG nWidth = fgwrc.right - fgwrc.left;
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; LONG nHeight = fgwrc.bottom - fgwrc.top;
nid.dwInfoFlags = NIIF_INFO;
StringCchCopy(nid.szTip, _countof(nid.szTip), szTitle); MONITORINFO mi;
mi.cbSize = sizeof(MONITORINFO);
int nArgs = 0; GetMonitorInfo(MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST), &mi);
LPWSTR *szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs); RECT area;
(nArgs >= 2 && 0 == lstrcmpiW(szArglist[1], L"/hide")) ? showIcon = FALSE : showIcon = TRUE; if (bWorkArea)
LocalFree(szArglist); {
HandlingTrayIcon(); area.bottom = mi.rcWork.bottom;
area.left = mi.rcWork.left;
MSG msg; area.right = mi.rcWork.right;
BOOL bRet; area.top = mi.rcWork.top;
}
while ((bRet = GetMessage(&msg, NULL, 0, 0)) != 0) else
{ {
if (bRet == -1) area.bottom = mi.rcMonitor.bottom;
{ area.left = mi.rcMonitor.left;
ShowError(IDS_ERR_MAIN); area.right = mi.rcMonitor.right;
return -1; area.top = mi.rcMonitor.top;
} }
else
{ int aw = area.right - area.left;
TranslateMessage(&msg); int ah = area.bottom - area.top;
DispatchMessage(&msg); if (nWidth > aw && bResize) nWidth = aw;
} if (nHeight > ah && bResize) nHeight = ah;
} if (area.left < 0) aw = -aw;
return (int)msg.wParam; if (area.top < 0) ah = -ah;
} int x = (aw - nWidth) / 2;
int y = (ah - nHeight) / 2;
ATOM MyRegisterClass(HINSTANCE hInstance)
{ SendMessage(hwnd, WM_ENTERSIZEMOVE, NULL, NULL);
WNDCLASSEX wcex = { 0 }; MoveWindow(hwnd, x, y, nWidth, nHeight, TRUE);
wcex.cbSize = sizeof(WNDCLASSEX); SendMessage(hwnd, WM_EXITSIZEMOVE, NULL, NULL);
wcex.lpfnWndProc = WndProc; }
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_TRAYICON));
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
wcex.lpszClassName = szClass; int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
wcex.hIconSm = wcex.hIcon; {
hIcon = wcex.hIcon; UNREFERENCED_PARAMETER(hPrevInstance);
return RegisterClassEx(&wcex); UNREFERENCED_PARAMETER(lpCmdLine);
}
hInst = hInstance;
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{ LoadString(hInstance, IDS_APP_TITLE, szTitle, _countof(szTitle));
switch (message) LoadString(hInstance, IDS_CLASSNAME, szClass, _countof(szClass));
{
case WM_CREATE: if (FindWindow(szClass, NULL))
{ {
hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_MENU)); ShowError(IDS_RUNNING);
if (!hMenu) return FALSE;
{ }
ShowError(IDS_ERR_MENU);
SendMessage(hWnd, WM_CLOSE, NULL, NULL); MyRegisterClass(hInstance);
} hWnd = CreateWindowEx(0, szClass, szTitle, 0, 0, 0, 0, 0, NULL, NULL, hInstance, NULL);
if (!hWnd)
hPopup = GetSubMenu(hMenu, 0); {
if (!hPopup) ShowError(IDS_ERR_WND);
{ return FALSE;
ShowError(IDS_ERR_POPUP); }
SendMessage(hWnd, WM_CLOSE, NULL, NULL);
} int nArgs = 0;
LPWSTR* szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
KeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardHookProc, hInst, NULL); (nArgs >= 2 && 0 == lstrcmpiW(szArglist[1], TEXT("/hide"))) ? bShowIcon = FALSE : bShowIcon = TRUE;
if (!KeyboardHook) LocalFree(szArglist);
{ HandlingTrayIcon();
ShowError(IDS_ERR_HOOK);
SendMessage(hWnd, WM_CLOSE, NULL, NULL); hTaskBar = FindWindow(TEXT("Shell_TrayWnd"), NULL);
} hProgman = FindWindow(TEXT("Progman"), NULL);
hDesktop = GetDesktopWindow();
LoadStringW(hInst, IDS_ABOUT, szAbout, _countof(szAbout));
RECT dtrc = { 0 }; MSG msg;
SystemParametersInfo(SPI_GETWORKAREA, NULL, &dtrc, FALSE); BOOL bRet;
dtCenterX = dtrc.right / 2, dtCenterY = dtrc.bottom / 2;
break; while ((bRet = GetMessage(&msg, NULL, 0, 0)) != 0)
} {
case WM_WCW: if (bRet == -1)
if (lParam == WM_RBUTTONDOWN && wParam == IDI_TRAYICON) {
{ ShowError(IDS_ERR_MAIN);
SetForegroundWindow(hWnd); return -1;
POINT pt; }
GetCursorPos(&pt); else
int idMenu = TrackPopupMenu(hPopup, TPM_RETURNCMD, pt.x, pt.y, 0, hWnd, NULL); {
if (idMenu == ID_POPUPMENU_ICON) TranslateMessage(&msg);
{ DispatchMessage(&msg);
showIcon = FALSE; }
HandlingTrayIcon(); }
}
if (idMenu == ID_POPUPMENU_ABOUT && !pressed) if (hMouseHook) UnhookWindowsHookEx(hMouseHook);
{ if (hKbdHook) UnhookWindowsHookEx(hKbdHook);
pressed = TRUE; if (hMenu) DestroyMenu(hMenu);
if (MessageBox(hWnd, szAbout, szTitle, MB_OK | MB_TOPMOST) == IDOK) pressed = FALSE; Shell_NotifyIcon(NIM_DELETE, &nid);
}
if (idMenu == ID_POPUPMENU_EXIT) SendMessage(hWnd, WM_CLOSE, NULL, NULL); return (int)msg.wParam;
} }
break;
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_DESTROY: {
if (KeyboardHook) UnhookWindowsHookEx(KeyboardHook); switch (message)
if (hMenu) DestroyMenu(hMenu); {
Shell_NotifyIcon(NIM_DELETE, &nid); case WM_CREATE:
PostQuitMessage(0); {
break; hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_MENU));
if (!hMenu)
default: {
return DefWindowProc(hWnd, message, wParam, lParam); ShowError(IDS_ERR_MENU);
} SendMessage(hWnd, WM_CLOSE, NULL, NULL);
return 0; }
}
hPopup = GetSubMenu(hMenu, 0);
LRESULT CALLBACK KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam) if (!hPopup)
{ {
pkhs = (KBDLLHOOKSTRUCT*)lParam; ShowError(IDS_ERR_POPUP);
SendMessage(hWnd, WM_CLOSE, NULL, NULL);
if (wParam == WM_KEYUP) }
{
if (pkhs->vkCode == VK_LCONTROL) bLCTRL = FALSE; mii.cbSize = sizeof(MENUITEMINFO);
if (pkhs->vkCode == VK_LWIN) bLWIN = FALSE; mii.fMask = MIIM_STATE;
pressed = FALSE; bWorkArea ? mii.fState = MFS_CHECKED : mii.fState = MFS_UNCHECKED;
} SetMenuItemInfo(hPopup, ID_POPUPMENU_AREA, FALSE, &mii);
if (wParam == WM_KEYDOWN) nid.cbSize = sizeof(NOTIFYICONDATA);
{ nid.hWnd = hWnd;
if (pkhs->vkCode == VK_LCONTROL) bLCTRL = TRUE; nid.uVersion = NOTIFYICON_VERSION;
if (pkhs->vkCode == VK_LWIN) bLWIN = TRUE; nid.uCallbackMessage = WM_WCW;
nid.hIcon = hIcon;
if (bLCTRL && bLWIN && pkhs->vkCode == 0x49 && !pressed) // 'I' key nid.uID = IDI_TRAYICON;
{ nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
pressed = TRUE; nid.dwInfoFlags = NIIF_INFO;
showIcon = !showIcon; StringCchCopy(nid.szTip, _countof(nid.szTip), szTitle);
HandlingTrayIcon();
} hMouseHook = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProc, hInst, NULL);
if (!hMouseHook)
if (bLCTRL && bLWIN && pkhs->vkCode == 0x43 && !pressed) // 'C' key {
{ ShowError(IDS_ERR_HOOK);
pressed = TRUE; SendMessage(hWnd, WM_CLOSE, NULL, NULL);
HWND fgWindow = GetForegroundWindow(); }
if (fgWindow)
{ hKbdHook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardHookProc, hInst, NULL);
HWND parentWindow = fgWindow; if (!hKbdHook)
while (TRUE) {
{ ShowError(IDS_ERR_HOOK);
parentWindow = GetParent(fgWindow); SendMessage(hWnd, WM_CLOSE, NULL, NULL);
if (parentWindow) fgWindow = parentWindow; }
else break;
} LoadString(hInst, IDS_ABOUT, szAbout, _countof(szAbout));
WINDOWPLACEMENT wp = { 0 }; }
wp.length = sizeof(WINDOWPLACEMENT); break;
GetWindowPlacement(fgWindow, &wp);
if (wp.showCmd == SW_SHOWNORMAL) case WM_WCW:
{ {
int fgW = wp.rcNormalPosition.right - wp.rcNormalPosition.left; if ((lParam == WM_RBUTTONDOWN || lParam == WM_LBUTTONDOWN) && wParam == IDI_TRAYICON)
int fgH = wp.rcNormalPosition.bottom - wp.rcNormalPosition.top; {
int fgX = dtCenterX - (fgW / 2); SetForegroundWindow(hWnd);
int fgY = dtCenterY - (fgH / 2); POINT pt;
wp.rcNormalPosition.left = fgX; GetCursorPos(&pt);
wp.rcNormalPosition.top = fgY; int idMenu = TrackPopupMenu(hPopup, TPM_RETURNCMD, pt.x, pt.y, 0, hWnd, NULL);
wp.rcNormalPosition.right = fgX + fgW; if (idMenu == ID_POPUPMENU_ICON)
wp.rcNormalPosition.bottom = fgY + fgH; {
SendMessage(fgWindow, WM_ENTERSIZEMOVE, NULL, NULL); bShowIcon = FALSE;
SetWindowPlacement(fgWindow, &wp); HandlingTrayIcon();
SendMessage(fgWindow, WM_EXITSIZEMOVE, NULL, NULL); }
} if (idMenu == ID_POPUPMENU_AREA)
} {
} bWorkArea = !bWorkArea;
} bWorkArea ? mii.fState = MFS_CHECKED : mii.fState = MFS_UNCHECKED;
return CallNextHookEx(NULL, nCode, wParam, lParam); SetMenuItemInfo(hPopup, ID_POPUPMENU_AREA, FALSE, &mii);
} }
if (idMenu == ID_POPUPMENU_ABOUT && !bKPressed)
VOID HandlingTrayIcon() {
{ bKPressed = TRUE;
if (showIcon) DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, (DLGPROC)About);
{ bKPressed = FALSE;
if (!Shell_NotifyIcon(NIM_ADD, &nid)) }
{ if (idMenu == ID_POPUPMENU_EXIT) SendMessage(hWnd, WM_CLOSE, NULL, NULL);
ShowError(IDS_ERR_ICON); }
showIcon = FALSE; }
} break;
}
else case WM_DESTROY:
{ {
Shell_NotifyIcon(NIM_DELETE, &nid); PostQuitMessage(0);
} }
break;
}
default:
VOID ShowError(UINT uID) return DefWindowProc(hWnd, message, wParam, lParam);
{ }
WCHAR szErrorText[MAX_LOADSTRING]; // Текст ошибки return 0;
LoadStringW(hInst, uID, szErrorText, _countof(szErrorText)); }
MessageBox(hWnd, szErrorText, szTitle, MB_OK | MB_ICONERROR);
} 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)
{
pkhs = (KBDLLHOOKSTRUCT*)lParam;
if (wParam == WM_KEYUP)
{
if (pkhs->vkCode == VK_LCONTROL) bLCTRL = FALSE;
if (pkhs->vkCode == VK_LWIN) bLWIN = FALSE;
bKPressed = FALSE;
}
if (wParam == WM_KEYDOWN)
{
if (pkhs->vkCode == VK_LCONTROL) bLCTRL = TRUE;
if (pkhs->vkCode == VK_LWIN) bLWIN = TRUE;
if (bLCTRL && bLWIN && pkhs->vkCode == KEY_I && !bKPressed) // 'I' key
{
bKPressed = TRUE;
bShowIcon = !bShowIcon;
HandlingTrayIcon();
return TRUE;
}
if (bLCTRL && bLWIN && pkhs->vkCode == KEY_C && !bKPressed && !bKEYV) // 'C' key
{
bKPressed = TRUE;
hFgWnd = GetForegroundWindow();
BOOL bApproved = CheckWindow(hFgWnd);
if (bApproved) MoveWindowToMonitorCenter(hFgWnd, bWorkArea, FALSE);
else hFgWnd = NULL;
return TRUE;
}
if (bLCTRL && bLWIN && pkhs->vkCode == KEY_V && !bKPressed && !bKEYV) // 'V' key
{
bKPressed = TRUE; bKEYV = TRUE;
hFgWnd = GetForegroundWindow();
BOOL bApproved = CheckWindow(hFgWnd);
if (bApproved) DialogBox(hInst, MAKEINTRESOURCE(IDD_MANUAL_EDITING), hWnd, (DLGPROC)DlgProc);
else hFgWnd = NULL;
bKEYV = FALSE;
return TRUE;
}
}
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()
{
if (bShowIcon)
{
if (!Shell_NotifyIcon(NIM_ADD, &nid))
{
ShowError(IDS_ERR_ICON);
bShowIcon = FALSE;
}
}
else
{
Shell_NotifyIcon(NIM_DELETE, &nid);
}
}
VOID ShowError(UINT uID)
{
TCHAR szErrorText[MAX_LOADSTRING]; // Error's text
LoadString(hInst, uID, szErrorText, _countof(szErrorText));
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;
}

View File

@@ -1,2 +1,3 @@
#pragma once #pragma once
#include "resource.h" #include "resource.h"

Binary file not shown.

View File

@@ -1,173 +1,173 @@
<?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>
<Platform>Win32</Platform> <Platform>Win32</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32"> <ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64"> <ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|x64"> <ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion> <VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{6A775901-6C34-4E96-B359-C11C76A520BB}</ProjectGuid> <Keyword>Win32Proj</Keyword>
<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>Unicode</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>Unicode</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>Unicode</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>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
</ImportGroup> </ImportGroup>
<ImportGroup Label="Shared"> <ImportGroup Label="Shared">
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<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>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<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>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<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>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<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 Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>false</LinkIncremental>
</PropertyGroup> <CopyCppRuntimeToOutputDir>false</CopyCppRuntimeToOutputDir>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> </PropertyGroup>
<LinkIncremental>false</LinkIncremental> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
</PropertyGroup> <LinkIncremental>true</LinkIncremental>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> </PropertyGroup>
<LinkIncremental>false</LinkIncremental> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</PropertyGroup> <LinkIncremental>false</LinkIncremental>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> </PropertyGroup>
<ClCompile> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PrecompiledHeader> <ClCompile>
</PrecompiledHeader> <WarningLevel>Level3</WarningLevel>
<WarningLevel>Level3</WarningLevel> <SDLCheck>true</SDLCheck>
<Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck> <ConformanceMode>true</ConformanceMode>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> </ClCompile>
<ConformanceMode>true</ConformanceMode> <Link>
</ClCompile> <SubSystem>Windows</SubSystem>
<Link> <GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem> <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation> </Link>
</Link> <Manifest>
</ItemDefinitionGroup> <AdditionalManifestFiles>$(ProjectName).manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> </Manifest>
<ClCompile> </ItemDefinitionGroup>
<PrecompiledHeader> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</PrecompiledHeader> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking>
<SDLCheck>true</SDLCheck> <IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile> <ConformanceMode>true</ConformanceMode>
<Link> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<SubSystem>Windows</SubSystem> </ClCompile>
<GenerateDebugInformation>true</GenerateDebugInformation> <Link>
</Link> <SubSystem>Windows</SubSystem>
</ItemDefinitionGroup> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <OptimizeReferences>true</OptimizeReferences>
<ClCompile> <GenerateDebugInformation>false</GenerateDebugInformation>
<PrecompiledHeader> <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</PrecompiledHeader> </Link>
<WarningLevel>Level3</WarningLevel> <Manifest>
<Optimization>MaxSpeed</Optimization> <AdditionalManifestFiles>$(ProjectName).manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
<FunctionLevelLinking>true</FunctionLevelLinking> </Manifest>
<IntrinsicFunctions>true</IntrinsicFunctions> </ItemDefinitionGroup>
<SDLCheck>true</SDLCheck> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <ClCompile>
<ConformanceMode>true</ConformanceMode> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>None</DebugInformationFormat> <SDLCheck>true</SDLCheck>
</ClCompile> <PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Link> <ConformanceMode>true</ConformanceMode>
<SubSystem>Windows</SubSystem> </ClCompile>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <Link>
<OptimizeReferences>true</OptimizeReferences> <SubSystem>Windows</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AssemblyDebug>false</AssemblyDebug> </Link>
</Link> </ItemDefinitionGroup>
</ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile>
<ClCompile> <WarningLevel>Level3</WarningLevel>
<PrecompiledHeader> <FunctionLevelLinking>true</FunctionLevelLinking>
</PrecompiledHeader> <IntrinsicFunctions>true</IntrinsicFunctions>
<WarningLevel>Level3</WarningLevel> <SDLCheck>true</SDLCheck>
<Optimization>MaxSpeed</Optimization> <PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking> <ConformanceMode>true</ConformanceMode>
<IntrinsicFunctions>true</IntrinsicFunctions> </ClCompile>
<SDLCheck>true</SDLCheck> <Link>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <SubSystem>Windows</SubSystem>
<ConformanceMode>true</ConformanceMode> <EnableCOMDATFolding>true</EnableCOMDATFolding>
</ClCompile> <OptimizeReferences>true</OptimizeReferences>
<Link> <GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem> </Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding> </ItemDefinitionGroup>
<OptimizeReferences>true</OptimizeReferences> <ItemGroup>
<GenerateDebugInformation>true</GenerateDebugInformation> <ClInclude Include="framework.h" />
</Link> <ClInclude Include="Resource.h" />
</ItemDefinitionGroup> <ClInclude Include="targetver.h" />
<ItemGroup> <ClInclude Include="wCenterWindow.h" />
<ClInclude Include="framework.h" /> </ItemGroup>
<ClInclude Include="resource.h" /> <ItemGroup>
<ClInclude Include="targetver.h" /> <ClCompile Include="wCenterWindow.cpp" />
<ClInclude Include="wCenterWindow.h" /> </ItemGroup>
</ItemGroup> <ItemGroup>
<ItemGroup> <ResourceCompile Include="wCenterWindow.rc" />
<ClCompile Include="wCenterWindow.cpp" /> </ItemGroup>
</ItemGroup> <ItemGroup>
<ItemGroup> <Image Include="small.ico" />
<ResourceCompile Include="wCenterWindow.rc" /> <Image Include="wCenterWindow.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Image Include="wCenterWindow.ico" /> <Manifest Include="wCenterWindow.manifest" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>

View File

@@ -1,46 +1,54 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<Filter Include="Исходные файлы"> <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="Файлы заголовков"> <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="Файлы ресурсов"> <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> <ItemGroup>
<ClInclude Include="framework.h"> <ClInclude Include="framework.h">
<Filter>Файлы заголовков</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="targetver.h"> <ClInclude Include="targetver.h">
<Filter>Файлы заголовков</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="wCenterWindow.h"> <ClInclude Include="Resource.h">
<Filter>Файлы заголовков</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="resource.h"> <ClInclude Include="wCenterWindow.h">
<Filter>Файлы заголовков</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="wCenterWindow.cpp"> <ClCompile Include="wCenterWindow.cpp">
<Filter>Исходные файлы</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include="wCenterWindow.rc"> <ResourceCompile Include="wCenterWindow.rc">
<Filter>Файлы ресурсов</Filter> <Filter>Resource Files</Filter>
</ResourceCompile> </ResourceCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Image Include="wCenterWindow.ico"> <Image Include="small.ico">
<Filter>Файлы ресурсов</Filter> <Filter>Resource Files</Filter>
</Image> </Image>
</ItemGroup> <Image Include="wCenterWindow.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<Manifest Include="wCenterWindow.manifest">
<Filter>Resource Files</Filter>
</Manifest>
</ItemGroup>
</Project> </Project>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>