Sign in to follow this  
Followers 0
DaProgrammer

Multi Tool

12 posts in this topic

#1 ·  Posted (edited)

New Version with Gui Option.

just press "Ctrl+Shift+Alt+O" for the options menu

now supports more image formats (untested, plz help test and post what formats do and don't work)

Posted Image

#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\Files\ico5.ico
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_PassPhrase=qwertasdfgzxcvb12345
#AutoIt3Wrapper_Res_Language=1033
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=y
#AutoIt3Wrapper_Run_Tidy=y
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/sf=1
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#Include <A3LGDIPlus.au3>
#include <GuiConstants.au3>
Global $Time, $Time2, $null = 0, $i = 0, $search, $file = "", $x = 0, $Folder = IniRead(@ScriptDir & "\MultiTool.ini", "Wallpaper", "folder", "")
Global $Gui, $Checkbox_Slide, $Input_Time, $Input_Folder, $Button_Folder, $Button_Save, $Radio_Strech, $Radio_Center, $Radio_Tile
Global $Input_Hidden_Time, $Checkbox_Extensions, $Checkbox_hFiles, $Checkbox_sFiles, $Checkbox_autostart, $Button_Exit
Opt("MustDeclareVars", 1)
Opt("GUIOnEventMode", 1)
HotKeySet("+!^h", "ToggleHiddenFiles")
HotKeySet("+!^w", "_ChangeWallpaper")
HotKeySet("+!^o", "Options")

While 1
    Sleep(Number(IniRead(@ScriptDir & "\MultiTool.ini", "Wallpaper", "time_in_ms", 1000)))
    If IniRead(@ScriptDir & "\MultiTool.ini", "Wallpaper", "Slide", "") = "1" Then _ChangeWallpaper()
WEnd

Func ToggleHiddenFiles()
    Local $WinList = 0, $WinListArr = 0, $iW = 0, $GetWinState = 0, $Hwnd = 0
    If IniRead(@ScriptDir & "\MultiTool.ini", "HiddenFiles", "hfiles", "0") = 1 Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden", "REG_DWORD", 1);=2 hide,=1 show
    If IniRead(@ScriptDir & "\MultiTool.ini", "HiddenFiles", "sfiles", "0") = 1 Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "ShowSuperHidden", "REG_DWORD", 1);=0 hide, 1 show
    If IniRead(@ScriptDir & "\MultiTool.ini", "HiddenFiles", "extensions", "0") = 1 Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt", "REG_DWORD", 0);=0 show, 1 hide

    ;Get explorer windows:
    Opt("WinTitleMatchMode", 4)
    $WinList = WinList("classname=CabinetWClass")
    If IsArray($WinList) Then
        Local $WinListArr[$WinList[0][0] + 1]
        For $iW = 1 To $WinList[0][0]
            $WinListArr[$iW] = $WinList[$iW][0]
        Next
        $WinListArr[0] = $WinList[0][0]

        For $iW = 1 To $WinListArr[0]
            $GetWinState = WinGetState($WinListArr[$iW])
            $Hwnd = WinGetHandle($WinListArr[$iW])
            DllCall("user32.dll", "long", "SendMessage", "hwnd", $Hwnd, "int", 0x111, "int", 28931, "int", 0)
        Next
    EndIf

    $Hwnd = WinGetHandle("classname=Progman")
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $Hwnd, "int", 0x111, "int", 28931, "int", 0)
    AdlibEnable("Hide", IniRead(@ScriptDir & "\MultiTool.ini", "HiddenFiles", "showtime", 30000))
EndFunc   ;==>ToggleHiddenFiles

Func Hide()
    Local $WinList = 0, $WinListArr = 0, $iW = 0, $GetWinState = 0, $Hwnd = 0
    If IniRead(@ScriptDir & "\MultiTool.ini", "HiddenFiles", "hfiles", "0") = 1 Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden", "REG_DWORD", 2);=2 hide,=1 show
    If IniRead(@ScriptDir & "\MultiTool.ini", "HiddenFiles", "sfiles", "0") = 1 Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "ShowSuperHidden", "REG_DWORD", 0);=0 hide, 1 show
    If IniRead(@ScriptDir & "\MultiTool.ini", "HiddenFiles", "extensions", "0") = 1 Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt", "REG_DWORD", 1);=0 show, 1 hide
    
    ;Get explorer windows:
    Opt("WinTitleMatchMode", 4)
    $WinList = WinList("classname=CabinetWClass")
    If IsArray($WinList) Then
        Local $WinListArr[$WinList[0][0] + 1]
        For $iW = 1 To $WinList[0][0]
            $WinListArr[$iW] = $WinList[$iW][0]
        Next
        $WinListArr[0] = $WinList[0][0]

        For $iW = 1 To $WinListArr[0]
            $GetWinState = WinGetState($WinListArr[$iW])
            $Hwnd = WinGetHandle($WinListArr[$iW])
            DllCall("user32.dll", "long", "SendMessage", "hwnd", $Hwnd, "int", 0x111, "int", 28931, "int", 0)
        Next
    EndIf

    $Hwnd = WinGetHandle("classname=Progman")
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $Hwnd, "int", 0x111, "int", 28931, "int", 0)
    AdlibDisable()
EndFunc   ;==>Hide

Func _ChangeWallpaper()
    Local $CurrentFile = "", $hImage = 0, $sCLSID = 0

    While 1
        $CurrentFile = RotateFiles()
        $null = StringRight($CurrentFile, 3)
        If $null = "jpg" Or _
                $null = "jpeg" Or _
                $null = "pic" Or _
                $null = "img" Or _
                $null = "png" Or _
                $null = "gif" Then
            _GDIP_StartUp ()
            $hImage = _GDIP_ImageLoadFromFile ($CurrentFile)
            $sCLSID = _GDIP_EncodersGetCLSID ("BMP")
            _GDIP_ImageSaveToFileEx ($hImage, @TempDir & "\999.bmp", $sCLSID)
            _GDIP_ShutDown ()
            $CurrentFile = @TempDir & "\999.bmp"
            ExitLoop
        ElseIf $null = "bmp" Then
            ExitLoop
        EndIf
    WEnd
    RegWrite('HKCU\Control Panel\Desktop', 'Wallpaper', 'reg_sz', $CurrentFile)
    DllCall("user32", "int", "SystemParametersInfo", "int", 20, "int", 0, "str", $CurrentFile, "int", 0)

EndFunc   ;==>_ChangeWallpaper

Func RotateFiles()
    Local $Folder2 = ""
    $Folder2 = IniRead(@ScriptDir & "\MultiTool.ini", "Wallpaper", "folder", "")
    If $Folder <> $Folder2 Then
        $i = 0
        $Folder = $Folder2
    EndIf
    If $i = 0 Then
        FileClose($search)
        $search = FileFindFirstFile($Folder & "*.*")
    EndIf
    $file = FileFindNextFile($search)
    If @error Then
        FileClose($search)
        $i = 0
        Return
    EndIf
    $i = 1
    Return $Folder & $file
EndFunc   ;==>RotateFiles

Func Options()
    $Gui = GUICreate("Multi Tool Options", 400, 300, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
    GUICtrlCreateTab(5, 5, 390, 290)



    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    GUICtrlCreateTabItem("Wallpaper")
    $Checkbox_Slide = GUICtrlCreateCheckbox("Auto change wallpaper every: ", 10, 60, 170, 20)
    GUICtrlSetState(-1, IniRead(@ScriptDir & "\MultiTool.ini", "Wallpaper", "Slide", ""))
    $Input_Time = GUICtrlCreateInput(IniRead(@ScriptDir & "\MultiTool.ini", "Wallpaper", "time_in_ms", "7200000") / 60000, 185, 60, 40, 20)
    GUICtrlCreateLabel("Minutes", 230, 62, 40, 20)
    $Input_Folder = GUICtrlCreateInput(IniRead(@ScriptDir & "\MultiTool.ini", "Wallpaper", "folder", ""), 10, 90, 310, 20)
    $Button_Folder = GUICtrlCreateButton("Browse", 330, 90, 50, 20)
    GUICtrlSetOnEvent(-1, "Options_Folder")
    $Radio_Strech = GUICtrlCreateRadio("Streched", 10, 120, 70, 15)
    $Radio_Center = GUICtrlCreateRadio("Centered", 10, 140, 70, 15)
    $Radio_Tile = GUICtrlCreateRadio("Tiled", 10, 160, 70, 15)
    Switch IniRead(@ScriptDir & "\MultiTool.ini", "Wallpaper", "size", "1")
        Case 2
            GUICtrlSetState($Radio_Center, 1)
        Case 3
            GUICtrlSetState($Radio_Tile, 1)
        Case Else
            GUICtrlSetState($Radio_Strech, 1)
    EndSwitch
    GUICtrlCreateLabel("Note: Ctrl+Shift+Alt+W   -->   Manually Change Wallpaper", 10, 220, 280, 20)
    $Button_Save = GUICtrlCreateButton("OK", 175, 250, 50, 30)
    GUICtrlSetOnEvent(-1, "Options_Save")



    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    GUICtrlCreateTabItem("Hidden Files")
    GUICtrlCreateLabel("Show hidden files for :", 10, 62, 110, 15)
    $Input_Hidden_Time = GUICtrlCreateInput(IniRead(@ScriptDir & "\MultiTool.ini", "HiddenFiles", "showtime", "30000") / 1000, 120, 60, 30, 20)
    GUICtrlCreateLabel("Seconds", 160, 62, 50, 15)
    $Checkbox_Extensions = GUICtrlCreateCheckbox("Toggle Extensions", 10, 90, 120, 15)
    GUICtrlSetState(-1, IniRead(@ScriptDir & "\MultiTool.ini", "HiddenFiles", "extensions", "1"))
    $Checkbox_hFiles = GUICtrlCreateCheckbox("Toggle Hidden Files", 10, 110, 120, 15)
    GUICtrlSetState(-1, IniRead(@ScriptDir & "\MultiTool.ini", "HiddenFiles", "hfiles", "1"))
    $Checkbox_sFiles = GUICtrlCreateCheckbox("Toggle System Files", 10, 130, 120, 15)
    GUICtrlSetState(-1, IniRead(@ScriptDir & "\MultiTool.ini", "HiddenFiles", "sfiles", "1"))
    GUICtrlCreateLabel("Note: Ctrl+Shift+Alt+H   -->   Toggle", 10, 220, 280, 20)
    $Button_Save = GUICtrlCreateButton("OK", 175, 250, 50, 30)
    GUICtrlSetOnEvent(-1, "Options_Save")


    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    GUICtrlCreateTabItem("Global")
    $Checkbox_autostart = GUICtrlCreateCheckbox("Start MultiTool when windows starts", 10, 62, 250, 15)
    If RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "MultiTool") <> "" Then GUICtrlSetState(-1, 1)
    $Button_Exit = GUICtrlCreateButton("Close MultiTool", 150, 100, 100, 50)
    GUICtrlSetOnEvent(-1, "_Exit")
    $Button_Save = GUICtrlCreateButton("OK", 175, 250, 50, 30)
    GUICtrlSetOnEvent(-1, "Options_Save")



    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    GUISetState()
    GUISetOnEvent(-3, "Options_Close")
EndFunc   ;==>Options

Func Options_Folder()
    GUICtrlSetData($Input_Folder, FileSelectFolder("Select a folder", "") & "\")
    If StringRight(GUICtrlRead($Input_Folder), 2) = "\\" Then GUICtrlSetData($Input_Folder, StringTrimRight(GUICtrlRead($Input_Folder), 1))
EndFunc   ;==>Options_Folder

Func Options_Save()
    ; Wallpaper
    IniWrite(@ScriptDir & "\MultiTool.ini", "Wallpaper", "folder", GUICtrlRead($Input_Folder))
    IniWrite(@ScriptDir & "\MultiTool.ini", "Wallpaper", "Slide", GUICtrlRead($Checkbox_Slide))
    IniWrite(@ScriptDir & "\MultiTool.ini", "Wallpaper", "time_in_ms", GUICtrlRead($Input_Time) * 60000)
    Switch 1
        Case GUICtrlRead($Radio_Center)
            RegWrite('HKCU\Control Panel\Desktop', 'TileWallpaper', 'reg_sz', '0')
            RegWrite('HKCU\Control Panel\Desktop', 'WallpaperStyle', 'reg_sz', '0')
            IniWrite(@ScriptDir & "\MultiTool.ini", "Wallpaper", "size", "2")
        Case GUICtrlRead($Radio_Tile)
            RegWrite('HKCU\Control Panel\Desktop', 'TileWallpaper', 'reg_sz', '1')
            RegWrite('HKCU\Control Panel\Desktop', 'WallpaperStyle', 'reg_sz', '0')
            IniWrite(@ScriptDir & "\MultiTool.ini", "Wallpaper", "size", "3")
        Case Else
            RegWrite('HKCU\Control Panel\Desktop', 'TileWallpaper', 'reg_sz', '0')
            RegWrite('HKCU\Control Panel\Desktop', 'WallpaperStyle', 'reg_sz', '2')
            IniWrite(@ScriptDir & "\MultiTool.ini", "Wallpaper", "size", "1")
    EndSwitch
    ; Hidden Files
    IniWrite(@ScriptDir & "\MultiTool.ini", "HiddenFiles", "showtime", GUICtrlRead($Input_Hidden_Time) * 1000)
    IniWrite(@ScriptDir & "\MultiTool.ini", "HiddenFiles", "extensions", GUICtrlRead($Checkbox_Extensions))
    IniWrite(@ScriptDir & "\MultiTool.ini", "HiddenFiles", "hfiles", GUICtrlRead($Checkbox_hFiles))
    IniWrite(@ScriptDir & "\MultiTool.ini", "HiddenFiles", "sfiles", GUICtrlRead($Checkbox_sFiles))
    ; Global
    If GUICtrlRead($Checkbox_autostart) = 1 Then
        RegWrite("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "MultiTool", "REG_SZ", @ScriptFullPath)
    Else
        RegDelete("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "MultiTool")
    EndIf
    
    GUIDelete($Gui)
EndFunc   ;==>Options_Save

Func Options_Close()
    GUIDelete($Gui)
EndFunc   ;==>Options_Close

Func _Exit()
    Exit
EndFunc   ;==>_Exit
Edited by DaProgrammer

Share this post


Link to post
Share on other sites



#Include <A3LGDIPlus.au3>
Global $hImage, $sCLSID, $Folder = IniRead(@ScriptDir & "\Data.ini", "Wallpaper", "folder", "")

#NoTrayIcon
HotKeySet("+!^w", "_ChangeWallpaper")
Global $search, $i = 0, $file, $x = 0
While 1
    Sleep(Number(IniRead(@ScriptDir & "\Data.ini", "Wallpaper", "time_in_ms", 1000)))
    If IniRead(@ScriptDir & "\Data.ini", "Wallpaper", "Slide", "") = "True" Then _ChangeWallpaper()
WEnd

Func _ChangeWallpaper()

    RegWrite('HKCU\Control Panel\Desktop', 'TileWallpaper', 'reg_sz', '0')
    RegWrite('HKCU\Control Panel\Desktop', 'WallpaperStyle', 'reg_sz', '2')
    
    $x = 0
    While $x = 0
    $CurrentFile = RotateFiles()
    If StringRight($CurrentFile,3) = "jpg" Or StringRight($CurrentFile,3) = "bmp" Then $x = 1
    WEnd
    
    If StringRight($CurrentFile,3) = "jpg" Then
        _GDIP_StartUp()
        $hImage = _GDIP_ImageLoadFromFile($CurrentFile)
        $sCLSID = _GDIP_EncodersGetCLSID("BMP")
        _GDIP_ImageSaveToFileEx($hImage, @TempDir & "\999.bmp", $sCLSID)
        _GDIP_ShutDown()        
        $CurrentFile = @TempDir & "\999.bmp"
    EndIf
;~ Sleep(500)
    RegWrite('HKCU\Control Panel\Desktop', 'Wallpaper', 'reg_sz', $CurrentFile)
    DllCall("user32", "int", "SystemParametersInfo", "int", 20, "int", 0, "str", $CurrentFile, "int", 0)

EndFunc   ;==>_ChangeWallpaper

Func RotateFiles()
    If $Folder <> IniRead(@ScriptDir & "\Data.ini", "Wallpaper", "folder", "") Then
        $i = 0
        $Folder = IniRead(@ScriptDir & "\Data.ini", "Wallpaper", "folder", "")
    EndIf
    If $i = 0 Then $search = FileFindFirstFile($Folder & "*.*")
    $file = FileFindNextFile($search)
    If @error Then
        FileClose($search)
        $i = 0
        Return
    EndIf
    $i = 1
    Return $Folder & $file
EndFunc   ;==>RotateFiles

[u]You can download my projects at:[/u] Pulsar Software

Share this post


Link to post
Share on other sites

thinks ding!!!

Share this post


Link to post
Share on other sites

thinks ding!!!

ill take that as a compliment though i have no idea what that means :) LOL


Share this post


Link to post
Share on other sites

Looks like you've made a lot of changes! Good work!

thanks man :) any idea's out there for improvements ?


Share this post


Link to post
Share on other sites

Yay! Someone's using one of my UDF's *sniff*

ToggleHiddenFiles()

Nice app :)

Share this post


Link to post
Share on other sites

thanks man :) any idea's out there for improvements ?

Well, it took me awhile to figure it out the first time I used it. I haven't used hotkeys enough to know what "+!^o" means so I modified to something I knew. So... in light of that, I have a few suggestions:
  • Have it show the options when for the very first time it opens (maybe check to see if the .ini file exists)
  • Have a tray item so that the user can access (or exit the script) the options through the tray, if they're too lazy to memorize the hotkeys
  • If you plan on making this official, put the .ini file in the temp directory so the user doesn't see it
  • Move the "Ok" button out of the Tab because it exists in every single tabitem (just put it below)
  • You might want to change the text from "Ok" to "Save Changes" just so the user knows that this will update the program
  • Let the user customize the hotkeys
This is just what I think would make your program better, but I am by no means am an expert critic on computer programs so change whatever you want! ;)

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

Yay! Someone's using one of my UDF's *sniff*

ToggleHiddenFiles()

Nice app :)

tnx for the UDF m8 ;) wanted to write where its from but forgot where i found it, LOL


Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Well, it took me awhile to figure it out the first time I used it. I haven't used hotkeys enough to know what "+!^o" means so I modified to something I knew. So... in light of that, I have a few suggestions:

  • Have it show the options when for the very first time it opens (maybe check to see if the .ini file exists)
  • Have a tray item so that the user can access (or exit the script) the options through the tray, if they're too lazy to memorize the hotkeys
  • If you plan on making this official, put the .ini file in the temp directory so the user doesn't see it
  • Move the "Ok" button out of the Tab because it exists in every single tabitem (just put it below)
  • You might want to change the text from "Ok" to "Save Changes" just so the user knows that this will update the program
  • Let the user customize the hotkeys
This is just what I think would make your program better, but I am by no means am an expert critic on computer programs so change whatever you want! :)

Dude i was talking about features to add and not conveniance, those stuff i believe u can modify yourself.

i'm not planning on making this an official program.

as i see it this is open source and every1 likes something else,

IF in the far future with your help this program will be packed with useful features, ill make it pretty and witty and gay.

as for hotkey it said in my post

New Version with Gui Option.

just press "Ctrl+Shift+Alt+O" for the options menu

Edited by DaProgrammer

Share this post


Link to post
Share on other sites

Dude i was talking about features to add...

How about a way to set a bunch of options - say make all files show a certain way i.e. not the default, but DETAILS.

Look at tools|folder options|view & general - ( under explorer in windows ) all of those can be turned off and on...also make it so all folders are the same.

Make the ability to change control panel from classic to XP and back.

How about the start button options - like, dont group icons, or add the quick launch or not.

Each of these could be an INI file for different profiles...

If you want to go further you could add - a way of turning off and on different programs - for added cpu power when playing games or needed programs for work/school. There was a great program out there - that was once free, called startupcop - that allowed you to save profiles for next boot up.


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

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

Create an account

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


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0