Jump to content
autoitxp

onAutoItExitRegister() getting empty value

Recommended Posts

#include <GUIConstantsEx.au3>
#include <GuiEdit.au3>
#include <WinAPIConv.au3>
#include <WindowsConstants.au3>

Global $g_hEdit

OnAutoItExitRegister("_OnExit")
 Example()


Func Example()
    Local $hGUI
    
    $hGUI = GUICreate("Edit Create", 400, 300)
    $g_hEdit = _GUICtrlEdit_Create($hGUI, "This is a test" & @CRLF & "Another Line", 2, 2, 394, 268)
    GUISetState(@SW_SHOW)

    _GUICtrlEdit_AppendText($g_hEdit, @CRLF & "Append to the end?")

   
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>Example

    Func _OnExit()
    MsgBox(0, '' , _GUICtrlEdit_GetText(  $g_hEdit))
    EndFunc

I'm using windows 10 _OnExit function _GuictrlEdit_GetText() getting empty string ? what is issue ?
 

Share this post


Link to post
Share on other sites

How do you exit the script? 

In case you exit it by a GUI_EVENT_CLOSE event it makes sense as you first do a GUIDelete()!

Jos


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

Share this post


Link to post
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

×
×
  • Create New...