Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get total item in context menu?
#4
Not Solved
Hi,

I am not sure what you want to get. But may the next part of code will help you.

Open "My Documents" and run (<Item 5> in my case has submenu):

Code:
strWin = "My Documents"
Window("regexpwndtitle:="&strWin).Activate
wait 1
Window("regexpwndtitle:="&strWin).WinListView("regexpwndclass:=SysListView32").Select 0,micRightBtn
wait 2
Set oContMenu = Window("regexpwndtitle:="&strWin).WinObject("regexpwndclass:=SHELLDLL_DefView").WinMenu("menuobjtype:=3")
nCnt = oContMenu.GetItemProperty("", "SubMenuCount")
strMenu = oContMenu.GetItemProperty("<Item 5>", "Label") '// will return the menu string
Window("regexpwndtitle:="&strWin).WinListView("regexpwndclass:=SysListView32").Select 0,micRightBtn
bRes = oContMenu.GetItemProperty("<Item 5>", "HasSubMenu") '// if it has sub menu
wait 2
If bRes Then
    Window("regexpwndtitle:="&strWin).WinListView("regexpwndclass:=SysListView32").Select 0,micRightBtn
    wait 2
    oContMenu.Select strMenu
    nCnt2 = oContMenu.GetItemProperty("<Item 5>", "SubMenuCount")
    strMenu2 = oContMenu.GetItemProperty("<Item 5>;<Item 1>", "Label") '// will return the menu string
End If
Reply


Messages In This Thread
How to get total item in context menu? - by Star - 07-28-2009, 06:05 PM
RE: How to get total item in context menu? - by Andriana - 09-11-2009, 01:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to select item within WebMenu learnasugo 4 8,107 10-11-2016, 03:35 PM
Last Post: learnasugo
  Fetching total number of records inside a webtable vidya2k2 2 3,877 06-15-2015, 02:55 PM
Last Post: venkatesh9032
  ContextMenu item disabled Powerbuilder Phread 1 4,162 05-24-2012, 10:15 AM
Last Post: Shridevi.Salagare
Question Get total links visible on a webpage Sanjay_DP 5 6,429 02-16-2012, 10:30 PM
Last Post: Parke
  to check if an item in the list is disabled or not sujaravi123 6 15,711 12-13-2011, 08:15 PM
Last Post: PrabhatN

Forum Jump:


Users browsing this thread: 2 Guest(s)