Results 1 to 3 of 3

Thread: GetMenuItemID

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363
    Hi, how can I select another application's main menu (such as File) without using Sendkeys (which might be interfered with by the user)? If the menu isn't a dropdown menu, you can use GetMenuItemID and then PostMessage to call the menu, but GetMenuItemID returns -1 if the menu is a dropdown.

    If you're curious why I need to select a main menu item, it's because my app replicates another menu and one of the external menus has dynamically enabled/disabled submenus that aren't enabled/disabled until the Edit menu (which has 28 submenus) is selected.

    Thanks in advance,
    Wade

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363
    Ok, you can use GetMenuItemInfo to get a menu ID even if it's a dropdown and then PostMessage to select it, which is working (the return value is nonzero). But this doesn't force the menu to dropdown so the other app doesn't refresh itself. I'm using:
    Code:
    retval = PostMessage(Hwindow, &H111, tMenuItemInfo.wID, 0)
    What constant can I use to force it to dropdown?

    Thanks in advance,
    Wade

    [Edited by WadeD on 03-27-2000 at 03:41 PM]

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363
    Anyone? I just want to select the Edit menu of an external app so that it refreshes itself (that's the way the external app works), but do this in a way that's transparent to the user so that I can check its submenus' states and enable/disable mine accordingly. I'm subclassing my app; using WM_INITMENUPOPUP, I can detect when the user selects my Edit menu and do processing before it drops, but I'm unable to replicate the menu states of the other app unless I manually select the other app's Edit menu and then come back to mine.

    Thanks,
    Wade

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width