Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Focused Check
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefanuk12 committed Aug 25, 2021
1 parent 4ae11c9 commit 2efc014
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

//
bool ShowWindows = false;
HWND WindowName;

//
static BOOL CALLBACK windcallback(HWND hWnd, LPARAM lparam) {
Expand Down Expand Up @@ -57,12 +58,10 @@ void GetKeyPress()
// Constant loop
while (true)
{
// Get input
if (GetKeyState(VK_RSHIFT) & 0x8000) {
// Toggle Show Window
// Get input and make sure if focused
if (GetKeyState(VK_RSHIFT) & 0x8000 && GetForegroundWindow() == WindowName) {
ShowWindows = !ShowWindows;

// Output
std::cout << (ShowWindows ? "Shown" : "Hidden") << std::endl;
}

Expand All @@ -74,6 +73,7 @@ void GetKeyPress()
// Main
int main(int argc, char** argv) {
//
WindowName = GetForegroundWindow();
std::cout << "All roblox clients that are open/opened will now be hidden. Press Right Shift to show all ROBLOX windows" << std::endl;

//
Expand Down

0 comments on commit 2efc014

Please sign in to comment.