Jammer1224
asked on
Getting active window in BCB 6.0
Using Borland C++ Builder 6.0
Got this code:
char* oldtitle = "";
char* title= "a";
while(1)
{
Sleep(10);
HWND wnd=GetForegroundWindow();
ShowMessage("Trying");
if(wnd) {
char* title;
GetWindowText(wnd,title,si zeof(title ));
ShowMessage("Success");
DWORD err = GetLastError();
ShowMessage("Error code:" + IntToStr(err));
ShowMessage(title);
}
if (title != oldtitle) {
oldtitle = title;
DoSomeAction();
}
Don't know why but the title is always a null value.
Got this code:
char* oldtitle = "";
char* title= "a";
while(1)
{
Sleep(10);
HWND wnd=GetForegroundWindow();
ShowMessage("Trying");
if(wnd) {
char* title;
GetWindowText(wnd,title,si
ShowMessage("Success");
DWORD err = GetLastError();
ShowMessage("Error code:" + IntToStr(err));
ShowMessage(title);
}
if (title != oldtitle) {
oldtitle = title;
DoSomeAction();
}
Don't know why but the title is always a null value.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
What can i say.
Finders keepers!
Congrats on you 500 points.
Thats all I needed.
Finders keepers!
Congrats on you 500 points.
Thats all I needed.
ASKER