OldGuyWalking

Dummy Control Not Triggering

4 posts in this topic

I wanted a quick way to identify screen coordinates and created a simple form.  I also wanted to collect the information. Goal was to move the mouse to different locations, hit a key combination and have the program  collect info for that position and write it to a file.

I couldn't use a button on the form and HotKeys was not recommended (according to some posts I'd read on here).

I discovered GUIAccelerators but I'm stuck on what triggers the accelerator key.  I've looked at the help file for GUISetAccelerators which references GUICtrlCreateDummy and used the code from both of those.  I'm not getting any errors and everything seems to run okay except when I press Ctrl + [F3] nothing is captured. 

This is a work in progress so there's extra code that I haven't cleaned up yet.

Any help would be appreciated. 

Bill

; Displays the Window Handle, Window Text, Control Handle, and mouse position.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=Y
#AutoIt3Wrapper_Res_Comment=Show screen coordinates.
#AutoIt3Wrapper_Res_Description=Show screen coordinates.
#AutoIt3Wrapper_Res_Fileversion=0.0.0.1
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

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

Global $Debug = 0

Dim $sWinTitle
Dim $sWinText
Dim $sWinHnd
Dim $sWinCtrlRef
Dim $sWinCtrlText
Dim $sWinCtrlHnd
Dim $aPos
Dim $mPos
Dim $sMousePos
Dim $sControlPos
Dim $iFile
Dim $sFileLogName = @WorkingDir & "\WinfoFile" & @YDAY & ".log"
Dim $sReport

; HotKeySet("!{Esc}", "Terminate")
; HotKeySet("!{F3}", "WriteLogFile")

#Region ### START Koda GUI section ### Form=F:\AutoIT Apps\Misc Mini Utilities\Coordinates\Coordinates.kxf
Global $Coordinates = GUICreate("Coordinates", 340, 225, 1, 750, -1, $WS_EX_TOPMOST)
Global $lblXPos = GUICtrlCreateLabel("XPos:", 7, 16, 39, 20, $SS_RIGHT)
Global $XPos = GUICtrlCreateLabel("XPos", 95, 16, 36, 20, $SS_RIGHT)
Global $lblYPos = GUICtrlCreateLabel("YPos:", 7, 34, 40, 20, $SS_RIGHT)
Global $YPos = GUICtrlCreateLabel("YPos", 95, 34, 37, 20, $SS_RIGHT)
Global $lblWinTitle = GUICtrlCreateLabel("Window Title:", 7, 61, 84, 20, $SS_RIGHT)
Global $WinTitle = GUICtrlCreateLabel("WinTitle", 95, 61, 250, 20)
Global $lblHandle = GUICtrlCreateLabel("Handle:", 7, 78, 51, 20, $SS_RIGHT)
Global $WinHandle = GUICtrlCreateLabel("Win Handle", 95, 78, 100, 20)
Global $lblCtrlID = GUICtrlCreateLabel("Control ID:", 7, 104, 65, 20, $SS_RIGHT)
Global $ControlID = GUICtrlCreateLabel("ControlID", 95, 104, 100, 20)
Global $lblCtrlText = GUICtrlCreateLabel("Control Text:", 7, 125, 78, 20, $SS_RIGHT)
Global $ControlText = GUICtrlCreateLabel("Control Text", 95, 125, 120, 20)
Global $lblCtrlPos = GUICtrlCreateLabel("Control Pos:", 7, 144, 76, 20, $SS_RIGHT)
Global $ControlPos = GUICtrlCreateLabel("Control Pos", 95, 144, 73, 20)
Global $btnExit = GUICtrlCreateButton("Exit", 8, 192, 75, 25)
Global $sKey1 = GUICtrlCreateDummy()
; Set GUIAccelerators for the button controlID Ctrl + [F3]
Global $aAccelKeys[1][2] = [["^{F3}", $sKey1]]
GUISetAccelerators($aAccelKeys)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    If $nMsg <> 0 Then
        ConsoleWrite("GUIGetMsg = " & $nMsg & @CRLF)
        ConsoleWrite("$sKey1 = " & $sKey1 & @CRLF)
    EndIf

    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            If $nMsg <> 0 Then
                ConsoleWrite("Event Close = " & $nMsg & @CRLF)
            EndIf
            Exit

        Case $btnExit
            If $nMsg <> 0 Then
                ConsoleWrite("Terminate = " & $nMsg & @CRLF)
            EndIf
            Terminate()

        Case $sKey1
            If $nMsg <> 0 Then
                ConsoleWrite("Report = " & $nMsg & @CRLF)
            EndIf
            $iFile = FileOpen($sFileLogName, 1)
            If $iFile = -1 Then
                MsgBox(0, "Error", "Unable to Open WinfoFile")
            EndIf
            $sWinTitle = WinGetTitle("", "")
            $sWinText = WinGetText($sWinTitle)
            $sWinHnd = WinGetHandle($sWinTitle)
            $sWinCtrlRef = ControlGetFocus($sWinHnd)
            $sWinCtrlText = ControlGetText($sWinHnd, "", $sWinCtrlRef)
            $sWinCtrlHnd = ControlGetHandle($sWinHnd, "", $sWinCtrlRef)
            ControlFocus($sWinHnd, "", $sWinCtrlRef)
            $aPos = ControlGetPos($sWinCtrlHnd, "", $sWinCtrlRef)
            $mPos = MouseGetPos()
            If IsString($sWinText) Then
                GUICtrlSetData($WinTitle, $sWinTitle)
            Else
                GUICtrlSetData($WinTitle, "")
            EndIf
            If IsHWnd($sWinHnd) Then
                GUICtrlSetData($WinHandle, $sWinHnd)
            Else
                GUICtrlSetData($WinHandle, "")
            EndIf
            GUICtrlSetData($ControlID, $sWinCtrlRef)
            GUICtrlSetData($ControlText, $sWinCtrlText)
            If IsArray($aPos) Then
                GUICtrlSetData($ControlPos, $aPos[0] & "," & $aPos[1])
                $sControlPos = $aPos[0] & "," & $aPos[1]
            Else
                GUICtrlSetData($ControlPos, "")
                $sControlPos = ""
            EndIf
            If IsArray($mPos) Then
                GUICtrlSetData($XPos, $mPos[0])
                GUICtrlSetData($YPos, $mPos[1])
                $sMousePos = $mPos[0] & "," & $mPos[1]
            Else
                GUICtrlSetData($XPos, "")
                GUICtrlSetData($YPos, "")
                $sMousePos = ""
            EndIf
            $sReport = $sReport & "Window Title     : " & $sWinTitle & @CRLF
            $sReport = $sReport & "Window Text      : " & $sWinText & @CRLF
            $sReport = $sReport & "Window Handle    : " & $sWinHnd & @CRLF
            $sReport = $sReport & "Control Refer    : " & $sWinCtrlRef & @CRLF
            $sReport = $sReport & "Control Text     : " & $sWinCtrlText & @CRLF
            $sReport = $sReport & "Control Handle   : " & $sWinCtrlHnd & @CRLF
            $sReport = $sReport & "Control Position : " & $sControlPos & @CRLF
            $sReport = $sReport & "Mouse Position   : " & $sMousePos & @CRLF
            If $Debug = 1 Then
                ConsoleWrite($sReport & @CRLF)
            EndIf
            FileWriteLine($iFile, "=====================================================")
            FileWriteLine($iFile, $sReport)
            FileWriteLine($iFile, "=====================================================")
            FileClose($iFile)
            If @error = -1 Then
                MsgBox(0, "Error", "Failed")
            Else
                MsgBox(0, "Report", "Report Completed")
            EndIf
    EndSwitch
    $sWinTitle = WinGetTitle("", "")
    $sWinText = WinGetText($sWinTitle)
    $sWinHnd = WinGetHandle($sWinTitle)
    $sWinCtrlRef = ControlGetFocus($sWinHnd)
    $sWinCtrlText = ControlGetText($sWinHnd, "", $sWinCtrlRef)
    $sWinCtrlHnd = ControlGetHandle($sWinHnd, "", $sWinCtrlRef)
    ControlFocus($sWinHnd, "", $sWinCtrlRef)
    $aPos = ControlGetPos($sWinCtrlHnd, "", $sWinCtrlRef)
    $mPos = MouseGetPos()
    If IsString($sWinText) Then
        GUICtrlSetData($WinTitle, $sWinTitle)
    Else
        GUICtrlSetData($WinTitle, "")
    EndIf
    If IsHWnd($sWinHnd) Then
        GUICtrlSetData($WinHandle, $sWinHnd)
    Else
        GUICtrlSetData($WinHandle, "")
    EndIf
    GUICtrlSetData($ControlID, $sWinCtrlRef)
    GUICtrlSetData($ControlText, $sWinCtrlText)
    If IsArray($aPos) Then
        GUICtrlSetData($ControlPos, $aPos[0] & "," & $aPos[1])
        $sControlPos = $aPos[0] & "," & $aPos[1]
    Else
        GUICtrlSetData($ControlPos, "")
        $sControlPos = ""
    EndIf
    If IsArray($mPos) Then
        GUICtrlSetData($XPos, $mPos[0])
        GUICtrlSetData($YPos, $mPos[1])
        $sMousePos = $mPos[0] & "," & $mPos[1]
    Else
        GUICtrlSetData($XPos, "")
        GUICtrlSetData($YPos, "")
        $sMousePos = ""
    EndIf

    ;Sleep(500)
WEnd


Func WriteLogFile()
    Local $iFile
    Local $sFileLogName
    Local $sReport

    $sFileLogName = @WorkingDir & "\WinfoFile" & @YDAY & ".log"
    $iFile = FileOpen($sFileLogName, 1)
    If $iFile = -1 Then
        MsgBox(0, "Error", "Unable to Open WinfoFile")
        Return -1
    EndIf
    $sReport = $sReport & "Window Title     : " & $sWinTitle & @CRLF
    $sReport = $sReport & "Window Text      : " & $sWinText & @CRLF
    $sReport = $sReport & "Window Handle    : " & $sWinHnd & @CRLF
    $sReport = $sReport & "Control Refer    : " & $sWinCtrlRef & @CRLF
    $sReport = $sReport & "Control Text     : " & $sWinCtrlText & @CRLF
    $sReport = $sReport & "Control Handle   : " & $sWinCtrlHnd & @CRLF
    $sReport = $sReport & "Control Position : " & $aPos[0] & "," & $aPos[1] & @CRLF
    $sReport = $sReport & "Mouse Position   : " & $mPos[0] & "," & $mPos[1] & @CRLF
    FileWriteLine($iFile, "=====================================================")
    FileWriteLine($iFile, $sReport)
    FileWriteLine($iFile, "=====================================================")
    FileClose($iFile)
    MsgBox(0, "Report", "Report Completed")
    Return
EndFunc   ;==>WriteLogFile

;======================================================================================
; Function: Terminate Hot Key = Alt+Esc
;======================================================================================
Func Terminate() ; Hot Key = Alt+Esc
    GUIDelete($Coordinates)
    Exit 0
EndFunc   ;==>Terminate

 

Share this post


Link to post
Share on other sites



OGW,

When I run your code I get a file containing this

=====================================================
Window Title     : Coordinates
Window Text      : XPos:
849
YPos:
629
Window Title:
Coordinates
Handle:
0x000000000004024E
Control ID:
Button1
Control Text:
Exit
Control Pos:

Exit

Window Handle    : 0x000000000004024E
Control Refer    : Button1
Control Text     : Exit
Control Handle   : 0x00000000000501F8
Control Position : 
Mouse Position   : 849,629
=====================================================

Check where your working dir is.

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

Kylomas,

I changed @workingdir to @scriptdir (which is what it should have been in the first place.)  But still not triggering or creating a file. Weird that it would work on your computer and not on mine. 

Thank you for testing it.

Argumentum,

Thanks. Good idea. I've done the same thing in VB and VBA when I needed fields in a form to hold values but didn't need the fields to be visible.

Bill

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

  • Similar Content

    • Viki
      By Viki
      This is my first time here so please dont bombard me that what a silly question I am asking!!
      I have 500 rows (A1:A500) in a spreadsheet and I just want to copy one by one row and then paste into another application and then press enter, loop should repeat this until finishes all 500 rows.
      I have looked at clipget(), clip(put() but dont know how to select next row in next turn. I also looked at Array to store but again no luck. Can some guide me please..
    • DineshPawar
      By DineshPawar
      0down votefavorite   In my current project, Excel macro open AutoIt script using a function Call Shell("location of autoit script").
      For proper functioning of AutoIt script it's need to be close parent Excel workbook, so this closing Excel action is written in AutoIt script itself.
      But as soon as AutoIt script close parent Excel workbook then script get pause and it do nothing.
      How open the AutoIt script from Excel workbook and after that parent Workbook get close?
    • AndroidZero
      By AndroidZero
      I want to animate transparent GIFs on my gui.
      I searched, read and tested a lot UDFs
      At the end none fits to me
      I wrote my own animated function, but its flickering sometimes just for a miliseconds but still doesnt looks good.

       
      Below is my code for Testing and also the GIF images you need for it.
      GUIChangeImage() is the Animation Function.
      CODE:
      ;************FOR GATHER HTML SOURCE CODE********************** #include <IE.au3> #include <InetConstants.au3> ;************FOR GUI*********** #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPIFiles.au3> ;**********FOR BUTTON ********** #include <ButtonConstants.au3> #include <StaticConstants.au3> ;**********FOR STRINGS ********** #include <StringConstants.au3> #include <String.au3> ;**********FOR COMBOBOX ********** #include <StringConstants.au3> #include <EditConstants.au3> #include <GuiEdit.au3> #include <GuiComboBox.au3> ;**********FOR FONTS ********** #include <FontConstants.au3> ;**********FOR GIF ANIMATION ********** #include <GIFAnimation.au3> ;**********FOR PROCESS ********** #include <Process.au3> #include <SendMessage.au3> #include <GDIPlus.au3> #include <WinAPIDiag.au3> Opt("GUIOnEventMode",1) Global Const $SC_DRAGMOVE = 0xF012 Global $hGUIAccountCreator Global $graphics_path = @ScriptDir & "\graphics" Global $fontSize_TextBody = 8.5, $fontName_TextBody = "", $fontWeight_TextBody = $FW_BOLD, $fontColor_TextBody = 0x5A2800 GUI_open_AccountCreator() Func GUI_open_AccountCreator() Global $hGUIAccountCreator = GUICreate("Tibia Account Creator - SubZero", 350, 400, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)) GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_Close_AccountCreator") GUICtrlCreatePic($graphics_path & "\WindowAccountCreator.gif", 0, 0, 350, 400) GUICtrlSetState(-1, $GUI_DISABLE) ;********* GUI CONTROLS (LABELS,INPUTS,COMBOBOXES) ********************************************************************** GUICtrlCreateLabel(" Create New Account", 25,47,103,14,$SS_CENTERIMAGE) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetColor(-1,0xFFFFFF) GUICtrlCreateLabel("Account Name:",30,75,75,14) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetColor(-1,0x5A2800) Global $inptBox_Acc = GUICtrlCreateInput("",130,75,150,20) GUICtrlCreateLabel("Email Adress:",30,100,70,14) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetColor(-1,0x5A2800) Global $inptBox_Email = GUICtrlCreateInput("",130,100,150,20) GUICtrlCreateLabel("Password:",30,125,55,14) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetColor(-1,0x5A2800) Global $inptBox_Passwd = GUICtrlCreateInput("",130,125,150,20,$ES_PASSWORD) GUICtrlSetData($inptBox_Passwd, "") GUICtrlCreateLabel("Character Name:",30,170,83,14) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetColor(-1,0x5A2800) Global $inptBox_CharName = GUICtrlCreateInput("",130,170,150,20) GUICtrlCreateLabel("Sex:",30,195,23,14) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1,$fontSize_TextBody,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetColor(-1,$fontColor_TextBody) Global $comboBox_sex = GUICtrlCreateCombo("",130,195,150,20,$CBS_DROPDOWNLIST) ;LoadSexIntoComboBox() GUICtrlCreateLabel("World Location:",30,240,77) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1,$fontSize_TextBody,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetFont(-1,8,$fontWeight_TextBody,0,$fontName_TextBody,1) GUICtrlSetColor(-1,$fontColor_TextBody) Global $comboBox_world = GUICtrlCreateCombo("",130,240,150,20,BitOr($CBS_DROPDOWNLIST, $WS_VSCROLL)) ;LoadWorldsIntoComboBox() Global $label_status = GUICtrlCreateLabel("",20,360,200,30) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) ;********* GUI CONTROLS (LABELS,INPUTS,COMBOBOXES) ********************************************************************** ;********* CONTROL PICS ********************************************************************** Global $btn_randAccName = GUICtrlCreatePic($graphics_path & "\Die_Static.gif", 280, 75, 26, 26) GUICtrlSetTip($btn_randAccName, "Generate a random account name") GUICtrlSetCursor($btn_randAccName,0) ;GUICtrlSetOnEvent($btn_randAccName,"GenerateRandomAccName") GUICtrlSetOnEvent($btn_randAccName,"GUIChangeImage") Global $btn_x = GUICtrlCreatePic("", 315, 5, 40, 36) GUICtrlSetTip($btn_x, "Close") GUICtrlSetCursor($btn_x,0) GUICtrlSetOnEvent($btn_x,"GUI_Close_AccountCreator") Global $btn_donate = GUICtrlCreatePic("", 112, 313, 126, 47) GUICtrlSetTip($btn_donate, "Donate") GUICtrlSetCursor($btn_donate,0) ;GUICtrlSetOnEvent($btn_donate,"Donate") ;********* CONTROL PICS ********************************************************************** ;********* GDI+ DRAW ********************************************************************** _GDIPlus_Startup() Local $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\X_Tic-Tac-Toe_Token.gif") Local $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg) _WinAPI_DeleteObject(GUICtrlSendMsg($btn_x, 0x0172, $IMAGE_BITMAP, $hHBMP)) _GDIPlus_ImageDispose($hImg) Local $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\Die_Static.gif") Local $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg) _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $hHBMP)) _GDIPlus_ImageDispose($hImg) Local $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\btn_donateCC_LG.gif") Local $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg) _WinAPI_DeleteObject(GUICtrlSendMsg($btn_donate, 0x0172, $IMAGE_BITMAP, $hHBMP)) _GDIPlus_ImageDispose($hImg) _GDIPlus_Shutdown() ;********* GDI+ DRAW ********************************************************************** _WinAPI_SetLayeredWindowAttributes($hGUIAccountCreator, 0x26f50b) GUISetIcon(@ScriptDir & "\TibiaInfo.ico") GUISetState(@SW_SHOW, $hGUIAccountCreator) WinSetOnTop($hGUIAccountCreator,"",1) GUIRegisterMsg($WM_LBUTTONDOWN, "_WM_LBUTTONDOWN") EndFunc Func GUIChangeImage() _GDIPlus_Startup() GUICtrlDelete($btn_randAccName) Local $btn_randAccName = GUICtrlCreatePic("", 280, 75, 26, 26) Local $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\Die_Frame2.gif") Local $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg) _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $hHBMP)) _GDIPlus_ImageDispose($hImg) _WinAPI_SetLayeredWindowAttributes($hGUIAccountCreator, 0x26f50b) Sleep(100) GUICtrlDelete($btn_randAccName) Local $btn_randAccName = GUICtrlCreatePic("", 280, 75, 26, 26) Local $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\Die_Frame3.gif") Local $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg) _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $hHBMP)) _GDIPlus_ImageDispose($hImg) _WinAPI_SetLayeredWindowAttributes($hGUIAccountCreator, 0x26f50b) Sleep(100) GUICtrlDelete($btn_randAccName) Local $btn_randAccName = GUICtrlCreatePic("", 280, 75, 26, 26) Local $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\Die_Frame4.gif") Local $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg) _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $hHBMP)) _GDIPlus_ImageDispose($hImg) _WinAPI_SetLayeredWindowAttributes($hGUIAccountCreator, 0x26f50b) Sleep(100) GUICtrlDelete($btn_randAccName) Local $btn_randAccName = GUICtrlCreatePic("", 280, 75, 26, 26) Local $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\Die_Frame5.gif") Local $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg) _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $hHBMP)) _GDIPlus_ImageDispose($hImg) _WinAPI_SetLayeredWindowAttributes($hGUIAccountCreator, 0x26f50b) Sleep(100) GUICtrlDelete($btn_randAccName) Local $btn_randAccName = GUICtrlCreatePic("", 280, 75, 26, 26) GUICtrlSetCursor($btn_randAccName,0) GUICtrlSetOnEvent($btn_randAccName,"GUIChangeImage") Local $hImg = _GDIPlus_ImageLoadFromFile($graphics_path & "\Die_Static.gif") Local $hHBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg) _WinAPI_DeleteObject(GUICtrlSendMsg($btn_randAccName, 0x0172, $IMAGE_BITMAP, $hHBMP)) _GDIPlus_ImageDispose($hImg) _WinAPI_SetLayeredWindowAttributes($hGUIAccountCreator, 0x26f50b) _GDIPlus_Shutdown() EndFunc Func GUI_Close_AccountCreator() Exit EndFunc Func _WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam) _SendMessage($hGUIAccountCreator, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0) EndFunc While 1 Sleep(10) WEnd  
      IMAGES:
       
       








    • ur
      By ur
      I am maintaining all the reusable code in a separate file as library.au3.
      In that file I have referenced some dependent files using fileinstall, so that they will be extracted when necessary.
       
      Problem is, if I use a function in the library.au3 in another script which doesn't require this dependent file, as I am including the whole file using include tag, it is embedding that file also.
      Is there any way to exclude that.
       
    • GAM
      By GAM
      Am trying to execute perl script from autoit script but its not running. Th command that I have given is...
      $rootDir = automation Run("cmd.exe /" & "C:\" & $rootDir & "\updatesource.pl") Can someone help please!