Solved

AppendMenu API call

Posted on 1998-04-07
1
343 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now