Jump to content

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


BBs19
 Share

Recommended Posts

Anyone has minded by a way or another to create a new status of toggle button with enable / disabled ?

I mean, like Metro does

If I disable the toggle button, the border color remains the same than the theme, I'd like it to become greyed like this

Think I am not GDI+ skilled enough to get this easily :/

disable.PNG

Edited by Ebola57
Link to comment
Share on other sites

  • 2 months later...

Hey!Ā  Very cool udf.Ā  Liking it a lot.Ā  I did want to ask if this scenario is possible, as I can't seem to implement it.Ā  Is it possible to create a gui where the menu is permanently expanded?Ā  As in, the GUI shows all of the menu buttons when the GUI loads and cannot be unexpanded?Ā  Thanks in advance.Ā 

Link to comment
Share on other sites

  • 2 months later...

ŠŸŃ€ŠøŠ²ŠµŃ‚ Š²ŃŠµŠ¼, я Š½Š¾Š²ŠøчŠ¾Šŗ Š² AutoIT, Šø у Š¼ŠµŠ½Ń ŠæрŠ¾Š±Š»ŠµŠ¼Š°. ŠÆ ŠøсŠæŠ¾Š»ŃŒŠ·ŃƒŃŽ сŠ²Š¾Š¹ сŠŗрŠøŠæт Š²Š¼ŠµŃŃ‚Šµ с фŠ»Š°Š¶ŠŗŠ°Š¼Šø. ŠÆ ŠøсŠæŠ¾Š»ŃŒŠ·ŃƒŃŽ сŠ²Š¾Š¹ стŠ°Ń€Ń‹Š¹ сŠŗрŠøŠæт, Šø Š¾Š½Šø рŠ°Š±Š¾Ń‚Š°ŃŽŃ‚. ŠŠ¾ Š½Šµ Š¼Š¾Š³Ńƒ Š·Š°ŃŃ‚Š°Š²Šøть рŠ°Š±Š¾Ń‚Š°Ń‚ŃŒ с MetroUDF. ŠÆ ŠæрŠøŠŗрŠµŠæŠ»ŃŽ сŠ²Š¾Š¹ стŠ°Ń€Ń‹Š¹ сŠŗрŠøŠæт. Š˜Š·Š²ŠøŠ½ŠøтŠµ Š·Š° Š¼Š¾Š¹ Š°Š½Š³Š»ŠøŠ¹ŃŠŗŠøŠ¹, я руссŠŗŠøŠ¹.

; ===============================================================================================================================
; Name ..........: MetroGUI UDF Example
; Version .......: v5.1
; Author ........: BB_19
; ===============================================================================================================================
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <MsgBoxConstants.au3>
#include <String.au3>
#include <Crypt.au3>
#RequireAdmin
#NoTrayIcon

$Main = GUICreate('FNKC Pack by DiJo ver.1.1', 588, 410, 318, 213) ;рŠøсуŠµŠ¼ Š³Š»Š°Š²Š½Š¾Šµ Š¾ŠŗŠ½Š¾
GUISetBkColor(0x000000)
GUICtrlCreatePic(@ScriptDir & '\Logo.jpg', 0, 0, 585, 500)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState()
; Š’Š½ŠµŃŃ‚Šø стрŠ¾Šŗу Šø ŠæŠ¾Š“ŠæŠøсь
GUICtrlCreateLabel  ("HOST", 331, 335, 30, 11)
GUICtrlSetFont(8, 800, 0, "Tahoma") ;Š·Š°Š“Š°ŠµŠ¼ стŠøŠ»ŃŒ эŠ»ŠµŠ¼ŠµŠ½Ń‚Ńƒ Š²Ń‹ŃˆŠµ
GUICtrlSetColor     (-1, 0xffffff)
GUICtrlSetBkColor   (-1, 0x000000)
$iHostName = GUICtrlCreateInput("", 362, 330, 180, 21, $ES_CENTER)
$Button1 = GUICtrlCreateButton("Ping",5, 30, 267, 43)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;Š·Š°Š“Š°ŠµŠ¼ стŠøŠ»ŃŒ эŠ»ŠµŠ¼ŠµŠ½Ń‚Ńƒ Š²Ń‹ŃˆŠµ
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x545454)
GUISetState() ; Show GUI
$Button2 = GUICtrlCreateButton("Start", 360, 355, 73, 33, $BS_DEFPUSHBUTTON) ;сŠ¾Š·Š“Š°ŠµŠ¼ ŠŗŠ½Š¾ŠæŠŗу ŠæŠ¾Š“ŠŗŠ»ŃŽŃ‡ŠµŠ½Šøя
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") ;Š·Š°Š“Š°ŠµŠ¼ стŠøŠ»ŃŒ эŠ»ŠµŠ¼ŠµŠ½Ń‚Ńƒ Š²Ń‹ŃˆŠµ
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x545454)
GUISetState() ; Show GUI)
$Checkbox1 = GUICtrlCreateCheckbox("", 275, 45, 12, 12)    ;1
GUISetState()
Local $rHostName

GUISetOnEvent($GUI_EVENT_CLOSE,"Exit1") ; If you press the X button ---> Call Function Exit1
GUICtrlSetOnEvent($Button1,"Pings") ; If Click to Button ---> Call Function Note
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button2
            $rHostName = GUICtrlRead($iHostName)
            If $rHostName <> '' Then
                If GUICtrlRead($Checkbox1) = 1 Then ;Š¾Ń‚Š¼ŠµŃ‡ŠµŠ½ чŠµŠŗŠ±Š¾Šŗс
                    RunWait(@ComSpec & ' /c C:\Windows\System32\Ping.exe ' & $rHostName & '')
                 EndIf
                 EndIf
         EndSwitch
WEnd


Func Exit1()
    Exit
EndFunc

; mandatory
While 2
    Sleep(10)
WEnd

Ā 

Edited by DirtyJohny
This simple example)
Link to comment
Share on other sites

Š˜ этŠ¾ Š¼Š¾Š¹ Š½Š¾Š²Ń‹Š¹ сŠŗрŠøŠæт. ŠœŠ¾Šø ŠŗŠ½Š¾ŠæŠŗŠø рŠ°Š±Š¾Ń‚Š°ŃŽŃ‚, Š° фŠ»Š°Š¶ŠŗŠø Š½ŠµŃ‚. ŠŸŠ¾Š½ŃŃ‚Šøя Š½Šµ ŠøŠ¼ŠµŃŽ ((((

Opt("GUIOnEventMode", 1)
;!Highly recommended for improved overall performance and responsiveness of the GUI effects etc.! (after compiling):
#AutoIt3Wrapper_Run_Au3Stripper=y
#Au3Stripper_Parameters=/so /rm /pe

;YOU NEED TO EXCLUDE FOLLOWING FUNCTIONS FROM AU3STRIPPER, OTHERWISE IT WON'T WORK:
#Au3Stripper_Ignore_Funcs=_iHoverOn,_iHoverOff,_iMinBtn,_iMaxBtn,_iCloseBtn,_iRestoreBtn,_iFullscreenToggleBtn,_cHvr_CSCP_X64,_cHvr_CSCP_X86,_iControlDelete
;Please not that Au3Stripper will show errors. You can ignore them as long as you use the above Au3Stripper_Ignore_Funcs parameters.

;Required if you want High DPI scaling enabled. (Also requries _Metro_EnableHighDPIScaling())
#AutoIt3Wrapper_Res_HiDpi=y
; ===============================================================================================================================

#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <MsgBoxConstants.au3>
#include <String.au3>
#include <Crypt.au3>
#include "MetroGUI_UDF.au3"
#include "_GUIDisable.au3" ; For dim effects when msgbox is displayed
#include <GUIConstants.au3>
#RequireAdmin
#NoTrayIcon

;=======================================================================Creating the GUI===============================================================================
;Enable high DPI support: Detects the users DPI settings and resizes GUI and all controls to look perfectly sharp.
 ; Note: Requries "#AutoIt3Wrapper_Res_HiDpi=y" for compiling. To see visible changes without compiling, you have to disable dpi scaling in compatibility settings of Autoit3.exe
;~ $OnEventMode = True

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

;Create resizable Metro GUI
$Form1 = _Metro_CreateGUI("Example", 350, 230, 318, 213, True)

;Add/create control buttons to the GUI
$Control_Buttons = _Metro_AddControlButtons(True, True, True, True, True) ;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
$GUI_CLOSE_BUTTON = $Control_Buttons[0]
$GUI_MAXIMIZE_BUTTON = $Control_Buttons[1]
$GUI_RESTORE_BUTTON = $Control_Buttons[2]
$GUI_MINIMIZE_BUTTON = $Control_Buttons[3]
$GUI_FULLSCREEN_BUTTON = $Control_Buttons[4]
$GUI_FSRestore_BUTTON = $Control_Buttons[5]
$GUI_MENU_BUTTON = $Control_Buttons[6]
;======================================================================================================================================================================
Func _GUIEvent_ControlButtons()
    Switch @GUI_CtrlId
        Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON
            _Metro_GUIDelete($Form1) ;Delete GUI/release resources, make sure you use this when working with multiple GUIs!
            Exit
        Case $GUI_MAXIMIZE_BUTTON
            GUISetState(@SW_MAXIMIZE, $Form1)
        Case $GUI_MINIMIZE_BUTTON
            GUISetState(@SW_MINIMIZE, $Form1)
        Case $GUI_RESTORE_BUTTON
            GUISetState(@SW_RESTORE, $Form1)
                    ; Open the metro Menu. See decleration of $MenuButtonsArray above.

      EndSwitch
EndFunc   ;==>_GUIEvent_ControlButtons
;Create  Buttons

$Button1 = _Metro_CreateButton("Ping",15, 35, 267, 40)
GUISetState()
$Button2 = _Metro_CreateButton("Start", 125, 120, 50, 40) ;сŠ¾Š·Š“Š°ŠµŠ¼ ŠŗŠ½Š¾ŠæŠŗу ŠæŠ¾Š“ŠŗŠ»ŃŽŃ‡ŠµŠ½Šøя
GUISetState() ; Show GUI
$iHostName = GUICtrlCreateInput("HOST", 60, 90, 180, 21, $ES_CENTER)
$Checkbox1 = _Metro_CreateCheckbox("", 295, 40, 25, 25)
GUISetState() ; Show GUI)
;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($Button1, $GUI_DOCKSIZE+$GUI_DOCKHCENTER+$GUI_DOCKVCENTER)
GUICtrlSetResizing($Button2, $GUI_DOCKSIZE+$GUI_DOCKHCENTER+$GUI_DOCKVCENTER)
GUICtrlSetResizing($Checkbox1, $GUI_DOCKSIZE+$GUI_DOCKHCENTER+$GUI_DOCKVCENTER)

GUISetState(@SW_SHOW)


GUISetOnEvent($GUI_EVENT_CLOSE, "_GUIEvent_ControlButtons")
GUICtrlSetOnEvent($GUI_CLOSE_BUTTON, "_GUIEvent_ControlButtons")
GUICtrlSetOnEvent($GUI_MAXIMIZE_BUTTON, "_GUIEvent_ControlButtons")
GUICtrlSetOnEvent($GUI_MINIMIZE_BUTTON, "_GUIEvent_ControlButtons")
GUICtrlSetOnEvent($GUI_RESTORE_BUTTON, "_GUIEvent_ControlButtons")
GUICtrlSetOnEvent($GUI_MENU_BUTTON, "_GUIEvent_ControlButtons")
GUICtrlSetOnEvent($Button1, "_GUIEvent_Buttons")
GUICtrlSetOnEvent($Checkbox1, "_GUIEvent_Checkboxes")

Func _GUIEvent_Checkboxes()
    Switch @GUI_CtrlId
        Case $Checkbox1
            If _Metro_CheckboxIsChecked($Checkbox1) Then
                _Metro_CheckboxUnCheck($Checkbox1)
                ConsoleWrite("Checkbox unchecked!" & @CRLF)
            Else
                _Metro_CheckboxCheck($Checkbox1)
                ConsoleWrite("Checkbox checked!" & @CRLF)
            EndIf

    EndSwitch
 EndFunc   ;==>_GUIEvent_Checkboxes



GUISetOnEvent($GUI_EVENT_CLOSE,"Exit1") ; If you press the X button ---> Call Function Exit1
GUICtrlSetOnEvent($Button1,"Pings") ; If Click to Button ---> Call Function Note
GUISetState()

Func  Pings()
   Run("C:\Program Files (x86)\DiJo\Ping\Ping.exe")
EndFunc


While 2
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button2
            $rHostName = GUICtrlRead($iHostName)
            If $rHostName <> '' Then
                If _Metro_CheckboxUnCheck($Checkbox1) Then ;Š¾Ń‚Š¼ŠµŃ‡ŠµŠ½ чŠµŠŗŠ±Š¾Šŗс
                    RunWait(@ComSpec & ' /c C:\Windows\System32\Ping.exe ' & $rHostName & '')
                 EndIf
              EndIf

         EndSwitch
WEnd



While 3
    Sleep(5)
WEnd

Ā 

Edited by DirtyJohny
This simple example)
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

@DirtyJohny ,Ā ŃƒĀ Š¼ŠµŠ½Ń рŠ°Š±Š¾Ń‚Š°ŃŽŃ‚ фŠ»Š°Š¶ŠŗŠø, Š½Š¾ Š½Šø ŠŗŠ½Š¾ŠæŠŗŠø, Š½Šø фŠ»Š°Š¶ŠŗŠø Š½Šµ ŠøŠ½ŠøцŠøŠøруют Š²Ń‹ŠæŠ¾Š»Š½ŠµŠ½Šøя ŠŗŠ°ŠŗŠ¾Š³Š¾-Š»ŠøŠ±Š¾ Š“ŠµŠ¹ŃŃ‚Š²Šøя. Š’ этŠ¾Š¼ ŠæрŠ¾Š±Š»ŠµŠ¼Š°? Š§ŠµŠ³Š¾ ŠŗŠ¾Š½ŠŗрŠµŃ‚Š½Š¾ ты ŠæытŠ°ŠµŃˆŃŒŃŃ Š“Š¾Š±Šøться?

Edit:

Ā 

checkboxes work for me, but neither buttons nor checkboxes initiate any action. Is that the problem? What exactly are you trying to achieve?

Edited by JLogan3o13
Link to comment
Share on other sites

  • Moderators

@pat4005Ā As this forum is a primarily-English site, please use Google Translate or other methods to post in English.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forciblyĀ through intellect must do so through shock and awe" - Spencer W.Ā Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

19 hours ago, pat4005 said:

I don't mind to use English, but seems like this guy won'tĀ understand me, so I tried to make it little easier for him. Perhaps, he has already found an answer in russian forum,Ā thoughšŸ™‚

Don't worry.I fing issue,Ā but usingĀ standart checkboxes,thanks)I haven'tĀ see that google translator set on.šŸ˜…šŸ¤£SorryšŸ˜Š

Edited by DirtyJohny
Link to comment
Share on other sites

  • 1 month later...

If anyone experiencing problems with creating CheckboxEx2 (script crashes with exit code 3221225477) I've found a solution. At the end of aĀ functionĀ _Metro_CreateCheckboxEx2 was used wrong fuction to dispose a graphic object: instead of a usingĀ _GDIPlus_PenDispose for a pen there is aĀ _GDIPlus_BrushDispose function.

This is how it is now:

_GDIPlus_BrushDispose($Pen1)
_GDIPlus_BrushDispose($Pen2)

and this is how it has to be:

_GDIPlus_PenDispose($Pen1)
_GDIPlus_PenDispose($Pen2)

Interesting that I have observed it only when running non-compiled script.

Edited by pat4005
Link to comment
Share on other sites

On 1/7/2021 at 10:38 AM, aaronhunter said:

Hi all

Does anyone use the command "Dircopy" in the this UDF?

It seems like doesn't work.

What do you mean "doesn't work". Function DirCopy in your script? UDF itself when using DirCopy?Ā Can you be more specific,Ā please?

Link to comment
Share on other sites

8 hours ago, pat4005 said:

What do you mean "doesn't work". Function DirCopy in your script? UDF itself when using DirCopy?Ā Can you be more specific,Ā please?

My script base on this UDF. But the command "DirCopy" dosen't work on the script. I mean it doesn't do anything , show any error message.

So I'mĀ curious aboutĀ does anyone use the command "DirCopy" with this UDF?

Link to comment
Share on other sites

2 hours ago, FrancescoDiMuro said:

@aaronhunter
You should always post the code, so we can see what's going on in your script :)

@FrancescoDiMuroĀ Here is the script. The script run ok until the command "DirCopy" (even the DirCreate run fine).

If I don't use this UDF, "DirCopy" work fine. So I don't know what's wrong .šŸ˜‚

; ===============================================================================================================================
; Name ..........: MetroGUI UDF Example
; Version .......: v5.1
; Author ........: BB_19
; ===============================================================================================================================
Opt("GUIOnEventMode", 1)
;!Highly recommended for improved overall performance and responsiveness of the GUI effects etc.! (after compiling):
#AutoIt3Wrapper_Run_Au3Stripper=y
#Au3Stripper_Parameters=/so /rm /pe

;YOU NEED TO EXCLUDE FOLLOWING FUNCTIONS FROM AU3STRIPPER, OTHERWISE IT WON'T WORK:
#Au3Stripper_Ignore_Funcs=_iHoverOn,_iHoverOff,_iMinBtn,_iMaxBtn,_iCloseBtn,_iRestoreBtn,_iFullscreenToggleBtn,_cHvr_CSCP_X64,_cHvr_CSCP_X86,_iControlDelete
;Please not that Au3Stripper will show errors. You can ignore them as long as you use the above Au3Stripper_Ignore_Funcs parameters.

;Required if you want High DPI scaling enabled. (Also requries _Metro_EnableHighDPIScaling())
#AutoIt3Wrapper_Res_HiDpi=y
; ===============================================================================================================================

#NoTrayIcon
#include "MetroGUI-UDF\MetroGUI_UDF.au3"
#include "MetroGUI-UDF\_GUIDisable.au3" ; For dim effects when msgbox is displayed
#include <GUIConstants.au3>
#include <ScreenCapture.au3>
#include <ComboConstants.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#include <StaticConstants.au3>
#include <EditConstants.au3>
#include <ScreenCapture.au3>
#include <Array.au3>
#include <File.au3>
#include <Excel.au3>
#Include <Misc.au3>
#include <AutoItConstants.au3>

;=======================================================================Creating the GUI===============================================================================
;Enable high DPI support: Detects the users DPI settings and resizes GUI and all controls to look perfectly sharp.
_Metro_EnableHighDPIScaling() ; Note: Requries "#AutoIt3Wrapper_Res_HiDpi=y" for compiling. To see visible changes without compiling, you have to disable dpi scaling in compatibility settings of Autoit3.exe
;~ $OnEventMode = True

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

;Create resizable Metro GUI
$Form1 = _Metro_CreateGUI("", 140, 100, -1, -1, False) ;čØ­140ē™½ē·šęœƒäøč¦‹

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

;Create  Buttons
$Button1 = _Metro_CreateButtonEx2("還原驅動", 10, 40, 115, 40)
;~ $Button2 = _Metro_CreateButtonEx2("還原驅動", 10, 85, 115, 40)


GUISetState(@SW_SHOW)

;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
$GUI_CLOSE_BUTTON = $Control_Buttons[0]
$GUI_MAXIMIZE_BUTTON = $Control_Buttons[1]
$GUI_RESTORE_BUTTON = $Control_Buttons[2]
$GUI_MINIMIZE_BUTTON = $Control_Buttons[3]
$GUI_FULLSCREEN_BUTTON = $Control_Buttons[4]
$GUI_FSRestore_BUTTON = $Control_Buttons[5]


;~ MsgBox(0, "", $DriverFilePath1,0)
;~ MsgBox(0, "", $DriverFilePath2,0)
;~ MsgBox(0, "", $DriverFilePath3,0)

GUISetState(@SW_SHOW)

GUICtrlSetOnEvent($GUI_CLOSE_BUTTON, "_GUIEvent_ControlButtons")
GUICtrlSetOnEvent($Button1, "_GUIEvent_Buttons")
;~ GUICtrlSetOnEvent($Button2, "_GUIEvent_Buttons")


While 1
    Sleep(5)
WEnd

Func _GUIEvent_ControlButtons()
    Switch @GUI_CtrlId
        Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON
            _Metro_GUIDelete($Form1) ;Delete GUI/release resources, make sure you use this when working with multiple GUIs!
            Exit
    EndSwitch
EndFunc   ;==>_GUIEvent_ControlButtons


Func _GUIEvent_Buttons()
    Switch @GUI_CtrlId
    Case $Button1
       DirCreate("D:\temp\")
       DirCopy("C:\temp\", "D:\temp\")
       EndSwitch
EndFunc   ;==>_GUIEvent_Buttons

Ā 

Edited by aaronhunter
added codebox
Link to comment
Share on other sites

Hi aaronhunter :)
If you want DirCopy to work in your script, then you need to use the 3rd parameter of the function.

DirCreate("D:\temp\")
DirCopy("C:\temp\", "D:\temp\", $FC_OVERWRITE)

As you don't use this 3rd parameter, then the function fails because the destination directory already exists.
A good way to know if the function succeeded is to test its result (which has nothing to do with @error) :

#include <FileConstants.au3>

$iStatus = DirCopy("C:\temp\", "D:\temp\", $FC_OVERWRITE)
If $iStatus = 0 Then ; 0 = failure, 1 = success
    ; your error message here
EndIf

Ā 

Link to comment
Share on other sites

On 1/16/2021 at 2:05 AM, pixelsearch said:

Hi aaronhunter :)
If you want DirCopy to work in your script, then you need to use the 3rd parameter of the function.

DirCreate("D:\temp\")
DirCopy("C:\temp\", "D:\temp\", $FC_OVERWRITE)

As you don't use this 3rd parameter, then the function fails because the destination directory already exists.
A good way to know if the function succeeded is to test its result (which has nothing to do with @error) :

#include <FileConstants.au3>

$iStatus = DirCopy("C:\temp\", "D:\temp\", $FC_OVERWRITE)
If $iStatus = 0 Then ; 0 = failure, 1 = success
    ; your error message here
EndIf

Ā 

wow it's working. Thank you so much.

But I can't figure out why the directory even don't exist in the destination, the function still doesn't work.

And even in a new script , just 2 line of code like what you write

#include <FileConstants.au3>
$iStatus = DirCopy("C:\temp\", "D:\temp\")

Even don't need the 3rd parameter , it Ā works fine.(that's why I didn't use the 3rd parameter in my script that based on the UDF, I thought it's not necessary.)

Anyway thank you for fix my issue , let me learn something from here.šŸ™‡ā€ā™‚ļø

Edited by aaronhunter
Link to comment
Share on other sites

  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...