I can not use GetAltTabInfo. Probably a stupid mistake, but what's wrong with that?
HWND taskSwitcher = FindWindow(L"TaskSwitcherWnd", L"Task Switching");
ALTTABINFO altTabInfo = {};
altTabInfo.cbSize = sizeof(ALTTABINFO);
GetAltTabInfo(taskSwitcher, -1, &altTabInfo, NULL, 0);
I checked that taskSwitcher is a window for switching tasks after calling FindWindow (regardless of whether it is visible or not). All altTabInfo fields remain 0 after calling GetAltTabInfo, with the exception of cbSize, which was set to 40 when assigned sizeof (ALTTABINFO). I am trying to do this on a windows 7 machine.
Alternative methods to extract the number of windows?
thank
Edit: Well, I just realized that I could get some error information. The value of the result of calling GetAltTabInfo is really 0, and GetLastError gives me 1400 (invalid window handle) or 1168 (element not found) if I specify NULL for the hwnd parameter (it was defined as __in_opt). Therefore, I think I'm going through the wrong window. What is correct, if not the one that returns FindWindow (L "TaskSwitcherWnd", L "Task Switching")? MSDN only tells me about the hwnd parameter that "This window should be an application switch window."
72con source
share