Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Adding Menu Options to 3rd Party App


Message #1 by "Bob Corn" <bobcorn@i...> on Mon, 14 May 2001 15:02:25
Bob,

    Woowie.  Allright, I can't provide you with any code, its been about five
years.  I can tell you the basic steps necessary and I hope someone on the list
can fill in the blanks (err fill in the code).

    You'll need some third party control to subclass across process spaces
(Desaware's spyworks does this well).

    Create a menu with your ping option on it with VB code in it.

    Use some various API calls to retrieve the handle of the menu that appears
when you right click (use the API spy with Visual Studio to do that; chances are
its a #32770 so you look for that inside the hWnd of the parent window which you
find by caption), then use API to append your menu onto the existing one (you
can even insert it in fact... this is how menus are built in Windows).

    Finally you use Spyworks to hook the menu and intercept any WM_COMMAND
messages that are sent to it (these fire whenever the mouse is clicked on the
option and when a keyboard command is executed).  When it is clicked your
function will run and execute the VB code.

    Here are some samples I found:
http://neofx.hypermart.net/vb.html - this one is missing a subclassing OCX
(maybe even freeware)
http://www.planetsourcecode.com/xq/ASP/txtCodeId.5566/lngWId.1/qx/vb/scripts/Sho
wCode.htm
the above example can only affect menus in your application's process space.

    Hope that helps.  Sorry I couldn't provide more.

- Chuck

----- Original Message -----
From: "Bob Corn" <bobcorn@i...>
To: "professional vb" <pro_vb@p...>
Sent: Monday, May 14, 2001 10:11 PM
Subject: [pro_vb] RE: Adding Menu Options to 3rd Party App


> Everything that I've seen pretty much says to use the API.   We develop
> solutions using that vendors product and have put a request in for them to
> allow us to do this view cod, but since they are in the midst of
> developing a new version, this request has been put on the back burner.
>
> How would i do it the 'arcane' way?  Do you have an resources that can
> point me in the right direction?
>
> thanks
> =========================
>

  Return to Index