Troudeloup
asked on
FindWindow(NULL,"notepad");
i know i said that i solved the problem, because I used a 3rd party software to look them up,
however
how do I find the handles of windows with the same title?
i other words, i have multiple notepads open
however
how do I find the handles of windows with the same title?
i other words, i have multiple notepads open
ASKER
what does it do?
I need n handles returned for n number of windows of that name.
I need n handles returned for n number of windows of that name.
Or
#include <windows.h>
#include <iostream>
using namespace std;
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam)
{
char buf [1024];
GetWindowText(hwnd,buf,102 4);
cout << buf << " HWND: " << hwnd << endl;
return true;
}
int main()
{
EnumWindows(EnumWindowsPro c,NULL);
return 0;
}
Alternatively, to filter for Notepad:
Or
#include <windows.h>
#include <iostream>
#include <string.h>
using namespace std;
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam)
{
char buf [1024];
GetWindowText(hwnd,buf,102 4);
if(!strstr(buf,(char*)lPar am)) return true;
cout << buf << " HWND: " << hwnd << endl;
return true;
}
int main()
{
EnumWindows(EnumWindowsPro c,(LPARAM) "Notepad") ;
return 0;
}
#include <windows.h>
#include <iostream>
using namespace std;
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam)
{
char buf [1024];
GetWindowText(hwnd,buf,102
cout << buf << " HWND: " << hwnd << endl;
return true;
}
int main()
{
EnumWindows(EnumWindowsPro
return 0;
}
Alternatively, to filter for Notepad:
Or
#include <windows.h>
#include <iostream>
#include <string.h>
using namespace std;
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam)
{
char buf [1024];
GetWindowText(hwnd,buf,102
if(!strstr(buf,(char*)lPar
cout << buf << " HWND: " << hwnd << endl;
return true;
}
int main()
{
EnumWindows(EnumWindowsPro
return 0;
}
ASKER
#include <windows.h>
#include <iostream>
#include <string.h>
using namespace std;
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam)
{
char buf [1024];
GetWindowText(hwnd,buf,102
if(!strstr(buf,(char*)lPar
cout << buf << " HWND: " << hwnd << endl;
return true;
}
int main()
{
EnumWindows(EnumWindowsPro
return 0;
}
I don't understand the code, i was expecting an array to be returnd and then i can send the hwnd to setforground()
yet this returns a bool
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
how do I find out how many items the vector has?
Just use
size_t sz = vw.size();
size_t sz = vw.size();
#include <windows.h>
#include <iostream>
using namespace std;
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam)
{
char buf [1024];
GetWindowText(hwnd,buf,102
cout << buf << endl;
return true;
}
int main()
{
EnumWindows(EnumWindowsPro
return 0;
}