In my application I am making a call to GetGUIThreadInfo() but it returns 0. After making a call to GetLastError() I see that it's returning 87; which hints to the fact that I am passing an incorrect parameter. Here is how I invoke it:
The MSDN documentation indicates that the only thing required in order to let a call to GetGUIThreadInfo() function properly is setting the GUITHREADINFO's cbSize member to sizeof(GUITHREADINFO), which I am doing.
info.cbSize = sizeof(GUITHREADINFO);
GetWindowText(info.hwndActive, buff, 256);
printf("Current Window: %s\n", buff);
What can be wrong?
>> What can be wrong?
It worked fine on my system.
On mine it doesn't :(
I am running Windows XP
>>On mine it doesn't
Well, MSDN does say to use GetWindowThreadProcessId or NULL (to get the current process info), although I can't imagine why GetCurrentThreadId wouldn't work.