Pages: 1
  Print  
Author Topic: C++ DestroyWindow() alternative  (Read 1708 times)
Offline (Male) time-killer-games
Posted on: October 04, 2014, 01:45:29 PM

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1169

View Profile Email
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.
Logged
Offline (Male) Goombert
Reply #1 Posted on: October 04, 2014, 02:07:15 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3151

View Profile
Hope this helps TKG.
http://stackoverflow.com/questions/2908632/why-does-destroywindow-close-my-application
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) time-killer-games
Reply #2 Posted on: October 04, 2014, 02:19:13 PM

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1169

View Profile Email
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.
Logged
Offline (Male) Goombert
Reply #3 Posted on: October 04, 2014, 02:30:42 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3151

View Profile
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
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) time-killer-games
Reply #4 Posted on: October 04, 2014, 03:07:20 PM

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1169

View Profile Email
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
Logged
Offline (Unknown gender) lonewolff
Reply #5 Posted on: October 04, 2014, 06:04:11 PM
"Guest"


Email
What does your las result callback for the client window look like?

You aren't doing PostQuitMessage() or something silly like that?
Logged
Offline (Male) Goombert
Reply #6 Posted on: October 04, 2014, 07:16:14 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3151

View Profile
Yes, let's see the code TKG.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Pages: 1
  Print