Jump to content
Sign in to follow this  
Bill44th

Embed Custom Button In External Program

Recommended Posts

Bill44th

I'm trying to embed my own custom button (created by autoit) into an existing program (not made by autoit). Then I want to launch some function from autoit when it is pressed. Does anyone know how to do that?

I can embed the button, for instance, using:

#include <GUIConstantsEx.au3>
#include <GuiButton.au3>
#include <WindowsConstants.au3>

Run("c:\program files\mozilla firefox\firefox.exe")
WinWaitActive("Mozilla","")
$foxHdl = WinGetHandle("Mozilla","")
$btn1 = _GUICtrlButton_Create($foxHdl, "Check1", 50, 20, 100, 50, $BS_PUSHLIKE)

While 1
 $msg=GUIGetMsg()
 Select
    case $msg = $btn1
        MsgBox(0,0,"Test worked")
    case Else
 EndSelect
WEnd
Exit

The button will show up, but doesn't seem to respond to me clicking it. I won't actually be embedding the button in to firefox...just using that as an example. I've tried searching the forum...but I can't find any info one my problem with the keywords I've been using.

Thanks for your help!

Edited by Bill44th

Share this post


Link to post
Share on other sites
rover

I'm trying to embed my own custom button (created by autoit) into an existing program (not made by autoit). Then I want to launch some function from autoit when it is pressed. Does anyone know how to do that?

I can embed the button, for instance, using:

#include <GUIConstantsEx.au3>
#include <GuiButton.au3>
#include <WindowsConstants.au3>

Run("c:\program files\mozilla firefox\firefox.exe")
WinWaitActive("Mozilla","")
$foxHdl = WinGetHandle("Mozilla","")
$btn1 = _GUICtrlButton_Create($foxHdl, "Check1", 50, 20, 100, 50, $BS_PUSHLIKE)

While 1
 $msg=GUIGetMsg()
 Select
    case $msg = $btn1
        MsgBox(0,0,"Test worked")
    case Else
 EndSelect
WEnd
Exit

The button will show up, but doesn't seem to respond to me clicking it. I won't actually be embedding the button in to firefox...just using that as an example. I've tried searching the forum...but I can't find any info one my problem with the keywords I've been using.

Thanks for your help!

have a look at ANYGUI

http://www.autoitscript.com/forum/index.php?showtopic=9517

seems to be no longer updated by the author 'quaizywabbit',

but 'Volly' has done one update.

http://www.autoitscript.com/forum/index.ph...mp;#entry515205

the UDF will need its includes updated.

replace

#include <guiconstants.au3>

#include "guilist.au3"

with

#include <Constants.au3>

#include <WindowsConstants.au3>

#include <GuiListBox.au3>


I see fascists...

Share this post


Link to post
Share on other sites
Bill44th

have a look at ANYGUI

http://www.autoitscript.com/forum/index.php?showtopic=9517

seems to be no longer updated by the author 'quaizywabbit',

but 'Volly' has done one update.

http://www.autoitscript.com/forum/index.ph...mp;#entry515205

the UDF will need its includes updated.

replace

#include <guiconstants.au3>

#include "guilist.au3"

with

#include <Constants.au3>

#include <WindowsConstants.au3>

#include <GuiListBox.au3>

Thanks Rover! That's just what I needed!

Share this post


Link to post
Share on other sites
rover

Thanks Rover! That's just what I needed!

glad to help

good luck with it


I see fascists...

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
Sign in to follow this  

×