🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6424

Re: IContextMenu for Explorer

#6424
From: nicolasr
Date: Mon, 16 May 2005 23:49
30 lines
1992 bytes
> You need to call the IContextMenu's QueryContextMenu() method before 
> calling
> GetCommandString().  QueryContextMenu() is what actually sets up the menu
> items.  Without it, there is nothing for GetCommandString() to query.  You
> can use the Win32 API CreatePopupMenu() function to create a temporary
> hidden HMENU for QueryContextMenu() to fill in, and then you can query the
> menu for whatever information you need.
>
>
> Gambit
>
>

thanks, that makes it much clearer. I added the following lines right before
calling GetCommandString():

hMenu = CreatePopupMenu();
Win32Check(hMenu != NULL);

OleCheck(menu->QueryContextMenu(hMenu, 0, 0, 2, CMF_NORMAL));


however, now the call to GetCommandString() throws 'Not implemented'.

What could be wrong? Also QueryContextMenu() requires parameters
for first and last command. What should I specify when I don't know the
number of available commands ahead?

thanks for your help!
Nick 
Technical Details
Message-ID: <4289317d@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <4287f6c1@newsgroups.borland.com> <4288e58b$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,7e49abe43ea24b0d
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "nicolasr" <nicolasrNOSPAMATSIGNgmx.net>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4287f6c1@newsgroups.borland.com> <4288e58b$1@newsgroups.borland.com>
Subject: Re: IContextMenu for Explorer
Date: Tue, 17 May 2005 01:49:13 +0200
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 84.174.174.227
Message-ID: <4289317d@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1116287357 84.174.174.227 (16 May 2005 16:49:17 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail