Unique identifing windows
How can I identify Windows. I know that there would be the possibility of the Window handle, but this works only during runtime. If my User restart their programs a totaly new handle ist used.
But I need to save some Window related Data. How could I manage that.
I'll better explain it in an example:
Some of our Users are very old, but want to try everything. So if they get bored with Internet Explorer and Web-Browsing, they are browsing through the option dialogs of any application, and change this and that, so we thought about the idea to "stick" a little note to the dialogs and windows with short informations like, do not change the proxy settings, otherwise your internet connection wont work.
So I would save those notes in a Database but how do i know when i've to display them?
Exactly: how can I work out a unique, persistent identifycation of windows. you see, i can find out, that im talking to an application which was loaded from a binary called iexplore.exe but how can i identify the dialouges and so on.
thanks matthias
[1100 byte] By [
steima] at [2007-11-18 20:27:29]

# 1 Re: Unique identifing windows
I hope I understood your problem right, and want to give some answers:
* Use FindWindow(...) to search for a (parent) window with a specific title. For example: "Internet settings" ...
HWND hDlg;
hDlg = FindWindow(NULL, "Internet settings");
* Then you could enumerate all child windows (using "EnumChildWindows")
* And then ... (yes then) ... You could retrieve which control you have by checking the window class and/or its text.
But I think the last point is a little bit unsafe and not the best way ...
NoHero at 2007-11-9 13:10:33 >

# 3 Re: Unique identifing windows
I recommend using a GUID. They can be generated through the MS utility that comes with VC++. #define that GUID in the code of the window. Then, also associated that GUID with your special message in the database. When that window opens put in some code to get the associated message with that GUID from the DBase and display it.