Solved

AppendMenu API call

Posted on 1998-04-07
1
371 Views
Last Modified: 2010-08-05
How do I use the AppendMenu call within Delphi?
Source code or example would be good.
I'm trying to add a menu into Outlook using API calls.
Also how would I go about finding all the menu ID's of existing menus in outlook.
0
Comment
Question by:JazC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
pjdb earned 100 total points
ID: 1361329
Drop a popupmenu on your from and anme the first item "test" then put the folowwing code in the oncreate event of the form. It will add a separator and the item test from the popupmenu.

var
  temp:array[0..20]of char;
begin
      AppendMenu(GetSystemMenu(Handle, FALSE), MF_SEPARATOR, 0, '');
      strpcopy(@temp, test.caption);
      AppendMenu(GetSystemMenu(Handle, FALSE), MF_STRING, test.Handle, @temp);
end;

to manage the event on this menu you need to add in the public declaration part of the form :
procedure onwm_syscommand (var msg: Tmessage); message wm_syscommand;

procedure Tmyformi.onwm_syscommand(var msg:Tmessage);
begin
      if msg.wparam=test.Handle then
      begin
            {your stuff}
      end;
      inherited;
end;

JDB
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question