Jump to content

OK need alot of help...


Recommended Posts

ok i came across this script...

It gives you as many desktops as you want for one person...

But it only down near the clock...

Can someone please make a Gui with all of that in...

but also a tree view with all of the desktops in as well...

here is my script:( or download it Below)

CODE

#include <File.au3>

#Include <Array.au3>

#NoTrayIcon

Opt('TrayOnEventMode',1)

Opt('TrayMenuMode',1)

Opt('OnExitFunc','_Exit')

Dim $desktops[30][2]

$open = TrayCreateMenu('Open...')

$create = TrayCreateItem('Create New Desktop')

TrayItemSetOnEvent($create, '_NewDesktop')

TrayItemSetState($create, 512)

TrayCreateItem('')

$delete = TrayCreateItem('Delete a Desktop')

TrayItemSetOnEvent($delete, '_Delete')

TrayCreateItem('')

$exit = TrayCreateItem('Exit')

TrayItemSetOnEvent($exit, '_Exit')

$desktopsDir = @AppDataDir & '\Desktops'

If DirGetSize($desktopsDir, 1) < 1 then DirCreate($desktopsDir & '\Default')

$currentDesktop = IniRead($desktopsDir & '\DesktopInfo.ini', 'Startup Info', 'Last used desktop', '')

If $currentDesktop = '' then

IniWrite($desktopsDir & '\DesktopInfo.ini', 'Startup Info', 'Last used desktop', 'Default')

$currentDesktop = 'Default'

EndIf

If IniRead($desktopsDir, $currentDesktop, 'Current', '') = '' then

IniWrite($desktopsDir & '\DesktopInfo.ini', 'Background', $currentDesktop, RegRead('HKEY_CURRENT_USER\Control Panel\Desktop', 'Wallpaper'))

EndIf

$priorDesktops = _FileListToArray($desktopsDir, '**', 2)

$count = 1

If IsArray($priorDesktops) then

If $priorDesktops[0] > 0 then

For $a = 1 to $priorDesktops[0]

$desktops[$a][0] = TrayCreateItem($priorDesktops[$a], $open)

TrayItemSetOnEvent($desktops[$a][0], '_SwitchDesktop')

$desktops[$a][1] = $priorDesktops[$a]

If $priorDesktops[$a] = $currentDesktop then

TrayItemSetState($desktops[$a][0], 1)

$currentIndex = $a

EndIf

$count += 1

Next

EndIf

Else

$desktops[1][0] = TrayCreateItem('Default', $open)

TrayItemSetState($desktops[1][0], 1)

TrayItemSetOnEvent($desktops[1][0], '_SwitchDesktop')

$desktops[1][1] = 'Default'

$count = 2

$currentIndex = 1

EndIf

TraySetState()

While 1

$priorDesktops = _FileListToArray($desktopsDir, '**', 2)

If IsArray($priorDesktops) then

If $count - 1 > $priorDesktops[0] then

For $a = 1 to $count

$pass = False

For $b = 1 to $priorDesktops[0]

If $priorDesktops[$b] = $desktops[$a][1] then $pass = True

Next

If Not $pass then TrayItemDelete($desktops[$a][0])

Next

EndIf

EndIf

Sleep(200)

Wend

Func _SwitchDesktop()

$files = _FileListToArray(@DesktopDir, "*.*", 1)

_StoreDesktop('','')

TrayItemSetState($desktops[$currentIndex][0], 4)

For $a = 1 to $count

If @Tray_ID = $desktops[$a][0] then

$currentDesktop = $desktops[$a][1]

$currentIndex = $a

EndIf

Next

TrayItemSetState($desktops[$currentIndex][0], 1)

_StoreDesktop(@DesktopDir, $desktopsDir & '\' & $currentDesktop, 0)

$newWallpaper = IniRead($desktopsDir &'\DesktopInfo.ini' , 'Background', $currentDesktop, '')

If $newWallpaper <> '' then _ChangeDesktopBackground($newWallpaper)

TrayItemSetState($desktops[$a][0], 1)

WinActivate('Program Manager')

Send('{F5}')

EndFunc

Func _StoreDesktop($to, $from, $type = 1)

If $from = '' then $from = @DesktopDir

If $to = '' then $to = $desktopsDir & '\' & $currentDesktop

If $type = 1 then

$original = @DesktopDir

Else

$original = $from

EndIf

$files = _FileListToArray($original, "*.*", 1)

If IsArray($files) then

For $a = 1 to $files[0]

FileMove($from & '\' & $files[$a], $to, 1)

Next

EndIf

$files = _FileListToArray($original, "**", 2)

If IsArray($files) then

For $a = 1 to $files[0]

DirMove($from & '\' & $files[$a], $to, 1)

Next

EndIf

EndFunc

Func _Delete()

$desktopDelete = Inputbox('Desktop Delete', 'Type the name of the desktop you would like to delete...' & @CRLF & @CRLF & 'All files currently in that desktop will also be deleted!', '', '', 350, 150)

If $desktopDelete = '' then Return

If $desktopDelete = 'Default' then

Msgbox(48, 'Error', 'You can not delete the default desktop')

Return

EndIf

If $currentDesktop = $desktopDelete then

Msgbox(48, 'Error', 'You can not delete a desktop if it is currently active.' & @CRLF & @CRLF & 'Please load a new desktop and try again.')

Return

EndIf

DirRemove($desktopsDir & '\' & $desktopDelete)

For $a = 1 to $count

If $desktops[$a][1] = $desktopDelete then TrayItemDelete($desktops[$a][0])

Next

EndFunc

Func _NewDesktop()

GuiCreate('Create a New Desktop', 416, 456)

GuiCtrlCreateGroup('Desktop Name', 8, 8, 400, 40)

$newName = GuiCtrlCreateInput('', 18, 23, 383, 20)

GuiCtrlCreateGroup('Desktop Background', 10, 52, 400, 360)

$picDir = RegRead("HKEY_CURRENT_USER\Control Panel\Desktop", "Wallpaper")

$currentDesktopPic = GuiCtrlCreatePic($picDir, 18, 67, 383, 306)

$change = GuiCtrlCreateButton('Change Picture', 18, 380, 383, 25)

$cancel = GuiCtrlCreateButton('Cancel', 118, 418, 100, 30)

$ok = GuiCtrlCreateButton('Ok', 238, 418, 100, 30)

GuiSetState()

While 1

Switch GuiGetMsg()

Case -3

GuiDelete()

Return 0

Case $cancel

GuiDelete()

Return 0

Case $change

$tempDir = FileOpenDialog('Chose a new background...', @MyDocumentsDir, '(*.jpg;*.bmp;*.gif;*.png)', 2)

If Not @Error then

GuiCtrlSetImage($currentDesktopPic, $tempDir)

$picDir = $tempDir

EndIf

Case $ok

$pass = True

$priorDesktops = _FileListToArray($desktopsDir, '**', 2)

$newNameText = StringStripWS (GuiCtrlRead($newName), 3)

If $newNameText = '' then

Msgbox(48, 'Error', 'Please insert a name for the new desktop')

Else

If IsArray($priorDesktops) then

For $a = 1 to $priorDesktops[0]

If $priorDesktops[$a] = $newNameText then $pass = False

Next

EndIf

If $pass = False Then

Msgbox(48, 'Error', 'There is alreay a desktop with that name or the name you specified can not be used.')

Else

DirCreate($desktopsDir & '\' & $newNameText)

_StoreDesktop('','')

$desktops[$count][1] = $newNameText

$desktops[$count][0] = TrayCreateItem($newNameText, $open)

TrayItemSetOnEvent($desktops[$count][0], '_SwitchDesktop')

TrayItemSetState($desktops[$count][0], 1)

TrayItemSetState($desktops[$currentIndex][0], 4)

$currentDesktop = $newNameText

$currentIndex = $count

_ChangeDesktopBackground($picDir)

IniWrite($desktopsDir & '\DesktopInfo.ini', 'Background', $currentDesktop, $picDir)

GuiDelete()

$count += 1

WinActivate('Program Manager')

Send('{F5}')

Return

EndIf

EndIf

EndSwitch

Wend

EndFunc

Func _Exit()

IniWrite($desktopsDir & '\DesktopInfo.ini', 'Startup Info', 'Last used desktop', $currentDesktop)

Exit

EndFunc

Func _ChangeDesktopBackground($path)

$apply_type = StringRight($path, 4)

If $apply_type = '.jpg' Or $apply_type = '.gif' Or $apply_type = '.png' Then

FileDelete(@WindowsDir & "\xwall.bmp")

RunWait(@ScriptDir & "\pvw32con.exe " & '"' & $path & '"' & " -w --oo " & '"' & @WindowsDir & "\xwall.bmp" & '"', @ScriptDir, @SW_HIDE)

Else

FileCopy($path, @WindowsDir & '\xwall.bmp', 1)

EndIf

RegWrite('HKEY_CURRENT_USER\Control Panel\Desktop', 'WallpaperStyle', 'REG_SZ', 2)

RegWrite('HKEY_CURRENT_USER\Control Panel\Desktop', 'TileWallpaper', 'REG_SZ', 0)

RegWrite('HKEY_CURRENT_USER\Control Panel\Desktop', 'Wallpaper', 'Reg_SZ', $path)

Sleep(250)

DllCall('User32.dll', 'int', 'SystemParametersInfo', 'int', 20, 'int', 0, 'string', @WindowsDir & '\xwall.bmp', 'int', 0)

EndFunc

Please help me!

Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

Link to comment
Share on other sites

:shocked:

Can someone please make a Gui with all of that in...

but also a tree view with all of the desktops in as well...

Hope you give due credit when you enter it in the contest?

Link to comment
Share on other sites

ok i came across this script...

It gives you as many desktops as you want for one person...

But it only down near the clock...

Can someone please make a Gui with all of that in...

but also a tree view with all of the desktops in as well...

here is my script:( or download it Below)

If you have the knowledge to make the script you would've made a GUI for yourself, don't claim the stuff that is not yours.
Link to comment
Share on other sites

one this is not going in contest this if for mine and m8s use only

And i did'nt meen to clame it as mine...

I ment it has here is the dowload for the version i have

Then ask the author and see if he is willing to make a GUI version
Link to comment
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
 Share

  • Recently Browsing   0 members

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