Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Automating Windows Explorer


  • Please log in to reply
39 replies to this topic
MisterW
  • Members
  • 65 posts
  • Last active: Jun 18 2007 11:14 AM
  • Joined: 20 Jul 2005
Works Now - Had to change ExplorerWClass to CabinetWClass.

In WindowsXP SP2 I'm getting 1 and 2 both displaying what corresponds to the "Icons" mode (not Tile), 3 and 4 work ok.

Also, is there one for Thumbnails? I'll see if I can find it myself if I have time and can figure out the method ok.


I have the same results with 1 and 2 both displaying icon mode not tile.

Other than that's this is very cool! Thanks Serenity.

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
@ Serenity: Did you use this method (Resource Hacker):
http://www.autohotke...opic.php?t=8213
to get the PostMessage values for explorer? If so, which file did you get them from? I couldn't find them in explorer.exe

MisterW
  • Members
  • 65 posts
  • Last active: Jun 18 2007 11:14 AM
  • Joined: 20 Jul 2005
Further, WinXP doesn't seem to have a notion of small icons - it doesn't appear as an option in the menu, so 1 and 2 give you "normal" icon view.

1::PostMessage, 0x111, 28713,,, ahk_class CabinetWClass ; Large Icons
2::PostMessage, 0x111, 28714,,, ahk_class CabinetWClass ; Small Icons
3::PostMessage, 0x111, 28715,,, ahk_class CabinetWClass ; List
4::PostMessage, 0x111, 28716,,, ahk_class CabinetWClass ; Details
5::PostMessage, 0x111, 28717,,, ahk_class CabinetWClass ; Thumbnails
6::PostMessage, 0x111, 28718,,, ahk_class CabinetWClass ; Tiles

I'd be interested in how to change sort order and how to show in groups if anyone has codes for these?

Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004

@ Serenity: Did you use this method (Resource Hacker):
http://www.autohotke...opic.php?t=8213
to get the PostMessage values for explorer? If so, which file did you get them from? I couldn't find them in explorer.exe


Yes. I've been spending the last week compiling a list and comparing system files from 98, 2k and XP but haven't had a chance to test on XP yet. I forgot that the class of Explorer is CabinetWClass on XP. The menus for Explorer are spread across two files, browselc.dll and shell32.dll. It seems that some menu items have the same ID across versions of windows, but perform different actions, for example:

; Filmstrip on XP, on 2k this launches Customize This Folder Wizard
PostMessage, 0x111, 28719,,, ahk_class ExploreWClass

"Anything worth doing is worth doing slowly." - Mae West
Posted Image

MisterW
  • Members
  • 65 posts
  • Last active: Jun 18 2007 11:14 AM
  • Joined: 20 Jul 2005
Here are some others

28705 - Select All
28722 - Customize Folder
28723 - Columns for Detail View
28771 - Folder Options
28786 - Help

I discovered these using sophisticated investigative techniques: :wink:
msg = 28700

1::
CoordMode, Tooltip, Screen
PostMessage, 0x111, %msg%,,, ahk_class CabinetWClass
ToolTip, %msg%,50,50
msg++
return

during which i managed to competely hide all icons on my desktop and all icons in the current explorer window. I cannot get them back - they are not hidden in the sense of hidden files - I just can't see them. (Edit - I got the folder icons back by sending it again but I haven't been able to retreive the desktop icons)
(Further Edit - posting this message to progman also fixed desktop icons)


The message number is 28755 and it works a bit like a toggle but also sends the entire screen blue (not BSOD).

Does anyone know this messages might be doing? Refresh Perhaps?

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
Actually the ahk_class depends on how you launch explorer (in XP):
Win+E = ExploreWClass
Opening My Computer from desktop = CabinetWClass

Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004

i managed to competely hide all icons on my desktop and all icons in the current explorer window. I cannot get them back - they are not hidden in the sense of hidden files - I just can't see them.

I think it was when sending messages between 28752 - 28758


I have only had the hidden desktop icons when I've used apps that change the Desktop icon view from Icons to Small Icons.

You could try the following, or reboot.

PostMessage, 0x111, 28755,,, ahk_class ExploreWClass ; Show Icons

"Anything worth doing is worth doing slowly." - Mae West
Posted Image

MisterW
  • Members
  • 65 posts
  • Last active: Jun 18 2007 11:14 AM
  • Joined: 20 Jul 2005
I tried rebooting which interestingly didn't fix the problem.

Posting 28755 to Progman and then to CabinetWClass worked.

What is the purpose of this code do you think?

Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004

I tried rebooting which interestingly didn't fix the problem.

Posting 28755 to Progman and then to CabinetWClass worked.

What is the purpose of this code do you think?


On 2k, it does nothing, although I got it from 2k's shell32.dll. The menu text was "Show Icons". It may be that you could toggle hide/showing of the icons by sending the message again and again.

Edit: I've just seen the edits to your post before last; the blue screen does not sound good. Can you reproduce it?
"Anything worth doing is worth doing slowly." - Mae West
Posted Image

MisterW
  • Members
  • 65 posts
  • Last active: Jun 18 2007 11:14 AM
  • Joined: 20 Jul 2005
1::PostMessage, 0x111, 28755,,, ahk_class Progman

Everything normal, icons on desktop etc.

Hit 1 key
Desktop flashes blue (behind any active windows)
Icons Dissappear

Hit 1 key
Desktop flashes blue (behind any active windows)
Icons Reappear
Everything Normal

1::PostMessage, 0x111, 28755,,, ahk_class CabinetWClass
Open Explorer Window

Hit 1 key
desktop flashes blue (behind any active windows)
desktop icons dissapear
icons in explorer window dissappear

Hit 1 key
desktop goes blue covering/hiding desktop icons
move window around erases blue desktop revealing wallpaper
2nd monitor is still blue
icons are restored in explorer window
icons are still hidden on desktop - use step 1 above to restore

How/Where did you find the codes for changing icons
Which DLL and which menu tree in Resource Hacker?

MisterW
  • Members
  • 65 posts
  • Last active: Jun 18 2007 11:14 AM
  • Joined: 20 Jul 2005
Conclusion:

1::PostMessage, 0x111, 28755,,, ahk_class Progman

is a fast way to toggle icons on your desktop

1::PostMessage, 0x111, 28755,,, ahk_class CabinetWClass; hide

2::
PostMessage, 0x111, 28755,,, ahk_class CabinetWClass ; show
PostMessage, 0x111, 28755,,, ahk_class Progman ; show/fix desktop
return

is a fast way to toggle desktop and explorer window icons

Don't seem to be able to toggle explorer icons without affecting desktop icons

MisterW
  • Members
  • 65 posts
  • Last active: Jun 18 2007 11:14 AM
  • Joined: 20 Jul 2005
29698 does the same thing as 28755 which is hide desktop icons

Here's a more comprehensive list:

Filmstrip, 28719
Thumbnails, 28717
Tiles, 28718
Icons, 28713
List, 28715
Details, 28716
Choose Details..., 28723
Show in Groups, 30209
Auto Arrange, 28753
Align to Grid, 28756

Refresh, 28931
Customize This Folder..., 28722

Cut\tCtrl+X, 28696
Copy\tCtrl+C, 28697
Paste, 28698
Undo, 28699
Delete, 28689
Rename, 28690
Paste Shortcut, 28700
Create Shortcut, 28688
Properties, 28691
Copy To Folder..., 28702
Move To Folder..., 28703
Select All\tCtrl+A, 28705
Invert Selection, 28706

Help and Support Center, 28785

Show Desktop Icons, 29698

Lock Web Items on Desktop, 29699
Run Desktop Cleanup Wizard, 29700

Explore, 20481
Open, 20480
Close, 40964
Close, 41225

Open Containing Folder, 40960
Save Search, 40963
Case Sensitive, 40961
What's This?, 40967
Open Containing Folder, 40960
Open All Users, 20482
Explore All Users, 20483
Make Available Offline, 41218
Synchronize, 41219
Properties, 41220
Customize My Desktop, 41224
Open in New Window, 41217
Restore, 41228
Split Desktop With Icons, 41227
Cover Desktop, 41226

Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004

1::PostMessage, 0x111, 28755,,, ahk_class Progman

is a fast way to toggle icons on your desktop


Do you get blue screen flicker with this method? (I am guessing that the blue screen is the background colour of your desktop, with no wallpaper showing).

1::
RegRead, val, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, HideIcons
val := !val
RegWrite, REG_DWORD, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, HideIcons, %val%
PostMessage, 0x111, 28931,,, ahk_class Progman ; refresh desktop
return

"Anything worth doing is worth doing slowly." - Mae West
Posted Image

BoBo
  • Guests
  • Last active:
  • Joined: --

Here's a more comprehensive list

@ MisterW
have you got that list directly from the king of wParam planet, or investigated it manually (WinSpector) ???

MisterW
  • Members
  • 65 posts
  • Last active: Jun 18 2007 11:14 AM
  • Joined: 20 Jul 2005
Here's how I got the list.

Loaded shell32.dll into Resource Hacker.
Saved the Menu tree to a file
Loaded browselc.dll into Resource Hacker.
Saved the Menu tree to a file
(the dll's are in windows/system32)
Merged the files together
stripped out all the guff using vim
wrote a perl script to write the following ahk program from this info

open an explorer window and try it:

#SingleInstance Force
gui,add,button,x10 y10 w160 gPushButton vPM28719,Filmstrip
gui,add,button,x180 y10 w160 gPushButton vPM28717,Thumbnails
gui,add,button,x350 y10 w160 gPushButton vPM28718,Tiles
gui,add,button,x520 y10 w160 gPushButton vPM28713,Icons
gui,add,button,x690 y10 w160 gPushButton vPM28715,List
gui,add,button,x10 y35 w160 gPushButton vPM28716,Details
gui,add,button,x180 y35 w160 gPushButton vPM28723,Choose Details...
gui,add,button,x350 y35 w160 gPushButton vPM30209,Show in Groups
gui,add,button,x520 y35 w160 gPushButton vPM28753,Auto Arrange
gui,add,button,x690 y35 w160 gPushButton vPM28756,Align to Grid
gui,add,button,x10 y60 w160 gPushButton vPM41504,Refresh\tF5
gui,add,button,x180 y60 w160 gPushButton vPM41499,Full Screen\tF11
gui,add,button,x350 y60 w160 gPushButton vPM28931,Refresh
gui,add,button,x520 y60 w160 gPushButton vPM28722,Customize This Folder...
gui,add,button,x690 y60 w160 gPushButton vPM41474,Status Bar
gui,add,button,x10 y85 w160 gPushButton vPM41025,Cut\tCtrl+X
gui,add,button,x180 y85 w160 gPushButton vPM41026,Copy\tCtrl+C
gui,add,button,x350 y85 w160 gPushButton vPM28696,Cut\tCtrl+X
gui,add,button,x520 y85 w160 gPushButton vPM28697,Copy\tCtrl+C
gui,add,button,x690 y85 w160 gPushButton vPM41027,Paste\tCtrl+V
gui,add,button,x10 y110 w160 gPushButton vPM28698,Paste
gui,add,button,x180 y110 w160 gPushButton vPM28699,Undo
gui,add,button,x350 y110 w160 gPushButton vPM28689,Delete
gui,add,button,x520 y110 w160 gPushButton vPM28690,Rename
gui,add,button,x690 y110 w160 gPushButton vPM40995,Delete
gui,add,button,x10 y135 w160 gPushButton vPM40996,Rename
gui,add,button,x180 y135 w160 gPushButton vPM41761,Undo
gui,add,button,x350 y135 w160 gPushButton vPM41762,Cut
gui,add,button,x520 y135 w160 gPushButton vPM41763,Copy
gui,add,button,x690 y135 w160 gPushButton vPM41764,Paste
gui,add,button,x10 y160 w160 gPushButton vPM41765,Delete
gui,add,button,x180 y160 w160 gPushButton vPM41766,Select All
gui,add,button,x350 y160 w160 gPushButton vPM41028,Select All\tCtrl+A
gui,add,button,x520 y160 w160 gPushButton vPM28700,Paste Shortcut
gui,add,button,x690 y160 w160 gPushButton vPM28688,Create Shortcut
gui,add,button,x10 y185 w160 gPushButton vPM41029,Create Shortcut
gui,add,button,x180 y185 w160 gPushButton vPM28691,Properties
gui,add,button,x350 y185 w160 gPushButton vPM41220,Properties
gui,add,button,x520 y185 w160 gPushButton vPM28702,Copy To Folder...
gui,add,button,x690 y185 w160 gPushButton vPM28703,Move To Folder...
gui,add,button,x10 y210 w160 gPushButton vPM28705,Select All\tCtrl+A
gui,add,button,x180 y210 w160 gPushButton vPM28706,Invert Selection
gui,add,button,x350 y210 w160 gPushButton vPM28785,Help and Support Center
gui,add,button,x520 y210 w160 gPushButton vPM29698,Show Desktop Icons
gui,add,button,x690 y210 w160 gPushButton vPM29699,Lock Web Items on Desktop
gui,add,button,x10 y235 w160 gPushButton vPM29700,Run Desktop Cleanup Wizard
gui,add,button,x180 y235 w160 gPushButton vPM20481,Explore
gui,add,button,x350 y235 w160 gPushButton vPM20480,Open
gui,add,button,x520 y235 w160 gPushButton vPM40993,Close
gui,add,button,x690 y235 w160 gPushButton vPM40964,Close
gui,add,button,x10 y260 w160 gPushButton vPM41225,Close
gui,add,button,x180 y260 w160 gPushButton vPM41249,Back\tAlt+Left Arrow
gui,add,button,x350 y260 w160 gPushButton vPM41250,Forward\tAlt+Right Arrow
gui,add,button,x520 y260 w160 gPushButton vPM40994,Up One Level
gui,add,button,x690 y260 w160 gPushButton vPM41253,Home Page\tAlt+Home
gui,add,button,x10 y285 w160 gPushButton vPM40960,Open Containing Folder
gui,add,button,x180 y285 w160 gPushButton vPM40963,Save Search
gui,add,button,x350 y285 w160 gPushButton vPM40961,Case Sensitive
gui,add,button,x520 y285 w160 gPushButton vPM40967,What's This?
gui,add,button,x690 y285 w160 gPushButton vPM20482,Open All Users
gui,add,button,x10 y310 w160 gPushButton vPM20483,Explore All Users
gui,add,button,x180 y310 w160 gPushButton vPM41218,Make Available Offline
gui,add,button,x350 y310 w160 gPushButton vPM41219,Synchronize
gui,add,button,x520 y310 w160 gPushButton vPM41224,Customize My Desktop
gui,add,button,x690 y310 w160 gPushButton vPM41217,Open in New Window
gui,add,button,x10 y335 w160 gPushButton vPM41228,Restore
gui,add,button,x180 y335 w160 gPushButton vPM41227,Split Desktop With Icons
gui,add,button,x350 y335 w160 gPushButton vPM41226,Cover Desktop
gui,add,button,x520 y335 w160 gPushButton vPM41258,Read Mail
gui,add,button,x690 y335 w160 gPushButton vPM41261,New Message...
gui,add,button,x10 y360 w160 gPushButton vPM41262,Send a Link...
gui,add,button,x180 y360 w160 gPushButton vPM41263,Send Page...
gui,add,button,x350 y360 w160 gPushButton vPM41259,Read News
gui,add,button,x520 y360 w160 gPushButton vPM40997,Properties
gui,add,button,x690 y360 w160 gPushButton vPM40998,Work Offline
gui,add,button,x10 y385 w160 gPushButton vPM41521,Search\tCtrl+E
gui,add,button,x180 y385 w160 gPushButton vPM41522,Favorites\tCtrl+I
gui,add,button,x350 y385 w160 gPushButton vPM41527,Media
gui,add,button,x520 y385 w160 gPushButton vPM41523,History\tCtrl+H
gui,add,button,x690 y385 w160 gPushButton vPM41525,Folders
gui,add,button,x10 y410 w160 gPushButton vPM41500,Java Console
gui,add,button,x180 y410 w160 gPushButton vPM41251,Folder Options...
gui,add,button,x350 y410 w160 gPushButton vPM41329,Internet Options...
gui,add,button,x520 y410 w160 gPushButton vPM41256,Channel Guide
gui,add,button,x690 y410 w160 gPushButton vPM41254,Search the Web
gui,add,button,x10 y435 w160 gPushButton vPM41266,My Computer
gui,add,button,x180 y435 w160 gPushButton vPM41793,Address Book
gui,add,button,x350 y435 w160 gPushButton vPM41794,Calendar
gui,add,button,x520 y435 w160 gPushButton vPM41795,Tasks
gui,add,button,x690 y435 w160 gPushButton vPM41796,Journal
gui,add,button,x10 y460 w160 gPushButton vPM41797,Notes
gui,add,button,x180 y460 w160 gPushButton vPM41798,Internet Call
gui,add,button,x350 y460 w160 gPushButton vPM41331,Add to Favorites...
gui,add,button,x520 y460 w160 gPushButton vPM41330,Organize Favorites...
gui,add,button,x690 y460 w160 gPushButton vPM41089,Map Network Drive...
gui,add,button,x10 y485 w160 gPushButton vPM41090,Disconnect Network Drive...
gui,add,button,x180 y485 w160 gPushButton vPM41334,Synchronize...
gui,add,button,x350 y485 w160 gPushButton vPM41482,Menu Bar
gui,add,button,x520 y485 w160 gPushButton vPM41476,Standard Buttons
gui,add,button,x690 y485 w160 gPushButton vPM41477,Address Bar
gui,add,button,x10 y510 w160 gPushButton vPM41478,Links
gui,add,button,x180 y510 w160 gPushButton vPM41484,Lock the Toolbars
gui,add,button,x350 y510 w160 gPushButton vPM41481,Auto-Hide
gui,add,button,x520 y510 w160 gPushButton vPM41501,Customize...
gui,add,button,x690 y510 w160 gPushButton vPM41479,Text Labels
gui,add,button,x10 y535 w160 gPushButton vPM41483,Go Button
gui,add,button,x180 y535 w160 gPushButton vPM1091,Find (on This Page)...\tCtrl+F
gui,add,button,x350 y535 w160 gPushButton vPM41498,Stop\tEsc
gui,add,button,x520 y535 w160 gPushButton vPM41507,Privacy Report...
gui,add,button,x690 y535 w160 gPushButton vPM41257,Reset Web Settings...
gui,add,button,x10 y560 w160 gPushButton vPM13665,Add to Favorites...
gui,add,button,x180 y560 w160 gPushButton vPM13673,Play in Default Player
gui,add,button,x350 y560 w160 gPushButton vPM13609,More Media
gui,add,button,x520 y560 w160 gPushButton vPM13604,Radio Guide
gui,add,button,x690 y560 w160 gPushButton vPM13666,Play web media in the bar
gui,add,button,x10 y585 w160 gPushButton vPM13667,Ask for preferred types
gui,add,button,x180 y585 w160 gPushButton vPM13668,Reset preferred types...
Gui, Show,
return

PushButton:
StringTrimLeft,code,A_GuiControl,2
PostMessage, 0x111, %code%,,, ahk_class CabinetWClass
return

There are multiple codes for some things like copy etc. Some work, some don't. Try opening iexplore.exe and sending codes.

So to answer your question - I used the King's methods :wink: