Dizzy Posted November 1, 2006 Share Posted November 1, 2006 Hi! I've a problem to handle the explorers context menu with autoit. I want to look if a file exists and if yes - to use a sub-entry from the context menu. See the picture below. How can i activate the item in the submenu? (7-Zip is just an example) Thanks for help! Link to comment Share on other sites More sharing options...
System Tester Posted November 1, 2006 Share Posted November 1, 2006 (edited) How can i activate the item in the submenu? (7-Zip is just an example)Thanks for help!I generally attempt to emulate the keyboard - then use the SEND function.Make the set of keystrokes a function. Make functions for all the operations you need, then just call themas necessary.I think you're going for the right-mouse-click in your example. <I THINK!> you want SEND ("{APPSKEY}") ;<------- More experienced members pls check & correct! sleep(100); 10mS delaySEND("7") ; 7 is the first letter - might be a different key - depends on the application.;or Send("{DOWN 6}") ;Presses the DOWN key 6 timessleep(100)and so on.BUTyou could also check the file exists.... FileFindFirstFileopen the application you wih to use.....Runthen open the file in the application (keystrokes for File.....Open using SEND)HTHhttp://support.microsoft.com/kb/126449 <-------- Keyboard shortcuts for Windows Edited November 1, 2006 by System Tester The AutoIt help file should be interrogated.The Editor should be SciTe.The forums should have been searched. Link to comment Share on other sites More sharing options...
Dizzy Posted November 1, 2006 Author Share Posted November 1, 2006 (edited) "Appskey"? - this would bring up the context menu ?? - okay ... But how can i use this directly on a file? Thanks Dizzy Edited November 1, 2006 by Dizzy Link to comment Share on other sites More sharing options...
System Tester Posted November 1, 2006 Share Posted November 1, 2006 "Appskey"? - this would bring up the context menu ?? - okay ... But how can i use this directly on a file? ThanksDizzySend "RETURN" when you have navigated the focus over the desired option.BUT I would only use this method as a last resort.There is more than one way to your objective. Don't use explorer!Use the functions I listed after the "BUT" check if the file is there.open the application you wish to use.use the keystrokes to open the file ---If you can use the command line parameters, you can combine the last two steps. The AutoIt help file should be interrogated.The Editor should be SciTe.The forums should have been searched. Link to comment Share on other sites More sharing options...
PaulIA Posted November 1, 2006 Share Posted November 1, 2006 (edited) You can use Auto3Lib to directly interact with Explorer, including using the context menus. Here is a short example that shows how to open Explorer, right click on the 2nd item and show the contents of the context menu that pops up:CODEexpandcollapse popup#include <A3LListView.au3> #include <A3LMenu.au3> ; ================================================================================================= ; Main ; ================================================================================================= Run("explorer.exe /root, ,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}") _WinWaitActive("My Computer") ; Get the list view window handle $hList = ControlGetHandle("My Computer", "", "SysListView321") ; Get the X/Y position of the 2nd item in Explorer $rPoint = _ListView_GetItemPosition($hList, 1) ; Convert client coordinates to screen coordinates _ClientToScreen($hList, $rPoint) ; Right click on 2nd item to popup the context menu MouseClick("right", _DllStructGetData($rPoint, $POINT_X), _DllStructGetData($rPoint, $POINT_Y)) ; Scan the window list for the popup menu _PopupScan() if _PopupCount() = 0 then _ShowError("Unable to find popup menu") ; Display information about popup menu ShowMenu(_PopupGetHWnd(), _PopupGetParent()) ; You can manipulate the popup menu items by using the functions in A3LMenu.au3. ; ================================================================================================= ; Show information about a menu item ; ================================================================================================= Func ShowMenu($hMenu, $hParent) Local $iI Local $iCount Local $sItem Local $rRect Local $iX1, $iY1, $iX2, $iY2 $iCount = _Menu_GetMenuItemCount($hMenu) ConsoleWrite("Parent handle .........: " & $hParent & @CR) ConsoleWrite("Menu handle ...........: " & $hMenu & @CR) ConsoleWrite("Menu item count .......: " & $iCount & @CR) ConsoleWrite(@CR) for $iI = 0 to $iCount - 1 if $iI < 10 then $sItem = "Item " & $iI & " " else $sItem = "Item " & $iI & " " endif $rRect = _Menu_GetMenuItemRect($hParent, $hMenu, $iI) $iX1 = _DllStructGetData($rRect, $RECT_LEFT ) $iY1 = _DllStructGetData($rRect, $RECT_TOP ) $iX2 = _DllStructGetData($rRect, $RECT_RIGHT ) $iY2 = _DllStructGetData($rRect, $RECT_BOTTOM) $rRect = 0 ConsoleWrite($sItem & "string ........: " & _Menu_GetMenuString ($hMenu, $iI) & @CR) ConsoleWrite($sItem & "checked .......: " & _Menu_IsChecked ($hMenu, $iI) & @CR) ConsoleWrite($sItem & "disabled ......: " & _Menu_IsDisabled ($hMenu, $iI) & @CR) ConsoleWrite($sItem & "grayed ........: " & _Menu_IsGrayed ($hMenu, $iI) & @CR) ConsoleWrite($sItem & "menu bar break : " & _Menu_IsMenuBarBreak($hMenu, $iI) & @CR) ConsoleWrite($sItem & "menu break ....: " & _Menu_IsMenuBreak ($hMenu, $iI) & @CR) ConsoleWrite($sItem & "owner draw ....: " & _Menu_IsOwnerDraw ($hMenu, $iI) & @CR) ConsoleWrite($sItem & "popup .........: " & _Menu_IsPopup ($hMenu, $iI) & @CR) ConsoleWrite($sItem & "popup items ...: " & _Menu_GetPopupCount ($hMenu, $iI) & @CR) ConsoleWrite($sItem & "rectangle .....: [" & $iX1 & ", " & $iY1 & ", " & $iX2 & ", " & $iY2 & "]" & @CR) ConsoleWrite($sItem & "separator .....: " & _Menu_IsSeparator ($hMenu, $iI) & @CR) ConsoleWrite(@CR) next EndFuncEdit: Codebox Edited November 1, 2006 by PaulIA Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
Dizzy Posted November 1, 2006 Author Share Posted November 1, 2006 "Appskey" and "send" is not bad, but when i execute the command in the menu with send ("{Enter}") the function was startet but also the file opened ... ('cause i send "enter") @PaulIA: How did i use your script to get the context menu for c:\temp\tt.txt ? Thanks Link to comment Share on other sites More sharing options...
Dizzy Posted November 1, 2006 Author Share Posted November 1, 2006 @PaulIA: In Scite i get following error: E:\Autoit\6\Auto3Lib\Test Scripts\A3LConstants.au3 (583) : ==> Can not redeclare a constant.: Global Const $LVFI_STRING = 0x00002 Global Const ^ ERROR Idea? Link to comment Share on other sites More sharing options...
Dizzy Posted November 1, 2006 Author Share Posted November 1, 2006 @System Tester: READ ... :"> I have to use "return" as you wrote ... Ok - that executes the function and leave the file as it is .. I will test a little bit more Link to comment Share on other sites More sharing options...
Dizzy Posted November 1, 2006 Author Share Posted November 1, 2006 @System Tester:"return" is ok. But the other problem is still : how can i get the focus on a file to work with SEND ("{APPSKEY}") ??@PaulIA:Similar to your way - how did i get the context menu on a file "c:\temp\tt.txt" ? Thanks for your help !! Link to comment Share on other sites More sharing options...
PaulIA Posted November 1, 2006 Share Posted November 1, 2006 (edited) @PaulIA: Similar to your way - how did i get the context menu on a file "c:\temp\tt.txt" ? CODEexpandcollapse popup#include <A3LListView.au3> #include <A3LMenu.au3> ; ================================================================================================= ; Main ; ================================================================================================= Run("explorer.exe /root, ,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}") _WinWaitActive("My Computer") ; Get the list view window handle $hList = ControlGetHandle("", "", "SysListView321") ; Find the "C:" drive $iIndex = FindItem("C:") if $iIndex = -1 then _ShowError('Unable to find the "C:" drive') ; Open up the "C:" drive ClickItem($iIndex, "left" , 2) _WinWaitActive("C:\") ; Get the new list view window handle $hList = ControlGetHandle("C:\", "", "SysListView321") ; Find the "temp" directory $iIndex = FindItem("temp") if $iIndex = -1 then _ShowError('Unable to find file "temp"') ; Open up the "temp" directory ClickItem($iIndex, "left", 2) _WinWaitActive("C:\Temp") ; Get the new list view window handle $hList = ControlGetHandle("C:\Temp", "", "SysListView321") ; Find the "tt.txt" file $iIndex = FindItem("tt.txt") if $iIndex = -1 then _ShowError('Unable to find file "tt.txt"') ; Right click on the "tt.txt" file ClickItem($iIndex, "right", 1) ; Scan for popup menu $iI = 0 do _PopupScan() if _PopupCount() > 0 then ExitLoop $iI += 1 Sleep(100) until $iI >= 10 if $iI >= 10 then _ShowError("Unable to find popup menu") ; Display information about popup menu ShowMenu(_PopupGetHWnd(), _PopupGetParent()) ; You can manipulate the popup menu items by using the functions in A3LMenu.au3. ; ================================================================================================= ; Find item in the ListView ; ================================================================================================= Func FindItem($sItemText) for $iI = 0 to _ListView_GetItemCount($hList) - 1 $sText = _ListView_GetItemText($hList, $iI) if StringInStr($sText, $sItemText) then Return $iI next _ShowError('Unable to find text "' & $sItemText & '"') EndFunc ; ================================================================================================= ; Click item in the ListView ; ================================================================================================= Func ClickItem($iIndex, $sButton, $iClicks) Local $iX, $iY $rPoint = _ListView_GetItemPosition($hList, $iIndex) _ClientToScreen($hList , $rPoint) _GetXYFromPoint($rPoint, $iX, $iY) $iX = $iX + 4 $iY = $iY + 4 MouseClick($sButton, $iX, $iY, $iClicks, 1) EndFunc ; ================================================================================================= ; Show information about a menu item ; ================================================================================================= Func ShowMenu($hMenu, $hParent) Local $iI Local $iCount Local $sItem $iCount = _Menu_GetMenuItemCount($hMenu) ConsoleWrite("Parent handle .........: " & $hParent & @CR) ConsoleWrite("Menu handle ...........: " & $hMenu & @CR) ConsoleWrite("Menu item count .......: " & $iCount & @CR) ConsoleWrite(@CR) for $iI = 0 to $iCount - 1 if $iI < 10 then $sItem = "Item " & $iI & " " else $sItem = "Item " & $iI & " " endif ConsoleWrite($sItem & "string ........: " & _Menu_GetMenuString ($hMenu, $iI) & @CR) ConsoleWrite($sItem & "checked .......: " & _Menu_IsChecked ($hMenu, $iI) & @CR) ConsoleWrite($sItem & "disabled ......: " & _Menu_IsDisabled ($hMenu, $iI) & @CR) ConsoleWrite($sItem & "grayed ........: " & _Menu_IsGrayed ($hMenu, $iI) & @CR) ConsoleWrite($sItem & "menu bar break : " & _Menu_IsMenuBarBreak($hMenu, $iI) & @CR) ConsoleWrite($sItem & "menu break ....: " & _Menu_IsMenuBreak ($hMenu, $iI) & @CR) ConsoleWrite($sItem & "owner draw ....: " & _Menu_IsOwnerDraw ($hMenu, $iI) & @CR) ConsoleWrite($sItem & "popup .........: " & _Menu_IsPopup ($hMenu, $iI) & @CR) ConsoleWrite($sItem & "popup items ...: " & _Menu_GetPopupCount ($hMenu, $iI) & @CR) ConsoleWrite($sItem & "separator .....: " & _Menu_IsSeparator ($hMenu, $iI) & @CR) ConsoleWrite(@CR) next EndFuncEdit: Codebox Edited November 1, 2006 by PaulIA Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
Dizzy Posted November 2, 2006 Author Share Posted November 2, 2006 Hi PaulIA,questions ... more and more ... OK, i try to follow your code in Toolbar.au3 in Scite (to have a look at the console) but i get:E:\Autoit\6\Auto3Lib\Test Scripts\A3LConstants.au3 (583) : ==> Can not redeclare a constant.: Global Const $LVFI_STRING = 0x00002 Global Const ^ ERROR I have copied the >au3.user.calltips.api< to my SciTe\api directory, but the error is still there I'm using autoit release 3.2.0.1 and i've tried the 3.2.1.11 beta Do you have a idea? Or can you give me an example how to get the information to activate the menuitem as i show in the pic?Then i redirect the output to a file to get the information. It's not possible to append txt-files so:2006-11-02 09:34:20 : Parent handle .........: 0x002708CA2006-11-02 09:34:20 : Menu handle ...........: 0x00E8101F2006-11-02 09:34:20 : Menu item count .......: 282006-11-02 09:34:20 : +++2006-11-02 09:34:20 : Item 0 string ........: Ö&ffnen2006-11-02 09:34:20 : Item 0 checked .......: False2006-11-02 09:34:20 : Item 0 disabled ......: False2006-11-02 09:34:20 : Item 0 grayed ........: False2006-11-02 09:34:20 : Item 0 menu bar break : False2006-11-02 09:34:20 : Item 0 menu break ....: False2006-11-02 09:34:20 : Item 0 owner draw ....: False2006-11-02 09:34:20 : Item 0 popup .........: False2006-11-02 09:34:20 : Item 0 popup items ...: 02006-11-02 09:34:20 : Item 0 separator .....: False2006-11-02 09:34:20 : Item 1 string ........: &Bearbeiten2006-11-02 09:34:20 : Item 1 checked .......: False2006-11-02 09:34:20 : Item 1 disabled ......: False2006-11-02 09:34:20 : Item 1 grayed ........: False2006-11-02 09:34:20 : Item 1 menu bar break : False2006-11-02 09:34:20 : Item 1 menu break ....: False2006-11-02 09:34:20 : Item 1 owner draw ....: False2006-11-02 09:34:20 : Item 1 popup .........: False2006-11-02 09:34:20 : Item 1 popup items ...: 02006-11-02 09:34:20 : Item 1 separator .....: False2006-11-02 09:34:20 : Item 2 string ........: File Options2006-11-02 09:34:20 : Item 2 checked .......: False2006-11-02 09:34:20 : Item 2 disabled ......: False2006-11-02 09:34:20 : Item 2 grayed ........: False2006-11-02 09:34:20 : Item 2 menu bar break : False2006-11-02 09:34:20 : Item 2 menu break ....: False2006-11-02 09:34:20 : Item 2 owner draw ....: False2006-11-02 09:34:20 : Item 2 popup .........: False2006-11-02 09:34:20 : Item 2 popup items ...: 02006-11-02 09:34:20 : Item 2 separator .....: False2006-11-02 09:34:20 : Item 3 string ........: &Hex-Editor2006-11-02 09:34:20 : Item 3 checked .......: False2006-11-02 09:34:20 : Item 3 disabled ......: False2006-11-02 09:34:20 : Item 3 grayed ........: False2006-11-02 09:34:20 : Item 3 menu bar break : False2006-11-02 09:34:20 : Item 3 menu break ....: False2006-11-02 09:34:20 : Item 3 owner draw ....: False2006-11-02 09:34:20 : Item 3 popup .........: False2006-11-02 09:34:20 : Item 3 popup items ...: 02006-11-02 09:34:20 : Item 3 separator .....: False2006-11-02 09:34:20 : Item 4 string ........: &Source-Editor2006-11-02 09:34:20 : Item 4 checked .......: False2006-11-02 09:34:20 : Item 4 disabled ......: False2006-11-02 09:34:20 : Item 4 grayed ........: False2006-11-02 09:34:20 : Item 4 menu bar break : False2006-11-02 09:34:20 : Item 4 menu break ....: False2006-11-02 09:34:20 : Item 4 owner draw ....: False2006-11-02 09:34:20 : Item 4 popup .........: False2006-11-02 09:34:20 : Item 4 popup items ...: 02006-11-02 09:34:20 : Item 4 separator .....: False2006-11-02 09:34:20 : Item 5 string ........: 7-Zip2006-11-02 09:34:20 : Item 5 checked .......: False2006-11-02 09:34:20 : Item 5 disabled ......: False2006-11-02 09:34:20 : Item 5 grayed ........: False2006-11-02 09:34:20 : Item 5 menu bar break : False2006-11-02 09:34:20 : Item 5 menu break ....: False2006-11-02 09:34:20 : Item 5 owner draw ....: True2006-11-02 09:34:20 : Item 5 popup .........: True2006-11-02 09:34:20 : Item 5 popup items ...: 52006-11-02 09:34:20 : Item 5 separator .....: True2006-11-02 09:34:20 : Item 6 string ........: 2006-11-02 09:34:20 : Item 6 checked .......: False2006-11-02 09:34:20 : Item 6 disabled ......: True2006-11-02 09:34:20 : Item 6 grayed ........: True2006-11-02 09:34:20 : Item 6 menu bar break : False2006-11-02 09:34:20 : Item 6 menu break ....: False2006-11-02 09:34:20 : Item 6 owner draw ....: False2006-11-02 09:34:20 : Item 6 popup .........: False2006-11-02 09:34:20 : Item 6 popup items ...: 02006-11-02 09:34:20 : Item 6 separator .....: False2006-11-02 09:34:20 : Item 7 string ........: Blowfish Advanced CS2006-11-02 09:34:20 : Item 7 checked .......: False2006-11-02 09:34:20 : Item 7 disabled ......: False2006-11-02 09:34:20 : Item 7 grayed ........: False2006-11-02 09:34:20 : Item 7 menu bar break : False2006-11-02 09:34:20 : Item 7 menu break ....: False2006-11-02 09:34:20 : Item 7 owner draw ....: False2006-11-02 09:34:20 : Item 7 popup .........: True2006-11-02 09:34:20 : Item 7 popup items ...: 82006-11-02 09:34:20 : Item 7 separator .....: True2006-11-02 09:34:20 : Item 8 string ........: 2006-11-02 09:34:20 : Item 8 checked .......: False2006-11-02 09:34:20 : Item 8 disabled ......: True2006-11-02 09:34:20 : Item 8 grayed ........: True2006-11-02 09:34:20 : Item 8 menu bar break : False2006-11-02 09:34:20 : Item 8 menu break ....: False2006-11-02 09:34:20 : Item 8 owner draw ....: False2006-11-02 09:34:20 : Item 8 popup .........: False2006-11-02 09:34:20 : Item 8 popup items ...: 02006-11-02 09:34:20 : Item 8 separator .....: False2006-11-02 09:34:20 : Item 9 string ........: &Verschlüsseln2006-11-02 09:34:20 : Item 9 checked .......: False2006-11-02 09:34:20 : Item 9 disabled ......: False2006-11-02 09:34:20 : Item 9 grayed ........: False2006-11-02 09:34:20 : Item 9 menu bar break : False2006-11-02 09:34:20 : Item 9 menu break ....: False2006-11-02 09:34:20 : Item 9 owner draw ....: False2006-11-02 09:34:20 : Item 9 popup .........: False2006-11-02 09:34:20 : Item 9 popup items ...: 02006-11-02 09:34:20 : Item 9 separator .....: False2006-11-02 09:34:20 : Item 10 string ........: &Zu EasyCrypto ZIP2006-11-02 09:34:20 : Item 10 checked .......: False2006-11-02 09:34:20 : Item 10 disabled ......: False2006-11-02 09:34:20 : Item 10 grayed ........: False2006-11-02 09:34:20 : Item 10 menu bar break : False2006-11-02 09:34:20 : Item 10 menu break ....: False2006-11-02 09:34:20 : Item 10 owner draw ....: False2006-11-02 09:34:20 : Item 10 popup .........: False2006-11-02 09:34:20 : Item 10 popup items ...: 02006-11-02 09:34:20 : Item 10 separator .....: False2006-11-02 09:34:20 : Item 11 string ........: 2006-11-02 09:34:20 : Item 11 checked .......: False2006-11-02 09:34:20 : Item 11 disabled ......: True2006-11-02 09:34:20 : Item 11 grayed ........: True2006-11-02 09:34:20 : Item 11 menu bar break : False2006-11-02 09:34:20 : Item 11 menu break ....: False2006-11-02 09:34:20 : Item 11 owner draw ....: False2006-11-02 09:34:20 : Item 11 popup .........: False2006-11-02 09:34:20 : Item 11 popup items ...: 02006-11-02 09:34:20 : Item 11 separator .....: False2006-11-02 09:34:20 : Item 12 string ........: Öffnen &mit2006-11-02 09:34:20 : Item 12 checked .......: False2006-11-02 09:34:20 : Item 12 disabled ......: False2006-11-02 09:34:20 : Item 12 grayed ........: False2006-11-02 09:34:20 : Item 12 menu bar break : False2006-11-02 09:34:20 : Item 12 menu break ....: False2006-11-02 09:34:20 : Item 12 owner draw ....: True2006-11-02 09:34:20 : Item 12 popup .........: True2006-11-02 09:34:20 : Item 12 popup items ...: 12006-11-02 09:34:20 : Item 12 separator .....: True2006-11-02 09:34:20 : Item 13 string ........: 2006-11-02 09:34:20 : Item 13 checked .......: False2006-11-02 09:34:20 : Item 13 disabled ......: True2006-11-02 09:34:20 : Item 13 grayed ........: True2006-11-02 09:34:20 : Item 13 menu bar break : False2006-11-02 09:34:20 : Item 13 menu break ....: False2006-11-02 09:34:20 : Item 13 owner draw ....: False2006-11-02 09:34:20 : Item 13 popup .........: False2006-11-02 09:34:20 : Item 13 popup items ...: 02006-11-02 09:34:20 : Item 13 separator .....: False2006-11-02 09:34:20 : Item 14 string ........: FilZip2006-11-02 09:34:20 : Item 14 checked .......: False2006-11-02 09:34:20 : Item 14 disabled ......: False2006-11-02 09:34:20 : Item 14 grayed ........: False2006-11-02 09:34:20 : Item 14 menu bar break : False2006-11-02 09:34:20 : Item 14 menu break ....: False2006-11-02 09:34:20 : Item 14 owner draw ....: False2006-11-02 09:34:20 : Item 14 popup .........: True2006-11-02 09:34:20 : Item 14 popup items ...: 22006-11-02 09:34:20 : Item 14 separator .....: True2006-11-02 09:34:20 : Item 15 string ........: 2006-11-02 09:34:20 : Item 15 checked .......: False2006-11-02 09:34:20 : Item 15 disabled ......: True2006-11-02 09:34:20 : Item 15 grayed ........: True2006-11-02 09:34:20 : Item 15 menu bar break : False2006-11-02 09:34:20 : Item 15 menu break ....: False2006-11-02 09:34:20 : Item 15 owner draw ....: False2006-11-02 09:34:20 : Item 15 popup .........: False2006-11-02 09:34:20 : Item 15 popup items ...: 02006-11-02 09:34:20 : Item 15 separator .....: False2006-11-02 09:34:20 : Item 16 string ........: Scan for viruses...2006-11-02 09:34:20 : Item 16 checked .......: False2006-11-02 09:34:20 : Item 16 disabled ......: False2006-11-02 09:34:20 : Item 16 grayed ........: False2006-11-02 09:34:20 : Item 16 menu bar break : False2006-11-02 09:34:20 : Item 16 menu break ....: False2006-11-02 09:34:20 : Item 16 owner draw ....: False2006-11-02 09:34:20 : Item 16 popup .........: False2006-11-02 09:34:20 : Item 16 popup items ...: 02006-11-02 09:34:20 : Item 16 separator .....: False2006-11-02 09:34:20 : Item 17 string ........: 2006-11-02 09:34:20 : Item 17 checked .......: False2006-11-02 09:34:20 : Item 17 disabled ......: True2006-11-02 09:34:20 : Item 17 grayed ........: True2006-11-02 09:34:20 : Item 17 menu bar break : False2006-11-02 09:34:20 : Item 17 menu break ....: False2006-11-02 09:34:20 : Item 17 owner draw ....: False2006-11-02 09:34:20 : Item 17 popup .........: False2006-11-02 09:34:20 : Item 17 popup items ...: 02006-11-02 09:34:20 : Item 17 separator .....: False2006-11-02 09:34:20 : Item 18 string ........: S&enden an2006-11-02 09:34:20 : Item 18 checked .......: False2006-11-02 09:34:20 : Item 18 disabled ......: False2006-11-02 09:34:20 : Item 18 grayed ........: False2006-11-02 09:34:20 : Item 18 menu bar break : False2006-11-02 09:34:20 : Item 18 menu break ....: False2006-11-02 09:34:20 : Item 18 owner draw ....: True2006-11-02 09:34:20 : Item 18 popup .........: True2006-11-02 09:34:20 : Item 18 popup items ...: 12006-11-02 09:34:20 : Item 18 separator .....: True2006-11-02 09:34:20 : Item 19 string ........: 2006-11-02 09:34:20 : Item 19 checked .......: False2006-11-02 09:34:20 : Item 19 disabled ......: True2006-11-02 09:34:20 : Item 19 grayed ........: True2006-11-02 09:34:20 : Item 19 menu bar break : False2006-11-02 09:34:20 : Item 19 menu break ....: False2006-11-02 09:34:20 : Item 19 owner draw ....: False2006-11-02 09:34:20 : Item 19 popup .........: False2006-11-02 09:34:20 : Item 19 popup items ...: 02006-11-02 09:34:20 : Item 19 separator .....: False2006-11-02 09:34:20 : Item 20 string ........: &Ausschneiden2006-11-02 09:34:20 : Item 20 checked .......: False2006-11-02 09:34:20 : Item 20 disabled ......: False2006-11-02 09:34:20 : Item 20 grayed ........: False2006-11-02 09:34:20 : Item 20 menu bar break : False2006-11-02 09:34:20 : Item 20 menu break ....: False2006-11-02 09:34:20 : Item 20 owner draw ....: False2006-11-02 09:34:20 : Item 20 popup .........: False2006-11-02 09:34:20 : Item 20 popup items ...: 02006-11-02 09:34:20 : Item 20 separator .....: False2006-11-02 09:34:20 : Item 21 string ........: &Kopieren2006-11-02 09:34:20 : Item 21 checked .......: False2006-11-02 09:34:20 : Item 21 disabled ......: False2006-11-02 09:34:20 : Item 21 grayed ........: False2006-11-02 09:34:20 : Item 21 menu bar break : False2006-11-02 09:34:20 : Item 21 menu break ....: False2006-11-02 09:34:20 : Item 21 owner draw ....: False2006-11-02 09:34:20 : Item 21 popup .........: False2006-11-02 09:34:20 : Item 21 popup items ...: 02006-11-02 09:34:20 : Item 21 separator .....: False2006-11-02 09:34:20 : Item 22 string ........: 2006-11-02 09:34:20 : Item 22 checked .......: False2006-11-02 09:34:20 : Item 22 disabled ......: True2006-11-02 09:34:20 : Item 22 grayed ........: True2006-11-02 09:34:20 : Item 22 menu bar break : False2006-11-02 09:34:20 : Item 22 menu break ....: False2006-11-02 09:34:20 : Item 22 owner draw ....: False2006-11-02 09:34:20 : Item 22 popup .........: False2006-11-02 09:34:20 : Item 22 popup items ...: 02006-11-02 09:34:20 : Item 22 separator .....: False2006-11-02 09:34:20 : Item 23 string ........: &Verknüpfung erstellen2006-11-02 09:34:20 : Item 23 checked .......: False2006-11-02 09:34:20 : Item 23 disabled ......: False2006-11-02 09:34:20 : Item 23 grayed ........: False2006-11-02 09:34:20 : Item 23 menu bar break : False2006-11-02 09:34:20 : Item 23 menu break ....: False2006-11-02 09:34:20 : Item 23 owner draw ....: False2006-11-02 09:34:20 : Item 23 popup .........: False2006-11-02 09:34:20 : Item 23 popup items ...: 02006-11-02 09:34:20 : Item 23 separator .....: False2006-11-02 09:34:20 : Item 24 string ........: &Löschen2006-11-02 09:34:20 : Item 24 checked .......: False2006-11-02 09:34:20 : Item 24 disabled ......: False2006-11-02 09:34:20 : Item 24 grayed ........: False2006-11-02 09:34:20 : Item 24 menu bar break : False2006-11-02 09:34:20 : Item 24 menu break ....: False2006-11-02 09:34:20 : Item 24 owner draw ....: False2006-11-02 09:34:20 : Item 24 popup .........: False2006-11-02 09:34:20 : Item 24 popup items ...: 02006-11-02 09:34:20 : Item 24 separator .....: False2006-11-02 09:34:20 : Item 25 string ........: &Umbenennen2006-11-02 09:34:20 : Item 25 checked .......: False2006-11-02 09:34:20 : Item 25 disabled ......: False2006-11-02 09:34:20 : Item 25 grayed ........: False2006-11-02 09:34:20 : Item 25 menu bar break : False2006-11-02 09:34:20 : Item 25 menu break ....: False2006-11-02 09:34:20 : Item 25 owner draw ....: False2006-11-02 09:34:20 : Item 25 popup .........: False2006-11-02 09:34:20 : Item 25 popup items ...: 02006-11-02 09:34:20 : Item 25 separator .....: False2006-11-02 09:34:20 : Item 26 string ........: 2006-11-02 09:34:20 : Item 26 checked .......: False2006-11-02 09:34:20 : Item 26 disabled ......: True2006-11-02 09:34:20 : Item 26 grayed ........: True2006-11-02 09:34:20 : Item 26 menu bar break : False2006-11-02 09:34:20 : Item 26 menu break ....: False2006-11-02 09:34:20 : Item 26 owner draw ....: False2006-11-02 09:34:20 : Item 26 popup .........: False2006-11-02 09:34:20 : Item 26 popup items ...: 02006-11-02 09:34:20 : Item 26 separator .....: False2006-11-02 09:34:20 : Item 27 string ........: E&igenschaften2006-11-02 09:34:20 : Item 27 checked .......: False2006-11-02 09:34:20 : Item 27 disabled ......: False2006-11-02 09:34:20 : Item 27 grayed ........: False2006-11-02 09:34:20 : Item 27 menu bar break : False2006-11-02 09:34:20 : Item 27 menu break ....: False2006-11-02 09:34:20 : Item 27 owner draw ....: False2006-11-02 09:34:20 : Item 27 popup .........: False2006-11-02 09:34:20 : Item 27 popup items ...: 02006-11-02 09:34:20 : Item 27 separator .....: FalseI try to follow your code, for example how to get the infos for >_Menu_ClickAccel($hWnd, $hMenu, $cAccel)< but i need a little bit more help. Is it possible to feed your Auto3lib with more examples? Thanks & GreetsDizzy Link to comment Share on other sites More sharing options...
System Tester Posted November 2, 2006 Share Posted November 2, 2006 Diz, don't use explorer unless you have to! ; CD to required directory FileChangeDir("C:\oasis\log") ;FIND File - first .XML file in this case. $SEARCH = FileFindFirstFile("c:\oasis\log\*.xml") ; Check if the search was successful If $SEARCH = -1 Then MsgBox(0,"file not found","File not found") EndIf ;get file name $FILE = FileFindNextFile($SEARCH) ;run application - notepad will do here. Run("notepad") ;now use SEND commands to open the file, or use STRING commands to build a command line, and use that string in the RUN command. A totally different way of getting the file open in the correct application without explorer. The AutoIt help file should be interrogated.The Editor should be SciTe.The forums should have been searched. Link to comment Share on other sites More sharing options...
Dizzy Posted November 2, 2006 Author Share Posted November 2, 2006 Hi System Tester,in the most cases you are right, but there are situations, in which you (i) have to act with files whith other app. they are connected with. For example: to open a large text-file in word, or open a picture with pictureIt (or something else) instead of paint??And sometimes i have some extensions which are not connected with an appl. In all other cases i would do it the way you describe (at this moment it is faster than the solution from PaulIA). But his way gives me other possibilities (after stumbling around in his very good code). But there are so many question marks i can't handle.Ok - for my problem i found a solution to get my item: _Menu_ClickItem(_PopupGetParent(), _PopupGetHWnd(), 5 ) ShowMenu(_PopupGetHWnd(), _PopupGetParent())_Menu_ClickItem(_PopupGetParent(), _PopupGetHWnd(), 0 )Maybe not the best way but ...But there are so many other functions which seems also very interesting ... If he can show us some more (best for every function) examples how to use the library, it would give us more possibilities in other cases. Dizzy Link to comment Share on other sites More sharing options...
System Tester Posted November 2, 2006 Share Posted November 2, 2006 Hi System Tester,in the most cases you are right, but there are situations, in which you (i) have to act with files whith other app. they are connected with. For example: to open a large text-file in word, or open a picture with pictureIt (or something else) instead of paint??And sometimes i have some extensions which are not connected with an appl.But the method I describe does not rely on a connection between the extension and an App.You either launch the app first, then use the app to open the file, or launch the app with command-line parameters to open the desired file. I think I'm missing part of the picture here. The AutoIt help file should be interrogated.The Editor should be SciTe.The forums should have been searched. Link to comment Share on other sites More sharing options...
PaulIA Posted November 2, 2006 Share Posted November 2, 2006 If he can show us some more (best for every function) examples how to use the library, it would give us more possibilities in other cases.I admit that Auto3Lib is not for beginners, but then it wasn't designed for beginners In order to get the most out of Auto3Lib, you really need to have some background in basic Windows programming. As far as how to handle popup menus, it's fairly straight forward if you study the ToolBar demo script: 1) In Explorer, you use the ToolBar library to manipulate the menu at the top and the button bar just under it. If you want to select a menu from the top menu, you use _ToolBar_ClickAccel, passing the handle of the ToolBar control and the character of the accelerator. For example, if you want to open the "File" menu: _ToolBar_ClickAccel($hToolBar, "f")oÝ÷ Ûe¡z|¨¹ÉbrJ'jg§º+^h§v,²0±ªh¦êfz{êÞj·ºw-ìuë"w~颩éî²ØZµ©e£¨ºÚ'$¢v©¢©éîo)êh²+b¢z+iÇêÚ¶Ò¢)ÄÆhêâ*.Á©íy×%É(Ø^ªê-)^ªê-éîjwméíꮢХ¢Çªºfz{¢µé¨~Ø^¦·yçb h¦êZºÚ"µÍÕÛÛÐÛXÚÐXØÙ[ ÌÍÚÛÛ ][ÝÙ][ÝÊBÓY[WÐÛXÚÔÜXØÙ[ ][ÝØÉ][ÝÊ 3) In your example above, you just need to keep going with the above example. When you click on the first popup menu, it opens a second one. Just call _Menu_ClickPopupAccel for the accelerator on the second popup menu that you want to click. Hope this helps. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
Dizzy Posted November 3, 2006 Author Share Posted November 3, 2006 @System Tester:Sometimes it is easier to go over the context menu as to open a application.For example: send a file to a bluetooth-device ... (see picture) And i wrote: in the most cases you are right...And it is not bad to know different ways to get a solution, right?So, both examples work for me (yours is a little bit faster), and the lib from PaulIA offers so many other possibilities ... (if i get them to work - but i'm on my way to learn it )@PaulIA: thanks for the tip - i will have a closer look at it. Do you have a idea for the error in scite?Can not redeclare a constantThanksDizzy Link to comment Share on other sites More sharing options...
System Tester Posted November 3, 2006 Share Posted November 3, 2006 @System Tester:Sometimes it is easier to go over the context menu as to open a application.For example: send a file to a bluetooth-device ... (see picture) And i wrote: And it is not bad to know different ways to get a solution, right?So, both examples work for me (yours is a little bit faster), and the lib from PaulIA offers so many other possibilities ... (if i get them to work - but i'm on my way to learn it )@PaulIA: thanks for the tip - i will have a closer look at it. Do you have a idea for the error in scite?ThanksDizzy The AutoIt help file should be interrogated.The Editor should be SciTe.The forums should have been searched. Link to comment Share on other sites More sharing options...
PaulIA Posted November 4, 2006 Share Posted November 4, 2006 Download the latest version of Auto3Lib. The constants problem is fixed. Auto3Lib: A library of over 1200 functions for AutoIt 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