Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Menu handler is 0 for Explorer folder main menu
#1
Not Solved Toungue 
Hi,

Can anyone help me to find out why handler to the context menu is 0 for Windows Explorer folder’s main menu.
Let’s say you open My Documents folder and it is necessary to get File->New->Folder item state (if it is enabled or disabled).

Below is part of code from the book (p. 41) http://www.scribd.com/doc/6678471/Codes, which really works for WordPad, but when I try to do the same for Win Expl folder – FileMenuHandle is 0

Code:
Extern.Declare micLong,"GetMenu", "user32.dll", "GetMenu",micHwnd
Extern.Declare micLong, "GetSubMenu", "user32.dll", "GetSubMenu", micLong, micInteger

‘// My Documents should be opened
strWin = "My Documents"
Window("regexpwndtitle:="&strWin).Activate
wait 1

' Get the Handle of the window.
WinHandle = Window("regexpwndtitle:="&strWin).GetROProperty("hwnd")  

' Window("regexpwndtitle:="&strWin).WinToolbar("regexpwndclass:=ToolbarWindow32","windowstyle:=1442895949") ‘// menu bar where actually main menu is located

' Get Handle Of Main Menu ( e.g File, Edit, View. etc )
MenuHandle = Extern.GetMenu ( WinHandle )

' Get Handle Of "File" Menu ( 0= File, 1=Edit, 2=View etc )
FileMenuHandle = Extern.GetSubMenu ( MenuHandle, 0 ) ‘// And here I get “0”
Reply


Messages In This Thread
Menu handler is 0 for Explorer folder main menu - by Andriana - 09-09-2009, 11:44 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to perform click operation on MDI menu/sub menu (Infragistics) with UFT 12 Mahen1108 0 3,456 06-17-2015, 05:29 PM
Last Post: Mahen1108
  Problem with menu object (UFT) Marta79 4 4,162 05-07-2015, 12:44 PM
Last Post: Marta79
  QTP 11 is not working for Internet Explorer 10 Niraj 5 10,133 08-14-2013, 01:34 PM
Last Post: Niraj
  Explorer Crash - when UFT 11.5 is open sriramb 2 3,785 07-08-2013, 05:18 PM
Last Post: Ankur
  create drop Down list or menu in qtp abansal 0 3,954 09-07-2012, 05:36 PM
Last Post: abansal

Forum Jump:


Users browsing this thread: 1 Guest(s)