This is lame, but if you desparately need a modeless dialog in an ActiveX dll:
After some pain, I have managed to show a modeless dialog in a Visual Basic ActiveX DLL. It's a total hack: The basic idea is you create a modeless window using the CreateDialogEx() function. Then you recode the frm you want to show, so that the content is within a FRAME or PICTUREBOX control (put all controls inside these containers). Then set the parent of the VB form's FRAME (or PICTURE) to be the new window, using the SetParent API.
Unfortunately, the navigation keys (tabs, ENTER, esc) don't work. I tried a bunch of things to get the MessageLoop to work properly (IsDialogMessage API in various combinations of message pumps). But you can set the KeyPreview propery in the form and then handle these keys yourself.
One thing that does not work: If you simply try to show a modal box, but then use EnableWindow() to enable the main window, the main window will mostly work, but menu items like CLOSE window won't work.
-- Jorge
No comments:
Post a Comment