LarsJ Posted November 18, 2012 Share Posted November 18, 2012 (edited) The files and folders of the Control Panel can be enumerated with the IShellFolder and IEnumIDList interfaces.In this example (run cpGui.au3) the files and folders are shown in a GUI with a TreeView and a ListView.Double click an item (or press Enter) in the ListView to execute. Right click to show the context menu.Executing a program and showing the context menu are implemented with the IContextMenu interface.If you are running a 64 bit OS you must run this script (cpGui.au3) as a 64 bit program.ExceptionsThe Control Panel isn't as easy to enumerate as a normal file system folder. Especially on Vista and 7. Some containers or pages appears as folders but must be treated as files. Some items appears as both files and folders. And there can be some "empty" items without a display name that have to be removed. You have to do some exceptions to make everything look properly.cpPrint.au3 is a script to print the files and folders of the Control Panel in the Scite console. By comparing the output from the script with the real Control Panel you can figure out the exceptions.If you are running a 64 bit OS you must run this script (cpPrint.au3) as a 64 bit program.Here are some of the exceptions on my Windows 7 64 bit PC.Containers or pages that appears as folders but must be treated as files:Control Panel = ::{26EE0668-A00A-44D7-9371-BEB064C98683} --[\System and Security] = ::{26EE0668-A00A-44D7-9371-BEB064C98683}\5 ----[\Power Options] = ::{26EE0668-A00A-44D7-9371-BEB064C98683}\5\::{025A5937-A6BE-4686-A844-36FE4BEC8B6D} ----[\Windows Update] = ::{26EE0668-A00A-44D7-9371-BEB064C98683}\5\::{36EEF7DB-88AD-4E81-AD49-0E313F0C35F8} ----[\Windows Firewall] = ::{26EE0668-A00A-44D7-9371-BEB064C98683}\5\::{4026492F-2F69-46B8-B9BF-5654FC07E423}Empty item:Control Panel = ::{26EE0668-A00A-44D7-9371-BEB064C98683} --[\System and Security] = ::{26EE0668-A00A-44D7-9371-BEB064C98683}\5 ----[] = ::{26EE0668-A00A-44D7-9371-BEB064C98683}\5\::{25C64847-B900-48AD-A164-1B4F9B774650}The empty items (no display name, only parsing name) are probably caused by failed program installations or updates.And some exceptions on my Windows XP SP3.Items that appears as both files and folders:Control Panel = ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D} --[\Network Connections] = ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\::{7007ACC7-3202-11D1-AAD2-00805FC1270E} ----[\Local Area Connection] = {BA126ADB-2166-11D1-B1D0-00805FC1270E} ----[\Internet Connection] = {BA126AE2-2166-11D1-B1D0-00805FC1270E} ----[Local Area Connection] = {BA126ADB-2166-11D1-B1D0-00805FC1270E} ----[Internet Connection] = {BA126AE2-2166-11D1-B1D0-00805FC1270E}These exceptions are handled in the functions EnumTreeViewObjects() and EnumListViewObjects() in cpFuncs.au3.Remark that the Fonts folder is skipped in cpPrint.au3.ZipfileThe zipfile below contains a number of files:cpGui.au3 - the GUI, run this filecpConsts.au3 - constants and globalscpFuncs.au3 - functions for the GUIContextMenu.au3 - context menucpPrint.au3 - print files and foldersCommon.au3 - common functionsFunctions.au3 - utilitiesGetIcon.au3 - icon functionsHourglassOff.au3 - turn hourglass offres\WSP.dll - NM_RETURN notifications in the ListViewIf the script fails for some reason and you are left with an hourglass cursor, then run HourglassOff.au3 to get the normal cursor back.For WSP.dll by Yashied see http://www.autoitscript.com/forum/index.php?showtopic=83621 post #16.You need APIConstants.au3 and WinAPIEx.au3 v3.8 by Yashied.Testet on Windows XP SP3 and Windows 7 64 bit.ControlPanel.7z Edited November 18, 2012 by LarsJ argumentum 1 Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Andreik Posted November 18, 2012 Share Posted November 18, 2012 You have so many redeclared constants and some without your script doesn't work you left it out. Link to comment Share on other sites More sharing options...
LarsJ Posted November 18, 2012 Author Share Posted November 18, 2012 Andreik, This error is because of an undeclared $S_OK variable. $S_OK is declared in APIConstants.au3 v3.8 as you need to run the script. Lars Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
ptrex Posted November 19, 2012 Share Posted November 19, 2012 @Andreik Nice job I like you splitterbar approach ! Rgds ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Yashied Posted November 20, 2012 Share Posted November 20, 2012 (edited) Testet on Windows XP SP3 and Windows 7 64 bit.You need 64-bit .dll for x64 OS.WSP_x64.dll Edited November 20, 2012 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
LarsJ Posted November 21, 2012 Author Share Posted November 21, 2012 Yashied, You are absolutely right. Thank you very much. ptrex, If this is for the OP then thank you. The splitterbar was the easy part. Lars. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now