I figured out how to make it work. I needed to use a HotkeyEvent and reactivate my main window at the end of the message handler
HotKeyEvent(1, 0, $102, 0, 0, 0, 0, WinMain) ;message handler Repeat EvntID = WaitEvent() Select EvntID Case $102 If EventData() = 1 result = Confirm("Terminate Game?") If result = True Then End EndIf End Select ActivateGadget WinMain Forever