Jump to content

Explorers context menu


Dizzy
 Share

Recommended Posts

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!

post-83-1162393801_thumb.jpg

Link to comment
Share on other sites

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 them

as 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 delay

SEND("7") ; 7 is the first letter - might be a different key - depends on the application.

;or Send("{DOWN 6}") ;Presses the DOWN key 6 times

sleep(100)

and so on.

BUT

you could also check the file exists.... FileFindFirstFile

open the application you wih to use.....Run

then open the file in the application (keystrokes for File.....Open using SEND)

HTH

http://support.microsoft.com/kb/126449 <-------- Keyboard shortcuts for Windows :whistle:

Edited 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

"Appskey"? - this would bring up the context menu ?? - okay ... ;)

But how can i use this directly on a file? :whistle:

Thanks

Dizzy

Send "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

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:

CODE
#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
EndFunc
Edit: Codebox Edited by PaulIA
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

"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

@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" ? :whistle:

Thanks for your help !!

Link to comment
Share on other sites

@PaulIA:

Similar to your way - how did i get the context menu on a file "c:\temp\tt.txt" ? :whistle:

CODE
#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
EndFunc
Edit: Codebox Edited by PaulIA
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

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

:P

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 .........: 0x002708CA

2006-11-02 09:34:20 : Menu handle ...........: 0x00E8101F

2006-11-02 09:34:20 : Menu item count .......: 28

2006-11-02 09:34:20 : +++

2006-11-02 09:34:20 : Item 0 string ........: Ö&ffnen

2006-11-02 09:34:20 : Item 0 checked .......: False

2006-11-02 09:34:20 : Item 0 disabled ......: False

2006-11-02 09:34:20 : Item 0 grayed ........: False

2006-11-02 09:34:20 : Item 0 menu bar break : False

2006-11-02 09:34:20 : Item 0 menu break ....: False

2006-11-02 09:34:20 : Item 0 owner draw ....: False

2006-11-02 09:34:20 : Item 0 popup .........: False

2006-11-02 09:34:20 : Item 0 popup items ...: 0

2006-11-02 09:34:20 : Item 0 separator .....: False

2006-11-02 09:34:20 : Item 1 string ........: &Bearbeiten

2006-11-02 09:34:20 : Item 1 checked .......: False

2006-11-02 09:34:20 : Item 1 disabled ......: False

2006-11-02 09:34:20 : Item 1 grayed ........: False

2006-11-02 09:34:20 : Item 1 menu bar break : False

2006-11-02 09:34:20 : Item 1 menu break ....: False

2006-11-02 09:34:20 : Item 1 owner draw ....: False

2006-11-02 09:34:20 : Item 1 popup .........: False

2006-11-02 09:34:20 : Item 1 popup items ...: 0

2006-11-02 09:34:20 : Item 1 separator .....: False

2006-11-02 09:34:20 : Item 2 string ........: File Options

2006-11-02 09:34:20 : Item 2 checked .......: False

2006-11-02 09:34:20 : Item 2 disabled ......: False

2006-11-02 09:34:20 : Item 2 grayed ........: False

2006-11-02 09:34:20 : Item 2 menu bar break : False

2006-11-02 09:34:20 : Item 2 menu break ....: False

2006-11-02 09:34:20 : Item 2 owner draw ....: False

2006-11-02 09:34:20 : Item 2 popup .........: False

2006-11-02 09:34:20 : Item 2 popup items ...: 0

2006-11-02 09:34:20 : Item 2 separator .....: False

2006-11-02 09:34:20 : Item 3 string ........: &Hex-Editor

2006-11-02 09:34:20 : Item 3 checked .......: False

2006-11-02 09:34:20 : Item 3 disabled ......: False

2006-11-02 09:34:20 : Item 3 grayed ........: False

2006-11-02 09:34:20 : Item 3 menu bar break : False

2006-11-02 09:34:20 : Item 3 menu break ....: False

2006-11-02 09:34:20 : Item 3 owner draw ....: False

2006-11-02 09:34:20 : Item 3 popup .........: False

2006-11-02 09:34:20 : Item 3 popup items ...: 0

2006-11-02 09:34:20 : Item 3 separator .....: False

2006-11-02 09:34:20 : Item 4 string ........: &Source-Editor

2006-11-02 09:34:20 : Item 4 checked .......: False

2006-11-02 09:34:20 : Item 4 disabled ......: False

2006-11-02 09:34:20 : Item 4 grayed ........: False

2006-11-02 09:34:20 : Item 4 menu bar break : False

2006-11-02 09:34:20 : Item 4 menu break ....: False

2006-11-02 09:34:20 : Item 4 owner draw ....: False

2006-11-02 09:34:20 : Item 4 popup .........: False

2006-11-02 09:34:20 : Item 4 popup items ...: 0

2006-11-02 09:34:20 : Item 4 separator .....: False

2006-11-02 09:34:20 : Item 5 string ........: 7-Zip

2006-11-02 09:34:20 : Item 5 checked .......: False

2006-11-02 09:34:20 : Item 5 disabled ......: False

2006-11-02 09:34:20 : Item 5 grayed ........: False

2006-11-02 09:34:20 : Item 5 menu bar break : False

2006-11-02 09:34:20 : Item 5 menu break ....: False

2006-11-02 09:34:20 : Item 5 owner draw ....: True

2006-11-02 09:34:20 : Item 5 popup .........: True

2006-11-02 09:34:20 : Item 5 popup items ...: 5

2006-11-02 09:34:20 : Item 5 separator .....: True

2006-11-02 09:34:20 : Item 6 string ........:

2006-11-02 09:34:20 : Item 6 checked .......: False

2006-11-02 09:34:20 : Item 6 disabled ......: True

2006-11-02 09:34:20 : Item 6 grayed ........: True

2006-11-02 09:34:20 : Item 6 menu bar break : False

2006-11-02 09:34:20 : Item 6 menu break ....: False

2006-11-02 09:34:20 : Item 6 owner draw ....: False

2006-11-02 09:34:20 : Item 6 popup .........: False

2006-11-02 09:34:20 : Item 6 popup items ...: 0

2006-11-02 09:34:20 : Item 6 separator .....: False

2006-11-02 09:34:20 : Item 7 string ........: Blowfish Advanced CS

2006-11-02 09:34:20 : Item 7 checked .......: False

2006-11-02 09:34:20 : Item 7 disabled ......: False

2006-11-02 09:34:20 : Item 7 grayed ........: False

2006-11-02 09:34:20 : Item 7 menu bar break : False

2006-11-02 09:34:20 : Item 7 menu break ....: False

2006-11-02 09:34:20 : Item 7 owner draw ....: False

2006-11-02 09:34:20 : Item 7 popup .........: True

2006-11-02 09:34:20 : Item 7 popup items ...: 8

2006-11-02 09:34:20 : Item 7 separator .....: True

2006-11-02 09:34:20 : Item 8 string ........:

2006-11-02 09:34:20 : Item 8 checked .......: False

2006-11-02 09:34:20 : Item 8 disabled ......: True

2006-11-02 09:34:20 : Item 8 grayed ........: True

2006-11-02 09:34:20 : Item 8 menu bar break : False

2006-11-02 09:34:20 : Item 8 menu break ....: False

2006-11-02 09:34:20 : Item 8 owner draw ....: False

2006-11-02 09:34:20 : Item 8 popup .........: False

2006-11-02 09:34:20 : Item 8 popup items ...: 0

2006-11-02 09:34:20 : Item 8 separator .....: False

2006-11-02 09:34:20 : Item 9 string ........: &Verschlüsseln

2006-11-02 09:34:20 : Item 9 checked .......: False

2006-11-02 09:34:20 : Item 9 disabled ......: False

2006-11-02 09:34:20 : Item 9 grayed ........: False

2006-11-02 09:34:20 : Item 9 menu bar break : False

2006-11-02 09:34:20 : Item 9 menu break ....: False

2006-11-02 09:34:20 : Item 9 owner draw ....: False

2006-11-02 09:34:20 : Item 9 popup .........: False

2006-11-02 09:34:20 : Item 9 popup items ...: 0

2006-11-02 09:34:20 : Item 9 separator .....: False

2006-11-02 09:34:20 : Item 10 string ........: &Zu EasyCrypto ZIP

2006-11-02 09:34:20 : Item 10 checked .......: False

2006-11-02 09:34:20 : Item 10 disabled ......: False

2006-11-02 09:34:20 : Item 10 grayed ........: False

2006-11-02 09:34:20 : Item 10 menu bar break : False

2006-11-02 09:34:20 : Item 10 menu break ....: False

2006-11-02 09:34:20 : Item 10 owner draw ....: False

2006-11-02 09:34:20 : Item 10 popup .........: False

2006-11-02 09:34:20 : Item 10 popup items ...: 0

2006-11-02 09:34:20 : Item 10 separator .....: False

2006-11-02 09:34:20 : Item 11 string ........:

2006-11-02 09:34:20 : Item 11 checked .......: False

2006-11-02 09:34:20 : Item 11 disabled ......: True

2006-11-02 09:34:20 : Item 11 grayed ........: True

2006-11-02 09:34:20 : Item 11 menu bar break : False

2006-11-02 09:34:20 : Item 11 menu break ....: False

2006-11-02 09:34:20 : Item 11 owner draw ....: False

2006-11-02 09:34:20 : Item 11 popup .........: False

2006-11-02 09:34:20 : Item 11 popup items ...: 0

2006-11-02 09:34:20 : Item 11 separator .....: False

2006-11-02 09:34:20 : Item 12 string ........: Öffnen &mit

2006-11-02 09:34:20 : Item 12 checked .......: False

2006-11-02 09:34:20 : Item 12 disabled ......: False

2006-11-02 09:34:20 : Item 12 grayed ........: False

2006-11-02 09:34:20 : Item 12 menu bar break : False

2006-11-02 09:34:20 : Item 12 menu break ....: False

2006-11-02 09:34:20 : Item 12 owner draw ....: True

2006-11-02 09:34:20 : Item 12 popup .........: True

2006-11-02 09:34:20 : Item 12 popup items ...: 1

2006-11-02 09:34:20 : Item 12 separator .....: True

2006-11-02 09:34:20 : Item 13 string ........:

2006-11-02 09:34:20 : Item 13 checked .......: False

2006-11-02 09:34:20 : Item 13 disabled ......: True

2006-11-02 09:34:20 : Item 13 grayed ........: True

2006-11-02 09:34:20 : Item 13 menu bar break : False

2006-11-02 09:34:20 : Item 13 menu break ....: False

2006-11-02 09:34:20 : Item 13 owner draw ....: False

2006-11-02 09:34:20 : Item 13 popup .........: False

2006-11-02 09:34:20 : Item 13 popup items ...: 0

2006-11-02 09:34:20 : Item 13 separator .....: False

2006-11-02 09:34:20 : Item 14 string ........: FilZip

2006-11-02 09:34:20 : Item 14 checked .......: False

2006-11-02 09:34:20 : Item 14 disabled ......: False

2006-11-02 09:34:20 : Item 14 grayed ........: False

2006-11-02 09:34:20 : Item 14 menu bar break : False

2006-11-02 09:34:20 : Item 14 menu break ....: False

2006-11-02 09:34:20 : Item 14 owner draw ....: False

2006-11-02 09:34:20 : Item 14 popup .........: True

2006-11-02 09:34:20 : Item 14 popup items ...: 2

2006-11-02 09:34:20 : Item 14 separator .....: True

2006-11-02 09:34:20 : Item 15 string ........:

2006-11-02 09:34:20 : Item 15 checked .......: False

2006-11-02 09:34:20 : Item 15 disabled ......: True

2006-11-02 09:34:20 : Item 15 grayed ........: True

2006-11-02 09:34:20 : Item 15 menu bar break : False

2006-11-02 09:34:20 : Item 15 menu break ....: False

2006-11-02 09:34:20 : Item 15 owner draw ....: False

2006-11-02 09:34:20 : Item 15 popup .........: False

2006-11-02 09:34:20 : Item 15 popup items ...: 0

2006-11-02 09:34:20 : Item 15 separator .....: False

2006-11-02 09:34:20 : Item 16 string ........: Scan for viruses...

2006-11-02 09:34:20 : Item 16 checked .......: False

2006-11-02 09:34:20 : Item 16 disabled ......: False

2006-11-02 09:34:20 : Item 16 grayed ........: False

2006-11-02 09:34:20 : Item 16 menu bar break : False

2006-11-02 09:34:20 : Item 16 menu break ....: False

2006-11-02 09:34:20 : Item 16 owner draw ....: False

2006-11-02 09:34:20 : Item 16 popup .........: False

2006-11-02 09:34:20 : Item 16 popup items ...: 0

2006-11-02 09:34:20 : Item 16 separator .....: False

2006-11-02 09:34:20 : Item 17 string ........:

2006-11-02 09:34:20 : Item 17 checked .......: False

2006-11-02 09:34:20 : Item 17 disabled ......: True

2006-11-02 09:34:20 : Item 17 grayed ........: True

2006-11-02 09:34:20 : Item 17 menu bar break : False

2006-11-02 09:34:20 : Item 17 menu break ....: False

2006-11-02 09:34:20 : Item 17 owner draw ....: False

2006-11-02 09:34:20 : Item 17 popup .........: False

2006-11-02 09:34:20 : Item 17 popup items ...: 0

2006-11-02 09:34:20 : Item 17 separator .....: False

2006-11-02 09:34:20 : Item 18 string ........: S&enden an

2006-11-02 09:34:20 : Item 18 checked .......: False

2006-11-02 09:34:20 : Item 18 disabled ......: False

2006-11-02 09:34:20 : Item 18 grayed ........: False

2006-11-02 09:34:20 : Item 18 menu bar break : False

2006-11-02 09:34:20 : Item 18 menu break ....: False

2006-11-02 09:34:20 : Item 18 owner draw ....: True

2006-11-02 09:34:20 : Item 18 popup .........: True

2006-11-02 09:34:20 : Item 18 popup items ...: 1

2006-11-02 09:34:20 : Item 18 separator .....: True

2006-11-02 09:34:20 : Item 19 string ........:

2006-11-02 09:34:20 : Item 19 checked .......: False

2006-11-02 09:34:20 : Item 19 disabled ......: True

2006-11-02 09:34:20 : Item 19 grayed ........: True

2006-11-02 09:34:20 : Item 19 menu bar break : False

2006-11-02 09:34:20 : Item 19 menu break ....: False

2006-11-02 09:34:20 : Item 19 owner draw ....: False

2006-11-02 09:34:20 : Item 19 popup .........: False

2006-11-02 09:34:20 : Item 19 popup items ...: 0

2006-11-02 09:34:20 : Item 19 separator .....: False

2006-11-02 09:34:20 : Item 20 string ........: &Ausschneiden

2006-11-02 09:34:20 : Item 20 checked .......: False

2006-11-02 09:34:20 : Item 20 disabled ......: False

2006-11-02 09:34:20 : Item 20 grayed ........: False

2006-11-02 09:34:20 : Item 20 menu bar break : False

2006-11-02 09:34:20 : Item 20 menu break ....: False

2006-11-02 09:34:20 : Item 20 owner draw ....: False

2006-11-02 09:34:20 : Item 20 popup .........: False

2006-11-02 09:34:20 : Item 20 popup items ...: 0

2006-11-02 09:34:20 : Item 20 separator .....: False

2006-11-02 09:34:20 : Item 21 string ........: &Kopieren

2006-11-02 09:34:20 : Item 21 checked .......: False

2006-11-02 09:34:20 : Item 21 disabled ......: False

2006-11-02 09:34:20 : Item 21 grayed ........: False

2006-11-02 09:34:20 : Item 21 menu bar break : False

2006-11-02 09:34:20 : Item 21 menu break ....: False

2006-11-02 09:34:20 : Item 21 owner draw ....: False

2006-11-02 09:34:20 : Item 21 popup .........: False

2006-11-02 09:34:20 : Item 21 popup items ...: 0

2006-11-02 09:34:20 : Item 21 separator .....: False

2006-11-02 09:34:20 : Item 22 string ........:

2006-11-02 09:34:20 : Item 22 checked .......: False

2006-11-02 09:34:20 : Item 22 disabled ......: True

2006-11-02 09:34:20 : Item 22 grayed ........: True

2006-11-02 09:34:20 : Item 22 menu bar break : False

2006-11-02 09:34:20 : Item 22 menu break ....: False

2006-11-02 09:34:20 : Item 22 owner draw ....: False

2006-11-02 09:34:20 : Item 22 popup .........: False

2006-11-02 09:34:20 : Item 22 popup items ...: 0

2006-11-02 09:34:20 : Item 22 separator .....: False

2006-11-02 09:34:20 : Item 23 string ........: &Verknüpfung erstellen

2006-11-02 09:34:20 : Item 23 checked .......: False

2006-11-02 09:34:20 : Item 23 disabled ......: False

2006-11-02 09:34:20 : Item 23 grayed ........: False

2006-11-02 09:34:20 : Item 23 menu bar break : False

2006-11-02 09:34:20 : Item 23 menu break ....: False

2006-11-02 09:34:20 : Item 23 owner draw ....: False

2006-11-02 09:34:20 : Item 23 popup .........: False

2006-11-02 09:34:20 : Item 23 popup items ...: 0

2006-11-02 09:34:20 : Item 23 separator .....: False

2006-11-02 09:34:20 : Item 24 string ........: &Löschen

2006-11-02 09:34:20 : Item 24 checked .......: False

2006-11-02 09:34:20 : Item 24 disabled ......: False

2006-11-02 09:34:20 : Item 24 grayed ........: False

2006-11-02 09:34:20 : Item 24 menu bar break : False

2006-11-02 09:34:20 : Item 24 menu break ....: False

2006-11-02 09:34:20 : Item 24 owner draw ....: False

2006-11-02 09:34:20 : Item 24 popup .........: False

2006-11-02 09:34:20 : Item 24 popup items ...: 0

2006-11-02 09:34:20 : Item 24 separator .....: False

2006-11-02 09:34:20 : Item 25 string ........: &Umbenennen

2006-11-02 09:34:20 : Item 25 checked .......: False

2006-11-02 09:34:20 : Item 25 disabled ......: False

2006-11-02 09:34:20 : Item 25 grayed ........: False

2006-11-02 09:34:20 : Item 25 menu bar break : False

2006-11-02 09:34:20 : Item 25 menu break ....: False

2006-11-02 09:34:20 : Item 25 owner draw ....: False

2006-11-02 09:34:20 : Item 25 popup .........: False

2006-11-02 09:34:20 : Item 25 popup items ...: 0

2006-11-02 09:34:20 : Item 25 separator .....: False

2006-11-02 09:34:20 : Item 26 string ........:

2006-11-02 09:34:20 : Item 26 checked .......: False

2006-11-02 09:34:20 : Item 26 disabled ......: True

2006-11-02 09:34:20 : Item 26 grayed ........: True

2006-11-02 09:34:20 : Item 26 menu bar break : False

2006-11-02 09:34:20 : Item 26 menu break ....: False

2006-11-02 09:34:20 : Item 26 owner draw ....: False

2006-11-02 09:34:20 : Item 26 popup .........: False

2006-11-02 09:34:20 : Item 26 popup items ...: 0

2006-11-02 09:34:20 : Item 26 separator .....: False

2006-11-02 09:34:20 : Item 27 string ........: E&igenschaften

2006-11-02 09:34:20 : Item 27 checked .......: False

2006-11-02 09:34:20 : Item 27 disabled ......: False

2006-11-02 09:34:20 : Item 27 grayed ........: False

2006-11-02 09:34:20 : Item 27 menu bar break : False

2006-11-02 09:34:20 : Item 27 menu break ....: False

2006-11-02 09:34:20 : Item 27 owner draw ....: False

2006-11-02 09:34:20 : Item 27 popup .........: False

2006-11-02 09:34:20 : Item 27 popup items ...: 0

2006-11-02 09:34:20 : Item 27 separator .....: False

I 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? :whistle:

Thanks & Greets

Dizzy

post-83-1162457781_thumb.jpg

Link to comment
Share on other sites

Diz, don't use explorer unless you have to! :whistle:

; 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

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: :P

_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 ... :whistle:

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

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

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 :whistle: 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

@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 :whistle: )

@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 constant

Thanks

Dizzy

Link to comment
Share on other sites

@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 :P - but i'm on my way to learn it :whistle: )

@PaulIA: thanks for the tip - i will have a closer look at it. Do you have a idea for the error in scite?

Thanks

Dizzy

;);)

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...