Shell automation module.
Shell | Shell automation module. |
Restart | Restarts shell. |
SMShow | Show start menu on particular location. |
SMAdd | Add shortcuts to start menu programs group. |
GetCommonPath | Return location of standard system folders. |
GetQuickLaunch | Returns files from the quick launch location. |
SetHook | |
EGetCount | Get the number of items in the view. |
EGetIEObject | Get IWebBrowser2 interface pointer from open explorer windows. |
GetPath | Returns the currently open file system path in the given explorer window. |
GetSelection | Get selected item(s) |
GetView | Gets the current view of desired Explorer window. |
ESelectItem | Select item by index. |
SetPath | Open the folder in given explorer window |
SetView | Sets the view in desired Explorer window |
Examples | Display info about active Explorer window |
About |
Shell_SMShow( X = "", Y = "", Transparency = "", bHideShadow = 1 )
Show start menu on particular location.
X, Y | Coordinate on which to show Start Menu. Omit both parameters to show the Start Menu on its original location. |
Transparency | Window transparency, by default 255. |
bHideShadow | Hide Start Menu Shadow. On some systems showing the menu on non-default position will bug up shadow. Enabled by default. |
ESC key will not close the window if you used X and Y parameters. To close the window you can use the following code:
ESC:: WinHide, ahk_class DV2ControlHost
Shell_SMAdd( Parent, FileName = "", o1 = "", o2 = "", o3 = "", o4 = "", o5 = "", o6 = "", o7 = "" )
Add shortcuts to start menu programs group.
Parent | Name of the parent folder, relative to the Programs folder. Specify “!” to add file to the StartUp group. |
FileName | Name of the file. If omited, only Parent will be created. If starts with the “!”, file will be added to the Start Menu for all users. FileName doesn’t have to exist. |
o1..o7 | Named parameters: Name, WDir, Args, Desc, Icon, Shortcut, IconNumber, RunState. Those parameters will be passed to FileCrateShortuct. If Name is not present function will use name of the input file. |
Shell_GetCommonPath( Name )
Return location of standard system folders.
Name | Name of the sysetem folder. |
Bellow is the list of available folders and their typical locations :
APPDATA | C:\Documents and Settings\username\Application Data. |
COOKIES | C:\Documents and Settings\username\Cookies. |
COMMON_APPDATA | C:\Documents and Settings\All Users\Application Data. |
COMMON_DOCUMENTS | C:\Documents and Settings\All Users\Documents. |
COMMON_PROGRAMS | C:\Documents and Settings\All Users\Start Menu\Programs. |
COMMON_STARTMENU | C:\Documents and Settings\All Users\Start Menu. |
COMMON_STARTUP | C:\Documents and Settings\All Users\Start Menu\Programs\Startup. |
DESKTOP | C:\Documents and Settings\username\Desktop. |
FONTS | C:\Windows\Fonts. |
FAVORITES | C:\Documents and Settings\username\Favorites. |
LOCAL_APPDATA | C:\Documents and Settings\username\Local Settings\Application Data. |
MYMUSIC | C:\Documents and Settings\User\My Documents\My Music. |
MYPICTURES | C:\Documents and Settings\username\My Documents\My Pictures. |
MYVIDEO | C:\Documents and Settings\username\My Documents\My Videos. |
PERSONAL | C:\Documents and Settings\username\My Documents. |
PROGRAM_FILES_COMMON | C:\Program Files\Common. |
PROGRAM_FILES | C:\Program Files. |
PROGRAMS | C:\Documents and Settings\username\Start Menu\Programs. |
PROFILE | C:\Documents and Settings\username. |
PROFILES | C:\Documents and Settings. |
RESOURCES | C:\WINDOWS\Resources\ (For theme and other windows resources). |
SENDTO | C:\Documents and Settings\username\SendTo. |
STARTMENU | C:\Documents and Settings\username\Start Menu. |
STARTUP | C:\Documents and Settings\username\Start Menu\Programs\Startup. |
SYSTEM | C:\Windows\System32. |
WINDOWS | C:\Windows. |
Full path
http://msdn.microsoft.com
Shell_SetHook( Handler = "" )
Handler | Name of the function to call on shell events. Omit to disable the active hook. |
Event | Event for which handler is called. |
Param | Parameter of the handler. Parameters are given bellow for each reason. |
OnShell(Reason, Param) { static WINDOWCREATED=1, WINDOWDESTROYED=2, WINDOWACTIVATED=4, GETMINRECT=5, REDRAW=6, TASKMAN=7, APPCOMMAND=12 }
WINDOWACTIVATED | The HWND handle of the activated window. |
WINDOWREPLACING | The HWND handle of the window replacing the top-level window. |
WINDOWCREATED | The HWND handle of the window being created. |
WINDOWDESTROYED | The HWND handle of the top-level window being destroyed. |
GETMINRECT | A pointer to a RECT structure. |
TASKMAN | Can be ignored. |
REDRAW | The HWND handle of the window that needs to be redrawn. |
Requires explorer to be set as a shell in order to work.
0 on failure, name of the previous hook procedure on success.
http://msdn.microsoft.com
Shell_EGetView( pHwnd )
Gets the current view of desired Explorer window.
pHwnd | Handle to windows explorer instance. |
Returns: View mode type, see SetView
Restarts shell.
Shell_Restart()
Show start menu on particular location.
Shell_SMShow( X = "", Y = "", Transparency = "", bHideShadow = 1 )
Add shortcuts to start menu programs group.
Shell_SMAdd( Parent, FileName = "", o1 = "", o2 = "", o3 = "", o4 = "", o5 = "", o6 = "", o7 = "" )
Return location of standard system folders.
Shell_GetCommonPath( Name )
Returns files from the quick launch location.
Shell_GetQuickLaunch()
Shell_SetHook( Handler = "" )
Get the number of items in the view.
Shell_EGetCount( pHwnd, flag = "" )
Get IWebBrowser2 interface pointer from open explorer windows.
Shell_EGetIEObject( hwndFind = "" )
Returns the currently open file system path in the given explorer window.
Shell_EGetPath( pHwnd )
Get selected item(s)
Shell_EGetSelection( pHwnd )
Gets the current view of desired Explorer window.
Shell_EGetView( pHwnd )
Select item by index.
Shell_ESelectItem( hwnd, idx1, idx2 = "" )
Open the folder in given explorer window
Shell_ESetPath( pHwnd, pPath )
Sets the view in desired Explorer window
Shell_ESetView( pHwnd, pView )