Playing with Desktop

Everything else that doesn't fall into one of the other PB categories.
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Playing with Desktop

Post 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
ARGENTINA WORLD CHAMPION
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Playing with Desktop

Post by PB »

Doesn't do anything on Windows 2000 Pro...
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

Yes, sorry, forget to mention: is only XP.

Is just playing with the listview that finally is the desktop.
ARGENTINA WORLD CHAMPION
Jellybean
User
User
Posts: 95
Joined: Wed Aug 24, 2005 7:33 pm

Post 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.
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Cool!

Didn't know desktop had those properties!
xgp
Enthusiast
Enthusiast
Posts: 128
Joined: Mon Jun 13, 2005 6:03 pm

Post by xgp »

Really nice ;)

xgp
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post 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.
ARGENTINA WORLD CHAMPION
Post Reply