Dialog activation issue (hard problem?)
I have this problem for a long time and hope to find a solution for it. It is very cumbersome to describe, so
please bear with me.
I have developed a CAD application using WTL. The screen is divided into two parts. The main window on left
size is a 3D canvas. The right side is 3DS like interface that uses an embedded tab control/view to host
various GUI pages. Each page hosts one or more dialogs which itself host various UI wedgets, eg. radio
button, edit control.
The problem: every time I want access any non-hot tracking UI wedgets, I have to double click it: 1st time to
activate the dialog, 2nd time to actually use the GUI control itself.
This is very annoying as user would not expect double clicks. My way of getting around this is to use
SetCapture for mouse and SetFocus for keyboard on mouse move or mouse enter event. I do this both for the
embedded dialogs and for the 3D canvas window. That is,when mouse enters the embedded dialogs,
SetCapture and SetFocus is called to set focus/capture to the dialog where mouse cursor is. When the mouse
is moved back into the 3D canvas, I do the same. This introduce another annoyance: when the mouse cursor is
moved back to 3D canvas, any floating non-modal dialog will NOT get focus, unless the mouse cursor is set to
a hot-tracking widget (e.g. a button that reacts to mouse enter event) in the non-modal dialog. This means
I have to make all controls in the non-modal dialog track with the
mouse movement. But as the application must run as an ActiveX control in another host, I have no controls to
any non-modal dialog displayed by the 3rd party host.
Is there any way to get around this problem? I can give you access to my software if my explanation of the
problem is not clear enough.
I know this is probably not WTL problem per se. But as the entire application is built with WTL, I think my
question is still relevant. Any help is appreciated.