Jump to content
BBs19

MetroGUI UDF v5.1 - Windows 10 style buttons, toggles, radios, menu etc.

Recommended Posts

yuhomesheng

very nice

Share this post


Link to post
Share on other sites
BBs19
On 3/15/2018 at 4:11 PM, Reekod said:

Hi there 

really nice work, why don't you share the 5.2 version used in your TV shows APPS ? 

the _List_CreateGUI is a pure and wonderfull advance for Auto-it scripting

regards


 

Hi, I didn't really test it or document anything of that version.

I am taking a break at the moment. TV-Show-Manager used the last of my resources :P

I will eventually start programming again and fix MetroGUI UDF.

The way I am creating custom lists is nothing special. The main problem is the limitation of Windows. After a certain size, it will stop drawing the items at the bottom and they will end up all at the same spot. I had this problem when I created custom graphs with + 200 Items. So not sure if it is worth adding to MetroUDF.

Share this post


Link to post
Share on other sites
x_bennY
Posted (edited)

how could i change de text of a button? the guictrlsetdata() doesn't work

Edited by x_bennY

Share this post


Link to post
Share on other sites
Rex

@x_bennY

Search and you will find :)

On 27/10/2017 at 4:47 PM, BBs19 said:

You can't edit the text of buttons as they are pictures, they need to be recreated to edit the text. I might add this later, but for now you can use two buttons and hide one if you for example want a button that switches between Start / Stop

  • Like 1

Share this post


Link to post
Share on other sites
No_Name

how do create multi Tab for metro gui ?

Share this post


Link to post
Share on other sites
nhockm4v

help me how to use guictrlsetdata on _Metro_CreateButtonex

Share this post


Link to post
Share on other sites
Rex

@nhockm4v

Same Question was asked 3 posts above yours, and the answer is just 2 post above yours :)

 

Cheers
/Rex

 

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites
pintas
Posted (edited)

Can i change an existing button color, or do i have to recreate the button?

Sorry if the question seems silly, i couldn't find an answer in the thread.

Edit: Ok, i guess it's the same answer as above...

Edited by pintas

Share this post


Link to post
Share on other sites
lpduy

I surgest add base control as label, group, combo, input.

For a sample:

Func _Metro_CreateLabel($Text,$x,$y,$w,$h,$tyle=-1,$xstyle =-1,$Font_Color = $FontThemeColor, $Font = "Segoe UI", $Fontsize = "12")
$hLabel = GUICtrlCreateLabel($Text,$x,$y,$w,$h,$tyle,$xstyle)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($hLabel), "wstr", 0, "wstr", 0)
    GUICtrlSetFont($hLabel, $Fontsize, 500, 0, $Font)
    GUICtrlSetColor($hLabel, $Font_Color)
    Return $hLabel
EndFunc

Func _Metro_CreateGroup($Text,$x,$y,$w,$h,$tyle=-1,$xstyle =-1,$Font_Color = $FontThemeColor, $Font = "Segoe UI", $Fontsize = "12")
$hgroup = GUICtrlCreateGroup($Text,$x,$y,$w,$h,$tyle,$xstyle)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($hgroup), "wstr", 0, "wstr", 0)
    GUICtrlSetFont($hgroup, $Fontsize, 500, 0, $Font)
    GUICtrlSetColor($hgroup, $Font_Color)
    Return $hgroup
EndFunc

Func _Metro_CreateInput($Text,$x,$y,$w,$h,$tyle=-1,$xstyle =-1,$BG_Color = $GUIThemeColor,$Font_Color = $FontThemeColor, $Font = "Arial", $Fontsize = "9")
    $hInput = GUICtrlCreateInput($Text,$x,$y,$w,$h,$tyle,$xstyle)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($hInput), "wstr", 0, "wstr", 0)
    GUICtrlSetFont($hInput, $Fontsize, 400, 0, $Font)
    GUICtrlSetColor($hInput, $Font_Color)
    GUICtrlSetBkColor($hInput,$GUIThemeColor)
    _cHvr_Register($hInput, "_iHoverOff", "_iHoverOn")
    Return $hInput
EndFunc

Func _Metro_CreateCombo($Text,$x,$y,$w,$h,$tyle=-1,$xstyle =-1,$BG_Color = $GUIThemeColor,$Font_Color = $FontThemeColor, $Font = "Arial", $Fontsize = "9")
    $hcombo = GUICtrlCreateCombo($Text,$x,$y,$w,$h,$tyle,$xstyle)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($hcombo), "wstr", 0, "wstr", 0)
    GUICtrlSetFont($hcombo, $Fontsize, 400, 0, $Font)
    GUICtrlSetColor($hcombo, $Font_Color)
    GUICtrlSetBkColor($hcombo,$GUIThemeColor)
    Return $hcombo
EndFunc

 

Share this post


Link to post
Share on other sites
lenclstr746

I 'm new on metrogui udf.
I have a ask, I click checkbox but checkbox is not checked ???

And I want to add $GUI_CLOSE_EVRNT but ı get a error

#include <MetroGUI_UDF.au3>
HotKeySet("{ESC}","_exit")
$1 = _Metro_CreateGUI("NpcBot",500,500)
_Metro_AddControlButtons(True,False,True,False)
_Metro_CreateCheckbox("X-2 NPC",10,10,150,24)
_Metro_SetGUIOption($1,True,False)
GUISetState(@SW_SHOW)
While 1
;~ $nMsg = GUIGetMsg()
;~ Switch $nMsg
;~     Case $GUI_EVENT_CLOSE
;~             Exit
;~     Case $GUI_EVENT_MINIMIZE
;~         Exit
;~ EndSwitch
WEnd
Func _exit()
    Exit
EndFunc

Share this post


Link to post
Share on other sites
lifesaverr

Hi there. First of all, i ADORE your UDF!

My programming skills are Novice. I am learning autoIT to automatize some of my task at work.

I am having a hard time with Metro checkboxes and Array. 

 

i Used to have a script that create a ticket in our IT ticketing System. 

here is my old code : 

 

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Version=Beta
#AutoIt3Wrapper_Icon=Media\newhire.ico
#AutoIt3Wrapper_Outfile=..\Addon\NewHire.exe
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_Fileversion=4.0.0.34
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.14.2
 Author:         JJ

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <AutoItConstants.au3>
#include 'ExtInputBox.au3'
#include <ComboConstants.au3>
#include <DateTimeConstants.au3>
#include <EditConstants.au3>
#include <Date.au3>
#include <Timers.au3>
#include <GuiComboBox.au3>

;Global variable for the entire script

Global $sFileVersion = FileGetVersion(@AutoItExe)

Global $g_bPaused = False
HotKeySet("{ESC}", "Terminate")
HotKeySet("{PAUSE}", "TogglePause")



preform()

Func preform()

;#Region ### START Koda GUI section ### Form=
Global $preform = GUICreate("Pre-Script Form", 401, 351, 617, 452)
$Prefixlabel = GUICtrlCreateLabel("Employe State", 8, 16, 100, 21)

    Global $prefixroot = GUICtrlCreateCombo("", 144, 16, 169, 21, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))

        GUICtrlSetData(-1, "New Hire|Mat leave Return|Transfert")
        GUICtrlSetTip(-1, "Choose Employee State")

    Global $Nameroot = GUICtrlCreateInput("", 144, 48, 169, 21)
        GUICtrlSetTip(-1, "Enter Full Name")

            $Namelabel = GUICtrlCreateLabel("Employe Name", 8, 48, 100, 21)
            GUICtrlSetTip(-1, "Please enter FULL NAME")

    Global $Usernameroot = GUICtrlCreateInput("", 144, 80, 169, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_UPPERCASE))
        GUICtrlSetTip(-1, "Enter Username")

            $Usernamelabel = GUICtrlCreateLabel("Employe Username", 8, 80, 100, 21)
            GUICtrlSetTip(-1, "Please Enter Username")

    Global $sameprofileroot = GUICtrlCreateInput("", 144, 176, 169, 21)
        GUICtrlSetTip(-1, "Please type Employe Peers")

            $profilelabel = GUICtrlCreateLabel("Same Profile As :", 8, 176, 100, 21)

    Global $deviceroot = GUICtrlCreateCombo("", 144, 112, 169, 21, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
        GUICtrlSetData(-1, "Laptop|Desktop")

            $devicelabel = GUICtrlCreateLabel("Employe Device :", 8, 112, 100, 21)
            GUICtrlSetTip(-1, "Please choose employe device type")

    Global $startdateroot = GUICtrlCreateDate( _NowDate() , 144, 144, 169, 17, 0)
        GUICtrlSetTip(-1, "Please choose start date")

            $timelabel = GUICtrlCreateLabel("Employe Start Date :", 8, 144, 100, 21)

    Global $Locationroot = GUICtrlCreateCombo("", 144, 208, 169, 21, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
        GUICtrlSetData(-1, "Internal Permanent|Internal Contractor|External Permanent|External Contractor")

            $locationlabel = GUICtrlCreateLabel("Employe Location :", 8, 208, 94, 17)
            GUICtrlSetTip(-1, "Please choose Employe Location")

    Global $officemoveroot = GUICtrlCreateDate( _NowDate() , 144, 240, 169, 21,0)
        GUICtrlSetTip( -1, " Please choose Office set up date" &@crlf& " If not sceduled, put the start date")

            $officemovelabel = GUICtrlCreateLabel("Office Set Up Date :",8, 240, 94, 17)

    Global $trainingdateroot = GUICtrlCreateDate( _NowDate() , 144, 272, 169, 21,0)
        GUICtrlSetTip( -1, " Please select Training date" &@crlf& " If not sceduled, put the start date")

            $trainingdatelabel = GUICtrlCreateLabel("Training Date :",8, 272, 94, 17)



$PreStart = GUICtrlCreateButton("Send ", 136, 314, 137, 25, BitOR($BS_PUSHLIKE,$WS_BORDER))
GUICtrlSetTip(-1, "Send Entered values to the Main New Hire GUI")



GUISetState()
;#EndRegion ### END Koda GUI section ###

While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                GUISetState(@SW_HIDE, $preform)
                ExitLoop

            case $PreStart
                GUISetState(@SW_HIDE, $preform)

                ExitLoop


        EndSwitch
    WEnd

EndFunc     ;==>preform



#Region ### START Koda GUI section ### Form=H:\Autoit\Forms\epack.kxf
Global $prefix = GUICtrlRead($prefixroot)
Global $Name = GUICtrlRead($Nameroot)
Global $username = GUICtrlRead($Usernameroot)
Global $sameprofile = GUICtrlRead($sameprofileroot)
Global $device = GUICtrlRead($deviceroot)
Global $startdate = GUICtrlRead($startdateroot)
Global $location = GUICtrlRead($Locationroot)
Global $officemove = GUICtrlRead($officemoveroot)
Global $trainingdate = GUICtrlRead($trainingdateroot)
Global $timer= TimerInit()

 $Mainform = GUICreate( $prefix&  " Ticket Creator For: " &$Name, 600, 400, 786, 251)
    GUISetIcon("V:\_Department\IT\IT-Support\Lazy IT 2018 R2 version 1.029838.1282805 Revision 99.2\Source\Media\pirate.ico")


$Label1 = GUICtrlCreateLabel("Select the services", 35, 8, 146, 20)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")

 $Label2 = GUICtrlCreateLabel("Required for " &$Name, 35, 25, 300, 30)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")

$Label3 = GUICtrlCreateLabel("Ticket Assignee", 235, 8, 300, 30)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")

 $Button1 = GUICtrlCreateButton("Select All", 500, 80, 89, 25, $WS_GROUP)
    GUICtrlSetTip(-1, "Select all Services")

 $Button2 = GUICtrlCreateButton("Clear All", 500, 112, 89, 25, $WS_GROUP)
    GUICtrlSetTip(-1, "Clear all selected services")

 $Button3 = GUICtrlCreateButton("Start!", 450, 310, 139, 50, $WS_GROUP)
    GUICtrlSetTip(-1, "Start the script and enjoy doing nothing!")

 $Button5 = GUICtrlCreateButton("Please Read", 500, 176, 89, 25, $WS_GROUP)

 $Button404 = GUICtrlCreateButton("Add Computer", 500, 48, 89, 25, $WS_GROUP)


$laptopassigne = GUICtrlCreateCombo("IT", 235, 48, 85, 17, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1,"LAMD4|PISCIONR|COSTEAP")


$iphoneassigne = GUICtrlCreateCombo("IT", 235, 72, 85, 17, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "IT1|IT2|IT3|IT4")


$ipadassigne = GUICtrlCreateCombo("IT", 235, 96, 85, 17, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "IT1|IT2|IT3|IT4")


$ciscoassigne = GUICtrlCreateCombo("IT", 235, 120, 85, 17, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "IT1|IT2|IT3|IT4")


$networkassigne = GUICtrlCreateCombo("IT", 235, 144, 85, 17, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "IT1|IT2|IT3|IT4")


$gridassigne = GUICtrlCreateCombo("IT", 235, 168, 85, 17, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "IT1|IT2|IT3|IT4")


$officeassigne = GUICtrlCreateCombo("IT", 235, 188, 85, 17, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "IT1|IT2|IT3|IT4")


$trainingassigne = GUICtrlCreateCombo("IT", 235, 208, 85, 17, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "IT1|IT2|IT3|IT4")



 $Button4 = GUICtrlCreateButton("Exit", 500, 144, 89, 25, $WS_GROUP)
    
$namevalidation = GUICtrlCreateLabel ("Full Name is: "&$Name, 8, 230, 560, 17)
    GUICtrlSetFont (-1,9, 800); bold

$uservalidation = GUICtrlCreateLabel ("Username is:  " &$UserName, 8, 250, 560, 17)
    GUICtrlSetFont (-1,9, 800); bold

$locationvalidation = GUICtrlCreateLabel ("Location is: " &$location, 8, 270, 560, 17)
    GUICtrlSetFont (-1,9, 800); bold

$profilevalidation = GUICtrlCreateLabel ("Same Profile is:  " &$sameprofile, 8, 290, 430, 17)
    GUICtrlSetFont (-1,9, 800); bold

$datevalidation = GUICtrlCreateLabel ("Start Date is: " &$startdate, 8, 310, 430, 17)
    GUICtrlSetFont (-1,9, 800); bold

$officevalidation = GUICtrlCreateLabel ("Office Setup deadline is: " &$officemove, 8, 330, 430, 17)
    GUICtrlSetFont (-1,9, 800); bold

$button6 = GUICtrlCreateButton ("Re-Enter values", 460, 360, 120, 25)
    GUICtrlSetTip(-1, "Re-enter Startup information in case of a misstype")

$versionlabel = GUICtrlCreateLabel ( "Version " & $sFileVersion , 8, 380, 161, 41)
    GUICtrlSetFont (-1,9, 800); bold





dim $checkbox[8]
 $checkbox[0] = GUICtrlCreateCheckbox($device, 8, 48, 100, 17)
 $checkbox[1] = GUICtrlCreateCheckbox("Iphone", 8, 72, 100, 17)
 $checkbox[2] = GUICtrlCreateCheckbox("Ipad + SIM Card", 8, 96, 100, 17)
 $checkbox[3] = GUICtrlCreateCheckbox("Cisco Extension", 8, 120, 100, 17)
 $checkbox[4] = GUICtrlCreateCheckbox("Network", 8, 144, 100, 17)
 $checkbox[5] = GUICtrlCreateCheckbox("Grid Card", 8, 168, 100, 17)
 $checkbox[6] = GUICtrlCreateCheckbox("Office Set-Up", 8, 188, 100, 17)
 $checkbox[7] = GUICtrlCreateCheckbox("User Training / Onboarding", 8, 208, 150, 17)




GUISetState()

#EndRegion ### END Koda GUI section ###




While 1
$nMsg = GUIGetMsg()



Select

    Case $nMsg = $GUI_EVENT_CLOSE
Exit
    Case $nMsg = $Button1   ;Check All
            For $n = 0 To UBound($checkbox) - 1
            ;For $n = 0 To 7 Step 1
                GUICtrlSetState ( $checkbox[$n] , $GUI_CHECKED )
            Next

    case $nmsg = $Button2   ;Clear All
            For $n = 0 To UBound($checkbox) - 1
            ;For $n = 0 To 7 Step 1
                GUICtrlSetState ( $checkbox[$n] , $GUI_UNCHECKED )
            Next

    case $nmsg = $Button3   ;Start script

    Sleep(400)

$fSelection = False
For $n = 0 To UBound($checkbox) - 1
    If BitAND(GUICtrlRead($checkbox[$n]), $GUI_CHECKED) Then
        $fSelection = True

        ExitLoop
    EndIf
Next

Global $laptopread = GUICtrlRead($laptopassigne)

Global $iphoneread = GUICtrlRead($iphoneassigne)

Global $ipadread = GUICtrlRead($ipadassigne)

Global $ciscoread = GUICtrlRead($ciscoassigne)

Global $networkread = GUICtrlRead($networkassigne)

Global $gridread = GUICtrlRead($gridassigne)

Global $officeread = GUICtrlRead($officeassigne)

Global $trainingread = GUICtrlRead($trainingassigne)


If $fSelection Then
    $answer = msgBox(36, 'Preparing the beast', $device & ' Ticket will be assigned to :' &$laptopread & @CRLF&@CRLF& "iPhone ticket will be assigned to :
    
    " & $iphoneread & @CRLF&@CRLF& "iPad ticket will be assigned to : " & $ipadread& @CRLF&@CRLF& "Cisco ticket will be assigned to : " & $ciscoread& 
    
    @CRLF&@CRLF& "Network ticket will be assigned to : " &  $networkread& @CRLF&@CRLF& "Grid card ticket will be assigned to : " & $gridread& @CRLF&@CRLF& 
    
    "Office Set-Up ticket will be assigned to : " & $officeread& @CRLF&@CRLF& "Training/Onboarding ticket will be assigned to : " & $trainingread)
     
     if $answer = 6 then
            $status0 = GUICtrlRead($checkbox[0])
            $status1 = GUICtrlRead($checkbox[1])
            $status2 = GUICtrlRead($checkbox[2])
            $status3 = GUICtrlRead($checkbox[3])
            $status4 = GUICtrlRead($checkbox[4])
            $status5 = GUICtrlRead($checkbox[5])
            $status6 = GUICtrlRead($checkbox[6])
            $status7 = GUICtrlRead($checkbox[7])


            If $status0 = 1 then call ("laptop")
            If $status1 = 1 then call ("iphone")
            If $status2 = 1 then call ("ipad")
            If $status3 = 1 then call ("cisco")
            If $status4 = 1 then call ("network")
            If $status5 = 1 then call ("grid")
            If $status6 = 1 then call ("office")
            If $status7 = 1 then call ("training")


        endif
        if $answer = 8 Then

        EndIf
Else
    MsgBox(48, 'No Items Selected', 'You have not selected any services, Please select from the list')
EndIf



    case $nmsg = $Button4   ;exit script

            Exit

    Case $nmsg = $button6   ;restart script

        Run ("V:\_Department\IT\IT-Support\Lazy IT 2018 R2 version 1.029838.1282805 Revision 99.2\addon\NewHire.exe")
            GUIDelete($Mainform)

        Exit




    case $nmsg = $Button5   ;Display ReadMe
            MsgBox(64, 'Please Read. . .', '1) You need to have HPSM oppened on your main screen.' & @CRLF & @CRLF & '2) Make sure Chrome is not zoomed in or out, Else SCRIPT WILL FAIL. ' &@CRLF & @CRLF & '3) To be added')

    Case $nmsg = $Button404
        Run ("V:\_Department\IT\IT-Support\SoftwaresAll\PC-NameCreator\Add new Computer.bat")



    EndSelect
WEnd






;Functions for each Services
Func laptop()

WinClose($Mainform, $prefix&  " Ticket Creator For: " &$Name)


    ;Point on incident and click on create incident
MouseClick($MOUSE_CLICK_LEFT, 32, 349)
        Sleep(400)
    MouseClick($MOUSE_CLICK_LEFT, 150,408)
Sleep(2450)


;click on the app/service and press enter
    MouseClick($MOUSE_CLICK_LEFT, 385, 387)
    sleep(1000)
Send("RLX-*ONSITE*")
    sleep(1000)
Send("{ENTER}")
    sleep(2000)

;assign it to the person specified in $assignee
Sleep (2600)
    MouseClick($MOUSE_CLICK_LEFT, 1457, 417)
    sleep(300)
        Send ($laptopread)
    sleep(300)
    Send("{ENTER}")
Sleep (500)

;Click Description, select all, delete template
Sleep (500)
    MouseClick($MOUSE_CLICK_LEFT, 867, 496)
        Send("^a")
            Send("{BS}")
                send($prefix& " :" &$username&@CRLF& "Start Date: " &$startdate&@CRLF& "Laptop / Desktop: " &$device&@CRLF& "Grid Card : Yes" &@CRLF& "Same profile as: " &$sameprofile )




;fill up contact and title
    MouseClick($MOUSE_CLICK_LEFT, 323, 232)
        Send($username)
            Sleep(2000)
                MouseClick($MOUSE_CLICK_LEFT, 375, 233)
                Sleep(1700)
            MouseMove(242, 200)
                sleep(1400)
            MouseClick($MOUSE_CLICK_LEFT, 242, 200)
            Sleep(450)
            MouseClick($MOUSE_CLICK_LEFT, 248, 200)
        sleep(3000)
    send($prefix& " :" &$Name& " , New Computer")





;Choose Enhancement incident type , Request for information category and Proactive source
        sleep(100)
        MouseClick($MOUSE_CLICK_LEFT, 1651, 791)
                Send("{DOWN 10}")

        MouseClick($MOUSE_CLICK_LEFT, 1598, 825)
                Send("{DOWN 1}")

        MouseClick($MOUSE_CLICK_LEFT, 1587, 854)
                Send("{DOWN 10}")




;save&Exit ticket

            MouseMove(199, 171)
        sleep(300)
            MouseClick($MOUSE_CLICK_LEFT, 199, 171)
        Sleep(2000)

sleep(2000)
EndFunc

Func iphone()

WinClose($Mainform, $prefix&  " Ticket Creator For: " &$Name)

    ;Point on incident and click on create incident
MouseClick($MOUSE_CLICK_LEFT, 32, 349)
        Sleep(400)
    MouseClick($MOUSE_CLICK_LEFT, 150,408)
Sleep(2450)


;click on the app/service and press enter
    MouseClick($MOUSE_CLICK_LEFT, 385, 387)
    sleep(1000)
Send("RLX-*ONSITE*")
    sleep(1000)
Send("{ENTER}")
    sleep(2000)

;assign it to the person specified in $assignee
Sleep (2600)
    MouseClick($MOUSE_CLICK_LEFT, 1457, 417)
    sleep(300)
        Send($iphoneread)
    sleep(300)
    Send("{ENTER}")
sleep(500)

;Click Description, select all, delete template
Sleep (500)
    MouseClick($MOUSE_CLICK_LEFT, 867, 496)
        Send("^a")
            Send("{BS}")
                    send($prefix& " : "  &$username&@CRLF& "Start Date: " &$startdate&@CRLF& "Same profile as: " &$sameprofile&@CRLF& "Internal/External: " &$location&@CRLF& "Require Iphone" )




;fill up contact and title
    MouseClick($MOUSE_CLICK_LEFT, 323, 232)
        Send($username)
            Sleep(2000)
                MouseClick($MOUSE_CLICK_LEFT, 375, 233)
                Sleep(1700)
            MouseMove(242, 200)
                sleep(1400)
            MouseClick($MOUSE_CLICK_LEFT, 242, 200)
            Sleep(450)
            MouseClick($MOUSE_CLICK_LEFT, 248, 200)
        sleep(3000)
    send($prefix& " : "  &$Name& " , New iPhone")






;Choose Enhancement incident type , Request for information category and Proactive source

        MouseClick($MOUSE_CLICK_LEFT, 1651, 791)
                Send("{DOWN 10}")

        MouseClick($MOUSE_CLICK_LEFT, 1598, 825)
                Send("{DOWN 1}")

        MouseClick($MOUSE_CLICK_LEFT, 1587, 854)
                Send("{DOWN 10}")




;save&Exit ticket

            MouseMove(199, 171)
        sleep(300)
            MouseClick($MOUSE_CLICK_LEFT, 199, 171)
        Sleep(2000)




sleep(2000)


EndFunc

Func ipad()

WinClose($Mainform, $prefix&  " Ticket Creator For: " &$Name)

    ;Point on incident and click on create incident
MouseClick($MOUSE_CLICK_LEFT, 32, 349)
        Sleep(400)
    MouseClick($MOUSE_CLICK_LEFT, 150,408)
Sleep(2450)


;click on the app/service and press enter
    MouseClick($MOUSE_CLICK_LEFT, 385, 387)
    sleep(1000)
Send("RLX-*ONSITE*")
    sleep(1000)
Send("{ENTER}")
    sleep(2000)

;assign it to the person specified in $assignee
Sleep (2600)
    MouseClick($MOUSE_CLICK_LEFT, 1457, 417)
    sleep(300)
        Send($ipadread)
    sleep(300)
    Send("{ENTER}")
Sleep (500)

;Click Description, select all, delete template
Sleep (500)
    MouseClick($MOUSE_CLICK_LEFT, 867, 496)
        Send("^a")
            Send("{BS}")
    send($prefix& " : "  &$username&@CRLF& "Start Date: " &$startdate&@CRLF& "Same profile as: " &$sameprofile&@CRLF& "Internal/External: " &$location&@CRLF& "Require Ipad" )




;fill up contact and title
    MouseClick($MOUSE_CLICK_LEFT, 323, 232)
        Send($username)
            Sleep(2000)
                MouseClick($MOUSE_CLICK_LEFT, 375, 233)
                Sleep(1700)
            MouseMove(242, 200)
                sleep(1400)
            MouseClick($MOUSE_CLICK_LEFT, 242, 200)
            Sleep(450)
            MouseClick($MOUSE_CLICK_LEFT, 248, 200)
        sleep(3000)
    send($prefix& " : "  &$Name& " , New iPad")





;Choose Enhancement incident type , Request for information category and Proactive source

        MouseClick($MOUSE_CLICK_LEFT, 1651, 791)
                Send("{DOWN 10}")

        MouseClick($MOUSE_CLICK_LEFT, 1598, 825)
                Send("{DOWN 1}")

        MouseClick($MOUSE_CLICK_LEFT, 1587, 854)
                Send("{DOWN 10}")




;save&Exit ticket

            MouseMove(199, 171)
        sleep(300)
            MouseClick($MOUSE_CLICK_LEFT, 199, 171)
        Sleep(3000)


sleep(2000)

EndFunc

Func cisco()

WinClose($Mainform, $prefix&  " Ticket Creator For: " &$Name)

    ;Point on incident and click on create incident
MouseClick($MOUSE_CLICK_LEFT, 32, 349)
        Sleep(400)
    MouseClick($MOUSE_CLICK_LEFT, 150,408)
Sleep(2450)


;click on the app/service and press enter
    MouseClick($MOUSE_CLICK_LEFT, 385, 387)
    sleep(1000)
Send("RLX-*ONSITE*")
    sleep(1000)
Send("{ENTER}")
    sleep(2000)

;assign it to the person specified in $assignee
Sleep (2600)
    MouseClick($MOUSE_CLICK_LEFT, 1457, 417)
    sleep(300)
        Send($ciscoread)
    sleep(300)
    Send("{ENTER}")
Sleep (500)

;Click Description, select all, delete template
Sleep (500)
    MouseClick($MOUSE_CLICK_LEFT, 867, 496)
        Send("^a")
            Send("{BS}")
    send($prefix& " : "  &$username&@CRLF& "Start Date: " &$startdate&@CRLF& "Same profile as: " &$sameprofile&@CRLF& "Require Cisco Extension" )




;fill up contact and title
    MouseClick($MOUSE_CLICK_LEFT, 323, 232)
        Send($username)
            Sleep(2000)
                MouseClick($MOUSE_CLICK_LEFT, 375, 233)
                Sleep(1700)
            MouseMove(242, 200)
                sleep(1400)
            MouseClick($MOUSE_CLICK_LEFT, 242, 200)
            Sleep(450)
            MouseClick($MOUSE_CLICK_LEFT, 248, 200)
        sleep(3000)
    send($prefix& " : "  &$Name& " , Cisco")





;Choose Enhancement incident type , Request for information category and Proactive source

        MouseClick($MOUSE_CLICK_LEFT, 1651, 791)
                Send("{DOWN 10}")

        MouseClick($MOUSE_CLICK_LEFT, 1598, 825)
                Send("{DOWN 1}")

        MouseClick($MOUSE_CLICK_LEFT, 1587, 854)
                Send("{DOWN 10}")




;save&Exit ticket

            MouseMove(199, 171)
        sleep(300)
            MouseClick($MOUSE_CLICK_LEFT, 199, 171)
        Sleep(3000)


sleep(2000)

EndFunc

Func network()

WinClose($Mainform, $prefix&  " Ticket Creator For: " &$Name)

    ;Point on incident and click on create incident
MouseClick($MOUSE_CLICK_LEFT, 32, 349)
        Sleep(400)
    MouseClick($MOUSE_CLICK_LEFT, 150,408)
Sleep(2450)


;click on the app/service and press enter
    MouseClick($MOUSE_CLICK_LEFT, 385, 387)
    sleep(1000)
Send("RLX-*ONSITE*")
    sleep(1000)
Send("{ENTER}")
    sleep(2000)

;assign it to the person specified in $assignee
Sleep (2600)
    MouseClick($MOUSE_CLICK_LEFT, 1457, 417)
    sleep(300)
        Send($networkread)
    sleep(300)
    Send("{ENTER}")
Sleep (500)

;Click Description, select all, delete template
Sleep (500)
    MouseClick($MOUSE_CLICK_LEFT, 867, 496)
        Send("^a")
            Send("{BS}")
    send($prefix& " : "  &$username&@CRLF& "Start Date: " &$startdate&@CRLF& "Same profile as: " &$sameprofile&@CRLF& "Internal/External: " &$location )




;fill up contact and title
    MouseClick($MOUSE_CLICK_LEFT, 323, 232)
        Send($username)
            Sleep(2000)
                MouseClick($MOUSE_CLICK_LEFT, 375, 233)
                Sleep(1700)
            MouseMove(242, 200)
                sleep(1400)
            MouseClick($MOUSE_CLICK_LEFT, 242, 200)
            Sleep(450)
            MouseClick($MOUSE_CLICK_LEFT, 248, 200)
        sleep(3000)
    send($prefix& " : "  &$Name& " , Network")





;Choose Enhancement incident type , Request for information category and Proactive source

        MouseClick($MOUSE_CLICK_LEFT, 1651, 791)
                Send("{DOWN 10}")

        MouseClick($MOUSE_CLICK_LEFT, 1598, 825)
                Send("{DOWN 1}")

        MouseClick($MOUSE_CLICK_LEFT, 1587, 854)
                Send("{DOWN 10}")




;save&Exit ticket

            MouseMove(199, 171)
        sleep(300)
            MouseClick($MOUSE_CLICK_LEFT, 199, 171)
        Sleep(3000)


sleep(2000)

EndFunc

Func grid()

WinClose($Mainform, $prefix&  " Ticket Creator For: " &$Name)

    ;Point on incident and click on create incident
MouseClick($MOUSE_CLICK_LEFT, 32, 349)
        Sleep(400)
    MouseClick($MOUSE_CLICK_LEFT, 150,408)
Sleep(2450)


;click on the app/service and press enter
    MouseClick($MOUSE_CLICK_LEFT, 385, 387)
    sleep(1000)
Send("RLX-*ONSITE*")
    sleep(1000)
Send("{ENTER}")
    sleep(2000)

;assign it to the person specified in $assignee
Sleep (2600)
    MouseClick($MOUSE_CLICK_LEFT, 1457, 417)
    sleep(300)
        Send($gridread)
    sleep(300)
    Send("{ENTER}")
Sleep (500)

;Click Description, select all, delete template
Sleep (500)
    MouseClick($MOUSE_CLICK_LEFT, 867, 496)
        Send("^a")
            Send("{BS}")
    send($prefix& " : "  &$username&@CRLF& "Start Date: " &$startdate&@CRLF& "Same profile as: " &$sameprofile&@CRLF& "Internal/External: " &$location&@CRLF& "Need Grid Card" )




;fill up contact and title
    MouseClick($MOUSE_CLICK_LEFT, 323, 232)
        Send($username)
            Sleep(2000)
                MouseClick($MOUSE_CLICK_LEFT, 375, 233)
                Sleep(1700)
            MouseMove(242, 200)
                sleep(1400)
            MouseClick($MOUSE_CLICK_LEFT, 242, 200)
            Sleep(450)
            MouseClick($MOUSE_CLICK_LEFT, 248, 200)
        sleep(3000)
    send($prefix& " : "  &$Name& " , Grid Card")





;Choose Enhancement incident type , Request for information category and Proactive source

        MouseClick($MOUSE_CLICK_LEFT, 1651, 791)
                Send("{DOWN 10}")

        MouseClick($MOUSE_CLICK_LEFT, 1598, 825)
                Send("{DOWN 1}")

        MouseClick($MOUSE_CLICK_LEFT, 1587, 854)
                Send("{DOWN 10}")




;save&Exit ticket

            MouseMove(199, 171)
        sleep(300)
            MouseClick($MOUSE_CLICK_LEFT, 199, 171)
        Sleep(3000)


sleep(2000)


EndFunc  ;==>Grid

Func office()

WinClose($Mainform, $prefix&  " Ticket Creator For: " &$Name)

    ;Point on incident and click on create incident
MouseClick($MOUSE_CLICK_LEFT, 32, 349)
        Sleep(400)
    MouseClick($MOUSE_CLICK_LEFT, 150,408)
Sleep(2450)


;click on the app/service and press enter
    MouseClick($MOUSE_CLICK_LEFT, 385, 387)
    sleep(1000)
Send("RLX-*ONSITE*")
    sleep(1000)
Send("{ENTER}")
    sleep(2000)

;assign it to the person specified in $assignee
Sleep (2600)
    MouseClick($MOUSE_CLICK_LEFT, 1457, 417)
    sleep(300)
        Send($officeread)
    sleep(300)
    Send("{ENTER}")
Sleep (500)

;Click Description, select all, delete template
Sleep (500)
    MouseClick($MOUSE_CLICK_LEFT, 867, 496)
        Send("^a")
            Send("{BS}")
                send($prefix& " :" &$username&@CRLF& "Start Date: " &$startdate&@CRLF& "Laptop / Desktop: " &$device&@CRLF& " Office Set up Date : " &$officemove )




;fill up contact and title
    MouseClick($MOUSE_CLICK_LEFT, 323, 232)
        Send($username)
            Sleep(2000)
                MouseClick($MOUSE_CLICK_LEFT, 375, 233)
                Sleep(1700)
            MouseMove(242, 200)
                sleep(1400)
            MouseClick($MOUSE_CLICK_LEFT, 242, 200)
            Sleep(450)
            MouseClick($MOUSE_CLICK_LEFT, 248, 200)
        sleep(3000)
    send($prefix& " :" &$Name& " , Office Set Up")





;Choose Enhancement incident type , Request for information category and Proactive source

        MouseClick($MOUSE_CLICK_LEFT, 1651, 791)
                Send("{DOWN 10}")

        MouseClick($MOUSE_CLICK_LEFT, 1598, 825)
                Send("{DOWN 1}")

        MouseClick($MOUSE_CLICK_LEFT, 1587, 854)
                Send("{DOWN 10}")




;save&Exit ticket

            MouseMove(199, 171)
        sleep(300)
            MouseClick($MOUSE_CLICK_LEFT, 199, 171)
        Sleep(3000)


sleep(2000)

EndFunc  ;==> Office

Func training()

WinClose($Mainform, $prefix&  " Ticket Creator For: " &$Name)

    ;Point on incident and click on create incident
MouseClick($MOUSE_CLICK_LEFT, 32, 349)
        Sleep(400)
    MouseClick($MOUSE_CLICK_LEFT, 150,408)
Sleep(2450)


;click on the app/service and press enter
    MouseClick($MOUSE_CLICK_LEFT, 385, 387)
    sleep(1000)
Send("RLX-*ONSITE*")
    sleep(1000)
Send("{ENTER}")
    sleep(2000)

;assign it to the person specified in $assignee
Sleep (2600)
    MouseClick($MOUSE_CLICK_LEFT, 1457, 417)
    sleep(300)
        Send($trainingread)
    sleep(300)
    Send("{ENTER}")
Sleep (500)

;Click Description, select all, delete template
Sleep (500)
    MouseClick($MOUSE_CLICK_LEFT, 867, 496)
        Send("^a")
            Send("{BS}")
                send($prefix& " :" &$username&@CRLF& "Start Date: " &$startdate&@CRLF& "Laptop / Desktop: " &$device&@CRLF& " Training / Onboarding date : " &$trainingdate )




;fill up contact and title
    MouseClick($MOUSE_CLICK_LEFT, 323, 232)
        Send($username)
            Sleep(2000)
                MouseClick($MOUSE_CLICK_LEFT, 375, 233)
                Sleep(1700)
            MouseMove(242, 200)
                sleep(1400)
            MouseClick($MOUSE_CLICK_LEFT, 242, 200)
            Sleep(450)
            MouseClick($MOUSE_CLICK_LEFT, 248, 200)
        sleep(3000)
    send($prefix& " :" &$Name& " , Training / Onboarding")





;Choose Training incident type , Request for information category and Proactive source

        MouseClick($MOUSE_CLICK_LEFT, 1651, 791)
                Send("{DOWN 17}")

        MouseClick($MOUSE_CLICK_LEFT, 1598, 825)
                Send("{DOWN 1}")

        MouseClick($MOUSE_CLICK_LEFT, 1587, 854)
                Send("{DOWN 10}")




;save&Exit ticket

            MouseMove(199, 171)
        sleep(300)
            MouseClick($MOUSE_CLICK_LEFT, 199, 171)
        Sleep(3000)


sleep(2000)

EndFunc ;==> training


Exit

Func TogglePause()
    $g_bPaused = Not $g_bPaused
    While $g_bPaused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
EndFunc   ;==>TogglePause

Func Terminate()
    Exit
EndFunc   ;==>Terminate

so If $checkbox[0] was checked and i pressed $Button3 , the script was only doing the Laptop() function and so on. 

 

Now my hair pulling situation. I need to convert this with the wonderful Metro GUI UDF.

 

Here is what i have so far : 

#NoTrayIcon
Opt("GUIOnEventMode", 1)
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=Media\newhire.ico
#AutoIt3Wrapper_Outfile=V:\_Department\IT\IT-Support\Lazy IT 2018 R2 version 1.029838.1282805 Revision 99.2\Source\Pre Prod\NewHire V2.0.exe
#AutoIt3Wrapper_Res_Fileversion=4.0.0.36
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#AutoIt3Wrapper_Res_HiDpi=y
#Au3Stripper_Parameters=/so /rm /pe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#Au3Stripper_Ignore_Funcs=_iHoverOn,_iHoverOff,_iFullscreenToggleBtn,_cHvr_CSCP_X64,_cHvr_CSCP_X86,_iControlDelete
#EndRegion
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.14.2
 Author:         JJ

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

#include <MetroGUI_UDF.au3>
#include <_GUIDisable.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <AutoItConstants.au3>
#include 'ExtInputBox.au3'
#include <ComboConstants.au3>
#include <DateTimeConstants.au3>
#include <EditConstants.au3>
#include <Date.au3>
#include <Timers.au3>
#include <GuiComboBox.au3>
#include <GDIPlus.au3>
#include <WinAPISys.au3>
#include <SecretStuffCOnstants.au3>
#include <FontConstants.au3>
#include <ColorConstants.au3>
#include <LazyITConstants.au3>

;Global Pause/Terminate function

Global $sFileVersion = FileGetVersion(@AutoItExe)

Global $g_bPaused = False
HotKeySet("{ESC}", "Terminate")
HotKeySet("{PAUSE}", "TogglePause")


;############################################################################Pre Form###############################################################################

preform()

Func preform()

_Metro_EnableHighDPIScaling()

;#Region ### START Koda GUI section ### Form=

;Set Theme
_SetTheme("DarkTeal") ;See MetroThemes.au3 for selectable themes or to add more


Global $preform = _Metro_CreateGUI("Pre-Script Form", 400, 390, -1, -1, True)

;Add/create control buttons to the GUI
$Control_Buttons = _Metro_AddControlButtons(True, False, True, False, False) ;CloseBtn = True, MaximizeBtn = True, MinimizeBtn = True, FullscreenBtn = True, MenuBtn = True

;Set variables for the handles of the GUI-Control buttons. (Above function always returns an array this size and in this order, no matter which buttons are selected.)
;All control buttons like maximize, minimize, fullscreen etc. (except the menu button) work natively. You can use these variables to handle the clicks manually, if you do so, then make sure set $ControlBtnsAutoMode = False
global  $GUI_CLOSE_BUTTON = $Control_Buttons[0]
Global $GUI_MINIMIZE_BUTTON = $Control_Buttons[3]


Global Const $Font = "Comis Sans Ms"

$Prefixlabel = GUICtrlCreateLabel("Employe State", 8, 16, 100, 21)
    GUICtrlSetBkColor($Prefixlabel, $GUI_BKCOLOR_TRANSPARENT)
        GUICtrlSetColor($Prefixlabel, $Color_White)

     Global $prefixroot = GUICtrlCreateCombo("", 140, 16, 169, 21, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))

        GUICtrlSetData(-1, "New Hire|Mat leave Return|Transfert")
        GUICtrlSetTip(-1, "Choose Employee State")

    Global $Nameroot = GUICtrlCreateInput("", 140, 48, 169, 21)
        GUICtrlSetTip(-1, "Enter Full Name")

            $Namelabel = GUICtrlCreateLabel("Employe Name", 8, 48, 100, 21)
            GUICtrlSetTip(-1, "Please enter FULL NAME")
                GUICtrlSetBkColor($Namelabel, $GUI_BKCOLOR_TRANSPARENT)
                    GUICtrlSetColor($Namelabel, $Color_White)


    Global $Usernameroot = GUICtrlCreateInput("", 140, 80, 169, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_UPPERCASE))
        GUICtrlSetTip(-1, "Enter Username")

            $Usernamelabel = GUICtrlCreateLabel("Employe Username", 8, 80, 100, 21)
            GUICtrlSetTip(-1, "Please Enter Username")
                GUICtrlSetBkColor($Usernamelabel, $GUI_BKCOLOR_TRANSPARENT)
                    GUICtrlSetColor($Usernamelabel, $Color_White)

    Global $sameprofileroot = GUICtrlCreateInput("", 140, 176, 169, 21)
        GUICtrlSetTip(-1, "Please type Employe Peers")

            $profilelabel = GUICtrlCreateLabel("Same Profile As :", 8, 176, 100, 21)
                GUICtrlSetBkColor($profilelabel, $GUI_BKCOLOR_TRANSPARENT)
                    GUICtrlSetColor($profilelabel, $Color_White)

    Global $deviceroot = GUICtrlCreateCombo("", 140, 112, 169, 21, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
        GUICtrlSetData(-1, "Laptop|Desktop")

            $devicelabel = GUICtrlCreateLabel("Employe Device :", 8, 112, 100, 21)
            GUICtrlSetTip(-1, "Please choose employe device type")
                GUICtrlSetBkColor($devicelabel, $GUI_BKCOLOR_TRANSPARENT)
                    GUICtrlSetColor($devicelabel, $Color_White)

    Global $startdateroot = GUICtrlCreateDate( _NowDate() , 140, 144, 169, 17, 0)
        GUICtrlSetTip(-1, "Please choose start date")

            $timelabel = GUICtrlCreateLabel("Employe Start Date :", 8, 144, 100, 21)
                GUICtrlSetBkColor($timelabel, $GUI_BKCOLOR_TRANSPARENT)
                    GUICtrlSetColor($timelabel, $Color_White)

    Global $Locationroot = GUICtrlCreateCombo("", 140, 208, 169, 21, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
        GUICtrlSetData(-1, "Internal Permanent|Internal Contractor|External Permanent|External Contractor")

            $locationlabel = GUICtrlCreateLabel("Employe Location :", 8, 208, 94, 17)
            GUICtrlSetTip(-1, "Please choose Employe Location")
                GUICtrlSetBkColor($locationlabel, $GUI_BKCOLOR_TRANSPARENT)
                    GUICtrlSetColor($locationlabel, $Color_White)

    Global $Postalcoderoot = GUICtrlCreateInput("", 140, 240, 169, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_UPPERCASE))
        GUICtrlSetTip(-1, "Enter User's postal code. " &@CRLF & "Leave Blank if unknown")

            $postalcodelabel = GUICtrlCreateLabel("Postal Code :",8, 240, 94, 17)
                GUICtrlSetBkColor($postalcodelabel, $GUI_BKCOLOR_TRANSPARENT)
                    GUICtrlSetColor($postalcodelabel, $Color_White)


    Global $trainingdateroot = GUICtrlCreateDate( _NowDate() , 140, 272, 169, 21,0)
        GUICtrlSetTip( -1, " Please select Training date" &@crlf& " If not sceduled, put the start date")

            $trainingdatelabel = GUICtrlCreateLabel("Training Date :",8, 272, 94, 17)
                GUICtrlSetBkColor($trainingdatelabel, $GUI_BKCOLOR_TRANSPARENT)
                    GUICtrlSetColor($trainingdatelabel, $Color_White)


    Global $officemoveroot = GUICtrlCreateDate( _NowDate() , 140, 304, 169, 21,0)
        GUICtrlSetTip( -1, " Please choose Office set up date" &@crlf& " If not sceduled, put the start date")

            $officemovelabel = GUICtrlCreateLabel("Office Set Up Date :",8, 304, 94, 17)
                GUICtrlSetBkColor($officemovelabel, $GUI_BKCOLOR_TRANSPARENT)
                    GUICtrlSetColor($officemovelabel, $Color_White)

global  $PreStart = _Metro_CreateButtonEx("Send", 136, 355, 137, 25, $BS_DEFPUSHBUTTON)
GUICtrlSetTip(-1, "Send Entered values to the Main New Hire GUI")



Global $DCToggle = _Metro_CreateToggle("DC", 8, 355, 100, 26)


;Set resizing options for the controls so they don't change in size or position. This can be customized to match your gui perfectly for resizing. See AutoIt Help file.
GUICtrlSetResizing($Prefixlabel, 768 + 8)
GUICtrlSetResizing($prefixroot, 768 + 8)
GUICtrlSetResizing($Nameroot, 768 + 8)
GUICtrlSetResizing($Namelabel, 768 + 8)
GUICtrlSetResizing($Usernameroot, 768 + 8)
GUICtrlSetResizing($Usernamelabel, 768 + 8)
GUICtrlSetResizing($sameprofileroot, 768 + 8)
GUICtrlSetResizing($profilelabel, 768 + 8)
GUICtrlSetResizing($deviceroot, 768 + 8)
GUICtrlSetResizing($devicelabel, 768 + 8)
GUICtrlSetResizing($startdateroot, 768 + 8)
GUICtrlSetResizing($DCToggle, 768 + 8)
GUICtrlSetResizing($timelabel, 768 + 8)
GUICtrlSetResizing($Locationroot, 768 + 8)
GUICtrlSetResizing($locationlabel, 768 + 8)
GUICtrlSetResizing($officemoveroot, 768 + 8)
GUICtrlSetResizing($officemovelabel, 768 + 8)
GUICtrlSetResizing($trainingdateroot, 768 + 8)
GUICtrlSetResizing($trainingdatelabel, 768 + 8)
GUICtrlSetResizing($PreStart, 768 + 8)

GUISetState(@SW_SHOW)
;#EndRegion ### END Koda GUI section ###

GUISetOnEvent($GUI_EVENT_CLOSE, "_GUIEvent_ControlButtons_pre")
GUICtrlSetOnEvent($GUI_MINIMIZE_BUTTON, "_GUIEvent_ControlButtons_pre")
GUICtrlSetOnEvent($PreStart, "_GUIEvent_Buttons_pre")
GUICtrlSetOnEvent($DCToggle, "_GUIEvent_Toggles_pre")



EndFunc ;==> Preform


While 1
    Sleep(5)

WEnd

Func _GUIEvent_ControlButtons_pre()
    Switch @GUI_CtrlId
        Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON
            Exit

        Case $GUI_MINIMIZE_BUTTON
            GUISetState(@SW_MINIMIZE, $preform)


    EndSwitch
EndFunc   ;==>_GUIEvent_ControlButtons

Func _GUIEvent_Buttons_pre()
    Switch @GUI_CtrlId

        Case $PreStart
            GUISetState(@SW_HIDE, $preform)

            Call("Mainform")

    EndSwitch
EndFunc ;==> _GUIEvent_Buttons

Func _GUIEvent_Toggles_pre()
    Switch @GUI_CtrlId
        Case $DCToggle
            If _Metro_ToggleIsChecked($DCToggle) Then
                _Metro_ToggleUnCheck($DCToggle)


            Else
                _Metro_ToggleCheck($DCToggle)

            EndIf


    EndSwitch
EndFunc   ;==>_GUIEvent_Toggles

;####################################################################################################################################################################




;############################################################################Main Form###############################################################################
mainform()
Func mainform()



If _Metro_ToggleIsChecked($DCToggle) Then

        Global $DC = True
Else
        Global $DC = False

EndIf

Global $prefix = GUICtrlRead($prefixroot)

If $DC = True Then
    $Prefix = "DC " & $prefix


EndIf

Global $Name = GUICtrlRead($Nameroot)
Global $username = GUICtrlRead($Usernameroot)
Global $sameprofile = GUICtrlRead($sameprofileroot)
Global $device = GUICtrlRead($deviceroot)
Global $startdate = GUICtrlRead($startdateroot)
Global $location = GUICtrlRead($Locationroot)
Global $officemove = GUICtrlRead($officemoveroot)
Global $trainingdate = GUICtrlRead($trainingdateroot)
Global $timer= TimerInit()
Global $Postalcode = GUICtrlRead($Postalcoderoot)

;Set Theme
_SetTheme("DarkTeal") ;See MetroThemes.au3 for selectable themes or to add more



 Global $Mainform = _Metro_CreateGUI( $prefix&  " Ticket Creator For: " &$Name, 700, 500, -1, -1, True)
    GUISetIcon("V:\_Department\IT\IT-Support\Lazy IT 2018 R2 version 1.029838.1282805 Revision 99.2\Source\Media\pirate.ico")

$Control_Buttons = _Metro_AddControlButtons(True, False, True, False, False) ;CloseBtn = True, MaximizeBtn = True, MinimizeBtn = True, FullscreenBtn = True, MenuBtn = Trueglobal   $GUI_CLOSE_BUTTON = $Control_Buttons[0]

Global $GUI_MINIMIZE_BUTTON = $Control_Buttons[3]
Global $GUI_CLOSE_BUTTON = $Control_Buttons[1]


$Label1 = GUICtrlCreateLabel("Select the services", 35, 8, 146, 20)
            GUICtrlSetBkColor($Label1, $GUI_BKCOLOR_TRANSPARENT)
                    GUICtrlSetColor($Label1, $Color_White)
                        GUICtrlSetFont($Label1,10,800)


 $Label2 = GUICtrlCreateLabel("Required for " &$Name, 35, 25, 300, 30)
                GUICtrlSetBkColor($Label2, $GUI_BKCOLOR_TRANSPARENT)
                    GUICtrlSetColor($Label2, $Color_White)
                        GUICtrlSetFont($Label2,10,800)

$Label3 = GUICtrlCreateLabel("Ticket Assignee", 260, 8, 300, 30)
                GUICtrlSetBkColor($Label3, $GUI_BKCOLOR_TRANSPARENT)
                    GUICtrlSetColor($Label3, $Color_White)
                        GUICtrlSetFont($Label3,10,800)

Global $AddComputerButton = _Metro_CreateButtonEx("Add Computer", 600, 43, 89, 35, $WS_GROUP)

Global $SelectAllButton = _Metro_CreateButtonEx("Select All", 600, 88, 89, 30, $WS_GROUP)
    GUICtrlSetTip(-1, "Select all Services")

Global $ClearAllButton = _Metro_CreateButtonEx("Clear All", 600, 128, 89, 30, $WS_GROUP)
    GUICtrlSetTip(-1, "Clear all selected services")

Global $ReadButton = _Metro_CreateButtonEx("Please Read", 600, 168, 89, 30, $WS_GROUP)

 Global $ExitButton = _Metro_CreateButtonEx("Exit", 600, 208, 89, 30, $WS_GROUP)

Global $StartButton = _Metro_CreateButtonEx("Start!", 550, 310, 139, 50, $WS_GROUP)
    GUICtrlSetTip(-1, "Start the script and enjoy doing nothing!")

Global $Restart = _Metro_CreateButtonEx("Re-Enter values", 570, 470, 120, 25)
    GUICtrlSetTip(-1, "Re-enter Startup information in case of a misstype")
        GUICtrlSetFont (-1,12)

Global $laptopassigne = GUICtrlCreateCombo("IT", 280, 48, 85, 17, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1,"IT1|IT2|IT3|IT4")


Global $iphoneassigne = GUICtrlCreateCombo("IT", 280, 72, 85, 17, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "IT1|IT2|IT3|IT4")


Global $ipadassigne = GUICtrlCreateCombo("IT", 280, 96, 85, 17, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "IT1|IT2|IT3|IT4")


Global $ciscoassigne = GUICtrlCreateCombo("IT", 280, 120, 85, 17, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "IT1|IT2|IT3|IT4")


Global $networkassigne = GUICtrlCreateCombo("IT", 280, 144, 85, 17, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "IT1|IT2|IT3|IT4")


Global $gridassigne = GUICtrlCreateCombo("IT", 280, 168, 85, 17, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "IT1|IT2|IT3|IT4")


Global $officeassigne = GUICtrlCreateCombo("IT", 280, 192, 85, 17, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "IT1|IT2|IT3|IT4")


Global $trainingassigne = GUICtrlCreateCombo("IT", 280, 216, 85, 17, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "IT1|IT2|IT3|IT4")


$DCvalidation = GUICtrlCreateLabel (" ==> Diabetes Care Employee <== ", 180, 250, 580, 26)
    GUICtrlSetFont (-1,14, 800)
        GUICtrlSetBkColor($DCvalidation, $GUI_BKCOLOR_TRANSPARENT)
            GUICtrlSetColor($DCvalidation, $Color_White)

If $DC = False Then

    GUICtrlSetData($DCvalidation, " ")

EndIf

$namevalidation = GUICtrlCreateLabel ("Full Name is: "&$Name, 8, 270, 560, 17)
    GUICtrlSetFont (-1,12)
        GUICtrlSetBkColor($namevalidation, $GUI_BKCOLOR_TRANSPARENT)
            GUICtrlSetColor($namevalidation, $Color_White)

$uservalidation = GUICtrlCreateLabel ("Username is:  " &$UserName, 8, 300, 560, 17)
    GUICtrlSetFont (-1,12)
        GUICtrlSetBkColor($uservalidation, $GUI_BKCOLOR_TRANSPARENT)
            GUICtrlSetColor($uservalidation, $Color_White)

$locationvalidation = GUICtrlCreateLabel ("Location is: " &$location, 8, 330, 560, 17)
    GUICtrlSetFont (-1,12)
        GUICtrlSetFont ($location,12)
            GUICtrlSetBkColor($locationvalidation, $GUI_BKCOLOR_TRANSPARENT)
                GUICtrlSetColor($locationvalidation, $Color_White)

$postalcodevalidation = GUICtrlCreateLabel ("Postal Code is :  " &$Postalcode, 8, 360, 430, 17)
    GUICtrlSetFont (-1,12)
        GUICtrlSetBkColor($postalcodevalidation, $GUI_BKCOLOR_TRANSPARENT)
            GUICtrlSetColor($postalcodevalidation, $Color_White)

$profilevalidation = GUICtrlCreateLabel ("Same Profile as:  " &$sameprofile, 8, 390, 430, 17)
    GUICtrlSetFont (-1,12)
        GUICtrlSetBkColor($profilevalidation, $GUI_BKCOLOR_TRANSPARENT)
            GUICtrlSetColor($profilevalidation, $Color_White)


$datevalidation = GUICtrlCreateLabel ("Start Date is: " &$startdate, 8, 420, 430, 17)
    GUICtrlSetFont ($datevalidation,12)
            GUICtrlSetBkColor($datevalidation, $GUI_BKCOLOR_TRANSPARENT)
                GUICtrlSetColor($datevalidation, $Color_White)

$officevalidation = GUICtrlCreateLabel ("Office Setup deadline is: " &$officemove, 8, 450, 430, 17)
    GUICtrlSetFont (-1,12)
        GUICtrlSetBkColor($officevalidation, $GUI_BKCOLOR_TRANSPARENT)
            GUICtrlSetColor($officevalidation, $Color_White)

$versionlabel = GUICtrlCreateLabel ( "Version " & $sFileVersion , 8, 480, 161, 41)
    GUICtrlSetFont (-1,12)
        GUICtrlSetBkColor($versionlabel, $GUI_BKCOLOR_TRANSPARENT)
            GUICtrlSetColor($versionlabel, $Color_White)





global $checkbox[8]

    GUICtrlSetColor($checkbox, $Color_White)

 $checkbox[0] = _Metro_CreateCheckbox($device, 8, 48, 200, 24)
 $checkbox[1] = _Metro_CreateCheckbox("Iphone", 8, 72, 200, 24)
 $checkbox[2] = _Metro_CreateCheckbox("Ipad + SIM Card", 8, 96, 200, 24)
 $checkbox[3] = _Metro_CreateCheckbox("Cisco Extension", 8, 120, 200, 24)
 $checkbox[4] = _Metro_CreateCheckbox("Network", 8, 144, 200, 24)
 $checkbox[5] = _Metro_CreateCheckbox("Grid Card", 8, 168, 200, 24)
 $checkbox[6] = _Metro_CreateCheckbox("Office Set-Up", 8, 192, 200, 24)
 $checkbox[7] = _Metro_CreateCheckbox("User Training", 8, 216, 200, 24)


GUICtrlSetResizing($SelectAllButton, 768 + 8)
GUICtrlSetResizing($ClearAllButton, 768 + 8)
GUICtrlSetResizing($StartButton, 768 + 8)
GUICtrlSetResizing($ReadButton, 768 + 8)
GUICtrlSetResizing($AddComputerButton, 768 + 8)
GUICtrlSetResizing($Restart, 768 + 8)
GUICtrlSetResizing($ExitButton, 768 + 8)


GUISetState()


GUISetOnEvent($GUI_EVENT_CLOSE, "_GUIEvent_ControlButtons_Main")
GUICtrlSetOnEvent($GUI_MINIMIZE_BUTTON, "_GUIEvent_ControlButtons_Main")
GUICtrlSetOnEvent($SelectAllButton, "_GUIEvent_Buttons_Main")
GUICtrlSetOnEvent($ClearAllButton, "_GUIEvent_Buttons_Main")
GUICtrlSetOnEvent($StartButton, "_GUIEvent_Buttons_Main")
GUICtrlSetOnEvent($ReadButton, "_GUIEvent_Buttons_Main")
GUICtrlSetOnEvent($AddComputerButton, "_GUIEvent_Buttons_Main")
GUICtrlSetOnEvent($ExitButton, "_GUIEvent_Buttons_Main")
GUICtrlSetOnEvent($Restart, "_GUIEvent_Buttons_Main")
GUICtrlSetOnEvent($checkbox[0], "_GUIEvent_Checkboxes")
GUICtrlSetOnEvent($checkbox[1], "_GUIEvent_Checkboxes")
GUICtrlSetOnEvent($checkbox[2], "_GUIEvent_Checkboxes")
GUICtrlSetOnEvent($checkbox[3], "_GUIEvent_Checkboxes")
GUICtrlSetOnEvent($checkbox[4], "_GUIEvent_Checkboxes")
GUICtrlSetOnEvent($checkbox[5], "_GUIEvent_Checkboxes")
GUICtrlSetOnEvent($checkbox[6], "_GUIEvent_Checkboxes")
GUICtrlSetOnEvent($checkbox[7], "_GUIEvent_Checkboxes")


EndFunc ;==> Mainform

;#######################################################################################################################

While 1
    sleep(5)
Wend

Func _GUIEvent_ControlButtons_Main()
    Switch @GUI_CtrlId
        Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON
            _Metro_GUIDelete($Mainform)
            Exit


        Case $GUI_MINIMIZE_BUTTON
            GUISetState(@SW_MINIMIZE, $Mainform)


    EndSwitch
EndFunc   ;==>_GUIEvent_ControlButtons

Func _GUIEvent_Buttons_Main()

    Switch @GUI_CtrlId

        Case $AddComputerButton
            Run ("V:\_Department\IT\IT-Support\SoftwaresAll\PC-NameCreator\Add new Computer.bat")

        Case $ExitButton
            _Metro_GUIDelete($Mainform)
            Exit

        Case $ReadButton
            _GUIDisable($Mainform, 0, 30) ;For better visibility of the MsgBox on top of the first GUI._GUIDisable($Form1)
             _Metro_MsgBox(64, 'Please Read. . .', '1) You need to have HPSM oppened on your main screen.' & @CRLF & @CRLF & '2) Make sure Chrome is not zoomed in or out, Else SCRIPT WILL FAIL. ' &@CRLF & @CRLF & '3) To be added')

             _GUIDisable($Mainform, 0, 30) ;For better visibility of the MsgBox on top of the first GUI._GUIDisable($Form1)

        Case $Restart

            _Metro_GUIDelete($Mainform)

            Sleep(500)

            GUISetState (@SW_SHOW, $preform)


        Case $SelectAllButton

            _Metro_CheckboxCheck($checkbox[0])

            _Metro_CheckboxCheck($checkbox[1])

            _Metro_CheckboxCheck($checkbox[2])

            _Metro_CheckboxCheck($checkbox[3])

            _Metro_CheckboxCheck($checkbox[4])

            _Metro_CheckboxCheck($checkbox[5])

            _Metro_CheckboxCheck($checkbox[6])

            _Metro_CheckboxCheck($checkbox[7])

        Case $ClearAllButton

            _Metro_CheckboxUnCheck($checkbox[0])

            _Metro_CheckboxunCheck($checkbox[1])

            _Metro_CheckboxunCheck($checkbox[2])

            _Metro_CheckboxunCheck($checkbox[3])

            _Metro_CheckboxunCheck($checkbox[4])

            _Metro_CheckboxunCheck($checkbox[5])

            _Metro_CheckboxunCheck($checkbox[6])

            _Metro_CheckboxunCheck($checkbox[7])


        Case $StartButton

            Sleep(400)

    _metro_msgBox(36, 'Preparing the beast', $device & ' Ticket will be assigned to :' &$laptopassigne & @CRLF&@CRLF&"iPhone ticket will be assigned to : " & $iphoneassigne & @CRLF&@CRLF&"iPad ticket will be assigned to : " & $ipadassigne& @CRLF&@CRLF&"Cisco ticket will be assigned to : " &$ciscoassigne& @CRLF&@CRLF&"Network ticket will be assigned to : " & $networkassigne& @CRLF&@CRLF&"Grid card ticket will be assigned to : " &$gridassigne& @CRLF&@CRLF&"Office Set-Up ticket will be assigned to : " & $officeassigne& @CRLF&@CRLF&"Training/Onboarding ticket will be assigned to: " & $trainingassigne)


EndSwitch


    EndFunc   ;==>_GUIEvent_Buttons

Func _GUIEvent_Checkboxes()



    Switch @GUI_CtrlId
        Case $checkbox[0]
            If _Metro_CheckboxIsChecked($checkbox[0]) Then
                _Metro_CheckboxUnCheck($checkbox[0])

            Else
                _Metro_CheckboxCheck($checkbox[0])

            EndIf

        Case $checkbox[1]
            If _Metro_CheckboxIsChecked($checkbox[1]) Then
                _Metro_CheckboxUnCheck($checkbox[1])

            Else
                _Metro_CheckboxCheck($checkbox[1])

            EndIf

        Case $checkbox[2]
            If _Metro_CheckboxIsChecked($checkbox[2]) Then
                _Metro_CheckboxUnCheck($checkbox[2])

            Else
                _Metro_CheckboxCheck($checkbox[2])

            EndIf

        Case $checkbox[3]
            If _Metro_CheckboxIsChecked($checkbox[3]) Then
                _Metro_CheckboxUnCheck($checkbox[3])

            Else
                _Metro_CheckboxCheck($checkbox[3])

            EndIf

        Case $checkbox[4]
            If _Metro_CheckboxIsChecked($checkbox[4]) Then
                _Metro_CheckboxUnCheck($checkbox[4])

            Else
                _Metro_CheckboxCheck($checkbox[4])

            EndIf

        Case $checkbox[5]
            If _Metro_CheckboxIsChecked($checkbox[5]) Then
                _Metro_CheckboxUnCheck($checkbox[5])

            Else
                _Metro_CheckboxCheck($checkbox[5])

            EndIf

        Case $checkbox[6]
            If _Metro_CheckboxIsChecked($checkbox[6]) Then
                _Metro_CheckboxUnCheck($checkbox[6])

            Else
                _Metro_CheckboxCheck($checkbox[6])

            EndIf

        Case $checkbox[7]
            If _Metro_CheckboxIsChecked($checkbox[7]) Then
                _Metro_CheckboxUnCheck($checkbox[7])

            Else
                _Metro_CheckboxCheck($checkbox[7])

            EndIf

EndSwitch

EndFunc ;==> _GUIEvent_Checkboxes



;Functions for each Services
Func laptop()

WinClose($Mainform, $prefix&  " Ticket Creator For: " &$Name)


    ;Point on incident and click on create incident
MouseClick($MOUSE_CLICK_LEFT, 32, 349)
        Sleep(400)
    MouseClick($MOUSE_CLICK_LEFT, 150,408)
Sleep(2450)


;click on the app/service and press enter
    MouseClick($MOUSE_CLICK_LEFT, 385, 387)
    sleep(1000)
Send("RLX-*ONSITE*")
    sleep(1000)
Send("{ENTER}")
    sleep(2000)

;assign it to the person specified in $assignee
Sleep (2600)
    MouseClick($MOUSE_CLICK_LEFT, 1457, 417)
    sleep(300)
        Send ($laptopassigne)
    sleep(300)
    Send("{ENTER}")
Sleep (500)

;Click Description, select all, delete template
Sleep (500)
    MouseClick($MOUSE_CLICK_LEFT, 867, 496)
        Send("^a")
            Send("{BS}")
                send($prefix& " :" &$username&@CRLF& "Start Date: " &$startdate&@CRLF& "Laptop / Desktop: " &$device&@CRLF& "Grid Card : Yes" &@CRLF& "Same profile as: " &$sameprofile )




;fill up contact and title
    MouseClick($MOUSE_CLICK_LEFT, 323, 232)
        Send($username)
            Sleep(2000)
                MouseClick($MOUSE_CLICK_LEFT, 375, 233)
                Sleep(1700)
            MouseMove(242, 200)
                sleep(1400)
            MouseClick($MOUSE_CLICK_LEFT, 242, 200)
            Sleep(450)
            MouseClick($MOUSE_CLICK_LEFT, 248, 200)
        sleep(3000)
    send($prefix& " :" &$Name& " , New Computer")





;Choose Enhancement incident type , Request for information category and Proactive source
        sleep(100)
        MouseClick($MOUSE_CLICK_LEFT, 1651, 791)
                Send("{DOWN 10}")

        MouseClick($MOUSE_CLICK_LEFT, 1598, 825)
                Send("{DOWN 1}")

        MouseClick($MOUSE_CLICK_LEFT, 1587, 854)
                Send("{DOWN 10}")




;save&Exit ticket

            MouseMove(199, 171)
        sleep(300)
            MouseClick($MOUSE_CLICK_LEFT, 199, 171)
        Sleep(2000)

sleep(2000)
EndFunc

Func iphone()

WinClose($Mainform, $prefix&  " Ticket Creator For: " &$Name)

    ;Point on incident and click on create incident
MouseClick($MOUSE_CLICK_LEFT, 32, 349)
        Sleep(400)
    MouseClick($MOUSE_CLICK_LEFT, 150,408)
Sleep(2450)

    ;click on the app/service and press enter
    MouseClick($MOUSE_CLICK_LEFT, 366, 397)
    sleep(1000)
Send("RLX-*VOICE*")
    sleep(1000)
Send("{ENTER}")
    sleep(2000)
MouseClick($MOUSE_CLICK_LEFT, 1659, 368)
    Send("{DOWN 2}")
        Send("{ENTER}")
            sleep("500")

;assign it to the person specified in $assignee
Sleep (2600)
    MouseClick($MOUSE_CLICK_LEFT, 1457, 417)
    sleep(300)
        Send($iphoneassigne)
    sleep(300)
    Send("{ENTER}")
sleep(500)

;Click Description, select all, delete template
Sleep (500)
    MouseClick($MOUSE_CLICK_LEFT, 867, 496)
        Send("^a")
            Send("{BS}")
                    send($prefix& " : "  &$username&@CRLF& "Start Date: " &$startdate&@CRLF& "Same profile as: " &$sameprofile&@CRLF& "Internal/External: " &$location&@CRLF& "Postal Code : " &$Postalcode&@CRLF&  "Require Iphone" )




;fill up contact and title
    MouseClick($MOUSE_CLICK_LEFT, 323, 232)
        Send($username)
            Sleep(2000)
                MouseClick($MOUSE_CLICK_LEFT, 375, 233)
                Sleep(1700)
            MouseMove(242, 200)
                sleep(1400)
            MouseClick($MOUSE_CLICK_LEFT, 242, 200)
            Sleep(450)
            MouseClick($MOUSE_CLICK_LEFT, 248, 200)
        sleep(3000)
    send($prefix& " : "  &$Name& " , New iPhone")






;Choose Enhancement incident type , Request for information category and Proactive source

        MouseClick($MOUSE_CLICK_LEFT, 1651, 791)
                Send("{DOWN 10}")

        MouseClick($MOUSE_CLICK_LEFT, 1598, 825)
                Send("{DOWN 1}")

        MouseClick($MOUSE_CLICK_LEFT, 1587, 854)
                Send("{DOWN 10}")




;save&Exit ticket

            MouseMove(199, 171)
        sleep(300)
            MouseClick($MOUSE_CLICK_LEFT, 199, 171)
        Sleep(2000)




sleep(2000)


EndFunc

Func ipad()

WinClose($Mainform, $prefix&  " Ticket Creator For: " &$Name)

    ;Point on incident and click on create incident
MouseClick($MOUSE_CLICK_LEFT, 32, 349)
        Sleep(400)
    MouseClick($MOUSE_CLICK_LEFT, 150,408)
Sleep(2450)


;click on the app/service and press enter
    MouseClick($MOUSE_CLICK_LEFT, 366, 397)
    sleep(1000)
Send("RLX-*VOICE*")
    sleep(1000)
Send("{ENTER}")
    sleep(2000)
MouseClick($MOUSE_CLICK_LEFT, 1659, 368)
    Send("{DOWN 2}")
        Send("{ENTER}")
            sleep("500")

;assign it to the person specified in $assignee
Sleep (2600)
    MouseClick($MOUSE_CLICK_LEFT, 1457, 417)
    sleep(300)
        Send($ipadassigne)
    sleep(300)
    Send("{ENTER}")
Sleep (500)

;Click Description, select all, delete template
Sleep (500)
    MouseClick($MOUSE_CLICK_LEFT, 867, 496)
        Send("^a")
            Send("{BS}")
                send($prefix& " : "  &$username&@CRLF& "Start Date: " &$startdate&@CRLF& "Same profile as: " &$sameprofile&@CRLF& "Internal/External: " &$location&@CRLF& "Postal Code : " &$Postalcode&@CRLF&  "Require Ipad" )




;fill up contact and title
    MouseClick($MOUSE_CLICK_LEFT, 323, 232)
        Send($username)
            Sleep(2000)
                MouseClick($MOUSE_CLICK_LEFT, 375, 233)
                Sleep(1700)
            MouseMove(242, 200)
                sleep(1400)
            MouseClick($MOUSE_CLICK_LEFT, 242, 200)
            Sleep(450)
            MouseClick($MOUSE_CLICK_LEFT, 248, 200)
        sleep(3000)
    send($prefix& " : "  &$Name& " , New iPad")





;Choose Enhancement incident type , Request for information category and Proactive source

        MouseClick($MOUSE_CLICK_LEFT, 1651, 791)
                Send("{DOWN 10}")

        MouseClick($MOUSE_CLICK_LEFT, 1598, 825)
                Send("{DOWN 1}")

        MouseClick($MOUSE_CLICK_LEFT, 1587, 854)
                Send("{DOWN 10}")




;save&Exit ticket

            MouseMove(199, 171)
        sleep(300)
            MouseClick($MOUSE_CLICK_LEFT, 199, 171)
        Sleep(3000)


sleep(2000)

EndFunc

Func cisco()

WinClose($Mainform, $prefix&  " Ticket Creator For: " &$Name)

    ;Point on incident and click on create incident
MouseClick($MOUSE_CLICK_LEFT, 32, 349)
        Sleep(400)
    MouseClick($MOUSE_CLICK_LEFT, 150,408)
Sleep(2450)


;click on the app/service and press enter
    MouseClick($MOUSE_CLICK_LEFT, 385, 387)
    sleep(1000)
Send("RLX-*ONSITE*")
    sleep(1000)
Send("{ENTER}")
    sleep(2000)

;assign it to the person specified in $assignee
Sleep (2600)
    MouseClick($MOUSE_CLICK_LEFT, 1457, 417)
    sleep(300)
        Send($ciscoassigne)
    sleep(300)
    Send("{ENTER}")
Sleep (500)

;Click Description, select all, delete template
Sleep (500)
    MouseClick($MOUSE_CLICK_LEFT, 867, 496)
        Send("^a")
            Send("{BS}")
    send($prefix& " : "  &$username&@CRLF& "Start Date: " &$startdate&@CRLF& "Same profile as: " &$sameprofile&@CRLF& "Require Cisco Extension" )




;fill up contact and title
    MouseClick($MOUSE_CLICK_LEFT, 323, 232)
        Send($username)
            Sleep(2000)
                MouseClick($MOUSE_CLICK_LEFT, 375, 233)
                Sleep(1700)
            MouseMove(242, 200)
                sleep(1400)
            MouseClick($MOUSE_CLICK_LEFT, 242, 200)
            Sleep(450)
            MouseClick($MOUSE_CLICK_LEFT, 248, 200)
        sleep(3000)
    send($prefix& " : "  &$Name& " , Cisco")





;Choose Enhancement incident type , Request for information category and Proactive source

        MouseClick($MOUSE_CLICK_LEFT, 1651, 791)
                Send("{DOWN 10}")

        MouseClick($MOUSE_CLICK_LEFT, 1598, 825)
                Send("{DOWN 1}")

        MouseClick($MOUSE_CLICK_LEFT, 1587, 854)
                Send("{DOWN 10}")




;save&Exit ticket

            MouseMove(199, 171)
        sleep(300)
            MouseClick($MOUSE_CLICK_LEFT, 199, 171)
        Sleep(3000)


sleep(2000)

EndFunc

Func network()

WinClose($Mainform, $prefix&  " Ticket Creator For: " &$Name)

    ;Point on incident and click on create incident
MouseClick($MOUSE_CLICK_LEFT, 32, 349)
        Sleep(400)
    MouseClick($MOUSE_CLICK_LEFT, 150,408)
Sleep(2450)


;click on the app/service and press enter
    MouseClick($MOUSE_CLICK_LEFT, 385, 387)
    sleep(1000)
Send("RLX-*ONSITE*")
    sleep(1000)
Send("{ENTER}")
    sleep(2000)

;assign it to the person specified in $assignee
Sleep (2600)
    MouseClick($MOUSE_CLICK_LEFT, 1457, 417)
    sleep(300)
        Send($networkassigne)
    sleep(300)
    Send("{ENTER}")
Sleep (500)

;Click Description, select all, delete template
Sleep (500)
    MouseClick($MOUSE_CLICK_LEFT, 867, 496)
        Send("^a")
            Send("{BS}")
    send($prefix& " : "  &$username&@CRLF& "Start Date: " &$startdate&@CRLF& "Same profile as: " &$sameprofile&@CRLF& "Internal/External: " &$location )




;fill up contact and title
    MouseClick($MOUSE_CLICK_LEFT, 323, 232)
        Send($username)
            Sleep(2000)
                MouseClick($MOUSE_CLICK_LEFT, 375, 233)
                Sleep(1700)
            MouseMove(242, 200)
                sleep(1400)
            MouseClick($MOUSE_CLICK_LEFT, 242, 200)
            Sleep(450)
            MouseClick($MOUSE_CLICK_LEFT, 248, 200)
        sleep(3000)
    send($prefix& " : "  &$Name& " , Network")





;Choose Enhancement incident type , Request for information category and Proactive source

        MouseClick($MOUSE_CLICK_LEFT, 1651, 791)
                Send("{DOWN 10}")

        MouseClick($MOUSE_CLICK_LEFT, 1598, 825)
                Send("{DOWN 1}")

        MouseClick($MOUSE_CLICK_LEFT, 1587, 854)
                Send("{DOWN 10}")




;save&Exit ticket

            MouseMove(199, 171)
        sleep(300)
            MouseClick($MOUSE_CLICK_LEFT, 199, 171)
        Sleep(3000)


sleep(2000)

EndFunc

Func grid()

WinClose($Mainform, $prefix&  " Ticket Creator For: " &$Name)

    ;Point on incident and click on create incident
MouseClick($MOUSE_CLICK_LEFT, 32, 349)
        Sleep(400)
    MouseClick($MOUSE_CLICK_LEFT, 150,408)
Sleep(2450)


;click on the app/service and press enter
    MouseClick($MOUSE_CLICK_LEFT, 385, 387)
    sleep(1000)
Send("RLX-*ONSITE*")
    sleep(1000)
Send("{ENTER}")
    sleep(2000)

;assign it to the person specified in $assignee
Sleep (2600)
    MouseClick($MOUSE_CLICK_LEFT, 1457, 417)
    sleep(300)
        Send($gridassigne)
    sleep(300)
    Send("{ENTER}")
Sleep (500)

;Click Description, select all, delete template
Sleep (500)
    MouseClick($MOUSE_CLICK_LEFT, 867, 496)
        Send("^a")
            Send("{BS}")
    send($prefix& " : "  &$username&@CRLF& "Start Date: " &$startdate&@CRLF& "Same profile as: " &$sameprofile&@CRLF& "Internal/External: " &$location&@CRLF& "Need Grid Card" )




;fill up contact and title
    MouseClick($MOUSE_CLICK_LEFT, 323, 232)
        Send($username)
            Sleep(2000)
                MouseClick($MOUSE_CLICK_LEFT, 375, 233)
                Sleep(1700)
            MouseMove(242, 200)
                sleep(1400)
            MouseClick($MOUSE_CLICK_LEFT, 242, 200)
            Sleep(450)
            MouseClick($MOUSE_CLICK_LEFT, 248, 200)
        sleep(3000)
    send($prefix& " : "  &$Name& " , Grid Card")





;Choose Enhancement incident type , Request for information category and Proactive source

        MouseClick($MOUSE_CLICK_LEFT, 1651, 791)
                Send("{DOWN 10}")

        MouseClick($MOUSE_CLICK_LEFT, 1598, 825)
                Send("{DOWN 1}")

        MouseClick($MOUSE_CLICK_LEFT, 1587, 854)
                Send("{DOWN 10}")




;save&Exit ticket

            MouseMove(199, 171)
        sleep(300)
            MouseClick($MOUSE_CLICK_LEFT, 199, 171)
        Sleep(3000)


sleep(2000)


EndFunc  ;==>Grid

Func office()

WinClose($Mainform, $prefix&  " Ticket Creator For: " &$Name)

    ;Point on incident and click on create incident
MouseClick($MOUSE_CLICK_LEFT, 32, 349)
        Sleep(400)
    MouseClick($MOUSE_CLICK_LEFT, 150,408)
Sleep(2450)


;click on the app/service and press enter
    MouseClick($MOUSE_CLICK_LEFT, 385, 387)
    sleep(1000)
Send("RLX-*ONSITE*")
    sleep(1000)
Send("{ENTER}")
    sleep(2000)

;assign it to the person specified in $assignee
Sleep (2600)
    MouseClick($MOUSE_CLICK_LEFT, 1457, 417)
    sleep(300)
        Send($officeassigne)
    sleep(300)
    Send("{ENTER}")
Sleep (500)

;Click Description, select all, delete template
Sleep (500)
    MouseClick($MOUSE_CLICK_LEFT, 867, 496)
        Send("^a")
            Send("{BS}")
                send($prefix& " :" &$username&@CRLF& "Start Date: " &$startdate&@CRLF& "Laptop / Desktop: " &$device&@CRLF& " Office Set up Date : " &$officemove )




;fill up contact and title
    MouseClick($MOUSE_CLICK_LEFT, 323, 232)
        Send($username)
            Sleep(2000)
                MouseClick($MOUSE_CLICK_LEFT, 375, 233)
                Sleep(1700)
            MouseMove(242, 200)
                sleep(1400)
            MouseClick($MOUSE_CLICK_LEFT, 242, 200)
            Sleep(450)
            MouseClick($MOUSE_CLICK_LEFT, 248, 200)
        sleep(3000)
    send($prefix& " :" &$Name& " , Office Set Up")





;Choose Enhancement incident type , Request for information category and Proactive source

        MouseClick($MOUSE_CLICK_LEFT, 1651, 791)
                Send("{DOWN 10}")

        MouseClick($MOUSE_CLICK_LEFT, 1598, 825)
                Send("{DOWN 1}")

        MouseClick($MOUSE_CLICK_LEFT, 1587, 854)
                Send("{DOWN 10}")




;save&Exit ticket

            MouseMove(199, 171)
        sleep(300)
            MouseClick($MOUSE_CLICK_LEFT, 199, 171)
        Sleep(3000)


sleep(2000)

EndFunc  ;==> Office

Func training()

WinClose($Mainform, $prefix&  " Ticket Creator For: " &$Name)

    ;Point on incident and click on create incident
MouseClick($MOUSE_CLICK_LEFT, 32, 349)
        Sleep(400)
    MouseClick($MOUSE_CLICK_LEFT, 150,408)
Sleep(2450)


;click on the app/service and press enter
    MouseClick($MOUSE_CLICK_LEFT, 385, 387)
    sleep(1000)
Send("RLX-*ONSITE*")
    sleep(1000)
Send("{ENTER}")
    sleep(2000)

;assign it to the person specified in $assignee
Sleep (2600)
    MouseClick($MOUSE_CLICK_LEFT, 1457, 417)
    sleep(300)
        Send($trainingassigne)
    sleep(300)
    Send("{ENTER}")
Sleep (500)

;Click Description, select all, delete template
Sleep (500)
    MouseClick($MOUSE_CLICK_LEFT, 867, 496)
        Send("^a")
            Send("{BS}")
                send($prefix& " :" &$username&@CRLF& "Start Date: " &$startdate&@CRLF& "Laptop / Desktop: " &$device&@CRLF& " Training / Onboarding date : " &$trainingdate )




;fill up contact and title
    MouseClick($MOUSE_CLICK_LEFT, 323, 232)
        Send($username)
            Sleep(2000)
                MouseClick($MOUSE_CLICK_LEFT, 375, 233)
                Sleep(1700)
            MouseMove(242, 200)
                sleep(1400)
            MouseClick($MOUSE_CLICK_LEFT, 242, 200)
            Sleep(450)
            MouseClick($MOUSE_CLICK_LEFT, 248, 200)
        sleep(3000)
    send($prefix& " :" &$Name& " , Training / Onboarding")





;Choose Training incident type , Request for information category and Proactive source

        MouseClick($MOUSE_CLICK_LEFT, 1651, 791)
                Send("{DOWN 17}")

        MouseClick($MOUSE_CLICK_LEFT, 1598, 825)
                Send("{DOWN 1}")

        MouseClick($MOUSE_CLICK_LEFT, 1587, 854)
                Send("{DOWN 10}")




;save&Exit ticket

            MouseMove(199, 171)
        sleep(300)
            MouseClick($MOUSE_CLICK_LEFT, 199, 171)
        Sleep(3000)


sleep(2000)

EndFunc ;==> training


Exit

Func TogglePause()
    $g_bPaused = Not $g_bPaused
    While $g_bPaused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
EndFunc   ;==>TogglePause

Func Terminate()

    _Metro_GUIDelete($Mainform)

Exit
    _Metro_GUIDelete($preform)

Exit

EndFunc   ;==>Terminate

The thing is :  i have NO idea how to make it work. 

Any help , as little as it can be would be very appreciated. I have been trying to convert my script for abut 2 weeks now..

 

 

Thank you a lot for helping a desesperate novice programmer :)

 

Share this post


Link to post
Share on other sites
islandspapand

Hi

First of all thanks for a great UDF

I am currently trying to create a menu for WinPE 10 x64

And i have encountered issue regarding the buttons dont have there text, first thought it was some wrong with my script so it testet with the example script same issue her exept when the input box open there the text was working fine, as soon as i add'ed Font in the buttons it works

Capture.PNG

Capture1.PNG

Share this post


Link to post
Share on other sites
islandspapand

I will give it a try and re download the udf and create a new WinPE10 x64(1803) from scratch and se if it help.

the udf works fine in windows  it only in WinPE this ocurres. 

Will give feedback when I have tried it later tonight

Share this post


Link to post
Share on other sites
Nunos

First thank you for this great UDF it looks amazing.

 

My question is I looked for a way to add an Edit Region to a gui and did not see it. I am hoping to use an edit area to show some results. Did I miss it? Is there a way to add it?

 

Thank you in advance.

Share this post


Link to post
Share on other sites
Miliardsto

I cant make more than 4 checkboxes (other checkboxes without Ex works fine)

_Metro_CreateCheckboxEx2

More than 4 these checkboxes returns error

!>23:21:21 AutoIt3.exe ended.rc:-1073741819

how to deal with that

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

    • somebadhat
      By somebadhat
      THANKS TO RASIM, MARTIN, AND BOOMINGRANNY FOR TEACHING ME HOW TO DO THIS. 
      SCRIPT ONE WORKS ON MY PLATFORM.  IT CREATED THE ATTACHMENTS.
      IMPROVEMENTS ARE WELCOMED. 
      SEE BOLD TEXT BELOW.
      PURPOSE:
      WRITE AN AUTOIT3 SCRIPT THAT WHEN RUN IN A WINDOWS SCHEDULED TASK WILL PRODUCE SCREENSHOTS OF THE DESKTOP, START MENU, QUICK ACCESS MENU, AND DEVICE MANAGER WITHOUT INTERACTION.  IF MULTIPLE SHOTS ARE REQUIRED THE SHOTS CAN BE COMBINED STACKED OR SIDE-BY-SIDE.  SCRIPTS ARE WRITTEN TO RUN ON WINDOWS 10.0.17134.286 PRO 64-BIT IN AN ACCOUNT WITH ADMIN PRIVILEGES IN A WINDOW WITH ADMIN PRIVILEGES AND AUTOIT3 v3.3.14.5
      PROCEDURE:
      WHAT ARE THE COORDINATES OF THE SCREENSHOTS?
      WHERE DO YOU WANT TO CREATE THE SHOTS?
      WHAT DO YOU WANT TO CALL THE SHOTS?
      TAKE THE SHOTS.
      PROCESS THE SHOTS:
      WHERE ARE THEY? WHAT ARE THEY CALLED? WHERE DO YOU WANT THEM TO GO? WHAT DO YOU WANT TO CALL THEM? DO YOU WANT THEM STACKED, SIDE-BY-SIDE, OR NEITHER? TWEAK TO ELIMINATE ERRORS.
      RESULTS: SCRIPT TWO I'VE INCORPORATED THE SUGGESTION OF @BOOMINGRANNY AND MADE A SECOND SCRIPT.  MY WAY OF FINDING THE SHOT COORDINATES OF THE DEVICE MANAGER DID NOT WORK WHEN STARTING THE DEVICE MANAGER THIS WAY . #include <Coordinates.au3> finds incorrect coordinates.  They are shifted down ~50px.  Does not work on menus exposed by right clicking or the start menu. WORK NEEDS TO BE DONE TO ELIMINATE THE BLACK BAR WHEN THE SHOTS ARE NOT THE SAME HEIGHT and ARE BEING DISPLAYED SIDE-BY-SIDE. 
      SEE    If $Position = "right"
      CONCLUSION:
      UNFINISHED AS OF THIS TIME.
      MAKE ROBUST.  A ROBUST SCRIPT FAILS LESS THAN 1% OF THE TIME AND RUNS ON WINDOWS 10 64-BIT THROUGH WINDOWS XP 32-BIT SP0 IN AN ACCOUNT WITH STANDARD/USER/LIMITED PRIVILEGES IN A WINDOW WITH STANDARD/USER/LIMITED PRIVILEGES.   IT WOULD BE NICE TO MAKE THE SCRIPT FASTER AND LIGHTER.

      RESULTS ATTACHED. SCRIPT ONE:
      ;; AUTOIT3 v3.3.14.5 SCRIPT ;; PURPOSE: ; WRITE AN AUTOIT3 SCRIPT THAT WHEN RUN IN A WINDOWS SCHEDULED TASK WILL PRODUCE SCREENSHOTS OF THE WINDOWS 10 DESKTOP, START MENU, QUICK ACCESS MENU, AND DEVICE MANAGER WITHOUT INTERACTION. ;; SEE https://www.autoitscript.com/forum/topic/196256-screenshot-win10-desktop-quick-access-device-manager-start-menu-automated-shots-stacked-or-side-by-side-requires-admin/ ;; MUST BE RUN WITH ADMIN PRIVILEDGES. NOT ROBUST YET. ;; SCREENSHOT WIN10 DESKTOP, QUICK ACCESS, DEVICE MANAGER AND START MENU. ;; MULTIPLE SHOTS JOINED STACKED, SIDE-BY-SIDE, OR NEITHER. SEE SIDE-BY-SIDE ;; WORK NEEDS TO BE DONE TO ELIMINATE THE BLACK BAR WHEN THE SHOTS ARE NOT THE SAME HEIGHT AND ARE BEING DISPLAYED SIDE-BY-SIDE. ;; MY GUESS THE EASIEST THING TO DO WOULD BE TO TURN IT WHITE. ;; YOU WILL HAVE TO TELL IT WHERE YOUR TASKBAR EXPLORER SHORTCUT IS. SEE MouseClick ( "right", 74, 748, 1, 0) ;; YOU WILL HAVE TO TELL IT WHERE TO PROCESS AND MOVE THE SHOTS. SEE MULTIPLE OF $ZDIR, $ZNAME, FQPN SEE $outputFile ;; ;; IMPROVEMENTS ARE WELCOMED ;; FIND LIST OF ENVIRONMENT VARIABLES NAMES ;; AUTOIT3 HELP File ;; "C:\Program Files (x86)\AutoIt3\AutoIt.chm" ;; SEARCH FOR MACRO REFERENCE AND MACRO REFERENCE - DIRECTORY ;; THANKS TO RASIM, MARTIN, AND BOOMINGRANNY AT AUTOITSCRIPT.COM ; https://www.autoitscript.com/forum/topic/80896-join-two-bitmap-images/ ; https://www.autoitscript.com/forum/topic/80896-join-two-bitmap-images/?do=findComment&comment=581214 ; https://www.autoitscript.com/forum/topic/80896-join-two-bitmap-images/?do=findComment&comment=581372 ; https://www.autoitscript.com/forum/topic/196256-screenshot-win10-desktop-quick-access-device-manager-start-menu-automated-shots-stacked-or-side-by-side-requires-admin/ ; https://www.autoitscript.com/forum/topic/196256-screenshot-win10-desktop-quick-access-device-manager-start-menu-automated-shots-stacked-or-side-by-side-requires-admin//?do=findComment&comment=1407181 ;; "C:\Program Files (x86)\AutoIt3\AutoIt3_x64.exe" "F:\MYAPPS\WINDOWS\screenshots1.au3" ;; Screenshot Win10 desktop, quick access, device manager, start menu. Automated. Shots stacked or side-by-side. Requires admin. ; BEGIN How to get 4 Screen Coordinates just by dragging a Rectangle ; download Coordinates.au3 https://www.autoitscript.com/forum/applications/core/interface/file/attachment.php?id=59228 ; END How to get 4 Screen Coordinates just by dragging a Rectangle ; BEGIN CAPTURE ; https://www.autoitscript.com/forum/topic/8377-capture-screen-dll/ ; Capture full screen ; Fist parameter - filename, last - jpeg quality. #include <ScreenCapture.au3> ; BEGIN THE FOLLOWING REQUIRED TO SHOOT THE ENTIRE DEVICE MANAGER IN ONE SHOT ; https://www.autoitscript.com/forum/topic/196256-screenshot-win10-desktop-quick-access-device-manager-start-menu-automated-shots-stacked-or-side-by-side-requires-admin//?do=findComment&comment=1407181 ; credit for the screenshot scrolling code goes to monoscout999 #include <ScrollBarsConstants.au3> #include <WindowsConstants.au3> #include <process.au3> #include <GuiTreeView.au3> #include <GuiScrollBars.au3> #include <WinAPISysWin.au3> ; END THE FOLLOWING REQUIRED TO SHOOT THE ENTIRE DEVICE MANAGER IN ONE SHOT ; BETTER RESULTS IF AT LEASE ONE EXPLORER WINDOW IS OPEN Run("explorer.exe", "", @SW_SHOWMINIMIZED) ; Run( @comspec & " /c start explorer.exe","", @SW_SHOWMINIMIZED) ; Run( @comspec & " /c start explorer.exe","", @SW_HIDE) WinWait("My Computer") ; WinActivate("My Computer") ; WinSetState("My Computer", "", @SW_MAXIMIZE) ; wake the monitor, show the desktop, wait X milliseconds ; Send(" ") send( "#d" ) Sleep( 500 ) ; QUICK ACCESS ; https://www.autoitscript.com/autoit3/docs/functions/MouseClick.htm MouseClick ( "right", 74, 748, 1, 0 ) ; right click windows explorer shortcut on taskbar to open context menu Sleep( 250 ) send("{PGDN}") ; expose the most pinned items Sleep( 250 ) send("{down}") ; expose the most pinned items $ZDIR=@homeDrive & "\Users\Default\Desktop\UPDATE" ;where does the screenshot go $ZNAME="\quick-access.jpg" ;what will its name be $ZTOPX=0 $ZTOPY=0 $ZBOTTOMX=250 $ZBOTTOMY=615 Sleep( 500 ) ScreenShot() ; Sleep( 2000 ) MouseClick ( "left", 74, 748, 1, 0 ) ; left click windows explorer shortcut on taskbar to close context menu send( "#d" ) ; show desktop ; exit ; START MENU Sleep( 500 ) send("{LWIN}") ;OPEN START MENU $ZDIR=@tempDir ;where does the screenshot go $ZNAME="\start-menu1.jpg" ;what will its name be $ZTOPX=315 $ZTOPY=139 $ZBOTTOMX=1285 $ZBOTTOMY=660 Sleep( 1250 ) ScreenShot() ; BEGIN WEAK POINT send("{tab}"); COMBINING TABS BREAKS SCRIPT Sleep( 120 ) send("{tab}") Sleep( 120 ) send("{tab}") Sleep( 500 ) send("{down 8}"); move to the bottom of the start menu to take the next screenshot. operates on the first column of shortcuts. will only go to the bottom of it. add send("{right}") after the last tab to operate on another column. ; END WEAK POINT ; $ZDIR=@tempDir ;where does the screenshot go $ZNAME="\start-menu2.jpg" ;what will its name be $ZTOPX=315 $ZTOPY=409 $ZBOTTOMX=1285 $ZBOTTOMY=730 Sleep( 125 ) ScreenShot() send("{LWIN}") ; CLOSE THE START MENU ; DESKTOP $ZDIR=@homeDrive & "\Users\Default\Desktop\UPDATE" ;where does the screenshot go $ZNAME="\desktop.jpg" ;what will its name be $ZTOPX=0 $ZTOPY=0 $ZBOTTOMX=-1 $ZBOTTOMY=-1 Sleep( 125 ) ScreenShot() ; BEGIN OPEN DEVICE MANAGER MAXIMIZED ; CHOOSE YOUR POISON Run( @comspec & " /c start devmgmt.msc","", @SW_HIDE) WinWait("Device Manager") WinActivate("Device Manager") WinSetState("Device Manager", "", @SW_MAXIMIZE) ; ; BEGIN SHOOTING THE DEVICE MANAGER THE FOLLOWING WAY REQUIRED: ; 1. IT BE DONE AT THE BEGINNING OF THE SCRIPT. ; 2. MORE WORK TO FIND THE COORDINATES: ; https://www.autoitscript.com/forum/topic/165325-how-to-get-4-screen-coordinates-just-by-dragging-a-rectangle/?do=findComment&comment=1206830 ; modified and saved as "C:\Program Files (x86)\AutoIt3\Include\Coordinates.au3" ; download Coordinates.au3 https://www.autoitscript.com/forum/topic/196256-screenshot-win10-desktop-quick-access-device-manager-start-menu-automated-shots-stacked-or-side-by-side-requires-admin/ ; Run("control /name Microsoft.DeviceManager") ; script must be run with admin privileges ; WinWaitActive("Device Manager") ; $WinHndl = WinGetHandle("Device Manager") ; WinMove($WinHndl,"",-4,0,@DesktopWidth+10,@DesktopHeight) ; MAKE ADJUSTMENTS HERE ; #include <Coordinates.au3> ; END SHOOTING THE DEVICE MANAGER THE FOLLOWING WAY REQUIRED: ; ; Run("mmc devmgmt.msc") ; WinActivate ( "Device Manager", "" ) ; Sleep( 125 ) ; WinSetState("[ACTIVE]", "", @SW_MAXIMIZE) ; Sleep( 125 ) ; WinSetState("Device Manager", "", @SW_MAXIMIZE) ; END OPEN DEVICE MANAGER MAXIMIZED Sleep( 1000 ) Send("{TAB}") Sleep( 250 ) send("{down 4}") Sleep( 250 ) send("{right}") ;DISK DRIVES Sleep( 250 ) send("{down2}") Sleep( 250 ) send("{right}") ;DISPLAY ADAPTERS Sleep( 250 ) send("{down 5}") Sleep( 250 ) send("{right}") ;IDE ATA/ATAPI CONTROLLERS Sleep( 250 ) send("{down 6}") Sleep( 250 ) send("{right}") ;NETWORK ADAPTERS $ZDIR=@tempDir ;where does the screenshot go $ZNAME="\device-manager1.jpg" ;what will its name be $ZTOPX=2 $ZTOPY=77 $ZBOTTOMX=272 $ZBOTTOMY=382 Sleep( 250 ) ScreenShot() send("{down 15}") Sleep( 250 ) send("{right}") ;SOUND, VIDEO, AND GAME CONTROLLERS Sleep( 250 ) send("{down 7}") ;MOVES NETWORK ADAPTERS TO THE $ZTOPY=273 POSITION $ZDIR=@tempDir ;where does the screenshot go $ZNAME="\device-manager2.jpg" ;what will its name be $ZTOPX=2 $ZTOPY=273 $ZBOTTOMX=272 $ZBOTTOMY=638 Sleep( 250 ) ScreenShot() Sleep( 1000 ) ; https://www.autoitscript.com/forum/topic/196256-screenshot-win10-desktop-quick-access-device-manager-start-menu-automated-shots-stacked-or-side-by-side-requires-admin//?do=findComment&comment=1407181 ; credit for the screenshot scrolling code goes to monoscout999 ; screenshot of everything in the device manager $outputFile = @HomeDrive&"\Users\Default\Desktop\UPDATE\device-manager2.jpg" ;get a handle of things $WinHndl = WinGetHandle("Device Manager") $Treeview = ControlGetHandle("Device Manager","","[Class:SysTreeView32]") ;expand the treeview control _GUICtrlTreeView_Expand($Treeview) MouseMove(300,200) MouseWheel("up",100) Sleep(250) ;Get Edit1 Vertical Scroll Min/Max range and page size. $aScrollRange = _GUIScrollBars_GetScrollRange($Treeview, $SB_VERT) $iPageSize = _GUIScrollBars_GetScrollInfoPage($Treeview, $SB_VERT) $iPages = Round($aScrollRange[1] / $iPageSize) ;get treeview control size $aTreeviewPos = ControlGetPos($WinHndl,"",$Treeview) ;Capture $scrollBarSize = 20 $hDC = _winapi_GetDC($Treeview) $hCDC = _WinAPI_CreateCompatibleDC($hDC) $hBMP = _WinAPI_CreateCompatibleBitmap($hDC, $aTreeviewPos[2] - $scrollBarSize , ($aTreeviewPos[3] * ($iPages +1 ))) _WinAPI_SelectObject($hCDC, $hBMP) For $i = 0 to $iPages+1 _WinAPI_BitBlt($hCDC, 0, $aTreeviewPos[3] * $i, $aTreeviewPos[2] - $scrollBarSize , ($aTreeviewPos[3] ), $hDC,0, 0, $SRCCOPY) _WinAPI_PostMessage($Treeview,$WM_VSCROLL,$SB_PAGEDOWN,0) Sleep(250) Next _WinAPI_ReleaseDC($Treeview, $hDC) _WinAPI_DeleteDC($hCDC) _GDIPlus_Startup() $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBMP) _GDIPlus_ImageSaveToFile($hImage, $outputFile) _GDIPlus_Shutdown() _WinAPI_DeleteObject($hBMP) ; If FileExists($outputFile) Then ShellExecute($outputFile) Sleep( 1000 ) ProcessClose ( "mmc.exe" ) ; close the device manager. THIS MIGHT BE WEAK. ; MouseMove ( 1150, 650) ; TO START, SECURE, SHUTDOWN SHORTCUT Sleep( 1000 ) ;; END CAPTURE ;; BEGIN JOIN IMAGES #include <GDIPlus.au3> #include <WinAPISysWin.au3> ; FULLY QUALIFIED PATH NAME (FQPN) TO FIRST IMAGE, FQPN TO SECOND IMAGE, FQPN TO COMBINED IMAGE ; _BMPJoin(@tempDir & "\start-menu1.jpg", @tempDir & "\start-menu2.jpg", @homeDrive & "\Users\Default\Desktop\UPDATE\start-menu.jpg", "right") ; SIDE-BY-SIDE ; _BMPJoin(@tempDir & "\device-manager1.jpg", @tempDir & "\device-manager2.jpg", @homeDrive & "\Users\Default\Desktop\UPDATE\device-manager.jpg", "") ; STACKED _BMPJoin(@tempDir & "\start-menu1.jpg", @tempDir & "\start-menu2.jpg", @homeDrive & "\Users\Default\Desktop\UPDATE\start-menu.jpg", "") _BMPJoin(@tempDir & "\device-manager1.jpg", @tempDir & "\device-manager2.jpg", @homeDrive & "\Users\Default\Desktop\UPDATE\device-manager.jpg", "") ;; END JOIN IMAGES Exit ; END OF SCRIPT ;; BEGIN SCREENSHOT FUNCTION Func ScreenShot() ; Capture full screen _ScreenCapture_Capture($ZDIR & $ZNAME, $ZTOPX, $ZTOPY, $ZBOTTOMX, $ZBOTTOMY) EndFunc ;==>ScreenShot ; https://www.autoitscript.com/autoit3/docs/libfunctions/_ScreenCapture_Capture.htm ; $iLeft [optional] X coordinate of the upper left corner of the rectangle ; $iTop [optional] Y coordinate of the upper left corner of the rectangle ; $iRight [optional] X coordinate of the lower right corner of the rectangle. If this is -1, the current screen width will be used. ; $iBottom [optional] Y coordinate of the lower right corner of the rectangle. If this is -1, the current screen height will be used. ;; END SCREENSHOT FUNCTION ;; BEGIN JOIN IMAGES FUNCTION ; https://www.autoitscript.com/forum/topic/80896-join-two-bitmap-images/ Func _BMPJoin($sFile1, $sFile2, $sResult, $Position) Local $hSourceIMG1, $hSourceIMG2, $iWidth1, $width2, $iHeight1, $iHeight2, $hBitmap, $hImage, $hGraphics Local $iBwidth, $iBheight If Not FileExists(StringRegExpReplace($sResult, "(^.*)\\.*", "\1")) Then $sResult = @ScriptDir & "\result.bmp" _GDIPlus_Startup() $hSourceIMG1 = _GDIPlus_ImageLoadFromFile($sFile1) $hSourceIMG2 = _GDIPlus_ImageLoadFromFile($sFile2) $iWidth1 = _GDIPlus_ImageGetWidth($hSourceIMG1) $iHeight1 = _GDIPlus_ImageGetHeight($hSourceIMG1) $iWidth2 = _GDIPlus_ImageGetWidth($hSourceIMG2) $iHeight2 = _GDIPlus_ImageGetHeight($hSourceIMG2) If $Position = "right" Then $iBwidth = $iWidth1 + $iWidth2 $iBheight = $iHeight1 if $iHeight2 > $iHeight1 then $iBheight = $iHeight2 ; WORK NEEDS TO BE DONE TO ELIMINATE THE BLACK BAR WHEN THE SHOTS ARE NOT THE SIZE HEIGHT AND ARE BEING DISPLAYED SIDE-BY-SIDE. Else;position = "below" $iBwidth = $iWidth1 if $iWidth2 > $iWidth1 then $iBwidth = $iWidth2 $iBheight = $iHeight1 + $iHeight2 EndIf $hBitmap = _CreateBMP($iBwidth, $iBheight) $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap) $hGraphics = _GDIPlus_ImageGetGraphicsContext($hImage) ; https://www.autoitscript.com/autoit3/docs/libfunctions/_GDIPlus_GraphicsDrawImageRectRect.htm _GDIPlus_GraphicsDrawImageRectRect($hGraphics, $hSourceIMG1, 0, 0, $iWidth1, $iHeight1, 0, 0, $iWidth1, $iHeight1) If $Position = "right" Then _GDIPlus_GraphicsDrawImageRectRect($hGraphics, $hSourceIMG2, 0, 0, $iWidth2, $iHeight2, $iWidth1, 0, $iWidth2, $iHeight2) Else _GDIPlus_GraphicsDrawImageRectRect($hGraphics, $hSourceIMG2, 0, 0, $iWidth2, $iHeight2, 0, $iHeight1, $iWidth2, $iHeight2) EndIf _GDIPlus_ImageSaveToFile($hImage, $sResult) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteObject($hImage) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_ImageDispose($hSourceIMG1) _GDIPlus_ImageDispose($hSourceIMG2) _GDIPlus_Shutdown() EndFunc ;==>_BMPJoin Func _CreateBMP($sWidth, $sHeight) Local $hWnd, $hDC, $hBMP $hWnd = _WinAPI_GetDesktopWindow() $hDC = _WinAPI_GetDC($hWnd) $hBMP = _WinAPI_CreateCompatibleBitmap($hDC, $sWidth, $sHeight) _WinAPI_ReleaseDC($hWnd, $hDC) Return $hBMP EndFunc ;==>_CreateBMP ;; END JOIN IMAGES FUNCTION SCRIPT TWO:
      ;; AUTOIT3 v3.3.14.5 SCRIPT ;; PURPOSE: ; WRITE AN AUTOIT3 SCRIPT THAT WHEN RUN IN A WINDOWS SCHEDULED TASK WILL PRODUCE A SCREENSHOT OF THE WINDOWS 10 DESKTOP, START MENU, QUICK ACCESS MENU, AND DEVICE MANAGER WITHOUT INTERACTION. ;; SEE https://www.autoitscript.com/forum/topic/196256-screenshot-win10-desktop-quick-access-device-manager-start-menu-automated-shots-stacked-or-side-by-side-requires-admin/ ;; MUST BE RUN WITH ADMIN PRIVILEDGES. NOT ROBUST YET. ;; DOWNLOAD COORDINATES.AU3 https://www.autoitscript.com/forum/topic/196256-screenshot-win10-desktop-quick-access-device-manager-start-menu-automated-shots-stacked-or-side-by-side-requires-admin/ ;; SCREENSHOT WIN10 DESKTOP, QUICK ACCESS, DEVICE MANAGER AND START MENU. ;; MULTIPLE SHOTS JOINED STACKED, SIDE-BY-SIDE, OR NEITHER. SEE SIDE-BY-SIDE ;; WORK NEEDS TO BE DONE TO ELIMINATE THE BLACK BAR WHEN THE SHOTS ARE NOT THE SAME HEIGHT AND ARE BEING DISPLAYED SIDE-BY-SIDE. ;; MY GUESS THE EASIEST THING TO DO WOULD BE TO TURN IT WHITE. ;; YOU WILL HAVE TO TELL IT WHERE YOUR TASKBAR EXPLORER SHORTCUT IS. SEE MouseClick ( "right", 74, 748, 1, 0) ;; YOU WILL HAVE TO TELL IT WHERE TO PROCESS AND MOVE THE SHOTS. SEE MULTIPLE OF $ZDIR, $ZNAME, FQPN SEE $outputFile ;; IMPROVEMENTS ARE WELCOMED ;; FIND LIST OF ENVIRONMENT VARIABLES NAMES ;; AUTOIT3 HELP File ;; "C:\Program Files (x86)\AutoIt3\AutoIt.chm" ;; SEARCH FOR MACRO REFERENCE AND MACRO REFERENCE - DIRECTORY ;; THANKS TO RASIM, MARTIN, AND BOOMINGRANNY AT AUTOITSCRIPT.COM ; https://www.autoitscript.com/forum/topic/80896-join-two-bitmap-images/ ; https://www.autoitscript.com/forum/topic/80896-join-two-bitmap-images/?do=findComment&comment=581214 ; https://www.autoitscript.com/forum/topic/80896-join-two-bitmap-images/?do=findComment&comment=581372 ; https://www.autoitscript.com/forum/topic/196256-screenshot-win10-desktop-quick-access-device-manager-start-menu-automated-shots-stacked-or-side-by-side-requires-admin/ ; https://www.autoitscript.com/forum/topic/196256-screenshot-win10-desktop-quick-access-device-manager-start-menu-automated-shots-stacked-or-side-by-side-requires-admin//?do=findComment&comment=1407181 ;; "C:\Program Files (x86)\AutoIt3\AutoIt3_x64.exe" "F:\MYAPPS\WINDOWS\screenshots9.au3" ;; Screenshot Win10 desktop, quick access, device manager, start menu. Shots stacked or side-by-side. Admin privileges. Not robust. ; BEGIN CAPTURE ; https://www.autoitscript.com/forum/topic/8377-capture-screen-dll/ ; Capture full screen ; Fist parameter - filename, last - jpeg quality. #include <ScreenCapture.au3> send("#d") ; show desktop ;DEVICE MANAGER ;STARTING THE DEVICE MANAGER THIS WAY REQUIRED: ; 1. IT BE DONE AT THE BEGINNING OF THE SCRIPT. ; 2. MORE WORK TO FIND THE COORDINATES: ; https://www.autoitscript.com/forum/topic/165325-how-to-get-4-screen-coordinates-just-by-dragging-a-rectangle/?do=findComment&comment=1206830 ; modified and saved as "C:\Program Files (x86)\AutoIt3\Include\Coordinates.au3" ; download Coordinates.au3 https://www.autoitscript.com/forum/topic/196256-screenshot-win10-desktop-quick-access-device-manager-start-menu-automated-shots-stacked-or-side-by-side-requires-admin/ Run("control /name Microsoft.DeviceManager") WinWaitActive("Device Manager") $WinHndl = WinGetHandle("Device Manager") WinMove($WinHndl,"",-4,0,@DesktopWidth+10,@DesktopHeight) ; MAKE ADJUSTMENTS HERE IF NECESSARY Sleep( 1000 ) Send("{TAB}") Sleep( 125 ) send("{down 4}") Sleep( 125 ) send("{right}") Sleep( 125 ) send("{down2}") Sleep( 125 ) send("{right}") Sleep( 125 ) send("{down 5}") Sleep( 125 ) send("{right}") Sleep( 500 ) send("{down 5}") Sleep( 500 ) send("{right}") Sleep( 125 ) send("{down 14}") Sleep( 125 ) send("{right}") Sleep( 125 ) send("{down 7}") Sleep ( 120 ) $ZDIR=@tempDir ;where does the screenshot go $ZNAME="\device-manager1.jpg" ;what will its name be $ZTOPX=24 $ZTOPY=84 $ZBOTTOMX=277 $ZBOTTOMY=374 #include <Coordinates.au3>; finds incorrect coordinates. They are shifted down ~50px. Does not work on menus exposed by right clicking or the start menu ScreenShot () ; exit $ZDIR=@tempDir ;where does the screenshot go $ZNAME="\device-manager2.jpg" ;what will its name be $ZTOPX=24 $ZTOPY=374 $ZBOTTOMX=277 $ZBOTTOMY=716 #include <Coordinates.au3>; finds incorrect coordinates. They are shifted down ~50px. Does not work on menus exposed by right clicking or the start menu ScreenShot() Sleep( 500 ) ProcessClose ( "mmc.exe" ) ; close the device manager ; QUICK ACCESS ; https://www.autoitscript.com/autoit3/docs/functions/MouseClick.htm MouseClick ( "right", 74, 748, 1, 0) ; right click windows explorer shortcut on taskbar. Sleep( 1200 ) send("{up}") ; SCRIPT MORE RELIABLE IF UPs ARE NOT COMBINED Sleep( 120 ) send("{up}") Sleep( 120 ) send("{up}") Sleep( 120 ) send("{up}") Sleep( 120 ) send("{down}") Sleep (1200) $ZDIR=@homeDrive & "\Users\Default\Desktop\UPDATE" ;where does the screenshot go $ZNAME="\quick-access.jpg" ;what will its name be $ZTOPX=0 $ZTOPY=0 $ZBOTTOMX=251 $ZBOTTOMY=615 #include <Coordinates.au3>; finds incorrect coordinates. They are shifted down ~50px. Does not work on menus exposed by right clicking or the start menu ScreenShot() Sleep ( 250 ) ; START MENU send("{LWIN}") ;OPEN START MENU Sleep ( 250 ) $ZDIR=@tempDir ;where does the screenshot go $ZNAME="\start-menu1.jpg" ;what will its name be $ZTOPX=315 $ZTOPY=139 $ZBOTTOMX=1285 $ZBOTTOMY=660 #include <Coordinates.au3>; finds incorrect coordinates. They are shifted down ~50px. Does not work on menus exposed by right clicking or the start menu ScreenShot() ; BEGIN WEAK POINT send("{tab}"); COMBINING TABS BREAKS SCRIPT Sleep ( 240 ) send("{tab}") Sleep ( 240 ) send("{tab}") Sleep ( 500 ) send("{down 8}"); move to the bottom of the start menu to take the next screenshot. operates on the first column of shortcuts. will only go to the bottom of it. add send("{right}") after the last tab to operate on another column. Sleep ( 1000 ) ; END WEAK POINT ; $ZDIR=@tempDir ;where does the screenshot go $ZNAME="\start-menu2.jpg" ;what will its name be $ZTOPX=315 $ZTOPY=409 $ZBOTTOMX=1285 $ZBOTTOMY=730 #include <Coordinates.au3>; finds incorrect coordinates. They are shifted down ~50px. Does not work on menus exposed by right clicking or the start menu ScreenShot() Sleep ( 120 ) send("{LWIN}") ; CLOSE THE START MENU Sleep ( 120 ) ; DESKTOP $ZDIR=@homeDrive & "\Users\Default\Desktop\UPDATE" ;where does the screenshot go $ZNAME="\desktop.jpg" ;what will its name be $ZTOPX=0 $ZTOPY=0 $ZBOTTOMX=-1 $ZBOTTOMY=-1 ScreenShot() sleep (500) ;; END CAPTURE ;; BEGIN JOIN IMAGES #include <GDIPlus.au3> #include <WinAPISysWin.au3> ; FULLY QUALIFIED PATH NAME (FQPN) TO FIRST IMAGE, FQPN TO SECOND IMAGE, FQPN TO COMBINED IMAGE ; _BMPJoin(@tempDir & "\start-menu1.jpg", @tempDir & "\start-menu2.jpg", @homeDrive & "\Users\Default\Desktop\UPDATE\start-menu.jpg", "right") ; SIDE-BY-SIDE ; _BMPJoin(@tempDir & "\device-manager1.jpg", @tempDir & "\device-manager2.jpg", @homeDrive & "\Users\Default\Desktop\UPDATE\device-manager.jpg", "") ; STACKED _BMPJoin(@tempDir & "\start-menu1.jpg", @tempDir & "\start-menu2.jpg", @homeDrive & "\Users\Default\Desktop\UPDATE\start-menu.jpg", "") _BMPJoin(@tempDir & "\device-manager1.jpg", @tempDir & "\device-manager2.jpg", @homeDrive & "\Users\Default\Desktop\UPDATE\device-manager.jpg", "") ;; END JOIN IMAGES Exit ; END OF SCRIPT ;; BEGIN SCREENSHOT FUNCTION Func ScreenShot() ; Capture full screen _ScreenCapture_Capture($ZDIR & $ZNAME, $ZTOPX, $ZTOPY, $ZBOTTOMX, $ZBOTTOMY) EndFunc ;==>ScreenShot ; https://www.autoitscript.com/autoit3/docs/libfunctions/_ScreenCapture_Capture.htm ; $iLeft [optional] X coordinate of the upper left corner of the rectangle ; $iTop [optional] Y coordinate of the upper left corner of the rectangle ; $iRight [optional] X coordinate of the lower right corner of the rectangle. If this is -1, the current screen width will be used. ; $iBottom [optional] Y coordinate of the lower right corner of the rectangle. If this is -1, the current screen height will be used. ;; END SCREENSHOT FUNCTION ;; BEGIN JOIN IMAGES FUNCTION ; https://www.autoitscript.com/forum/topic/80896-join-two-bitmap-images/ Func _BMPJoin($sFile1, $sFile2, $sResult, $Position) Local $hSourceIMG1, $hSourceIMG2, $iWidth1, $width2, $iHeight1, $iHeight2, $hBitmap, $hImage, $hGraphics Local $iBwidth, $iBheight If Not FileExists(StringRegExpReplace($sResult, "(^.*)\\.*", "\1")) Then $sResult = @ScriptDir & "\result.bmp" _GDIPlus_Startup() $hSourceIMG1 = _GDIPlus_ImageLoadFromFile($sFile1) $hSourceIMG2 = _GDIPlus_ImageLoadFromFile($sFile2) $iWidth1 = _GDIPlus_ImageGetWidth($hSourceIMG1) $iHeight1 = _GDIPlus_ImageGetHeight($hSourceIMG1) $iWidth2 = _GDIPlus_ImageGetWidth($hSourceIMG2) $iHeight2 = _GDIPlus_ImageGetHeight($hSourceIMG2) If $Position = "right" Then $iBwidth = $iWidth1 + $iWidth2 $iBheight = $iHeight1 if $iHeight2 > $iHeight1 then $iBheight = $iHeight2 ; WORK NEEDS TO BE DONE TO ELIMINATE THE BLACK BAR WHEN THE SHOTS ARE NOT THE SIZE HEIGHT AND ARE BEING DISPLAYED SIDE-BY-SIDE. Else;position = "below" $iBwidth = $iWidth1 if $iWidth2 > $iWidth1 then $iBwidth = $iWidth2 $iBheight = $iHeight1 + $iHeight2 EndIf $hBitmap = _CreateBMP($iBwidth, $iBheight) $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap) $hGraphics = _GDIPlus_ImageGetGraphicsContext($hImage) ; https://www.autoitscript.com/autoit3/docs/libfunctions/_GDIPlus_GraphicsDrawImageRectRect.htm _GDIPlus_GraphicsDrawImageRectRect($hGraphics, $hSourceIMG1, 0, 0, $iWidth1, $iHeight1, 0, 0, $iWidth1, $iHeight1) If $Position = "right" Then _GDIPlus_GraphicsDrawImageRectRect($hGraphics, $hSourceIMG2, 0, 0, $iWidth2, $iHeight2, $iWidth1, 0, $iWidth2, $iHeight2) Else _GDIPlus_GraphicsDrawImageRectRect($hGraphics, $hSourceIMG2, 0, 0, $iWidth2, $iHeight2, 0, $iHeight1, $iWidth2, $iHeight2) EndIf _GDIPlus_ImageSaveToFile($hImage, $sResult) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteObject($hImage) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_ImageDispose($hSourceIMG1) _GDIPlus_ImageDispose($hSourceIMG2) _GDIPlus_Shutdown() EndFunc ;==>_BMPJoin Func _CreateBMP($sWidth, $sHeight) Local $hWnd, $hDC, $hBMP $hWnd = _WinAPI_GetDesktopWindow() $hDC = _WinAPI_GetDC($hWnd) $hBMP = _WinAPI_CreateCompatibleBitmap($hDC, $sWidth, $sHeight) _WinAPI_ReleaseDC($hWnd, $hDC) Return $hBMP EndFunc ;==>_CreateBMP ;; END JOIN IMAGES FUNCTION ;; BEGIN COORDINATES FUNCTION ;; END COORDINATES FUNCTION
      KEYWORDS: RIGHT CLICK EXPLORER SHORTCUT PINNED TO TASKBAR PINNED TO QUICK ACCESS PIN TO QUICK ACCESS PIN TO EXPLORER PINNED TO EXPLORER
       
       
    • stayready40
      By stayready40
      Hello all. I created a script to uninstall Symantec from our environment and I placed the "BlockInput(1)" command in the beginning of the script so that end users would not be able to move the mouse or keyboard to disrupt the mouse clicks.
      During testing we found that this worked for our Windows 7 machines, but for our windows 10 machines the mouse disable did not work can anyone shed some light on why this is? 
      Here is my code:

       
    • faustf
      By faustf
      hi guys
      i have a script  like this,  in windows 7 work perfect , in windows 10 not  work  , some one can explain me  why ??'
      #include <Array.au3> #include <MsgBoxConstants.au3> Global $aGPathFoto= FileReadToArray (@ScriptDir & "\TEMP\PathFoto.txt") Local $ctrl = 0 While 1 Local $hWnd = WinWait("[CLASS:#32770]", "", 10) If WinExists("[CLASS:#32770]") Then If $ctrl < 2 Then ControlSend($hWnd, "Choose File to Upload", "[CLASS:Edit; INSTANCE:1]", $aGPathFoto[0]&"{Enter}") Exit $ctrl += 1 Else ExitLoop EndIf EndIf WEnd $aGpathfoto = C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg
    • Skeletor
      By Skeletor
      Hi Virtual People, 
      I'm trying to lock my screen in Windows 10 but to no avail. 
      Has Windows 10 forbidden this feature? 
      Send("#l") Above code does not work. Even sending Ctrl Alt Del does not work nor as an Admin. 
      Note: I want to lock my screen, not log off. Thanks for been kind.
       
    • astrionn
      By astrionn
      Hi Guys,
       
      I`m trying to record with my webcam in 5s intervalls and do some stuff between starting to record and stoping.
      I took code from here: https://www.autoitscript.com/forum/topic/27925-webcam-example/
      and took what looked relevant to me.
      I use 3 different files:
       Is called WMS.au3 and contains all the constants for the dll calls is called rec.au3 and does all necessary dll calls to start a webcam recording to a file Is called stopcam.exe and does the dll calls to stop recording into a file WMS.au3  :
      $WM_CAP_START = 0x400 $WM_CAP_UNICODE_START = $WM_CAP_START +100 $WM_CAP_PAL_SAVEA = $WM_CAP_START + 81 $WM_CAP_PAL_SAVEW = $WM_CAP_UNICODE_START + 81 $WM_CAP_UNICODE_END = $WM_CAP_PAL_SAVEW $WM_CAP_ABORT = $WM_CAP_START + 69 $WM_CAP_DLG_VIDEOCOMPRESSION = $WM_CAP_START + 46 $WM_CAP_DLG_VIDEODISPLAY = $WM_CAP_START + 43 $WM_CAP_DLG_VIDEOFORMAT = $WM_CAP_START + 41 $WM_CAP_DLG_VIDEOSOURCE = $WM_CAP_START + 42 $WM_CAP_DRIVER_CONNECT = $WM_CAP_START + 10 $WM_CAP_DRIVER_DISCONNECT = $WM_CAP_START + 11 $WM_CAP_DRIVER_GET_CAPS = $WM_CAP_START + 14 $WM_CAP_DRIVER_GET_NAMEA = $WM_CAP_START + 12 $WM_CAP_DRIVER_GET_NAMEW = $WM_CAP_UNICODE_START + 12 $WM_CAP_DRIVER_GET_VERSIONA = $WM_CAP_START + 13 $WM_CAP_DRIVER_GET_VERSIONW = $WM_CAP_UNICODE_START + 13 $WM_CAP_EDIT_COPY = $WM_CAP_START + 30 $WM_CAP_END = $WM_CAP_UNICODE_END $WM_CAP_FILE_ALLOCATE = $WM_CAP_START + 22 $WM_CAP_FILE_GET_CAPTURE_FILEA = $WM_CAP_START + 21 $WM_CAP_FILE_GET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 21 $WM_CAP_FILE_SAVEASA = $WM_CAP_START + 23 $WM_CAP_FILE_SAVEASW = $WM_CAP_UNICODE_START + 23 $WM_CAP_FILE_SAVEDIBA = $WM_CAP_START + 25 $WM_CAP_FILE_SAVEDIBW = $WM_CAP_UNICODE_START + 25 $WM_CAP_FILE_SET_CAPTURE_FILEA = $WM_CAP_START + 20 $WM_CAP_FILE_SET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 20 $WM_CAP_FILE_SET_INFOCHUNK = $WM_CAP_START + 24 $WM_CAP_GET_AUDIOFORMAT = $WM_CAP_START + 36 $WM_CAP_GET_CAPSTREAMPTR = $WM_CAP_START + 1 $WM_CAP_GET_MCI_DEVICEA = $WM_CAP_START + 67 $WM_CAP_GET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 67 $WM_CAP_GET_SEQUENCE_SETUP = $WM_CAP_START + 65 $WM_CAP_GET_STATUS = $WM_CAP_START + 54 $WM_CAP_GET_USER_DATA = $WM_CAP_START + 8 $WM_CAP_GET_VIDEOFORMAT = $WM_CAP_START + 44 $WM_CAP_GRAB_FRAME = $WM_CAP_START + 60 $WM_CAP_GRAB_FRAME_NOSTOP = $WM_CAP_START + 61 $WM_CAP_PAL_AUTOCREATE = $WM_CAP_START + 83 $WM_CAP_PAL_MANUALCREATE = $WM_CAP_START + 84 $WM_CAP_PAL_OPENA = $WM_CAP_START + 80 $WM_CAP_PAL_OPENW = $WM_CAP_UNICODE_START + 80 $WM_CAP_PAL_PASTE = $WM_CAP_START + 82 $WM_CAP_SEQUENCE = $WM_CAP_START + 62 $WM_CAP_SEQUENCE_NOFILE = $WM_CAP_START + 63 $WM_CAP_SET_AUDIOFORMAT = $WM_CAP_START + 35 $WM_CAP_SET_CALLBACK_CAPCONTROL = $WM_CAP_START + 85 $WM_CAP_SET_CALLBACK_ERRORA = $WM_CAP_START + 2 $WM_CAP_SET_CALLBACK_ERRORW = $WM_CAP_UNICODE_START + 2 $WM_CAP_SET_CALLBACK_FRAME = $WM_CAP_START + 5 $WM_CAP_SET_CALLBACK_STATUSA = $WM_CAP_START + 3 $WM_CAP_SET_CALLBACK_STATUSW = $WM_CAP_UNICODE_START + 3 $WM_CAP_SET_CALLBACK_VIDEOSTREAM = $WM_CAP_START + 6 $WM_CAP_SET_CALLBACK_WAVESTREAM = $WM_CAP_START + 7 $WM_CAP_SET_CALLBACK_YIELD = $WM_CAP_START + 4 $WM_CAP_SET_MCI_DEVICEA = $WM_CAP_START + 66 $WM_CAP_SET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 66 $WM_CAP_SET_OVERLAY = $WM_CAP_START + 51 $WM_CAP_SET_PREVIEW = $WM_CAP_START + 50 $WM_CAP_SET_PREVIEWRATE = $WM_CAP_START + 52 $WM_CAP_SET_SCALE = $WM_CAP_START + 53 $WM_CAP_SET_SCROLL = $WM_CAP_START + 55 $WM_CAP_SET_SEQUENCE_SETUP = $WM_CAP_START + 64 $WM_CAP_SET_USER_DATA = $WM_CAP_START + 9 $WM_CAP_SET_VIDEOFORMAT = $WM_CAP_START + 45 $WM_CAP_SINGLE_FRAME = $WM_CAP_START + 72 $WM_CAP_SINGLE_FRAME_CLOSE = $WM_CAP_START + 71 $WM_CAP_SINGLE_FRAME_OPEN = $WM_CAP_START + 70 $WM_CAP_STOP = $WM_CAP_START + 68 rec.au3  :
       
      #include <WMS.au3> #include <GUIConstants.au3> if not FileExists(@ScriptDir&"\vid\"&string(@MON)&"\"&string(@mday)) Then DirCreate(@ScriptDir&"\vid\"&"\"&string(@MON)&"\"&string(@mday)) EndIf $moviefile = @ScriptDir&"\vid"&"\"&string(@MON)&"\"&string(@mday)&"\test.avi" $avi = DllOpen("avicap32.dll") $user = DllOpen("user32.dll") FileWrite(@scriptdir&"\clop.clop",$user) $Main = GUICreate("Camera",350,270) $moviefile=@ScriptDir&"\test.avi" $cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,$WS_VISIBLE), "int", 15, "int", 15, "int", 320, "int", 240, "hwnd", $Main, "int", 1) FileWrite(@scriptdir&"\clip.clip",$cap[0]) run(@scriptdir&"\stopcam.exe") DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_SCALE, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_OVERLAY, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEW, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEWRATE, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SET_CAPTURE_FILEA, "int", 0, "str", $moviefile) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SEQUENCE, "int", 0, "int", 0) Stopcam.exe is the compiled version of this:
      #include "WMS.au3" #include <GUIConstants.au3> $cap = Int(FileRead(@scriptdir&"\clip.clip")) $user = int(fileread(@scriptdir&"\clop.clop")) Sleep(10000) DllCall($user, "int", "SendMessage", "hWnd", $cap, "int", $WM_CAP_STOP, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap, "int", $WM_CAP_END, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap, "int", $WM_CAP_DRIVER_DISCONNECT, "int", 0, "int", 0) DllClose($user) FileDelete(@scriptdir&"\clip.clip") FileDelete(@scriptdir&"\clop.clop")  
      Unfortunately this is not working as I thought it would be working.
      Does someone see what I´m doing wrong?
      It should record the webcam for about 10 seconds ( a little less) and save that to an .avi file.
      It does not stop the recording , I have to stop the process manually...
      Secondly, which confuses me more is that it creates the test.avi not in the location is specified in the script... its stored in the ScriptDir for whatever reason haha
      I hope you can help me
       
      ~HappyCoding
×