Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
if (isMenuActive != lastIsMenuActive) { if (isMenuActive) { /* Remove TRANSPARENT and NOACTIVATE. */ LONG ex = GetWindowLong(hwnd, GWL_EXSTYLE); ex &= ~WS_EX_TRANSPARENT; ex &= ~WS_EX_NOACTIVATE; ex |= (WS_EX_TOPMOST | WS_EX_LAYERED | WS_EX_TOOLWINDOW); SetWindowLong(hwnd, GWL_EXSTYLE, ex); SetWindowPos ( hwnd, nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED ); /* Activate the overlay so the game stops receiving input. */ DWORD gameTid = GetWindowThreadProcessId(hTargetWindow, nullptr); DWORD myTid = GetCurrentThreadId(); AttachThreadInput(myTid, gameTid, TRUE); SetForegroundWindow(hwnd); SetActiveWindow(hwnd); SetFocus(hwnd); AttachThreadInput(myTid, gameTid, FALSE); /* Capture the mouse (all WM_MOUSE messages go to us). */ if (GetCapture() != hwnd) SetCapture(hwnd); /* If the game hides the cursor, draw the ImGui cursor. */ ImGui::GetIO().MouseDrawCursor = true; } else { /* Restore click-through behavior for the overlay. */ LONG ex = GetWindowLong(hwnd, GWL_EXSTYLE); ex |= WS_EX_TRANSPARENT; ex &= ~WS_EX_NOACTIVATE; // keep without NOACTIVATE so clicking can activate ex |= (WS_EX_TOPMOST | WS_EX_LAYERED | WS_EX_TOOLWINDOW); SetWindowLong(hwnd, GWL_EXSTYLE, ex); SetWindowPos ( hwnd, nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED ); if (GetCapture() == hwnd) ReleaseCapture(); ImGui::GetIO().MouseDrawCursor = false; /* Return focus to the game. */ if (IsWindow(hTargetWindow)) SetForegroundWindow(hTargetWindow); }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)