Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Menu with icons.

44 views
Skip to first unread message

Frank Cheng

unread,
Dec 28, 1997, 3:00:00 AM12/28/97
to

Hi,
I want to make a menu which has icon
next to menu item( just like the start menu in Win95)
What function should I use?
(I am using Delphi 2)
Thanks for helping.

Jason Wallace

unread,
Dec 28, 1997, 3:00:00 AM12/28/97
to

Hundreds of them.... It's NOT a simple project... (E-mail me, and I'll
see if I can still send you part of my code to do it...)
You have to use ownerdrawn menus, which means you have to build them from
scratch... take a look at the hmenu (specifically CreateMenu, AppendMenu,
ModifyMenu and TrackPopupMenu) in the Win32API help file...

--
Jason Wallace
SL Software
Dar...@SLSoftware.reno.nv.us
--
"We are Microsoft. Resistance is Futile. You will be assimilated."


Frank Cheng wrote in message <01bd13a9$3b19f6c0$0ec0020a@default>...

Yorai Aminov

unread,
Dec 28, 1997, 3:00:00 AM12/28/97
to

Frank Cheng <kim...@mail.theonramp.net> wrote in article
<01bd13a9$3b19f6c0$0ec0020a@default>...

> I want to make a menu which has icon
> next to menu item( just like the start menu in Win95)

You need to create an owner drawn menu. To do this, you need to process
WM_MEASUREITEM and WM_DRAWITEM messages in the window that owns the popup
menu. I'm not sure about Delphi 2, but there are enough similarities
between the code in Delphi 1 and 3 to assume this is correct:

Delphi creates an internal list, called PopupList, of all popup menus. They
are all owned by a single window. In the Popup method, Delphi calls
TrackPopupMenu or TrackPopupMenuEx to display the popup menu and assign an
owner window. To be able to handle menu messages, you need to override the
Popup method, assign an owner window you create, and in that window's
message procedure handle the WM_DRAWITEM and WM_MEASUREITEM messages, as
well as reproduce the default processing performed by Delphi.

--
Yorai Aminov
El-On Software Systems
http://ourworld.compuserve.com/homepages/yaminov


Kinetics

unread,
Dec 29, 1997, 3:00:00 AM12/29/97
to

you can also download menus98 (freeware I think) from the Delphi Super Page or
Torry's Delphi page (from memory). It will do all the work for you...you just
worry about finding the icons to fill the glyphs property. I will say I have
had problems getting it to look right playing with icon sizes etc...but after
that it does it works fine.

just an idea =)

Shane Bridges
kinetic1@ix..netcom.com

0 new messages