DWORD WINAPI GhostThreadProc(LPVOID pParameter) { HWND hwndTarget = (HWND)pParameter; HWND hOwner = GetWindow(hwndTarget, GW_OWNER); DWORD style = (DWORD)GetWindowLongPtr(hwndTarget, GWL_STYLE); DWORD exstyle = (DWORD)GetWindowLongPtr(hwndTarget, GWL_EXSTYLE); if (style & WS_CHILD) return 1; if (!(style & WS_VISIBLE)) return 2; HWND hwndGhost = CreateWindowExW(exstyle, L"Ghost", NULL, style, 0, 0, 0, 0, hOwner, NULL, GetModuleHandle(NULL), hwndTarget); if (!hwndGhost) { ERR("Failed to create Ghost\n"); return 3; } MSG msg; while (GetMessage(&msg, NULL, 0, 0)) { DispatchMessage(&msg); } return (DWORD)msg.wParam; } BOOL FASTCALL IntGoGhost(PWND Window, BOOL bGo) { if (!Window) return FALSE; if (IsDebuggerPresent()) return FALSE; HANDLE hThread = CreateThread(NULL, 0, GhostThreadProc, Window->head.h, 0, NULL); if (!hThread) return FALSE; CloseHandle(hThread); return TRUE; }