Jump to content

AHK & AU3


 Share

Recommended Posts

Is it possible and will it work to include an auto hot key script in my autoit program and then call a function from the ahk script, execute it, then continue on with my au3 code? Possible? Will it work? Are there better approachs?

And if possible, how?

Thanks.

Edited by chssoccer
Link to comment
Share on other sites

Is it possible and will it work to include an auto hot key script in my autoit program and then call a function from the ahk script, execute it, then continue on with my au3 code? Possible? Will it work? Are there better approachs?

And if possible, how?

Thanks.

Personally, a better approach, use Autoit entirely and leave AHK out.

But you're opening up a can of something bringing up AHK...

Link to comment
Share on other sites

Example:

$address = "www.google.com"
$result = RunWait(@ComSpec & " /c ping " & $address)
;0 = Success, 1 = Failire
MsgBox(0,"",$result)

You can only return integer exit codes from the compiled program. You will need to post a script for us to help further, there is no reason AutoIt can't do what is in the AHK script.

Link to comment
Share on other sites

Out of curiousity, what exactly are you doing in AHK that you can't accomplish in AutoIt?

The AHK script can copy listbox items from an external non autoit gui listbox into my scripts listview.

I can't figure out how to do that in au3. Thats why Im incorporating the code.

Link to comment
Share on other sites

Example:

$address = "www.google.com"
$result = RunWait(@ComSpec & " /c ping " & $address)
;0 = Success, 1 = Failire
MsgBox(0,"",$result)

You can only return integer exit codes from the compiled program. You will need to post a script for us to help further, there is no reason AutoIt can't do what is in the AHK script.

I don't understand what this script does?
Link to comment
Share on other sites

The AHK script can copy listbox items from an external non autoit gui listbox into my scripts listview.

I can't figure out how to do that in au3. Thats why Im incorporating the code.

This should be doable with AutoIt, _GUICtrlListBox_xxxx functions and _GUICtrlListView_xxxxx functions

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Edit: That was for ListViews not ListBoxes

Read a External Listbox:

#include <GUIListBox.au3>
#include <Array.au3>

Local $sAr = ReadListBoxText("My Listbox", 3)
_ArrayDisplay($sAr)

Func ReadListBoxText($Window, $ControlID)
    Local $lbHwd = ControlGetHandle($Window, '', $ControlID)
    If @error Then Return SetError(1, 0, 0)
    Local $lbCount = _GUICtrlListBox_GetCount($lbHwd) - 1
    Local $lbRet[$lbCount + 1]
    For $nHw = 0 To $lbCount Step 1
        $lbRet[$nHw] = _GUICtrlListBox_GetText($lbHwd, $nHw)
    Next
    Return $lbRet
EndFuncoÝ÷ ØÌË[£.±çZºÚ"µÍÚ[ÛYH    ÑÕRPÛÛÝ[Ë]LÉÝÂÚ[ÛYH  ÑÕRSÝÞ]LÉÝÂÔYÚ[ÛÈÈÈÕTÛÙHÕRHÙXÝ[ÛÈÈÈÜOBÌÍÑÜLHHÕRPÜX]J  ][ÝÓ^HÝÞ    ][ÝËL

NLËLJBÌÍÓÝHHÕRPÝÜX]SÝ
    ][ÝÉ][ÝËNLËÎMBÌÍÒ[]HHÕRPÝÜX]R[]
    ][ÝÉ][ÝË
NLËJBÌÍÐ]ÛHHÕRPÝÜX]P]Û ][ÝÐY[]ÈÝÞ ][ÝË
ÌNMKK
BÕRTÙ]Ý]JÕ×ÔÒÕÊBÑ[YÚ[ÛÈÈÈSÛÙHÕRHÙXÝ[ÛÈÈÂÚ[HB   ÌÍÛÙÈHÕRQÙ]ÙÊ
BÝÚ]Ú    ÌÍÛÙÂØÙH ÌÍÑÕRWÑUSÐÓÔÑB^]ØÙH  ÌÍÐ]ÛBÑÕRPÝÝÞÐYÝ[Ê  ÌÍÓÝKÕRPÝXY
    ÌÍÒ[]JJBÕRPÝÙ]]J  ÌÍÒ[]K   ][ÝÉ][ÝÊB[ÝÚ]ÚÑ[

The Function returns an array.

Edited by Chip
Link to comment
Share on other sites

http://www.autoitscript.com/autoit3/docs/f...rolListView.htm

Come on, there's a whole function for Controling ListBoxes.

ControlListview and ControlCommand if your using 3.2.8.1 will probably be your best bet.

3.2.10.0 introduces a whole bunch of new functionality.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

ControlListview and ControlCommand if your using 3.2.8.1 will probably be your best bet.

3.2.10.0 introduces a whole bunch of new functionality.

ControlListView doesn't control a listbox. All it does is sends a command to a listview.

Edited by chssoccer
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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