For some security reasons, my clients have contracted me to write a vb application that runs a windows shell (replacing explorer). As you would expect of such an application, its heavily dependent on the API. In brief it hooks into the the windows messaging system via a small win32 dll i had to write in C. So far everything is working perfectly and the application is in testing phase. I have been well relieved that everything is going according to plan until i stumbled on the following in the MSDN and i quote:
"The Microsoft Windows operating environment identifies each form and control in an application by assigning it a handle, or hWnd. The hWnd property is used with Windows API calls. Many Windows operating environment functions require the hWnd of the active window as an argument.
Note: Because the value of this property can change while a program is running, never store the hWnd value in a variable." end of quote.
To me this is unthinkable. The program does exactly what MSDN tell me not to do: it stores the hWnd of all the open top-level and unowned windows in the system into variables so that i can manipulate them from my application. The "Constantness" of other applications' windows is a big factor.
Now can someone tell me what is constant in a window(other applications' windows). What property of a window is guaranteed to remain constant throughout a window's life. If the hWnd of a window can change when it is running is there a way my application can know when this is happening. An answer in any programming language will be acceptable. I dont want to keep monitoring the system for any loaded windows as this will certainly cause irritating flickers.
And another question, what worries me most: Why does my application appear to be running perfectly?