Nicht modales Fenster schließen?
-
Hi,
ich möchte ein von mir aus meinem Hauptdialog erzeugtes nicht modales
Fenster schließen. Ich habe es mit DestroyWindow versucht, erhalte aber
NULL zurück. Es schlägt also fehl. Und das, obwohl mein HWND mit
FindWindow gültig ist:HWND cls; cls=::FindWindow(NULL,"Testlauf..."); if(cls==NULL) { MessageBox("Window nicht gefunden!"); } //... if(::DestroyWindow(cls)==0) { MessageBox("Konnte Fenster nicht schließen!"); }
-
... und was sagt GetLastError ??
-
Wie immer lohnt es sich einfach mal die Doku zu lesen:
http://msdn.microsoft.com/en-us/library/ms632682(VS.85).aspxA thread cannot use DestroyWindow to destroy a window created by a different thread.