Jump to content

Dapwal


dabus
 Share

Recommended Posts

Hi @ all.

I've created a little app-launcher that can be accessed via hotkey ([ctrl]+[shift]) or clicking the middle-mousebutton on the desktop.

The configuration is written into an ini-file.

The gui is transparent and uses gifs to display icons.

Edit the FileInstall()-Lines to fit your needs. Run the script.

After the gui opened you can't see anything - it is transparent, and since there is no valid entry, nothing is displayed - but there should be an entry in the taskbar.

Hit [ctrl] + [tab] to see all possible slots.

Now rightclick one question mark to open the editor.

Adding links via the selector will convert the link (the application the link is pointing to is used). You can use the commandline if you wish to (maybe I'll add dnd-support :) )

Select a (transparent) gif to have a special icon, otherwise the default-icon is used. After clicking ok, the window disappears.

Open the main-gui again to see the changes.

Seems to work now (at least for me :) )

Maybe someone can help me with the todo(s).

ToDo: Find out how to obtain Installer-Dirs (like those used by oo.org-links)

Hide the entries in the taskbar

Maybe use formats like ico, dll, exe (does not work currently(no transparency)

If you use linux, have a look at http://apwal.free.fr (that's the one that gave me the idea to do this.)

Developed with Site4AutoIt and AutoIt beta 114 (if your version runs _ispressed, it should work.)

Any idea/comments are welcome. :mellow:

Basic.zip

Edited by dabus
Link to comment
Share on other sites

Polished the edit-dialog, replaced the hotkeys with more convinient methods (see changelog).

You still need the icons from first post.

I think it's more useable now. :mellow:

CODE

#cs

Author: dabus

Script function: open a transparent gui with configureable icons to run some commands

Changes:

0.0.0 - based on System-Icons by YDY (Lazycat)

0.0.1 - added _IsPressed to notice mouseclicks

0.0.5 - added MouseGetPos and WinGetPos with counters to calc the current item

0.1.0 - added a menu 'attached' to the selected item - thanks to help from gafrost

0.1.1 - 24.03.2006 - ripped out the old interface

0.1.2 - 24.03.2006 - replaced fixed icon-sizes and numbers with variables

0.1.3 - 24.03.2006 - replaced the picture-patchwork to create transparence with a big one - real speedup

0.1.4 - 24.03.2006 - added reading of inifile to specifiy which slots are used

0.2.0 - 24.03.2006 - open Gui at mousepos if user clicked middlemousbutton on desktop, some code-documentation

0.2.5 - 24.03.2006 - added an edit-dialog to configure items at runtime, put all gifs into one dir in @TempDir

0.2.6 - 24.03.2006 - fixed a stupid pic-error (have to use 0 as style to put pic in background)

0.2.7 - 24.03.2006 - close main-gui if changes have been made, changed edit-gui to accept all files

if links are specified, the target will be written taken as the program to run

0.2.8 - 24.03.2006 - exe-files will be run, else run ( @Comspec & ' /c ...) is tried

0.2.9 - 24.03.2006 - added hotkeys: Shift+Control will open the main-gui, Control+Tab will show all entries

added option to add workingdir 'manually'

0.3.0 - 24.03.2006 - added extract-cmdline-option, minor bugfixes

0.3.1 - 25.03.2006 - added height-check for edit-gui-palcement, replaced checks & default-input for inputboxes of edit-gui

0.3.2 - 25.03.2006 - replaced hotkeymodel with Key+Mouse -- you will have to use the mouse anyway

(Esc+Middle=Exit, Ctrl+Middle=Open, Shift+Middle=ShowAll, Middle on desktop still works; added topmost-attib to windows

0.3.3 - 25.03.2006 - remind old settings when editing via FileOpenDialog; set dapwal-windows behind dialog

ToDo: Find out how to obtain Installer-Dirs (like those used by oo.org-links)

Hide the entries in the Taskbar

Maybe use formats like ico, dll, exe (does not work currently(no transparency)

#ce

#Region Compiler directives section

#Compiler_Prompt = n

#Compiler_Icon = filetype1.ico

#Compiler_Compression = 4

#Compiler_Allow_Decompile = y

#Compiler_PassPhrase =

#Compiler_Res_Comment = Programlauncher to unclutter your desktop.

#Compiler_Res_Description = A port of apwal.

#Compiler_Res_Fileversion = 0.3.3

#Compiler_Res_LegalCopyright = dabus

#Compiler_Res_Field1Name = Made By

#Compiler_Res_Field1Value = Dirk Busse

#Compiler_Res_Field2Name = Apwal

#Compiler_res_Field2Value = Look at freshmeat to discover the original one.

#Compiler_Run_AU3Check = y

#EndRegion

#include <GUIConstants.au3>

#include <Misc.au3>

AutoItSetOption('TrayIconDebug', 1)

Opt('OnExitFunc', 'ExitProgram')

; Setting variables

Global $Num = 6; Number of slots=$Num*$Num (it's a square)

Global $IconSize = 48; The real icon-size

Global $IconVSize = 60; The size of an icon-slot ~ the icon itself an a border

Global $IniFile = @ScriptDir & '\DApwal.ini'; The location of the config-file

Global $StartIndex = 0, $Row, $Col, $Icons[$Num * $Num], $Index, $dll, $Selection

; Extract-Option

If $CmdLine[0] = 1 Then

If $CmdLine[1] = '/extract' Then

DirCreate(@ScriptDir & '\Source')

FileInstall('D:\Scripts\Helpers\DApwal\DApwal.au3', @ScriptDir & '\Source\DApwal.au3', 1)

ExtractGraphics()

FileMove(@TempDir & '\DApwal\*', @ScriptDir & '\Source\')

DirRemove(@TempDir & '\DApwal')

#Region --- CodeWizard generated code Start ---

;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Info

MsgBox(64, "DApwal-Extreactor", "The sub-directory source now contains the script and the image-files.")

#EndRegion --- CodeWizard generated code End ---

Exit

EndIf

EndIf

$dll = DllOpen('user32.dll')

While 1

If _IsPressed ('04') Then; MiddleMouse

If _IsPressed('1B') Then;Esc

ExitProgram()

ElseIf _IsPressed('11') Then; LCtrl

OpenGui()

Else

$Name = WinGetTitle('')

If $Name = 'program manager' Then; On Desktop

$mPos = MouseGetPos()

OpenGui($mPos[0], $mPos[1])

EndIf

EndIf

EndIf

Sleep(10)

WEnd

Func OpenGui($a = 0, $b = 0)

$Selection=''

ExtractGraphics()

If $a = 0 Then $a= (@DesktopWidth - $Num * $IconVSize) / 2

If $b = 0 Then $b= (@DesktopHeight - $Num * $IconVSize) / 2

; Creating GUI

$Gui = GUICreate('DApwal', $Num * $IconVSize, $Num * $IconVSize, $a, $b, $WS_POPUP, $WS_EX_LAYERED+$WS_EX_TOPMOST )

$BG = GUICtrlCreatePic(@TempDir & '\DApwal\AllTrans.gif', 0, 0, 450, 450, 0)

GUICtrlCreateLabel('Test', -50, -50, 10, 10)

; Please note that you need to resize AllTrans.gif and recompile the script if you want a bigger transparent GUI than 450*450

; Creating GUI and visible icons

For $Row = 0 To $Num - 1

For $Col = 0 To $Num - 1

$Index = $Row * $Num + $Col

$Command = IniRead($IniFile, $Index, 'Command', '')

If $Command <> '' Then

$Pic = IniRead($IniFile, $Index, 'Icon', @TempDir & '\DApwal\Question.gif')

$Icons[$Index] = GUICtrlCreatePic($Pic, $IconVSize * $Col, $IconVSize * $Row, $IconSize, $IconSize)

ConsoleWrite('@@ Debug(105) : $Pic = ' & $Pic & @LF & '>Error code: ' & @error & @LF) ;### Debug Console

GUICtrlSetTip(-1, $Command)

EndIf

Next

Next

GUISetState(@SW_SHOW, $Gui)

While 1

$Msg = GUIGetMsg()

If _IsPressed (01, $dll) Or _IsPressed (02, $dll) Then

$Edit = 0

If _IsPressed (02, $dll) Then $Edit = 1

; If clicked out ouf bounds, assume user wanted to exit

$wPos = WinGetPos('DApwal')

$mPos = MouseGetPos()

If $mPos[0] < $wPos[0] Then ExitLoop

If $mPos[1] < $wPos[1] Then ExitLoop

If $mPos[0] > $wPos[0] + $wPos[2] Then ExitLoop

If $mPos[1] > $wPos[1] + $wPos[3] Then ExitLoop

; Detect item

$xCounter = 0

$yCounter = 0

While 1

If $xCounter = $Num - 1 Then ExitLoop

If ($mPos[0] - $wPos[0]) - (($xCounter + 1) * $IconVSize) >= 0 Then

$xCounter = $xCounter + 1

Else

ExitLoop

EndIf

WEnd

While 1

If $yCounter = $Num - 1 Then ExitLoop

If ($mPos[1] - $wPos[1]) - (($yCounter + 1) * $IconVSize) >= 0 Then

$yCounter = $yCounter + 1

Else

ExitLoop

EndIf

WEnd

$Selection = $yCounter * $Num + $xCounter

If $Edit = 1 Then

Edit($wPos[0] + $xCounter * $IconVSize, $wPos[1] + $yCounter * $IconVSize, $Selection)

If $Selection = '-' Then ExitLoop

Else

$WorkDir = ''

$Command = IniRead($IniFile, $Selection, 'Command', '')

If StringInStr($Command, '|') Then

$Command = StringSplit($Command, '|')

$WorkDir = $Command[2]

$Command = $Command[1]

EndIf

If StringInStr($Command, '.exe') Then

Run($Command, $WorkDir)

ExitLoop

Else

Run(@ComSpec & ' /c ' & $Command, $WorkDir, @SW_HIDE)

ExitLoop

EndIf

EndIf

Sleep(250)

ElseIf _IsPressed('10') And _IsPressed('04') Then; Shift + MiddleMouse

ShowAll()

ElseIf $Msg = $GUI_EVENT_CLOSE Then

ExitLoop

EndIf

WEnd

GUIDelete($Gui)

If $Selection='-' Then OpenGui ($a, $:)

EndFunc ;==>OpenGui

; Edit slots

Func Edit($a, $b, ByRef $c); Left, Top, Name

Local $EDir, $EFile

ExtractGraphics()

; Search for defined parameters

$ECommand = IniRead($IniFile, $c, 'Command', '')

$EIcon = IniRead($IniFile, $c, 'Icon', @TempDir & '\DApwal\Question.gif')

; Create Gui, Check for space first

If @DesktopWidth > $a + 225 Then

$EWidth = $a + $IconVSize + 25

Else

$EWidth = $a - 225

EndIf

If @DesktopHeight > $b + 145 Then

$EHeight = $b

Else

$EHeight = $b - 145

EndIf

$EGui = GUICreate('DApwal-Edit', 200, 120, $EWidth, $EHeight, $WS_POPUP, $WS_EX_LAYERED+$WS_EX_TOPMOST )

$BG = GUICtrlCreatePic(@TempDir & '\DApwal\AllTrans.gif', 0, 0, 450, 450, 0)

$EInput1 = GUICtrlCreateInput($ECommand, 0, 40, 130, 20)

GUICtrlSetBkColor(-1, 0xf7c35a)

GUICtrlSetTip(-1, 'If you need the program to run in a dir, add |$dir' & @CR & 'e.g. C:\windows\notepad.exe|C:\')

$EButton1 = GUICtrlCreatePic(@TempDir & '\DApwal\Dots.gif', 140, 40, 60, 20)

$EInput2 = GUICtrlCreateInput($EIcon, 0, 70, 130, 20)

GUICtrlSetBkColor(-1, 0xf7c35a)

$EButton2 = GUICtrlCreatePic(@TempDir & '\DApwal\Dots.gif', 140, 70, 60, 20)

$EButton3 = GUICtrlCreatePic(@TempDir & '\DApwal\OK.gif', 0, 100, 60, 20)

$EButton4 = GUICtrlCreatePic(@TempDir & '\DApwal\Delete.gif', 70, 100, 60, 20)

$EButton5 = GUICtrlCreatePic(@TempDir & '\DApwal\Cancel.gif', 140, 100, 60, 20)

GUISetState(@SW_SHOW, $EGui)

While 1

$EMsg = GUIGetMsg()

Select

Case $EMsg = $GUI_EVENT_CLOSE

ExitLoop

Case $EMsg = $EButton1; Search for file to run

If $ECommand<>'' Then

_StringSplit($ECommand, '\', $EDir, $EFile)

Else

$EDir=@ProgramsCommonDir

EndIf

WinSetOnTop('DApwal', 'Test', 0)

WinSetOnTop('DApwal-Edit', '', 0)

$ECommand = FileOpenDialog('DApwal-Select', $EDir , 'All Files (*.*)')

If @error<>1 Then

If StringRight($ECommand, 3) = 'lnk' Then

$ELink = FileGetShortcut($ECommand)

$ECommand = $ELink[0]

EndIf

GUICtrlSetData($EInput1, $ECommand)

EndIf

WinSetOnTop('DApwal', 'Test', 1)

WinSetOnTop('DApwal-Edit', '', 1)

Case $EMsg = $EButton2; Search for icon

If $EIcon<>'' Then

_StringSplit($EIcon, '\', $EDir, $EFile)

Else

$EDir=@MyDocumentsDir

EndIf

WinSetOnTop('DApwal', 'Test', 0)

WinSetOnTop('DApwal-Edit', '', 0)

$EIcon = FileOpenDialog('DApwal-Select', $EDir, 'Images (*.gif)|All Files (*.*)')

If @error<>1 Then GUICtrlSetData($EInput2, $EIcon)

WinSetOnTop('DApwal', 'Test', 1)

WinSetOnTop('DApwal-Edit', '', 1)

Case $EMsg = $EButton3; OK

If GUICtrlRead($EInput1) = '' Then

GUICtrlSetData($EInput1, 'Missing command')

GUICtrlSetBkColor($EInput1, 0xff0000) ; Red

Sleep(1000)

GUICtrlSetBkColor($EInput1, 0x00ff00) ; Green

Sleep(1000)

GUICtrlSetBkColor($EInput1, 0xf7c35a)

GUICtrlSetData($EInput1, '')

ContinueLoop

EndIf

If GUICtrlRead($EInput2) = '' Then

GUICtrlSetData($EInput2, 'Missing icon')

GUICtrlSetBkColor($EInput2, 0xff0000) ; Red

Sleep(1000)

GUICtrlSetBkColor($EInput2, 0x00ff00) ; Green

Sleep(1000)

GUICtrlSetBkColor($EInput2, 0xf7c35a)

GUICtrlSetData($EInput2, @TempDir & '\DApwal\Question.gif')

ContinueLoop

EndIf

IniWrite($IniFile, $c, 'Command', GUICtrlRead($EInput1))

IniWrite($IniFile, $c, 'Icon', GUICtrlRead($EInput2))

$c = '-'

ExitLoop

Case $EMsg = $EButton4; Delete

IniDelete($IniFile, $c)

$c = '-'

ExitLoop

Case $EMsg = $EButton5; Cancel

ExitLoop

EndSelect

WEnd

GUIDelete($EGui)

EndFunc ;==>Edit

Func ExitProgram(); CleanUp

If $dll <> '' Then DllClose($dll)

DirRemove(@TempDir & '\DApwal', 1)

Exit

EndFunc ;==>ExitProgram

Func ExtractGraphics() ; Install Graphics

DirCreate(@TempDir & '\DApwal')

FileInstall('D:\Scripts\Helpers\DApwal\AllTrans.gif', @TempDir & '\DApwal\AllTrans.gif')

FileInstall('D:\Scripts\Helpers\DApwal\Question.gif', @TempDir & '\DApwal\Question.gif')

FileInstall('D:\Scripts\Helpers\DApwal\Cancel.gif', @TempDir & '\DApwal\Cancel.gif')

FileInstall('D:\Scripts\Helpers\DApwal\Delete.gif', @TempDir & '\DApwal\Delete.gif')

FileInstall('D:\Scripts\Helpers\DApwal\Dots.gif', @TempDir & '\DApwal\Dots.gif')

FileInstall('D:\Scripts\Helpers\DApwal\OK.gif', @TempDir & '\DApwal\OK.gif')

EndFunc ;==>ExtractGraphics

; Show unused slots

Func ShowAll()

GUISetState(@SW_HIDE)

For $Row = 0 To $Num - 1

For $Col = 0 To $Num - 1

$Index = $Row * $Num + $Col

$Command = IniRead($IniFile, $Index, 'Command', '')

If $Command = '' Then

$Icons[$Index] = GUICtrlCreatePic(@TempDir & '\DApwal\Question.gif', $IconVSize * $Col, $IconVSize * $Row, $IconSize, $IconSize)

EndIf

Next

Next

GUISetState(@SW_SHOW)

EndFunc ;==>ShowAll

Func _StringSplit ($a, $b, ByRef $c, ByRef $d) ; $a=file to split, $b=devider, $c=Prefix, $d=suffix

Local $counter

$counter = 1

While 1

$Error = StringInStr($a, $b, 0, $counter)

If $Error <> 0 Then

$counter = $counter + 1

Else

$Pos = StringInStr($a , $b, 0, $counter - 1)

ExitLoop

EndIf

WEnd

$c = StringLeft($a, $Pos - 1)

$d = StringTrimLeft($a, $Pos)

EndFunc

Link to comment
Share on other sites

All you need is love... and Icons :mellow:

So I ripped through a collection icons of kde (look at http://www.kde.org ) and gnome (look at http://www.gnome.org).

The original ones were saved as png, I just converted the icons via gimp (irfan_view doesn't really like transparency). I roughly ordered them as devices, folders and apps (which also includes the other stuff).

I don't remember the exact belonging (since I do not use gnome or kde), but it should be roughly like this:

KDE-Themes: Crystal, IKons, KDEClasic, Slick.

Gnome-Themes: Gnome, HIColor ( Pixmap is not the themename, it's the default-directory for gnome-icons).

If you like to correct me, feel free to do that. I give them my credit.

The icons a licenced under (l)gpl-like licences, so they are free to (open source).

To give you a simple glimpse of how it whould look like, here's a screenshot. (Currently 291 Icons are included. :) )

Icons.zip

Link to comment
Share on other sites

Made a few adjustments to add new guis with ease.

Added unix-like window-movement.

Added window-management.

I'll post my iconset & ini later (have to find out why round corners don't work with gimp first, since the edit-dialog is kinda crappy if you klick right through an input-control. :)

Anyway, here's the current "snapshot".

I think I'll add a desktopswitch and try to include my hotkey-script.

Anyone out there to help me with my few questions from the first post?

CODE

#cs

Author: dabus

Script function: open a transparent gui with configureable icons to run some commands

Changes:

0.0.0 - based on System-Icons by YDY (Lazycat)

0.0.1 - added _IsPressed to notice mouseclicks

0.0.5 - added MouseGetPos and WinGetPos with counters to calc the current item

0.1.0 - added a menu 'attached' to the selected item - thanks to help from gafrost

0.1.1 - 24.03.2006 - ripped out the old interface

0.1.2 - 24.03.2006 - replaced fixed icon-sizes and numbers with variables

0.1.3 - 24.03.2006 - replaced the picture-patchwork to create transparence with a big one - real speedup

0.1.4 - 24.03.2006 - added reading of inifile to specifiy which slots are used

0.2.0 - 24.03.2006 - open Gui at mousepos if user clicked middlemousbutton on desktop, some code-documentation

0.2.5 - 24.03.2006 - added an edit-dialog to configure items at runtime, put all gifs into one dir in @TempDir

0.2.6 - 24.03.2006 - fixed a stupid pic-error (have to use 0 as style to put pic in background)

0.2.7 - 24.03.2006 - close main-gui if changes have been made, changed edit-gui to accept all files

if links are specified, the target will be written taken as the program to run

0.2.8 - 24.03.2006 - exe-files will be run, else run ( @Comspec & ' /c ...) is tried

0.2.9 - 24.03.2006 - added hotkeys: Shift+Control will open the main-gui, Control+Tab will show all entries

added option to add workingdir 'manually'

0.3.0 - 24.03.2006 - added extract-cmdline-option, minor bugfixes

0.3.1 - 25.03.2006 - added height-check for edit-gui-palcement, replaced checks & default-input for inputboxes of edit-gui

0.3.2 - 25.03.2006 - replaced hotkeymodel with Key+Mouse -- you will have to use the mouse anyway

(Esc+Middle=Exit, Ctrl+Middle=Open, Shift+Middle=ShowAll, Middle on desktop still works; added topmost-attib to windows

0.3.3 - 25.03.2006 - remind old settings when editing via FileOpenDialog; set dapwal-windows behind dialog

0.3.4 - 29.03.2006 - added type-parameter, so we got a new usable gui if we add a few lines of code in keypress-region =o)

0.4.0 - 30.03.2006 - added gui for windows-management (Alt+Middle); added several basic actions for windows

added advanced options like vertical and horicontal maximize with undo-function; added movement to corners

0.4.2 - 01-04.2006 - added unix-like move-function, since it's elemental function in the gnu world,

it's accessible via a sperate hotkey (Alt+First) or gui. (For those who don't know: you just press the keys, and while you push

FirstMouse, you are able to move the selected window > no more need to do moving to titlebar)

ToDo: Find out how to obtain Installer-Dirs (like those used by oo.org-links)

Hide the entries in the Taskbar

Maybe use formats like ico, dll, exe (does not work currently(no transparency)

#ce

#Region Compiler directives section

#Compiler_Prompt = n

#Compiler_Icon = filetype1.ico

#Compiler_Compression = 4

#Compiler_Allow_Decompile = y

#Compiler_PassPhrase =

#Compiler_Res_Comment = Programlauncher to unclutter your desktop.

#Compiler_Res_Description = A port of apwal.

#Compiler_Res_Fileversion = 0.4.2

#Compiler_Res_LegalCopyright = dabus

#Compiler_Res_Field1Name = Made By

#Compiler_Res_Field1Value = Dirk Busse

#Compiler_Res_Field2Name = Apwal

#Compiler_res_Field2Value = Look at freshmeat to discover the original one.

#Compiler_Run_AU3Check = y

#EndRegion

#include <Array.au3>

#include <GUIConstants.au3>

#include <Misc.au3>

AutoItSetOption('TrayIconDebug', 1)

;AutoItSetOption('WinTitleMatchMode', 2)

AutoItSetOption('WinTextMatchMode', 2)

Opt('OnExitFunc', 'ExitProgram')

; Setting variables

Global $Num = 6; Number of slots=$Num*$Num (it's a square)

Global $IconSize = 48; The real icon-size

Global $IconVSize = 60; The size of an icon-slot ~ the icon itself an a border

Global $IniFile = @ScriptDir & '\DApwal.ini'; The location of the config-file

Global $StartIndex = 0, $Row, $Col, $Icons[$Num * $Num], $Index, $dll, $Selection, $Title, $Text, $WinMax[1], $tPos

ExtractGraphics()

#region extract-option

If $CmdLine[0] = 1 Then

If $CmdLine[1] = '/extract' Then

DirCreate(@ScriptDir & '\Source')

FileInstall('D:\Scripts\Helpers\DApwal\DApwal.au3', @ScriptDir & '\Source\DApwal.au3', 1)

FileMove(@TempDir & '\DApwal\*', @ScriptDir & '\Source\')

DirRemove(@TempDir & '\DApwal')

#Region --- CodeWizard generated code Start ---

;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Info

MsgBox(64, "DApwal-Extreactor", "The sub-directory source now contains the script and the image-files.")

#EndRegion --- CodeWizard generated code End ---

Exit

EndIf

EndIf

#endregion

#region keypress

$dll = DllOpen('user32.dll')

While 1

If _IsPressed ('04') Then; MiddleMouse

$Title = WinGetTitle('')

; $Text = WinGetText($Title)

; If StringLen($Text) > 14 Then $Text=StringLeft($Text, 15)

$tPos = WinGetPos($Title)

$mPos = MouseGetPos()

If _IsPressed('1B') Then;Esc

ExitProgram()

ElseIf _IsPressed('12') Then;Alt

OpenGui('W', $mPos[0], $mPos[1])

ElseIf _IsPressed('11') Then; LCtrl

OpenGui('P', $mPos[0], $mPos[1])

Else

If $Title = 'program manager' Then; On Desktop

OpenGui('P', $mPos[0], $mPos[1])

Else

OpenGui('W', $mPos[0], $mPos[1])

EndIf

EndIf

ElseIf _IsPressed ('01') Then; FirstMouse

If _IsPressed ('12') Then

$Title = WinGetTitle('')

$tPos = WinGetPos($Title)

Move()

EndIf

EndIf

Sleep(10)

WEnd

#endregion

; Edit slots

Func Edit($a, $b, ByRef $c, $d); Left, Top, Name, Type

Local $EDir, $EFile

ExtractGraphics()

; Search for defined parameters

$ECommand = IniRead($IniFile, $c, 'Command', '')

$EIcon = IniRead($IniFile, $c, 'Icon', @TempDir & '\DApwal\Question.gif')

; Create Gui, Check for space first

If @DesktopWidth > $a + 225 Then

$EWidth = $a + $IconVSize + 25

Else

$EWidth = $a - 225

EndIf

If @DesktopHeight > $b + 145 Then

$EHeight = $b

Else

$EHeight = $b - 145

EndIf

$EGui = GUICreate('DApwal-Edit', 200, 120, $EWidth, $EHeight, $WS_POPUP, $WS_EX_LAYERED+$WS_EX_TOPMOST+$WS_EX_ACCEPTFILES )

$BG = GUICtrlCreatePic(@TempDir & '\DApwal\AllTrans.gif', 0, 0, 450, 450, 0)

$EInput1 = GUICtrlCreateInput($ECommand, 0, 40, 130, 20)

GUICtrlSetBkColor(-1, 0xf7c35a)

GUICtrlSetTip(-1, 'If you need the program to run in a dir, add |$dir' & @CR & 'e.g. C:\windows\notepad.exe|C:\')

If $d = 'W' Then

$EInput1 = GUICtrlCreateCombo($ECommand, 0, 40, 130, 20)

GUICtrlSetData($EInput1, 'AMax|BLeft|BRight|Close|Hide|HMax|Kill|Min|OnTop|ShowDesk|TLeft|TRight|Trans|UnDesk|UnMax|UnTop|

UnTrans|VMax', 'AMax')

GUICtrlSetState($EInput1, $GUI_ONTOP)

EndIf

$EButton1 = GUICtrlCreatePic(@TempDir & '\DApwal\Dots.gif', 140, 40, 60, 20)

$EInput2 = GUICtrlCreateInput($EIcon, 0, 70, 130, 20)

GUICtrlSetBkColor(-1, 0xf7c35a)

GUICtrlSetState(-1,$GUI_DROPACCEPTED)

$EButton2 = GUICtrlCreatePic(@TempDir & '\DApwal\Dots.gif', 140, 70, 60, 20)

$EButton3 = GUICtrlCreatePic(@TempDir & '\DApwal\OK.gif', 0, 100, 60, 20)

$EButton4 = GUICtrlCreatePic(@TempDir & '\DApwal\Delete.gif', 70, 100, 60, 20)

$EButton5 = GUICtrlCreatePic(@TempDir & '\DApwal\Cancel.gif', 140, 100, 60, 20)

GUISetState(@SW_SHOW, $EGui)

While 1

$EMsg = GUIGetMsg()

Select

Case $EMsg = $GUI_EVENT_CLOSE

ExitLoop

Case $EMsg = $EButton1; Search for file to run

If $ECommand<>'' Then

_StringSplit($ECommand, '\', $EDir, $EFile)

Else

$EDir=@ProgramsCommonDir

EndIf

WinSetOnTop('DApwal', 'Test', 0)

WinSetOnTop('DApwal-Edit', '', 0)

$ECommand = FileOpenDialog('DApwal-Select', $EDir , 'All Files (*.*)')

If @error<>1 Then

If StringRight($ECommand, 3) = 'lnk' Then

$ELink = FileGetShortcut($ECommand)

$ECommand = $ELink[0]

EndIf

GUICtrlSetData($EInput1, $ECommand)

EndIf

WinSetOnTop('DApwal', 'Test', 1)

WinSetOnTop('DApwal-Edit', '', 1)

Case $EMsg = $EButton2; Search for icon

If $EIcon<>'' Then

_StringSplit($EIcon, '\', $EDir, $EFile)

Else

$EDir=@MyDocumentsDir

EndIf

WinSetOnTop('DApwal', 'Test', 0)

WinSetOnTop('DApwal-Edit', '', 0)

$EIcon = FileOpenDialog('DApwal-Select', $EDir, 'Images (*.gif)|All Files (*.*)')

If @error<>1 Then GUICtrlSetData($EInput2, $EIcon)

WinSetOnTop('DApwal', 'Test', 1)

WinSetOnTop('DApwal-Edit', '', 1)

Case $EMsg = $EButton3; OK

If GUICtrlRead($EInput1) = '' Then

GUICtrlSetData($EInput1, 'Missing command')

GUICtrlSetBkColor($EInput1, 0xff0000) ; Red

Sleep(1000)

GUICtrlSetBkColor($EInput1, 0x00ff00) ; Green

Sleep(1000)

GUICtrlSetBkColor($EInput1, 0xf7c35a)

GUICtrlSetData($EInput1, '')

ContinueLoop

EndIf

If GUICtrlRead($EInput2) = '' Then

GUICtrlSetData($EInput2, 'Missing icon')

GUICtrlSetBkColor($EInput2, 0xff0000) ; Red

Sleep(1000)

GUICtrlSetBkColor($EInput2, 0x00ff00) ; Green

Sleep(1000)

GUICtrlSetBkColor($EInput2, 0xf7c35a)

GUICtrlSetData($EInput2, @TempDir & '\DApwal\Question.gif')

ContinueLoop

EndIf

IniWrite($IniFile, $c, 'Command', GUICtrlRead($EInput1))

IniWrite($IniFile, $c, 'Icon', GUICtrlRead($EInput2))

$c = '-'

ExitLoop

Case $EMsg = $EButton4; Delete

IniDelete($IniFile, $c)

$c = '-'

ExitLoop

Case $EMsg = $EButton5; Cancel

ExitLoop

EndSelect

WEnd

GUIDelete($EGui)

EndFunc ;==>Edit

Func ExitProgram(); CleanUp

If $dll <> '' Then DllClose($dll)

DirRemove(@TempDir & '\DApwal', 1)

Exit

EndFunc ;==>ExitProgram

Func ExtractGraphics() ; Install Graphics

DirCreate(@TempDir & '\DApwal')

FileInstall('D:\Scripts\Helpers\DApwal\AllTrans.gif', @TempDir & '\DApwal\AllTrans.gif')

FileInstall('D:\Scripts\Helpers\DApwal\Question.gif', @TempDir & '\DApwal\Question.gif')

FileInstall('D:\Scripts\Helpers\DApwal\Cancel.gif', @TempDir & '\DApwal\Cancel.gif')

FileInstall('D:\Scripts\Helpers\DApwal\Delete.gif', @TempDir & '\DApwal\Delete.gif')

FileInstall('D:\Scripts\Helpers\DApwal\Dots.gif', @TempDir & '\DApwal\Dots.gif')

FileInstall('D:\Scripts\Helpers\DApwal\OK.gif', @TempDir & '\DApwal\OK.gif')

EndFunc ;==>ExtractGraphics

Func Move()

$mbpos=MouseGetPos()

While 1

$msPos=MouseGetPos()

WinMove($Title, $Text, $tPos[0]+$msPos[0]-$mbpos[0], $tPos[1]+$msPos[1]-$mbpos[1])

Sleep (100)

If Not _IsPressed('01') Then ExitLoop

WEnd

EndFunc

Func OpenGui($a, $b = 0, $c = 0); $a=type , $b=width, $c=height

$Selection=''

If $b = 0 Then $b= (@DesktopWidth - $Num * $IconVSize) / 2

If $c = 0 Then $c= (@DesktopHeight - $Num * $IconVSize) / 2

; Creating GUI

$Gui = GUICreate('DApwal', $Num * $IconVSize, $Num * $IconVSize, $b, $c, $WS_POPUP, $WS_EX_LAYERED+$WS_EX_TOPMOST )

$BG = GUICtrlCreatePic(@TempDir & '\DApwal\AllTrans.gif', 0, 0, 450, 450, 0)

GUICtrlCreateLabel('Test', -50, -50, 10, 10)

; Please note that you need to resize AllTrans.gif and recompile the script if you want a bigger transparent GUI than 450*450

; Creating GUI and visible icons

For $Row = 0 To $Num - 1

For $Col = 0 To $Num - 1

$Index = $Row * $Num + $Col

$Command = IniRead($IniFile, $a&$Index, 'Command', '')

If $Command <> '' Then

$Pic = IniRead($IniFile, $a&$Index, 'Icon', @TempDir & '\DApwal\Question.gif')

$Icons[$Index] = GUICtrlCreatePic($Pic, $IconVSize * $Col, $IconVSize * $Row, $IconSize, $IconSize)

GUICtrlSetTip(-1, $Command)

EndIf

Next

Next

GUISetState(@SW_SHOW, $Gui)

While 1

$Msg = GUIGetMsg()

If _IsPressed (01, $dll) Or _IsPressed (02, $dll) Then

$Edit = 0

If _IsPressed (02, $dll) Then $Edit = 1

; If clicked out ouf bounds, assume user wanted to exit

$wPos = WinGetPos('DApwal')

$mPos = MouseGetPos()

If $mPos[0] < $wPos[0] Then ExitLoop

If $mPos[1] < $wPos[1] Then ExitLoop

If $mPos[0] > $wPos[0] + $wPos[2] Then ExitLoop

If $mPos[1] > $wPos[1] + $wPos[3] Then ExitLoop

; Detect item

$xCounter = 0

$yCounter = 0

While 1

If $xCounter = $Num - 1 Then ExitLoop

If ($mPos[0] - $wPos[0]) - (($xCounter + 1) * $IconVSize) >= 0 Then

$xCounter = $xCounter + 1

Else

ExitLoop

EndIf

WEnd

While 1

If $yCounter = $Num - 1 Then ExitLoop

If ($mPos[1] - $wPos[1]) - (($yCounter + 1) * $IconVSize) >= 0 Then

$yCounter = $yCounter + 1

Else

ExitLoop

EndIf

WEnd

$Selection = $a&($yCounter * $Num + $xCounter)

If $Edit = 1 Then; edit

Edit($wPos[0] + $xCounter * $IconVSize, $wPos[1] + $yCounter * $IconVSize, $Selection, $a)

If $Selection = '-' Then ExitLoop

Else;

$WorkDir = ''

$Command = IniRead($IniFile, $Selection, 'Command', '')

If $a='P' Then; programs

If StringInStr($Command, '|') Then

$Command = StringSplit($Command, '|')

$WorkDir = $Command[2]

$Command = $Command[1]

EndIf

If StringInStr($Command, '.exe') Then

Run($Command, $WorkDir)

ExitLoop

Else

Run(@ComSpec & ' /c ' & $Command, $WorkDir, @SW_HIDE)

ExitLoop

EndIf

Else; window-management

Select

Case $Command = 'Close'

WinClose($Title)

ExitLoop

Case $Command = 'Kill'

WinKill($Title, $Text)

ExitLoop

Case $Command = 'AMax'

WinSetState($Title, $Text, @SW_MAXIMIZE)

ExitLoop

Case $Command = 'VMax'

$WinMaxed=0

For $i=0 To UBound($WinMax)-1

$Line=StringSplit($WinMax[$i], "|")

If StringInStr($Line[1] , $Title, 1) Then

$WinMaxed=1

ExitLoop

EndIf

Next

If $WinMaxed=0 Then _ArrayAdd($WinMax, $Title & "|" & $tPos[0] & "|" & $tPos[1] & "|" & $tPos[2] & "|" & $tPos[3])

WinMove($Title, $Text, $tPos[0], 0, $tPos[2], @DesktopHeight)

ExitLoop

Case $Command = 'HMax'

$WinMaxed=0

For $i=0 To UBound($WinMax)-1

$Line=StringSplit($WinMax[$i], "|")

If StringInStr($Line[1] , $Title, 1) Then

$WinMaxed=1

ExitLoop

EndIf

Next

If $WinMaxed=0 Then _ArrayAdd($WinMax, $Title & "|" & $tPos[0] & "|" & $tPos[1] & "|" & $tPos[2] & "|" & $tPos[3])

WinMove($Title, $Text, 0, $tPos[1], @DesktopWidth, $tPos[3])

ExitLoop

Case $Command = 'UnMax'

$Found=0

For $i=0 To UBound($WinMax)-1

$Line=StringSplit($WinMax[$i], "|")

If StringInStr ( $Line[1] , $Title, 1) Then

WinMove($Title, $Text, $Line[2], $Line[3], $Line[4], $Line[5])

_ArrayDelete ( $WinMax, $i)

$Found=1

ExitLoop

EndIf

Next

If $Found=0 Then WinSetState($Title, $Text, @SW_RESTORE);assume @SW_MAXIMIZE as Max-Action

ExitLoop

Case $Command = 'Min'

WinSetState($Title, $Text, @SW_MINIMIZE)

ExitLoop

Case $Command = 'Hide'

WinSetState($Title, $Text, @SW_HIDE)

ExitLoop

Case $Command = 'OnTop'

WinSetOnTop($Title, $Text, 1)

ExitLoop

Case $Command = 'UnTop'

WinSetOnTop($Title, $Text, 0)

ExitLoop

Case $Command = 'Trans'

WinSetTrans($Title, $Text, 175)

ExitLoop

Case $Command = 'UnTrans'

WinSetTrans($Title, $Text, 255)

ExitLoop

Case $Command = 'Move'

GUISetState(@SW_HIDE, $Gui)

Move()

ExitLoop

Case $Command = 'BLeft'

WinMove($Title, $Text, 0, @DesktopHeight-$tPos[3], $tPos[2], $tPos[3])

ExitLoop

Case $Command = 'BRight'

WinMove($Title, $Text, @DesktopWidth-$tPos[2], @DesktopHeight-$tPos[3], $tPos[2], $tPos[3])

ExitLoop

Case $Command = 'TLeft'

WinMove($Title, $Text, 0, 0, $tPos[2], $tPos[3])

ExitLoop

Case $Command = 'TRight'

WinMove($Title, "", @DesktopWidth-$tPos[2], 0, $tPos[2], $tPos[3])

ExitLoop

Case $Command = 'ShowDesk'

WinMinimizeAll()

ExitLoop

Case $Command = 'UnDesk'

WinMinimizeAllUndo()

ExitLoop

EndSelect

EndIf

EndIf

Sleep(250)

ElseIf _IsPressed('10') And _IsPressed('04') Then; Shift + MiddleMouse

ShowAll($a)

ElseIf $Msg = $GUI_EVENT_CLOSE Then

ExitLoop

EndIf

WEnd

GUIDelete($Gui)

If $Selection='-' Then OpenGui ($b, $c)

EndFunc ;==>OpenGui

; Show unused slots

Func ShowAll($a); $a=type

GUISetState(@SW_HIDE)

For $Row = 0 To $Num - 1

For $Col = 0 To $Num - 1

$Index = $Row * $Num + $Col

$Command = IniRead($IniFile, $a&$Index, 'Command', '')

If $Command = '' Then

$Icons[$Index] = GUICtrlCreatePic(@TempDir & '\DApwal\Question.gif', $IconVSize * $Col, $IconVSize * $Row, $IconSize, $IconSize)

EndIf

Next

Next

GUISetState(@SW_SHOW)

EndFunc ;==>ShowAll

Func _StringSplit ($a, $b, ByRef $c, ByRef $d) ; $a=file to split, $b=devider, $c=Prefix, $d=suffix

Local $counter

$counter = 1

While 1

$Error = StringInStr($a, $b, 0, $counter)

If $Error <> 0 Then

$counter = $counter + 1

Else

$Pos = StringInStr($a , $b, 0, $counter - 1)

ExitLoop

EndIf

WEnd

$c = StringLeft($a, $Pos - 1)

$d = StringTrimLeft($a, $Pos)

EndFunc

Link to comment
Share on other sites

Another update. ;) (Have a look at the changes for a quite complete list.)

Tried to add an advanced desktop-switcher.

It is able to handle desktops from 0 (none) to ~ and you can access them by using your mousewheel (and the alt-key).

You can define startup-desktops for your apps (e.g. FireFox should be put on desktop 2).

Added new basic and window-icons (for movement, trancparency, ...).

Seems to be quiet stable now. Download files from first post.

Any ideas how to get the current height of a window title bar? :think:

CODE

#cs

Author: dabus

Script function: open a transparent gui with configureable icons to run some commands

manage your opened windows with some advanced unix-like features (easier movement and resizing)

encrease your desktop-space by creating virtual desktops, define desktops that applications should be associated with

Changes:

0.0.0 - based on System-Icons by YDY (Lazycat)

0.0.1 - added _IsPressed to notice mouseclicks

0.0.5 - added MouseGetPos and WinGetPos with counters to calc the current item

0.1.0 - added a menu 'attached' to the selected item - thanks to help from gafrost

0.1.1 - 24.03.2006 - ripped out the old interface

0.1.2 - 24.03.2006 - replaced fixed icon-sizes and numbers with variables

0.1.3 - 24.03.2006 - replaced the picture-patchwork to create transparence with a big one - real speedup

0.1.4 - 24.03.2006 - added reading of inifile to specifiy which slots are used

0.2.0 - 24.03.2006 - open Gui at mousepos if user clicked middlemousbutton on desktop, some code-documentation

0.2.5 - 24.03.2006 - added an edit-dialog to configure items at runtime, put all gifs into one dir in @TempDir

0.2.6 - 24.03.2006 - fixed a stupid pic-error (have to use 0 as style to put pic in background)

0.2.7 - 24.03.2006 - close main-gui if changes have been made, changed edit-gui to accept all files

if links are specified, the target will be written taken as the program to run

0.2.8 - 24.03.2006 - exe-files will be run, else run ( @Comspec & ' /c ...) is tried

0.2.9 - 24.03.2006 - added hotkeys: Shift+Control will open the main-gui, Control+Tab will show all entries

added option to add workingdir 'manually'

0.3.0 - 24.03.2006 - added extract-cmdline-option, minor bugfixes

0.3.1 - 25.03.2006 - added height-check for edit-gui-palcement, replaced checks & default-input for inputboxes of edit-gui

0.3.2 - 25.03.2006 - replaced hotkeymodel with Key+Mouse -- you will have to use the mouse anyway

(Esc+Middle=Exit, Ctrl+Middle=Open, Shift+Middle=ShowAll, Middle on desktop still works; added topmost-attib to windows

0.3.3 - 25.03.2006 - remind old settings when editing via FileOpenDialog; set dapwal-windows behind dialog

0.3.4 - 29.03.2006 - added type-parameter, so we got a new usable gui if we add a few lines of code in keypress-region =o)

0.4.0 - 30.03.2006 - added gui for windows-management (Alt+Middle); added several basic actions for windows

added advanced options like vertical and horicontal maximize with undo-function; added movement to corners

0.4.2 - 01.04.2006 - added unix-like move-function, since it's elemental function in the gnu world,

it's accessible via a sperate hotkey (Alt+Left) or gui. (For those who don't know: you just press the keys, and while you push

FirstMouse, you are able to move the selected window > no more need to do moving to titlebar)

0.4.5 - 01.04.2006 - changed the appearance of the edit-box: now it's non-transparent to avoid clicking through the interface

pictures used have wooden appearance and 3D-effects

0.4.6 - 01.04.2006 - added unix-like resize: push Alt+Right to resize the current window

0.6.0 - 03.04.2006 - added desktop-switching to get more virtual space; put your software at defined desktops in section Desktop,

SearchString=Desktop - thanks for Ghastly_MIBs example; added ability for faster switching via SwitchDesk()

0.6.1 - 03.04.2006 - added user-defined desktops (section Config - entry ist Desktop=$DeskNum); can be disabled (Desktop=0)

0.6.2 - 03.04.2006 - added Larry's MouseHook to access desktops via Alt+MouseWheelUp or Alt+MouseWheelDown

0.6.3 - 03.04.2006 - replaced @SW_MAXIMIZE with WinMove; works more reliable for me

0.7.0 - 07.04.2006 - big bugfix: totally rewrote GetList-func to provide a solution with two arrays and no use of assign

get rid of any definitions beside those arrays, lots of testing/coding to find solutions to "save" handles; restore windows

if needed; windows will not stay hidden anymore if you switch too fast; added $getactive to avoid rebuild while still active

0.7.1 - 07.04.2006 - added ability to switch windows to certain desktops

ToDo:

Major:

testing =oD

Medium:

add unix-like "min - to - title bar"

Inform about current desktop via larrys osd-func (seems to unsync switching)

Add TrayMenu-entries and/or gui for desktops (easier navigation)

Maybe add Alt+F[1-12] to access desktop[1-12]

Maybe adding autoproperties (set sizes, positions, states, ... for apps)

Add hotkeys (so I can dump my curent hotkey-program)

Minor:

add sticky option

Hide the entries in the taskbar, remove main-gui after editing (bug?)

Find out how to obtain Installer-Dirs (like those used by oo.org-links)

Maybe use formats like ico, dll, exe (does not work currently(no transparency)

#ce

#Region Compiler directives section

#Compiler_Prompt = n

#Compiler_Icon = Dapwal.ico

#Compiler_Compression = 4

#Compiler_Allow_Decompile = y

#Compiler_PassPhrase =

#Compiler_Res_Comment = Programlauncher to unclutter your desktop.

#Compiler_Res_Description = A port of apwal.

#Compiler_Res_Fileversion = 0.7.1

#Compiler_Res_LegalCopyright = dabus

#Compiler_Res_Field1Name = Made By

#Compiler_Res_Field1Value = Dirk Busse

#Compiler_Res_Field2Name = Apwal

#Compiler_res_Field2Value = Look at freshmeat to discover the original one.

#Compiler_Run_AU3Check = y

#EndRegion

#region includes, opts, vars

#include <Array.au3>

#include <GUIConstants.au3>

#include <Misc.au3>

AutoItSetOption('TrayIconDebug', 1)

AutoItSetOption('WinTextMatchMode', 2)

AutoItSetOption("WinWaitDelay", 0)

AutoItSetOption('OnExitFunc', 'ExitProgram')

; setting variables

Global $Num = 6; Number of slots=$Num*$Num (it's a square)

Global $IconSize = 48; The real icon-size

Global $IconVSize = 60; The size of an icon-slot ~ the icon itself an a border

Global $IniFile = @ScriptDir & '\DApwal.ini'; The location of the config-file

Global $StartIndex = 0, $Row, $Col, $Icons[$Num * $Num], $Index, $dll, $Selection, $Title, $Text, $WinMax[1], $mPos, $tPos

Global $DeskNum = IniRead ( $IniFile, 'Config', 'Desktop', 0); Define size of desktop

Global $DefWin[1][2], $CurDesk=1, $Win[1][2], $NewDesk, $DeskCycle, $getactive ; Global register for windows

#endregion

ExtractGraphics()

#region extract-option

If $CmdLine[0] = 1 Then

If $CmdLine[1] = '/extract' Then

DirCreate(@ScriptDir & '\Source')

FileInstall('D:\Scripts\Helpers\DApwal\DApwal.au3', @ScriptDir & '\DApwal.au3', 1)

;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Info

MsgBox(64, "DApwal-Extreactor", "The sub-directory source now contains the script and the image-files.")

Exit

EndIf

EndIf

#endregion

If $DeskNum <> 0 Then

#region Install Larrys MouseWheel-Hook

$hook = GUICreate("test")

Global $n,$msg,$buffer = ""

If Not FileExists(@TempDir&'\hook.dll') Then FileInstall ('D:\Scripts\Helpers\DApwal\hook.dll', @TempDir&'\hook.dll')

$DLLinst = DLLCall("kernel32.dll","hwnd","LoadLibrary","str",@TempDir&"\hook.dll")

$mouseHOOKproc = DLLCall("kernel32.dll","hwnd","GetProcAddress","hwnd",$DLLInst[0],"str","MouseProc")

$hhMouse = DLLCall("user32.dll","hwnd","SetWindowsHookEx","int",7, "hwnd",$mouseHOOKproc[0],"hwnd",$DLLinst[0],"int",0)

DLLCall(@TempDir&"\hook.dll","int","SetValuesMouse","hwnd",$hook,"hwnd",$hhMouse[0])

GUIRegisterMsg(0x1400 + 0x0A3C,"GetWheel")

GUIRegisterMsg(0x1400 + 0x0A3D,"GetWheel")

#endregion

WinPrep()

EndIf

#region keypress

$dll = DllOpen('user32.dll')

While 1

Select

Case _IsPressed ('04', $dll); MiddleMouse

GetInfo()

If _IsPressed('1B', $dll) Then;Esc

ExitProgram()

ElseIf _IsPressed('12', $dll) Then;Alt

OpenGui('W', $mPos[0], $mPos[1])

ElseIf _IsPressed('11', $dll) Then; LCtrl

OpenGui('P', $mPos[0], $mPos[1])

#cs uncomment this if you are sure you do not click while scrolling the mousewheel

Else

If $Title = 'program manager' Then; On Desktop

OpenGui('P', $mPos[0], $mPos[1])

Else

OpenGui('W', $mPos[0], $mPos[1])

EndIf

#ce

EndIf

Case _IsPressed ('01', $dll); LeftMouse

GetInfo()

If _IsPressed ('12', $dll) Then Move(); Alt

Case _IsPressed ('02', $dll); RightMouse

GetInfo()

If _IsPressed ('12', $dll) Then Resize(); Alt

EndSelect

If $DeskNum <> 0 Then

$DeskCycle=$DeskCycle+1

If $DeskCycle=100 Then

$DeskCycle=0

GetList(0, $CurDesk)

EndIf

EndIf

Sleep(10)

WEnd

#endregion

Func Edit($a, $b, ByRef $c, $d); edit slots Param.: Left, Top, Name, Type

Local $EDir, $EFile

ExtractGraphics()

; Search for defined parameters

$ECommand = IniRead($IniFile, $c, 'Command', '')

$EIcon = IniRead($IniFile, $c, 'Icon', @ScriptDir & '\Icons\Basic\Question.gif')

; Create Gui, Check for space first

If @DesktopWidth > $a + 225 Then

$EWidth = $a + $IconVSize + 25

Else

$EWidth = $a - 225

EndIf

If @DesktopHeight > $b + 145 Then

$EHeight = $b

Else

$EHeight = $b - 145

EndIf

$EGui = GUICreate('DApwal-Edit', 200, 120, $EWidth, $EHeight, $WS_POPUP, $WS_EX_TOPMOST+$WS_EX_ACCEPTFILES )

$BG = GUICtrlCreatePic(@ScriptDir & '\Icons\Basic\BG.jpg', 0, 0, 200, 120, 0)

$EInput1 = GUICtrlCreateInput($ECommand, 10, 20, 120, 20)

GUICtrlSetBkColor(-1, 0xdfa04b)

GUICtrlSetTip(-1, 'If you need the program to run in a dir, add |$dir' & @CR & 'e.g. C:\windows\notepad.exe|C:\')

If $d = 'W' Then

$EInput1 = GUICtrlCreateCombo($ECommand, 10, 20, 120, 20)

GUICtrlSetData($EInput1, 'AMax|BLeft|BRight|Close|Desktop|Hide|HMax|Kill|Min|OnTop|ShowDesk|TLeft|TRight|Trans|UnDesk|UnMa

x|UnTop|UnTrans|VMax', 'AMax')

GUICtrlSetState($EInput1, $GUI_ONTOP)

EndIf

$EButton1 = GUICtrlCreatePic(@ScriptDir & '\Icons\Basic\Dots.jpg', 140, 20, 50, 20)

$EInput2 = GUICtrlCreateInput($EIcon, 10 , 50, 120, 20)

GUICtrlSetBkColor(-1, 0xdfa04b)

GUICtrlSetState(-1,$GUI_DROPACCEPTED)

$EButton2 = GUICtrlCreatePic(@ScriptDir & '\Icons\Basic\Dots.jpg', 140, 50, 50, 20)

$EButton3 = GUICtrlCreatePic(@ScriptDir & '\Icons\Basic\OK.jpg', 10, 80, 50, 20)

$EButton4 = GUICtrlCreatePic(@ScriptDir & '\Icons\Basic\Delete.jpg', 75, 80, 50, 20)

$EButton5 = GUICtrlCreatePic(@ScriptDir & '\Icons\Basic\Cancel.jpg', 140, 80, 50, 20)

GUISetState(@SW_SHOW, $EGui)

While 1

$EMsg = GUIGetMsg()

Select

Case $EMsg = $GUI_EVENT_CLOSE

ExitLoop

Case $EMsg = $EButton1; Search for file to run

If $ECommand<>'' Then

_StringSplit($ECommand, '\', $EDir, $EFile)

Else

$EDir=@ProgramsCommonDir

EndIf

WinSetOnTop('DApwal', 'Test', 0)

WinSetOnTop('DApwal-Edit', '', 0)

$ECommand = FileOpenDialog('DApwal-Select', $EDir , 'All Files (*.*)')

If @error<>1 Then

If StringRight($ECommand, 3) = 'lnk' Then

$ELink = FileGetShortcut($ECommand)

$ECommand = $ELink[0]

EndIf

GUICtrlSetData($EInput1, $ECommand)

EndIf

WinSetOnTop('DApwal', 'Test', 1)

WinSetOnTop('DApwal-Edit', '', 1)

Case $EMsg = $EButton2; Search for icon

If $EIcon<>'' Then

_StringSplit($EIcon, '\', $EDir, $EFile)

Else

$EDir=@MyDocumentsDir

EndIf

WinSetOnTop('DApwal', 'Test', 0)

WinSetOnTop('DApwal-Edit', '', 0)

$EIcon = FileOpenDialog('DApwal-Select', $EDir, 'Images (*.gif)|All Files (*.*)')

If @error<>1 Then GUICtrlSetData($EInput2, $EIcon)

WinSetOnTop('DApwal', 'Test', 1)

WinSetOnTop('DApwal-Edit', '', 1)

Case $EMsg = $EButton3; OK

If GUICtrlRead($EInput1) = '' Then

GUICtrlSetData($EInput1, 'Missing command')

GUICtrlSetBkColor($EInput1, 0xff0000) ; Red

Sleep(1000)

GUICtrlSetBkColor($EInput1, 0x00ff00) ; Green

Sleep(1000)

GUICtrlSetBkColor($EInput1, 0xf7c35a)

GUICtrlSetData($EInput1, '')

ContinueLoop

EndIf

If GUICtrlRead($EInput2) = '' Then

GUICtrlSetData($EInput2, 'Missing icon')

GUICtrlSetBkColor($EInput2, 0xff0000) ; Red

Sleep(1000)

GUICtrlSetBkColor($EInput2, 0x00ff00) ; Green

Sleep(1000)

GUICtrlSetBkColor($EInput2, 0xf7c35a)

GUICtrlSetData($EInput2, @ScriptDir & '\Icons\Basic\Question.gif')

ContinueLoop

EndIf

IniWrite($IniFile, $c, 'Command', GUICtrlRead($EInput1))

IniWrite($IniFile, $c, 'Icon', GUICtrlRead($EInput2))

$c = '-'

ExitLoop

Case $EMsg = $EButton4; Delete

IniDelete($IniFile, $c)

$c = '-'

ExitLoop

Case $EMsg = $EButton5; Cancel

ExitLoop

EndSelect

WEnd

GUIDelete($EGui)

EndFunc ;==>Edit

Func ExtractGraphics(); install graphics

If Not FileExists ( @ScriptDir & '\Icons' ) Then DirCreate(@ScriptDir & '\Icons')

If Not FileExists ( @ScriptDir & '\Icons\Basic' ) Then DirCreate(@ScriptDir & '\Icons\Basic')

FileInstall('D:\Scripts\Helpers\DApwal\Icons-Bak\Basic\AllTrans.gif', @ScriptDir & '\Icons\Basic\AllTrans.gif')

FileInstall('D:\Scripts\Helpers\DApwal\Icons-Bak\Basic\Question.gif', @ScriptDir & '\Icons\Basic\Question.gif')

FileInstall('D:\Scripts\Helpers\DApwal\Icons-Bak\Basic\Cancel.jpg', @ScriptDir & '\Icons\Basic\Cancel.jpg')

FileInstall('D:\Scripts\Helpers\DApwal\Icons-Bak\Basic\Delete.jpg', @ScriptDir & '\Icons\Basic\Delete.jpg')

FileInstall('D:\Scripts\Helpers\DApwal\Icons-Bak\Basic\Dots.jpg', @ScriptDir & '\Icons\Basic\Dots.jpg')

FileInstall('D:\Scripts\Helpers\DApwal\Icons-Bak\Basic\OK.jpg', @ScriptDir & '\Icons\Basic\OK.jpg')

FileInstall('D:\Scripts\Helpers\DApwal\Icons-Bak\Basic\BG.jpg', @ScriptDir & '\Icons\Basic\BG.jpg')

EndFunc ;==>ExtractGraphics

Func GetInfo (); get current title and positions

$Title = WinGetTitle('')

$tPos = WinGetPos($Title)

$mPos = MouseGetPos()

EndFunc

Func GetList($a, $:(; Get the current visible windows, Param.: Scan/Hide/Show/Switch-Mode, CurrentDesk

If $getactive=0 Then

$getactive=1

;ConsoleWrite('@@ Debug(306) : $getactive = ' & $getactive & @lf & '>Error code: ' & @error & @lf) ;### Debug Console

$var = WinList()

For $v = 1 To $var[0][0]

If $a=2 And $var[$v][0] <> "" And $var[$v][0] <> "Program Manager" Then; show the (previously hidden) windows associated with the desktop

For $u=0 to UBound($Win)-1

If $var[$v][1]=$Win[$u][0] And $b=$Win[$u][1] Then

WinSetState($var[$v][1], "", @SW_SHOW)

;ConsoleWrite('@@ Debug(350) Show - Current Desk: Handle ' & $var[$v][1] & ' Name: ' & $var[$v][0] & @CR ) ;### Debug Console

EndIf

Next

ElseIf $a=3 And $var[$v][0] <> "" And $var[$v][0] <> "Program Manager" And BitAND(WinGetState($var[$v][1]), 2) Then; change desktop for visible win

If $Title = $var[$v][0] Then

For $u=0 to UBound($Win)-1

If $var[$v][1]=$Win[$u][0] And $b=$Win[$u][1] Then

$Win[$u][1]=$NewDesk

WinSetState($var[$v][1], "", @SW_HIDE)

;ConsoleWrite('@@ Debug(350) Show - Current Desk: Handle ' & $var[$v][1] & ' Name: ' & $var[$v][0] & @CR ) ;### Debug Console

EndIf

Next

EndIf

ElseIf $a<>2 And $a<>2 And $var[$v][0] <> "" And $var[$v][0] <> "Program Manager" And BitAND(WinGetState($var[$v][1]), 2) Then; visable, regular win

If $a = '0' Then; this will scan for new windows

For $u = 0 To UBound($Win, 1) - 1

$Found = -1

If $var[$v][1]=$Win[$u][0] Then

; ConsoleWrite('@@ Debug(315) : Win[$u][0] = '& $u & ': '& $Win[$u][0]&@CR)

$Found = $u

ExitLoop

EndIf

Next

If $Found = -1 Then; searched if it's one of those predefined apps

For $u = 0 To UBound($DefWin, 1) - 1

$Found = -1

; ConsoleWrite('@@ Debug(324) : $DefWin[$u][0] = ' & $u &': ' & $DefWin[$u][0] & @CR) ;### Debug Console

If StringInStr ( $var[$v][0], $DefWin[$u][0]) Then

$Found = $u

ExitLoop

EndIf

Next

If $Found = -1 Then; nothing predefined, don't hide it

ReDim $Win[uBound($Win)+1][2]

; ConsoleWrite(UBound($Win)-1&@CR)

$Win[uBound($Win)-1][0] = $var[$v][1]; Handle

$Win[uBound($Win)-1][1] = $CurDesk; Desktop

;ConsoleWrite('Not defined ' & $var[$v][0] & ' on ' & $CurDesk & @CR )

Else; it is predefined, hide it and associate with special desktop

ReDim $Win[uBound($Win)+1][2]

; ConsoleWrite(UBound($Win)-1&@CR)

$Win[uBound($Win)-1][0] = $var[$v][1]; Handle

$Win[uBound($Win)-1][1] = $DefWin[$Found][1]; Desktop

IF $b <> $DefWin[$Found][1] Then WinSetState($var[$v][1], "", @SW_HIDE)

;ConsoleWrite('Defined ' & $var[$v][0] & ' on ' & $DefWin[$Found][1] & @CR )

EndIf

EndIf

Else; hide currently visible windows

For $u=0 to UBound($Win)-1

If $var[$v][1]=$Win[$u][0] Then

WinSetState($var[$v][1], "", @SW_HIDE)

;ConsoleWrite('@@ Debug(344) Hide - Current Desk: Handle ' & $var[$v][1] & ' Name: ' & $var[$v][0] & @CR) ;### Debug Console

EndIf

Next

EndIf

EndIf

Next

$getactive=0

; Else; try again if blocked

; Sleep (10)

; GetList($a, $:)

EndIf

EndFunc ;==>GetList

Func GetWheel($hWndGUI, $MsgID, $WParam, $LParam); Larrys Func to get MouseWheel-Action

$n += 1

If $n > 25 Then

$n = 25

$buffer = StringTrimLeft($buffer,StringInStr($buffer,@LF))

EndIf

If $MsgID=7740 Then; MouseWheelUp

If _IsPressed('12', $dll) Then; Alt

SwitchDesk('+')

EndIf

EndIf

If $MsgID=7741 Then; MouseWheelDown

If _IsPressed('12', $dll) Then; Alt

SwitchDesk('-')

EndIf

EndIf

EndFunc

Func Move(); Move windows unix-style

$mbpos=MouseGetPos()

While 1

$msPos=MouseGetPos()

WinMove($Title, $Text, $tPos[0]+$msPos[0]-$mbpos[0], $tPos[1]+$msPos[1]-$mbpos[1])

Sleep (100)

If Not _IsPressed('01', $dll) Then ExitLoop

WEnd

EndFunc

Func ExitProgram(); special exit-event

If $DeskNum <> 0 Then

DLLCall("user32.dll","int","UnhookWindowsHookEx","hwnd",$hhMouse[0])

DLLCall("kernel32.dll","int","FreeLibrary","hwnd",$DLLinst[0])

FileDelete(@TempDir&'\hook.dll')

For $CurDesk=1 to $DeskNum

GetList(2, $CurDesk)

Next

EndIf

If $dll <> '' Then DllClose($dll)

Exit

EndFunc ;==>ExitProgram

Func OpenGui($a, $b = 0, $c = 0); This is the main gui Param.: $a=type , $b=width, $c=height

$Selection=''

If $b = 0 Then $b= (@DesktopWidth - $Num * $IconVSize) / 2

If $c = 0 Then $c= (@DesktopHeight - $Num * $IconVSize) / 2

; Creating GUI

$Gui = GUICreate('DApwal', $Num * $IconVSize, $Num * $IconVSize, $b, $c, $WS_POPUP, $WS_EX_LAYERED+$WS_EX_TOPMOST )

$BG = GUICtrlCreatePic(@ScriptDir & '\Icons\Basic\AllTrans.gif', 0, 0, 450, 450, 0)

GUICtrlCreateLabel('Test', -50, -50, 10, 10)

; Please note that you need to resize AllTrans.gif and recompile the script if you want a bigger transparent GUI than 450*450

; Creating GUI and visible icons

For $Row = 0 To $Num - 1

For $Col = 0 To $Num - 1

$Index = $Row * $Num + $Col

$Command = IniRead($IniFile, $a&$Index, 'Command', '')

If $Command <> '' Then

$Pic = IniRead($IniFile, $a&$Index, 'Icon', @ScriptDir & '\Icons\Basic\Question.gif')

$Icons[$Index] = GUICtrlCreatePic($Pic, $IconVSize * $Col, $IconVSize * $Row, $IconSize, $IconSize)

GUICtrlSetTip(-1, $Command)

EndIf

Next

Next

GUISetState(@SW_SHOW, $Gui)

While 1

$Msg = GUIGetMsg()

If _IsPressed (01, $dll) Or _IsPressed (02, $dll) Then

$Edit = 0

If _IsPressed (02, $dll) Then $Edit = 1

; If clicked out ouf bounds, assume user wanted to exit

$wPos = WinGetPos('DApwal')

$mPos = MouseGetPos()

If $mPos[0] < $wPos[0] Then ExitLoop

If $mPos[1] < $wPos[1] Then ExitLoop

If $mPos[0] > $wPos[0] + $wPos[2] Then ExitLoop

If $mPos[1] > $wPos[1] + $wPos[3] Then ExitLoop

; Detect item

$xCounter = 0

$yCounter = 0

While 1

If $xCounter = $Num - 1 Then ExitLoop

If ($mPos[0] - $wPos[0]) - (($xCounter + 1) * $IconVSize) >= 0 Then

$xCounter = $xCounter + 1

Else

ExitLoop

EndIf

WEnd

While 1

If $yCounter = $Num - 1 Then ExitLoop

If ($mPos[1] - $wPos[1]) - (($yCounter + 1) * $IconVSize) >= 0 Then

$yCounter = $yCounter + 1

Else

ExitLoop

EndIf

WEnd

$Selection = $a&($yCounter * $Num + $xCounter)

If $Edit = 1 Then; edit

Edit($wPos[0] + $xCounter * $IconVSize, $wPos[1] + $yCounter * $IconVSize, $Selection, $a)

If $Selection = "-" Then ExitLoop

Else;

$WorkDir = ''

$Command = IniRead($IniFile, $Selection, 'Command', '')

If $a='P' Then; programs

If StringInStr($Command, '|') Then

$Command = StringSplit($Command, '|')

$WorkDir = $Command[2]

$Command = $Command[1]

Else

_StringSplit($Command, '\', $WorkDir, $Command)

$Command=$WorkDir & '\' & $Command

EndIf

If StringInStr($Command, '.exe') Then

Run($Command, $WorkDir)

ExitLoop

Else

Run(@ComSpec & ' /c ' & $Command, $WorkDir, @SW_HIDE)

ExitLoop

EndIf

Else; window-management

Select

Case $Command = 'Close'

WinClose($Title)

ExitLoop

Case $Command = 'Kill'

WinKill($Title, $Text)

ExitLoop

Case $Command = 'AMax'

$WinMaxed=0

For $i=0 To UBound($WinMax)-1

$Line=StringSplit($WinMax[$i], "|")

If StringInStr($Line[1] , $Title, 1) Then

$WinMaxed=1

ExitLoop

EndIf

Next

If $WinMaxed=0 Then _ArrayAdd($WinMax, $Title & "|" & $tPos[0] & "|" & $tPos[1] & "|" & $tPos[2] & "|" & $tPos[3])

WinMove($Title, $Text, 0, 0, @DesktopWidth, @DesktopHeight )

ExitLoop

Case $Command = 'VMax'

$WinMaxed=0

For $i=0 To UBound($WinMax)-1

$Line=StringSplit($WinMax[$i], "|")

If StringInStr($Line[1] , $Title, 1) Then

$WinMaxed=1

ExitLoop

EndIf

Next

If $WinMaxed=0 Then _ArrayAdd($WinMax, $Title & "|" & $tPos[0] & "|" & $tPos[1] & "|" & $tPos[2] & "|" & $tPos[3])

WinMove($Title, $Text, $tPos[0], 0, $tPos[2], @DesktopHeight)

ExitLoop

Case $Command = 'HMax'

$WinMaxed=0

For $i=0 To UBound($WinMax)-1

$Line=StringSplit($WinMax[$i], "|")

If StringInStr($Line[1] , $Title, 1) Then

$WinMaxed=1

ExitLoop

EndIf

Next

If $WinMaxed=0 Then _ArrayAdd($WinMax, $Title & "|" & $tPos[0] & "|" & $tPos[1] & "|" & $tPos[2] & "|" & $tPos[3])

WinMove($Title, $Text, 0, $tPos[1], @DesktopWidth, $tPos[3])

ExitLoop

Case $Command = 'UnMax'

$Found=0

For $i=0 To UBound($WinMax)-1

$Line=StringSplit($WinMax[$i], "|")

If StringInStr ( $Line[1] , $Title, 1) Then

WinMove($Title, $Text, $Line[2], $Line[3], $Line[4], $Line[5])

_ArrayDelete ( $WinMax, $i)

$Found=1

ExitLoop

EndIf

Next

If $Found=0 Then WinSetState($Title, $Text, @SW_RESTORE);assume @SW_MAXIMIZE as Max-Action

ExitLoop

Case $Command = 'Min'

WinSetState($Title, $Text, @SW_MINIMIZE)

ExitLoop

Case $Command = 'Hide'

WinSetState($Title, $Text, @SW_HIDE)

ExitLoop

Case $Command = 'OnTop'

WinSetOnTop($Title, $Text, 1)

ExitLoop

Case $Command = 'UnTop'

WinSetOnTop($Title, $Text, 0)

ExitLoop

Case $Command = 'Trans'

WinSetTrans($Title, $Text, 175)

ExitLoop

Case $Command = 'UnTrans'

WinSetTrans($Title, $Text, 255)

ExitLoop

Case $Command = 'Move'

GUISetState(@SW_HIDE, $Gui)

Move()

ExitLoop

Case $Command = 'BLeft'

WinMove($Title, $Text, 0, @DesktopHeight-$tPos[3], $tPos[2], $tPos[3])

ExitLoop

Case $Command = 'BRight'

WinMove($Title, $Text, @DesktopWidth-$tPos[2], @DesktopHeight-$tPos[3], $tPos[2], $tPos[3])

ExitLoop

Case $Command = 'TLeft'

WinMove($Title, $Text, 0, 0, $tPos[2], $tPos[3])

ExitLoop

Case $Command = 'TRight'

WinMove($Title, "", @DesktopWidth-$tPos[2], 0, $tPos[2], $tPos[3])

ExitLoop

Case $Command = 'ShowDesk'

WinMinimizeAll()

ExitLoop

Case $Command = 'UnDesk'

WinMinimizeAllUndo()

ExitLoop

Case $Command = 'Desktop'

;InputBox features: Title=Yes, Prompt=Yes, Default Text=No, Height=150

$NewDesk = InputBox("DApwal","Please choose the target-desktop this application should be moved to.",""," ","-1","150","-1","-1")

If @Error = 0 Then

If $NewDesk-1 < $DeskNum Then

GetList(3, $CurDesk)

ExitLoop

Else

;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Critical

MsgBox(16,"Dapwal","Please select a desktop that is in your defined range." & _

@CRLF & "(Currently this is from 1 to " & $DeskNum& ")")

EndIf

EndIf

EndSelect

EndIf

EndIf

Sleep(250)

ElseIf _IsPressed('10', $dll) And _IsPressed('04', $dll) Then; Shift + MiddleMouse

ShowAll($a)

ElseIf $Msg = $GUI_EVENT_CLOSE Then

ExitLoop

EndIf

WEnd

GUIDelete($Gui)

If $Selection='-' Then OpenGui ($b, $c)

EndFunc ;==>OpenGui

Func Resize(); Resize windows unix-style

$mbpos=MouseGetPos()

While 1

$msPos=MouseGetPos()

WinMove($Title, $Text, $tPos[0], $tPos[1], $tPos[2]+$msPos[0]-$mbpos[0],$tPos[3]+$msPos[1]-$mbpos[1])

Sleep (100)

If Not _IsPressed('02', $dll) Then ExitLoop

WEnd

EndFunc

Func ShowAll($a); Show unused slots Param.: $a=type

GUISetState(@SW_HIDE)

For $Row = 0 To $Num - 1

For $Col = 0 To $Num - 1

$Index = $Row * $Num + $Col

$Command = IniRead($IniFile, $a&$Index, 'Command', '')

If $Command = '' Then

$Icons[$Index] = GUICtrlCreatePic(@ScriptDir & '\Icons\Basic\Question.gif', $IconVSize * $Col, $IconVSize * $Row, $IconSize, $IconSize)

EndIf

Next

Next

GUISetState(@SW_SHOW)

EndFunc ;==>ShowAll

Func ShowArray($a);Display $myArray's contents

$output = ""

For $r = 0 to UBound($a,1) - 1

$output = $output & @LF

For $c = 0 to UBound($a,2) - 1

$output = $output & $a[$r][$c] & " "

Next

Next

MsgBox (0, 'Array' , $output)

EndFunc

Func _StringSplit ($a, $b, ByRef $c, ByRef $d) ; Split input at the last devider Param.: $a=var, $b=devider, $c=Prefix, $d=suffix

Local $counter

$counter = 1

While 1

$Error = StringInStr($a, $b, 0, $counter)

If $Error <> 0 Then

$counter = $counter + 1

Else

$Pos = StringInStr($a , $b, 0, $counter - 1)

ExitLoop

EndIf

WEnd

$c = StringLeft($a, $Pos - 1)

$d = StringTrimLeft($a, $Pos)

EndFunc

Func SwitchDesk ($a='+'); Switch the desktop, Param.: target-desktop

GetList(1, $CurDesk)

If StringInStr ($a, '+') Then

If $CurDesk=$DeskNum Then

$CurDesk=1

Else

$CurDesk=$CurDesk+1

EndIf

ElseIf StringInStr ($a, '-') Then

If $CurDesk=1 Then

$CurDesk=$DeskNum

Else

$CurDesk=$CurDesk-1

EndIf

Else

$CurDesk = $a

EndIf

GetList(2, $CurDesk)

TrayTip('', '', 0)

TrayTip('Desk', $CurDesk, 5, 1)

EndFunc

Func WinPrep(); create $vars, read predefined desktops

For $d=1 to $DeskNum

Assign ( 'Desk' & $d, '', 2)

Next

$Entry = IniReadSection($IniFile, 'Desktop')

If Not @error Then

ReDim $DefWin[$Entry[0][0]][2]

For $e = 0 To $Entry[0][0] - 1

$DefWin[$e][0] = $Entry[$e + 1][0]; Names

$DefWin[$e][1] = $Entry[$e + 1][1]; Desktop

Next

EndIf

EndFunc ;==>WinProp

Here's my current configuration

CODE

[Config]

Desktop=4

[Desktop]

WinAmp=3

Internet=2

Firefox=2

Scite=4

AutoIt Help=4

[P0]

Command=C:\Programme\AutoIt3\AU3Info.exe

Icon=D:\Scripts\Icons\AU3Info.gif

[P1]

Command=C:\Programme\IrfanView\i_view32.exe

Icon=D:\Scripts\Helpers\DApwal\Icons\Apps\Pixmap-gthumb.gif

[P2]

Command=C:\Programme\GIMP\bin\gimp-2.2.exe

Icon=D:\Scripts\Helpers\DApwal\Icons\Apps\Slick-gimp.gif

[P3]

Command=C:\Programme\AutoIt3\SciTe\SciTe.exe

Icon=D:\Scripts\Helpers\DApwal\Icons\Apps\Pixmap-Scite.gif

[P4]

Command=C:\Programme\AutoIt3\AU3Info.exe

Icon=D:\Scripts\Helpers\DApwal\Icons\Apps\HIColor-panel-window-menu.gif

[P5]

Command=C:\Programme\XnView\xnview.exe

Icon=D:\Scripts\Helpers\DApwal\Icons\Apps\HIColor-sodipodi.gif

[P6]

Command=cmd.exe

Icon=D:\Scripts\Helpers\DApwal\Icons\Apps\IKons-konsole.gif

[P7]

Command=C:\Programme\IZArc\IZArc.exe

Icon=D:\Scripts\Helpers\DApwal\Icons\Apps\Gnome-gnome-package.gif

[P8]

Command=C:\Programme\QuickDic\QuickDic.exe

Icon=D:\Scripts\Helpers\DApwal\Icons\Apps\Slick-korganizer.gif

[P9]

Command=C:\Programme\CUEcards\CUEcards.exe

Icon=D:\Scripts\Helpers\DApwal\Icons\Apps\Crystal-klipper.gif

[P10]

Command=C:\Programme\Nero\Nero 7\Core\nero.exe

Icon=D:\Scripts\Helpers\DApwal\Icons\Devices\Slick-cdwriter_unmount.gif

[P11]

Command=C:\Programme\NetSupport Manager\PCICTLUI.EXE

Icon=D:\Scripts\Helpers\DApwal\Icons\Apps\Slick-disconnect.gif

[P12]

Command=C:\Programme\Winamp\winamp.exe

Icon=D:\Scripts\Helpers\DApwal\Icons\Apps\Crystal-noatun.gif

[P13]

Command=C:\Programme\Windows Media Player\wmplayer.exe

Icon=D:\Scripts\Helpers\DApwal\Icons\Apps\Pixmap-rhythmbox.gif

[P14]

Command=C:\Programme\Nero\Nero 7\Nero ShowTime\ShowTime.exe

Icon=D:\Scripts\Helpers\DApwal\Icons\Apps\Slick-mplayer.gif

[P15]

Command=C:\Programme\PowerDVD\PowerDVD.exe

Icon=D:\Scripts\Helpers\DApwal\Icons\Apps\Slick-noatun2.gif

[P16]

[P17]

[P18]

Command=E:\BGII\baldur.exe

Icon=D:\Scripts\Helpers\DApwal\Icons\Apps\Pixmap-gtetrinet.gif

[P19]

Command=E:\NWN\nwn.exe

Icon=D:\Scripts\Helpers\DApwal\Icons\Apps\Slick-package_toys.gif

[P20]

Command=E:\Tony Tough\TonyTough.exe

Icon=D:\Scripts\Helpers\DApwal\Icons\Apps\HIColor-im-msn.gif

[P21]

[P22]

[P23]

[P24]

[P25]

[P26]

[P27]

[P28]

[P29]

[P30]

[P31]

[P32]

[P33]

[P34]

[P35]

Command=explorer

Icon=D:\Scripts\Helpers\DApwal\Icons\Folders\Slick-desktop.gif

[W0]

Command=TLeft

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\TLeft.gif

[W1]

Command=Move

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\Move.gif

[W2]

Command=Desktop

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\DeskSwitch.gif

[W3]

Command=TRight

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\TRight.gif

[W4]

[W5]

[W6]

Command=OnTop

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\OnTop.gif

[W7]

Command=UnTop

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\UnTop.gif

[W8]

Command=Close

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\Close.gif

[W9]

Command=Kill

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\Kill.gif

[W10]

[W11]

[W12]

Command=HMax

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\HMax.gif

[W13]

Command=VMAx

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\VMax.gif

[W14]

Command=AMax

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\AMax.gif

[W15]

Command=UnMax

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\UnMax.gif

[W16]

[W17]

[W18]

Command=ShowDesk

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\ShowDesk.gif

[W19]

Command=UnDesk

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\UnDesk.gif

[W20]

Command=Trans

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\Trans.gif

[W21]

Command=UnTrans

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\UnTrans.gif

[W22]

[W23]

[W24]

Command=BLeft

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\BLeft.gif

[W25]

Command=Min

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\Min.gif

[W26]

Command=Hide

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\Hide.gif

[W27]

Command=BRight

Icon=D:\Scripts\Helpers\DApwal\Icons\Windows\BRight.gif

[W28]

[W29]

[W30]

[W31]

[W32]

[W33]

[W34]

[W35]

Edited by dabus
Link to comment
Share on other sites

  • Moderators

I'm having a problem copy/pasting your updated code, could you put up the source code?

Try it from firefox... If they don't... codebox messes up IE I believe.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Developers

Cut&Paste it into WordPad.. then Cut&Paste it into your Editor.....

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I'm having a problem copy/pasting your updated code, could you put up the source code?

If you copy it and paste it into Wordpad then copy it from wordpad and paste it int SciTe it is ok.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Edited a few posts to save space and attached latest source into first posting. Maybe I'll have to remove the icons if I run out of space...

Since some people seem to test my stuff: What's your opinion? :think:

Edited by dabus
Link to comment
Share on other sites

  • 2 weeks 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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...