Title of the active window
Hello,
What is the best way to get the title (or any other info) about the current active window (It may not belong to my application). In other words I mean the window user working with.
As I understandd CWnd::GetActiveWindow works only with current Application
Best regards, Constantin Kuznetsov Jr.
Re: Title of the active window
This is the standard action to retrieve a caption of any Windows control.
char szTitle[80];
HWND hActiveWnd = GetActiveWindow();
hActiveWnd = GetWindowText(hActiveWnd, szTitle);
This is using Windows API but it is easy to find analogs in Visual C
Re: Title of the active window
If the application may not be urs, u can use GetForegroundWindow(). This will help i think