vb6, win32API, windows hooks, positioning problem
Hi everybody,
I am trying to create a program (in VB6) which talks to a C dll to set a system wide hook. The purpose of hooking is to intercept all window creation / destruction messages...so that I can position the window (which may belong to any application), at whatever position I want. This includes dialog boxes, message/error dialogs, DOS/command windows and every visible window...
I have successfully managed to set the system-wide hook in the C dll using the CBT hook, and I can intercept window creation and destruction messages. I have figured out that the window class name #32770 is the one which refers to a common dialog: such as the file-open / save-as dialogs.
I am successfully able to retrieve the window positioning details, and store them to a database, when a window is destroyed. The next time the window is created, I detect it. and retrieve the details of the window from the dB. If the details are found, then I try to set the window positioning, using SetWindowPlacement, SetWindowPos...(both work for me).
Now the main problem is: this approach detects dialog windows with class #32770, but cannot "set" the position for those dialogs. It doesnt detect the DOS window. And for some weird reason, the position and size attributes for Explorer.exe and IExplore.exe are always wrong...I get a size of something like 10000 x 10000 always...
Can someone please help me...?
I have dont quite a bit of searching online...including the API section here on XtremeVBTalk.com, but no use :(
Please point me in the right direction...
Thanks a lot!
Cheers
Krishna
|