Jump to content

Embed Custom Button In External Program


Bill44th
 Share

Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

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