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?