Loading ...
Sorry, an error occurred while loading the content.

Popup context menu

Expand Messages
  • Larry
    Peter, My memory is telling me that awhile back you wrote some code to simplify adding popup context menus. Is that true, of is age just gettting to me. Lee
    Message 1 of 3 , Jul 15, 2010
    • 0 Attachment
      Peter,

      My memory is telling me that awhile back you wrote some code to simplify adding popup context menus.

      Is that true, of is age just gettting to me.

      Lee
    • Peter Olsson
      I looked through the archive and the best post i is probably this one http://groups.yahoo.com/group/cc2-dev-l/message/455 Before you click on it, make a guess
      Message 2 of 3 , Jul 16, 2010
      • 0 Attachment

        I looked through the archive and the best post i is probably this one

        http://groups.yahoo.com/group/cc2-dev-l/message/455

         

        Before you click on it, make a guess who wrote the above post. :-)

         

        I looked in my code and I have done things slightly different.

         

        POINT Point;

        HMENU hMenu;

        MENUITEMINFO MenuItemInfo={sizeof(MENUITEMINFO), MIIM_TYPE | MIIM_ID | MIIM_DATA, MFT_STRING, MFS_DEFAULT, 0, NULL, NULL, NULL, 0, NULL, 0};

        int MenuPos=1;

         

        hMenu=CreatePopupMenu();

         

        MenuItemInfo.fType=MFT_STRING;

        MenuItemInfo.dwTypeData=yourText;

        MenuItemInfo.dwItemData=yourData;

        MenuItemInfo.wID=MenuPos;InsertMenuItem(hMenu, MenuPos++, TRUE, &MenuItemInfo);

         

        GetCursorPos(&Point);

        rc=TrackPopupMenuEx(hMenu, TPM_NONOTIFY | TPM_RETURNCMD | TPM_RIGHTBUTTON, Point.x-3, Point.y-3, MyXP.hMainWin, NULL);

        if(rc)

        {

          MenuItemInfo.dwItemData=0;

          MenuItemInfo.fMask=MIIM_DATA;

          GetMenuItemInfo(hMenu, rc-1, TRUE, &MenuItemInfo);

          selectedData=MenuItemInfo.dwItemData;

        }

        DestroyMenu(hMenu);

         

        Peter

         

        Från: cc2-dev-l@yahoogroups.com [mailto:cc2-dev-l@yahoogroups.com] För Larry
        Skickat: den 15 juli 2010 21:49
        Till: cc2-dev-l@yahoogroups.com
        Ämne: [cc2-dev-l] Popup context menu

         

         

        Peter,

        My memory is telling me that awhile back you wrote some code to simplify adding popup context menus.

        Is that true, of is age just gettting to me.

        Lee

      • L. Lee Saunders
        Eight years ago? (Thu Apr 25, 2002 7:19 pm) Wow, have we been doing this THAT long? (And I still don’t know a pointer from a hole in the ground – sad) Lee
        Message 3 of 3 , Jul 16, 2010
        • 0 Attachment

          Eight years ago? (Thu Apr 25, 2002 7:19 pm)

           

          Wow, have we been doing this THAT long?  (And I still don’t know a pointer from a hole in the ground – sad)

           

          Lee

           

           

          From: cc2-dev-l@yahoogroups.com [mailto:cc2-dev-l@yahoogroups.com] On Behalf Of Peter Olsson
          Sent: Friday, July 16, 2010 8:30 AM
          To: cc2-dev-l@yahoogroups.com
          Subject: Re: [cc2-dev-l] Popup context menu

           

           

          I looked through the archive and the best post i is probably this one

          http://groups.yahoo.com/group/cc2-dev-l/message/455

           

          Before you click on it, make a guess who wrote the above post. :-)

           

          I looked in my code and I have done things slightly different.

           

          POINT Point;

          HMENU hMenu;

          MENUITEMINFO MenuItemInfo={sizeof(MENUITEMINFO), MIIM_TYPE | MIIM_ID | MIIM_DATA, MFT_STRING, MFS_DEFAULT, 0, NULL, NULL, NULL, 0, NULL, 0};

          int MenuPos=1;

           

          hMenu=CreatePopupMenu();

           

          MenuItemInfo.fType=MFT_STRING;

          MenuItemInfo.dwTypeData=yourText;

          MenuItemInfo.dwItemData=yourData;

          MenuItemInfo.wID=MenuPos;InsertMenuItem(hMenu, MenuPos++, TRUE, &MenuItemInfo);

           

          GetCursorPos(&Point);

          rc=TrackPopupMenuEx(hMenu, TPM_NONOTIFY | TPM_RETURNCMD | TPM_RIGHTBUTTON, Point.x-3, Point.y-3, MyXP.hMainWin, NULL);

          if(rc)

          {

            MenuItemInfo.dwItemData=0;

            MenuItemInfo.fMask=MIIM_DATA;

            GetMenuItemInfo(hMenu, rc-1, TRUE, &MenuItemInfo);

            selectedData=MenuItemInfo.dwItemData;

          }

          DestroyMenu(hMenu);

           

          Peter

           

          Från: cc2-dev-l@yahoogroups.com [mailto:cc2-dev-l@yahoogroups.com] För Larry
          Skickat: den 15 juli 2010 21:49
          Till: cc2-dev-l@yahoogroups.com
          Ämne: [cc2-dev-l] Popup context menu

           

           

          Peter,

          My memory is telling me that awhile back you wrote some code to simplify adding popup context menus.

          Is that true, of is age just gettting to me.

          Lee

        Your message has been successfully submitted and would be delivered to recipients shortly.