Microsoft KB Archive/155847

= How To Activate a System Menu Item in Visual FoxPro 5.0 =

Article ID: 155847

Article Last Modified on 6/29/2004

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q155847



SUMMARY
The SYS(1500) function allows you to gain access and activate a specific system menu item. However, the SYS(1500) function does not work with user defined menu items.



MORE INFORMATION
The SYS(1500) function allows you to call the functionality of system menu options from within your programs. Unfortunately, if the specific menus are not active or if SYSMENU is OFF, SYS(1500) does not work.

The following example uses SYS(1500) to paste a command into a program file. Place the following code into a program file: _CLIPTEXT = "MESSAGEBOX([ASCII 145]TEST[ASCII 146])" && Command to paste MODIFY COMMAND myprog NOWAIT && Open a program file =SYS(1500, '_MED_PASTE', '_MEDIT') && Paste menu item Compile the program file and execute the .fxp file. The program creates a file called Myprog that contains "MESSAGEBOX('TEST')."

