Jump to content

help me _GuiCtrlCreateEdit


Recommended Posts

AutoIt uses the control ID as opposed to the return value of _GUICtrl*_Create()'s return value which is a handle. Either use _WinAPI_GetDlgCtrlID() to get the control id and use this ID for the control (not control's items such as listview's, etc..) and use that control ID instead. a Simpler method would be to create the control using the native built in functions of AutoIt the start with GUICtrlCreate* and then you can get the control's handle using GUICtrlGetHandle().

Edit: Moi mistake. Just ignore my mumbling... If you're working only with handle you should use the control's UDF library.

Edited by Authenticity
Link to comment
Share on other sites

If you want to use the built in functions AutoIt has to offer you need to create the control using one of the GUICtrlCreate*() functions. You can later get the handle to this control and work with it on different UDF library.

Example:

#include <GUIConstantsEx.au3>
#include <GUIEdit.au3>

$hGUI = GUICreate("Title", 200, 200)
$Edit = GUICtrlCreateEdit("Line1" & @CRLF & "Line2" & @CRLF & "Line3", 20, 20, 160, 160)
$hEdit = GUICtrlGetHandle(-1)

GUISetState()
MsgBox(0x40, "Info", GUICtrlRead($Edit))
_GUICtrlEdit_AppendText($hEdit, @CRLF & "Line 4" & @CRLF & "Line 5")

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

GUIDelete()
Exit

If you choose however to create the control using _GUICtrlEdit_Create() instead, you can't manipulate the control using AutoIt's GUICtrl* functions.

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