Deye Posted February 2, 2019 Share Posted February 2, 2019 To all, I was looking for the command that can launch explorer's context menu With most of searches so far results that "tell how to add items to it" I'm only trying to load it in whole .. If anyone here knows the know how, I'm still interested to know ! I will continue try with more wording combo's in my searches, later on .. Thanks Deye Link to comment Share on other sites More sharing options...
mikell Posted February 2, 2019 Share Posted February 2, 2019 Maybe Shift + F10 used with Send or ControlSend ? Link to comment Share on other sites More sharing options...
TheXman Posted February 2, 2019 Share Posted February 2, 2019 (edited) This appears to work for me: ControlClick("Program Manager", "", "[CLASS:SysListView32; INSTANCE:1]", 'right') I should add that this was tested on a Windows 7 OS. Haven't tried it on Windows 10. Updated: Please disregard my post. I think Shift+F10, with ControlSend, is much more reliable than a right mouse click. Edited February 2, 2019 by TheXman CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Deye Posted February 2, 2019 Author Share Posted February 2, 2019 (edited) It will also need to accept a FilePath to address ie: ControlSend("Program Manager", "", "[CLASS:SysListView32; INSTANCE:1]", @ScriptFullPath) for instance http://www.easexp.com/xsearch/ this one doesn't offer explorer's one but still gives the option to "open with" (even though for just one file) all so that the file argument passes "Open With" > "My App context menu wrapper" > options to some winrar command that is available in the explorer context menu .. found these 2 links so far, still not fully readable to me .. https://www.codeproject.com/Articles/22012/%2fArticles%2f22012%2fExplorer-Shell-Context-Menu https://blogs.msdn.microsoft.com/oldnewthing/20040920-00/?p=37823 Deye Edited February 2, 2019 by Deye Link to comment Share on other sites More sharing options...
LarsJ Posted February 2, 2019 Share Posted February 2, 2019 If Windows is a 64 bit version the examples must be run as 64 bit code. Deye 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...
Deye Posted February 2, 2019 Author Share Posted February 2, 2019 Thanks LarsJ, Yet to figure-out how its to be executed ,will read into it .. @ first try .. expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include "ShellContextMenu.au3" #include <Misc.au3> HotKeySet("{ESC}", "Close") ; Set ESC as a hotkey to exit the script. Global $g_tStruct = DllStructCreate($tagPOINT) ; Create a structure that defines the point to be checked. Global $hDLL = DllOpen("user32.dll") Example() Func Example() Local $hWnd While 1 ToolTip("") Position() ; Update the X and Y elements with the X and Y co-ordinates of the mouse. $hWnd = _WinAPI_WindowFromPoint($g_tStruct) ; Retrieve the window handle. If _IsPressed("01", $hDLL) Then ShellContextMenu($hWnd, $hWnd, $g_tStruct, @ScriptFullPath) Sleep(5000) ExitLoop EndIf ToolTip("left click somewhere ..") Sleep(100) WEnd DllClose($hDLL) EndFunc ;==>Example Func Position() DllStructSetData($g_tStruct, "x", MouseGetPos(0)) DllStructSetData($g_tStruct, "y", MouseGetPos(1)) EndFunc ;==>Position Func Close() DllClose($hDLL) Exit EndFunc ;==>Close Deye Link to comment Share on other sites More sharing options...
LarsJ Posted February 3, 2019 Share Posted February 3, 2019 Deye, You can start with this code: #AutoIt3Wrapper_UseX64=y #include "ShellContextMenu.au3" HotKeySet( "{F1}", "CMenu" ) ; F1: Open context menu, Esc: Close context menu HotKeySet( "{F2}", "Close" ) ; F2: Close script While Sleep(10) WEnd Func CMenu() Local $hDesktop = _WinAPI_GetDesktopWindow() Local $tPoint = _WinAPI_GetMousePos(), $x = DllStructGetData( $tPoint, "x" ), $y = DllStructGetData( $tPoint, "y" ) Local $hGui = GUICreate( "", 32, 32, $x, $y, 0x80880000 ) ; 0x80880000 = $WS_POPUPWINDOW GUISetState( @SW_SHOW, $hGui ) ; You must create a GUI ShellContextMenu( $hGui, $hDesktop, $tPoint, @ScriptFullPath ) GUIDelete( $hGui ) EndFunc Func Close() Exit EndFunc Deye 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...
Deye Posted February 3, 2019 Author Share Posted February 3, 2019 LarsJ, Kudos to you, It all finally fell into place Thanks very much! Deye 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