Wie bekommt ein Fenster den Fokus, wenn Parent DesktopWindow ist?
-
Hi!
Ich habe ein Control, welches ein Fenster mit einem CEdit-Control öffnet.
Soweit gut, nur leider bekommt das Eingabe-Control nicht den Fokus, wenn ich als Parent GetDesktopWindow() angebe.Geht nicht:
VERIFY(m_EingabeWindow.CreateEx(WS_EX_TOOLWINDOW,
szClassName,NULL,
WS_THICKFRAME | WS_CHILD | WS_BORDER |
WS_CLIPSIBLINGS | WS_OVERLAPPED,
CRect(rcWnd.left, rcWnd.top +20, rcWnd.left+ 200, rcWnd.top+200),
GetDesktopWindow(),
0x3E8, NULL));Geht:
VERIFY(m_EingabeWindow.CreateEx(WS_EX_TOOLWINDOW,
szClassName,NULL,
WS_THICKFRAME | WS_CHILD | WS_BORDER |
WS_CLIPSIBLINGS | WS_OVERLAPPED ,
CRect(rcWnd.left, rcWnd.top +20, rcWnd.left+ 200, rcWnd.top+200),
AfxGetMainWnd(),
0x3E8, NULL));Hier lässt sich das Fenster dann aber nicht über den Dialog hinaus vergrößern.
Die Kombi -> Control -> Window -> CEdit muss leider so sein. GetDesktopWindow() nutze ich deshalb, damit das CDialog, welcher das Control beherbergt, nicht inaktiv wird. Klappt bis dahin ja auch, nur bekommt der Eingabecontrol nicht den Fokus.
Weiß jemand, wie es doch gehen könnte?
-
Hat hier niemand eine Antwort für mich?????