Andreik Posted July 26, 2008 Posted July 26, 2008 I create a little script to run more easy programs from your computer.expandcollapse popupHotKeySet("{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] EndFuncHere is QLaunch.dll: http://www.sendspace.com/file/dcfdfb
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now