GetForgroundwindow function

Firstly...sorry about the Title
OK,so here's my code
1
2
3
4
5
6
7
string GetActiveWindowTitle()
{
	char a[MAX_PATH] = {};
	HWND hw = GetForegroundWindow();
	GetWindowTextA(hw, a, sizeof(a));
	return string(a);
}

I get the title but as you know the title changes.
a good example is Google Chrome when you go to Yahoo it'll be like: Yahoo - ....
is there a way to get a STATIC information from the active window? no matter what the exe file name is or what title it has?

sorry for my bad English.
Last edited on
What the "STATIC" information means ?
FindWindow() will return many things based on how you set up the parameters. Somewhat more complicated and sophisticated are the EnumWindow family of functions. Just throwing these ideas out there. I don't really understand your question.
I figured it out my self
my program was meant to do something when the title of the foreground window was Google Chrome but my problem was that the title of the google chrome changes based on the site you are visiting so instead of getting the title I can simply tell it to get the File Description in the Details menu and if it's Google Chrome then do the rest
sorry for taking your time with such a confusing question XD
Topic archived. No new replies allowed.