Jump to content
Sign in to follow this  
Andreik

Quick Launch

Recommended Posts

Andreik

I create a little script to run more easy programs from your computer.

HotKeySet("{F10}","HIDE")
HotKeySet("{F11}","SHOW")
$GUI = GUICreate("Quick Launch",650,295,-1,-1,0x80000000)
Global $STATUS = 1
Dim $BUTTON[41]
$BUTTON[0] = 40
$INDEX = 1
For $X = 1 To 10
    For $Y = 1 To 4
        $BUTTON[$INDEX] = GUICtrlCreateButton("",5+$X*64-64,5+$Y*64-64,64,64,0x0040)
        GUICtrlSetImage($BUTTON[$INDEX],@ScriptDir & "\QLaunch.dll",$INDEX,1)
        $INDEX += 1
    Next
Next
$PATH_SIGN = GUICtrlCreateCheckbox("SET PATH",10,270,100,20)
$QUIT = GUICtrlCreateButton("QUIT",590,270,50,20)
GUISetState(@SW_SHOW,$GUI)
_ReduceMemory()

While 1
    $MSG = GUIGetMsg()
    For $COUNT = 1 To 40
    If $MSG = $BUTTON[$COUNT] Then
        If GUICtrlRead($PATH_SIGN) = 1 Then 
            $PATH = FileOpenDialog("PATH",@ProgramFilesDir,"EXE Files (*.exe)",1)
            IniDelete(@ScriptDir & "\Config.ini","PROGRAM" & $COUNT)
            IniWrite(@ScriptDir & "\Config.ini","PROGRAM" & $COUNT,"PATH",$PATH)
        Else
            $FILE = IniReadSection(@ScriptDir & "\Config.ini","PROGRAM" & $COUNT)
            If @error Then 
                MsgBox(0,"ERROR","Check path")
            Else
                ShellExecute($FILE[1][1])
            EndIf
        EndIf
    ElseIf $MSG = $QUIT Then
        Exit
    EndIf
    Next
    Sleep(20)
WEnd

Func HIDE()
    If WinActive("Quick Launch") Then
            GUISetState(@SW_HIDE,$GUI)
            $STATUS -= 1
            _ReduceMemory()
    EndIf
EndFunc

Func SHOW()
    GUISetState(@SW_SHOW,$GUI)
    $STATUS += 1
    _ReduceMemory()
EndFunc

Func _ReduceMemory()
    Local $dll = DllOpen("kernel32.dll")
    Local $ai_GetCurrentProcessId = DllCall($dll, 'int', 'GetCurrentProcessId')
    Local $ai_Handle = DllCall($dll, 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $ai_GetCurrentProcessId[0])
    Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
    DllCall($dll, 'int', 'CloseHandle', 'int', $ai_Handle[0])
    DllClose($dll)
    Return $ai_Return[0]
EndFunc

Here is QLaunch.dll: http://www.sendspace.com/file/dcfdfb


When the words fail... music speaks

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  

×