Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Adding and deleting Scheduled Tasks using NetScheduleJob API functions
Custom GDI+ class
Converting Unicode data from the Clipboard to a character string using a given code page
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Enumerating data formats currently available on the clipboard
Winsock: sending email messages (SMTP, port 25)
Detecting changes in connections to removable drives (VFP9)
Custom FTP Class for Visual FoxPro application
How to download a file from the FTP server using FtpGetFile
Splash Screen for the VFP application
Mapping and disconnecting network drives
Custom HttpRequest class (WinINet)
How to activate Windows Calculator
How to convert a bitmap file to monochrome format (1 bpp)
Custom HttpRequest class (WinHTTP)
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
Establishing connection using the SQLDriverConnect
GDI+: copying to the Clipboard (a) image of active FoxPro window/form, (b) image file
Using Font and Text functions
Displaying bitmap using the AlphaBlend function
Using WM_COPYDATA for interprocess communication (VFP9)
Using EnumPrinters function to enumerate locally installed printers
Extensible Storage Engine class library
Programmatically removing submenus from VFP main menu

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Before you begin:
The following code removes all but the last submenus from VFP main menu.

To restore the system menu type SET SYSMENU TO DEFAULT

 
#DEFINE MF_BYPOSITION 0x00000400
DO declare
 
LOCAL hWindow, hMainMenu
 
hWindow = _vfp.hWnd
 
* retrieves a handle to the menu 
* assigned to the specified window
hMainMenu = GetMenu( m.hWindow )
 
IF IsMenu(hMainMenu) = 0
    RETURN
ENDIF
 
LOCAL nItemCount, nItemIndex
 
* determines the number of items in the specified menu
nItemCount = GetMenuItemCount(hMainMenu)
 
* deletes all menu items but the last one
FOR nItemIndex=1 TO nItemCount-1
 
    * deletes 1st menu item
    DeleteMenu( hMainMenu, 0, MF_BYPOSITION )
 
    * application must call the DrawMenuBar 
    * whenever a menu changes
    DrawMenuBar( m.hWindow )
NEXT
* end of main
 
PROCEDURE declare
    DECLARE INTEGER GetMenu IN user32 INTEGER hWindow
    DECLARE INTEGER IsMenu IN user32 INTEGER hMenu
    DECLARE INTEGER GetMenuItemCount IN user32 INTEGER hMenu
    DECLARE INTEGER DrawMenuBar IN user32 INTEGER hWindow
 
    DECLARE INTEGER DeleteMenu IN user32;
        INTEGER hMenu, INTEGER uPosition,;
        INTEGER uFlags
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
986 bytes  
Created: 2002-01-18 19:55:08  
Modified: 2011-02-26 14:56:24  
Visits in 7 days: 128  
Listed functions:
DeleteMenu
DrawMenuBar
GetMenu
GetMenuItemCount
IsMenu
Printer friendly API declarations
Word Index links for this example:
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
User Contributed Notes:
There are no notes on this subject.


Copyright © 2001-2013 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.235.20.17)
4 sec.Example: 'Using mailslots to send messages on the network'
52.37 min.Function: 'GdipGetPropertyItem'
Function group: 'GDI+ Image'
52.42 min.Example: 'Writing to INI file'
Language: 'C#'
2.38 hrs.Example: 'Using the ChooseColor function'
9.19 hrs.Function: 'UrlGetPart'
Function group: 'Shell Lightweight Utility APIs -- Path Functions'
9.2 hrs.Example: 'Pocket PC: base class'
13.96 hrs.Example: 'Retrieving size of a remote file'
 Example: 'How to make the caption of a VFP application flashing in the Windows task bar'
19.71 hrs.
Function group: 'Shell Lightweight Utility APIs -- Path Functions'
22.06 hrs.Example: 'Using Change Notification Objects to monitor changes to the printer or print server'
Google
Advertise here!