Sign in to follow this  
Followers 0
chssoccer

AHK & AU3

28 posts in this topic

#1 ·  Posted (edited)

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

Share this post


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

Share this post


Link to post
Share on other sites

Look, I'd love to take your advice, honestly, but I've been having a problem with my au3 script that I found done perfectly in an AHK script. All I need to do is incorporate it into my au3 script. How?

Share this post


Link to post
Share on other sites

You will have to compile them as seperate exe's, they will not share information easily.

Share this post


Link to post
Share on other sites

You will have to compile them as seperate exe's, they will not share information easily.

But they will share it nonetheless? I would rather include the file than compile them separately.

Share this post


Link to post
Share on other sites

The only info you will share is by means of command line parameters and exit codes. AutoIt cannot talk with AHK.

Share this post


Link to post
Share on other sites

so how can i use command line parameters and/or exit codes to get this done?

Share this post


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

Share this post


Link to post
Share on other sites

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

Share this post


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

Share this post


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

Share this post


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

 

Share this post


Link to post
Share on other sites

how? wheres the code example?

Share this post


Link to post
Share on other sites

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

how can i do it with version 3.2.8.1?

Share this post


Link to post
Share on other sites

Why don't you install 3.2.10.0 and the latest version of SciTe?

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

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

Share this post


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

 

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

@Chip

Why did you post that for 3.2.10.0? How do I do that in 3.2.8.1?

Edited by chssoccer

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0