Link to home
Start Free TrialLog in
Avatar of shetlandbob
shetlandbob

asked on

openGL in dialog - child window focus

Hi,

I have a MFC Dialog control with an OpenGL window embedded into it and other controls associated also.

One of my controls loads up a child dialog control, however the focus of the child is "lost" and it falls behind the main application (one way to get focus is to press "ALT" but this is obviously not ideal!!!).

I've tried a few things but they dont seem to work (such as setfocus, setforegroundwindow etc..) although I'm open to any suggestions!!!

On a side note, if the child dialog is modeless then this problem is not evident!!

Anyone experienced this? Or any ideas on how to fix it?

As always much appreciated.

Cheers
Avatar of nabehs
nabehs

Did u try BringWindowToTop(hwnd) API function?
Avatar of shetlandbob

ASKER

Thanks for the reply

yes I've tried that and it returns a TRUE as if the function is successful, but the window remains behind the main application.
i found a solution on line at

http://steinsoft.net/index.php?site=Programming/Tutorials/opengl_dialog

for any one interested
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial