Board index » cppbuilder » System Menu

System Menu


2005-04-22 08:58:01 PM
cppbuilder19
First of all: sorry that I am posting to the "wrong" group, but I am a
beginner using the Borland Builder,
and I am not sure shich NG to select.
Maybe someone can help me anyway:
Is it possible to access the System Menu of a VCL-Application/Form?
If yes, how can I do that?
Background is that I would like to add an item to it.
Thanks and
--
Best regards, Pi (Ralf Pichocki).
 
 

Re:System Menu

Quote
First of all: sorry that I am posting to the "wrong" group,
but I am a beginner using the Borland Builder,
and I am not sure shich NG to select.

Is it possible to access the System Menu of a
VCL-Application/Form?
If yes, how can I do that?

Background is that I would like to add an item to it.
The proper NG would be .nativeapi because
GetSystemMenu/InsertMenuItem is what you need.
Example:
MENUITEMINFO mii;
HMENU SM = GetSystemMenu(Handle, false);
ZeroMemory(&mii, sizeof(MENUITEMINFO));
mii.cbSize = sizeof(MENUITEMINFO);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
mii.dwTypeData = "*** MY MENU ***";
mii.cch = strlen(mii.dwTypeData);
InsertMenuItem(SM, 0, 1, &mii);
Check all the details in MSDN.
HTH,
Steve.
 

Re:System Menu

"Ralf Pichocki" < XXXX@XXXXX.COM >wrote in message
Quote
I am not sure shich NG to select.
When in doubt, ask in the .non-technical group which group is appropriate
for you to direct your questions to.
Quote
Is it possible to access the System Menu of a VCL-Application/Form?
Of course.
Quote
If yes, how can I do that?
You need to use the Win32 API functions directly. Look at GetSystemMenu()
and related functions.
Quote
Background is that I would like to add an item to it.
Look at InsertMenuItem() and SetMenuItemInfo().
Gambit
 

{smallsort}