Re: [GD-Windows] Finding HWND of the current thread
Brought to you by:
vexxed72
From: Jan W. <ur...@st...> - 2004-07-28 08:45:09
|
On Thu, 15 Jul 2004 14:19:49 -0400, Brian Hook <ho...@bo...> wrote: >> GetConsoleWindow > As a library, I won't know if it's a console window or not. You can check the Subsystem field of the PE "optional" header (always present): if it's equal IMAGE_SUBSYSTEM_WINDOWS_CUI (3), you've got a console app. void* base = (void*)0x400000 (or GetModuleHandle(0)) IMAGE_NT_HEADERS* h = ImageNtHeader(base) h->OptionalHeader.Subsystem == 3? Disclaimer: off the top of my head and ugly to boot ;) |