Page 1 of 1

Playing with Desktop

Posted: Sun Sep 04, 2005 2:57 am
by ricardo
Im playin with desktop a little

Code: Select all

;Example of playing with Desktop  -  Ricardo

hDesktop=GetDesktopWindow_(); 
hDesktop=FindWindowEx_(hDesktop, 0, "Progman", "Program Manager"); 
hDesktop=FindWindowEx_(hDesktop, 0, "SHELLDLL_DefView", 0); 
hDesktop=FindWindowEx_(hDesktop, 0, "SysListView32", 0);

If OpenWindow(0,0,0,0,0,#PB_Window_Invisible,"")
    AddSysTrayIcon(0, WindowID(), ExtractIcon_(0,"C:\purebasic\purebasic.exe",0))
    SysTrayIconToolTip(0, "Desktop View")
    CreatePopupMenu(0)
    MenuItem(1,"Normal Mode")
    MenuItem(2,"Details Mode")
    MenuItem(3,"Small Icons Mode")
    MenuItem(4,"Tiled Mode")
    MenuBar()
    MenuItem(5,"Quit")
    Repeat
        
        Select WaitWindowEvent()
            
            Case  #PB_Event_SysTray
                DisplayPopupMenu(0,WindowID())
            Case #PB_Event_Menu        ; an item of the popup-menu was clicked
                Select EventMenuID()
                    Case 1
                        ; ;nomal
                        SendMessage_(hDesktop, 4238, $0, 0)
                    Case 2
                        ; ;details
                        SendMessage_(hDesktop, 4238, $1, 0)
                    Case 3
                        ; ;small
                        SendMessage_(hDesktop, 4238, $2, 0)
                    Case 4
                        ;tiles
                        SendMessage_(hDesktop, 4238, $4, 0)
                    Case 5 
                        Quit = 1
                EndSelect
        EndSelect
        
    Until Quit = 1
EndIf
End

Re: Playing with Desktop

Posted: Sun Sep 04, 2005 3:49 am
by PB
Doesn't do anything on Windows 2000 Pro...

Posted: Sun Sep 04, 2005 3:59 am
by ricardo
Yes, sorry, forget to mention: is only XP.

Is just playing with the listview that finally is the desktop.

Posted: Sun Sep 04, 2005 9:05 am
by Jellybean
Cool, but it messes up sort of when you want to restore it to normal more. Luckily I had Iconoid running and had all positions saved, but you should add a warning.

Posted: Sun Sep 04, 2005 10:21 am
by Num3
Cool!

Didn't know desktop had those properties!

Posted: Sun Sep 04, 2005 1:04 pm
by xgp
Really nice ;)

xgp

Posted: Sun Sep 04, 2005 4:58 pm
by ricardo
Jellybean wrote:Cool, but it messes up sort of when you want to restore it to normal more. Luckily I had Iconoid running and had all positions saved, but you should add a warning.
Here it dont happends, i put special atention to that... because i was wondering how can some software 'remember' the position of icons.