Im trying to output only the windows opened in the Taskbar.
I tried to use FindWindow() but apparrently its not the one to use.
Code:
#include <windows.h>
#include <iostream>
#pragma hdrstop
#pragma argsused
using namespace std;
BOOL EnumWindowsProc(HWND hTaskbar, long lParam)
{
char Buff[255], NameOfClass[255];
hTaskbar = FindWindow(TEXT("Shell_TrayWnd"), NULL);
GetWindowText(hTaskbar, Buff, 254);
GetClassName(hTaskbar, NameOfClass, 254);
cout << "Window Text: " << Buff << "\t"
<< "Class Name: " << NameOfClass << endl;
return TRUE;
}
int main(int argc, char* argv[])
{
EnumWindows((WNDENUMPROC)EnumWindowsProc, 0);
cin.ignore();
return 0;
}