Jump to content

$GUI_EVENT_CLOSE


Recommended Posts

Is there any way to "clear" this message, run code before the form closes, intercept the red "X" and the form Close (Alt_F4) message or change the behavior of $GUI_EVENT_CLOSE?

Sorry for broad scope of my question, I'm just trying to understand what's possible with respect to intercepting / working with the form close event so I can continue to try different options to get this to work. 

I'm messing around with LibVLC and when I close my player window with a button calling a CloseVideoPlayer() function the player closes.  When I call the same function in the  Case $GUI_EVENT_CLOSE section, Autoit hands on the first libvlc dll call. libvlc_media_player_stop($hLibVLC_dll, $VLCMPlayer) ;stop the video.

Any thoughts on other things to try?


    While 1
         Local $GuiMsg = GUIGetMsg(1)
        Switch $GuiMsg[0]

            Case $GUI_EVENT_CLOSE
                Switch $GuiMsg[1]
                    Case $VPlayerWindow
                        ExitLoop
                    Case Else
                        CloseVideoPlayer()
                EndSwitch

            Case $bnClose
                 CloseVideoPlayer()
           EndSwitch            

      Wend

Func CloseVideoPlayer()
    If $VLCMPlayer <> "" Then
        libvlc_media_player_stop($hLibVLC_dll, $VLCMPlayer) ;stop the video
        libvlc_media_player_release($hLibVLC_dll, $VLCMPlayer)
        libvlc_release($hLibVLC_dll, $hVLC)
    EndIf
EndFunc

 

Thanks for anything that might help me figure this out.

Link to comment
Share on other sites

  • Developers

Have a look at the helpfile for

Quote

GUI Reference - OnEvent Mode

as that should give you this option.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...