-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c81618
commit 7168865
Showing
7 changed files
with
66 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include "windowfixer.h" | ||
|
||
bool WindowFixer_Hooked = false; | ||
extern HWND g_hWnd; | ||
|
||
#define IsKeyDown(VK_NAME) ((GetAsyncKeyState(VK_NAME) & 0x8000) ? true:false) | ||
|
||
DWORD __stdcall Listen(LPVOID lpThreadParameter) { | ||
POINT point; // 鼠标所在位置 | ||
HWND target; // 目标窗口句柄 | ||
while (1) | ||
{ | ||
if IsKeyDown(VK_F7) | ||
{ | ||
GetCursorPos(&point); | ||
target = WindowFromPoint(point); | ||
if (target != NULL && target == g_hWnd) { | ||
RECT rect; | ||
GetWindowRect(target, &rect); | ||
// 重新设置窗口大小 | ||
MoveWindow(target, rect.left, rect.top, rect.right - rect.left-1, rect.bottom - rect.top, true); | ||
// 恢复窗口大小 | ||
MoveWindow(target, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, true); | ||
} | ||
} | ||
Sleep(200); | ||
} | ||
return 0; | ||
} | ||
|
||
void WindowFixer::Start() { | ||
CreateThread(NULL, NULL, Listen, NULL, NULL, NULL); | ||
} | ||
|
||
void WindowFixer::Stop() { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#pragma once | ||
|
||
#include "hook.h" | ||
|
||
class WindowFixer { | ||
public: | ||
void Start(); | ||
void Stop(); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters