Solved

AppendMenu API call

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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

691 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