ENIGMA Forums

Outsourcing saves money => Programming Help => Topic started by: time-killer-games on October 04, 2014, 01:45:29 pm

Title: C++ DestroyWindow() alternative
Post by: time-killer-games on October 04, 2014, 01:45:29 pm
DestroyWindow() closes my browser control but I recently discovered it also causes the game to crash after about 5-10 seconds.

Is there any other means possible I can close my browser window without closing or crashing the parent? GMStudio doesn't seem to like DestroyWindow(), and CloseWindow() doesn't actually close anything it just minimizes.  TerminateProcess() closes everything including the parent process.

Please help.
Title: Re: C++ DestroyWindow() alternative
Post by: Goombert on October 04, 2014, 02:07:15 pm
Hope this helps TKG.
http://stackoverflow.com/questions/2908632/why-does-destroywindow-close-my-application
Title: Re: C++ DestroyWindow() alternative
Post by: time-killer-games on October 04, 2014, 02:19:13 pm
I can't do that because it requires DestroyWindow() which crashes GameMaker.

While using the hwnd param as the game handle can close the game:
Code: [Select]
SendMessage(hWnd, WM_CLOSE, 0, 0);I try the same thing on my browser handle and it just acts like it isn't supposed to do anything which is weird.
Title: Re: C++ DestroyWindow() alternative
Post by: Goombert on October 04, 2014, 02:30:42 pm
This post suggest you can set the parent of it to NULL and then destroy it.
https://forums.ni.com/t5/LabVIEW/Remove-Child-Window-from-Parent-using-WIN-API/td-p/1470888
Title: Re: C++ DestroyWindow() alternative
Post by: time-killer-games on October 04, 2014, 03:07:20 pm
The funny thing is I've already tried setting the parent to the desktop handle a day or two ago and it still crashes. But I'll try it with the parent param as NULL and get back to you! Thank you! I'm a geek in training! ;D
Title: Re: C++ DestroyWindow() alternative
Post by: lonewolff on October 04, 2014, 06:04:11 pm
What does your las result callback for the client window look like?

You aren't doing PostQuitMessage() or something silly like that?
Title: Re: C++ DestroyWindow() alternative
Post by: Goombert on October 04, 2014, 07:16:14 pm
Yes, let's see the code TKG.