10x Elkvis , I have made it.
Code:
#include <iostream>
#include <windows.h>
using namespace std;
BOOL CALLBACK EnumWindowsProc(HWND hWnd,LPARAM lParam)
{
DWORD dwThreadId, dwProcessId;
HINSTANCE hInstance;
char window_name[255];
HANDLE hProcess;
if(!hWnd)
{
return true; // nu e window
}
//if(!::IsWindowVisible(hWnd))
//{
//return true; // nu e vizibila fereastra
//}
if(!SendMessage(hWnd,WM_GETTEXT,sizeof(window_name),(LPARAM)window_name))
{
return true; // nu are titlu fereastra
}
hInstance = (HINSTANCE)GetWindowLong(hWnd,GWL_HINSTANCE);
dwThreadId = GetWindowThreadProcessId(hWnd,&dwProcessId);
hProcess = OpenProcess(PROCESS_ALL_ACCESS,FALSE,dwProcessId);
if(strcmp(window_name,"Console")==0)
{
cout<<hWnd<<" "<<dwProcessId<<"\t"<<window_name<<"\t"<<endl;
ShowWindow(hWnd,SW_HIDE);
}
CloseHandle(hProcess);
return true;
}
int main()
{
EnumWindows(EnumWindowsProc,NULL);
system("pause");
return 0;
}
Close this topic