How to make a PropertySheet window always display as the top-most one?
-
I am working on a project of BHO and I need to make a PropertySheet dialog box pop up when I click on an item in the context menu. The property sheet is from the BHO. The problem is sometimes the PropertySheet is displayed under the current IE window and the user cannot see it. I know what caused the problem. It is because there is one BHO for each IE window. But when a property sheet is called, the program just use PostMessage to send out a message, and the first BHO that gets it will display the property sheet. That is why sometimes the property sheet cannot be seen. How do I solve this problem? I tried to use SetWindowPos(NULL,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE) in the property’s initialization function. But it doesn’t work. I also tried to add SetForegroundWindow(); before that. There is still something wrong with it. First, it will make the IE window that the BHO hooked to become the window on focus and make the current IE window hide; Second, it only works on the IE windows from the same thread(The new window is generated from current old window by clicking on File->new->Window). It doesn’t work when the IE windows are on different thread, for exampe, generated by clicking on the blue “e”. Please help. Thanks a lot in advance
-
I am working on a project of BHO and I need to make a PropertySheet dialog box pop up when I click on an item in the context menu. The property sheet is from the BHO. The problem is sometimes the PropertySheet is displayed under the current IE window and the user cannot see it. I know what caused the problem. It is because there is one BHO for each IE window. But when a property sheet is called, the program just use PostMessage to send out a message, and the first BHO that gets it will display the property sheet. That is why sometimes the property sheet cannot be seen. How do I solve this problem? I tried to use SetWindowPos(NULL,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE) in the property’s initialization function. But it doesn’t work. I also tried to add SetForegroundWindow(); before that. There is still something wrong with it. First, it will make the IE window that the BHO hooked to become the window on focus and make the current IE window hide; Second, it only works on the IE windows from the same thread(The new window is generated from current old window by clicking on File->new->Window). It doesn’t work when the IE windows are on different thread, for exampe, generated by clicking on the blue “e”. Please help. Thanks a lot in advance
I am not familiar with BHO but did you try wndTop as the first parameter to SetWindowPos() instead of NULL? John