none
Button popup menu item handling RRS feed

  • Question

  • Im creating a program to autoclick on a particular button and then click on its popup menu item. So i use Spy++ to obtain window control handle and clicked the window with WM_LBUTTONDOWN and release WM_LBUTTONUP. Now how can I get the handle to the popup menu items for this button.
    Im clicking on the desired button using this code and its fine but cant move further with menu item. Tried with GetMenu api but no use. 

    SendMessage(hChldWnd, WM_LBUTTONDOWN, (WPARAM)MK_LBUTTON, 0);
    SendMessage(hChldWnd, WM_LBUTTONUP, (WPARAM)MK_LBUTTON, 0);

    Monday, March 1, 2010 4:06 AM

All replies

  • 
    hypheni wrote:
    > Im creating a program to autoclick on a particular button and then click on its popup menu item. So i use Spy++ to obtain window
    > control handle and clicked the window with WM_LBUTTONDOWN and release WM_LBUTTONUP.
     
    Instead of going to all this trouble, use Spy++ to figure out the parameters of WM_COMMAND message that he popup item sends when clicked, then just send WM_COMMAND directly.
    --
    Igor Tandetnik
    Monday, March 1, 2010 5:12 AM
  • See.. I could not find any WM_COMMAND msg while clicking a popup menu item. Only receive a WM_COMMAND msg while pushing the button itself. 
    Monday, March 1, 2010 7:14 AM
  • Please guide me to solve this..
    Tuesday, March 2, 2010 4:09 PM