Jump to content

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 ?
 

Link to comment
Share on other sites

  • Developers

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 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...