0 Members and 1 Guest are viewing this topic.
#include <windows.h>#include <iostream>#include <Psapi.h>BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam);//Defining these obviously local vars as global so they don't get re-defined every time. Trying to speed shit up.COLORREF getColor = RGB(0,0,0);COLORREF transKey = RGB(77,77,77);unsigned char alpha = 0;const unsigned char unfocused = 180;const unsigned char focused = 255;HWND hwndCurrent;TCHAR WindowTitle[MAX_PATH] = "";int main(){ printf("Press CTRL+C to quit\n"); while(true) { EnumWindows(EnumWindowsProc, 0); Sleep(20); }}BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam) { GetWindowText(hwnd, WindowTitle, sizeof(WindowTitle)); if (strstr(WindowTitle,"- Remote Desktop Connection")) { if (!GetLayeredWindowAttributes(hwnd,&getColor,&alpha,NULL)) SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); if (GetForegroundWindow() != hwnd) { if (alpha != unfocused) SetLayeredWindowAttributes(hwnd,transKey,unfocused,LWA_COLORKEY + LWA_ALPHA); } else if (alpha != focused) SetLayeredWindowAttributes(hwnd,transKey,focused,LWA_COLORKEY + LWA_ALPHA); } return true;}
#include <windows.h>#include <iostream>#include <Psapi.h>BOOL CALLBACK EnumWindowsProcess(HWND hwnd, LPARAM lParam);const COLORREF transKey = RGB(77,77,77);int main(){ EnumWindows(EnumWindowsProcess, 0);}BOOL CALLBACK EnumWindowsProcess(HWND hwnd, LPARAM lParam) { TCHAR WindowTitle[MAX_PATH] = ""; GetWindowText(hwnd, WindowTitle, sizeof(WindowTitle)); if (strstr(WindowTitle,"- Remote Desktop Connection") && !GetLayeredWindowAttributes(hwnd,NULL,NULL,NULL)) { SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); SetLayeredWindowAttributes(hwnd,transKey,255,LWA_COLORKEY + LWA_ALPHA); } return true;}