Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Custom GDI+ class
Capturing keyboard activity of another application with the Raw Input API (VFP9)
How to print a bitmap file
Winsock: sending email messages (SMTP, port 25)
System Image List Viewer
Using the LoadImage function to have a bitmap file loaded and displayed on VFP main window
Printing Image File, programmatically set print page orientation to landscape
How to display Windows On-Screen Keyboard
Creating the Save dialog box to specify the drive, directory, and name of a file to save
How to convert a bitmap file to monochrome format (1 bpp)
Using EnumPrinters function to enumerate locally installed printers
Custom HttpRequest class (WinHTTP)
The window and its ancestors
Drawing Windows predefined bitmaps using the LoadBitmap functions
How to download a file from the FTP server using FtpGetFile
Custom FTP Class for Visual FoxPro application
Mapping and disconnecting network drives
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
Using FoxTray ActiveX control: System Tray Icon and menu attached to VFP form
Displaying the associated icons and descriptions for files and folders
How to activate Windows Calculator
Sending email messages with Simple MAPI
Displaying icons in the system tray (VFP9)
How to hide your program from the Close Program dialog (Win9* only)

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:
In numerous Tips-and-Tricks pages on the Internet for VB, Delphi, and C this little one is an old-timer. Now is the time to "port" it to the FoxPro.
 
DO decl
#DEFINE RSP_SIMPLE_SERVICE      1  && hide
#DEFINE RSP_UNREGISTER_SERVICE  0  && show
 
LOCAL lnProcessId
lnProcessId = GetCurrentProcessId()
 
* hide by registering as a service mode program
= RegisterServiceProcess (lnProcessId, RSP_SIMPLE_SERVICE)
 
* show 
*= RegisterServiceProcess (lnProcessId, RSP_UNREGISTER_SERVICE)
 
PROCEDURE  decl
    DECLARE INTEGER GetCurrentProcessId IN kernel32
    DECLARE INTEGER RegisterServiceProcess IN kernel32;
        INTEGER dwProcessId, INTEGER dwType
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
504 bytes  
Created: 2002-02-15 08:53:00  
Modified: 2008-12-03 15:26:21  
Visits in 7 days: 81  
Listed functions:
GetCurrentProcessId
RegisterServiceProcess
Printer friendly API declarations
My comment:
Registering your application as a service mode program removes it from the Task List in Win95/98/Me. That means it cannot be so easily aborted by an advanced user who already mastered the magic triple-key forcer.

It is recommended to restore the regular mode (Simple Service) for your application before closing it, to let it free its system resources in a proper way.

The RegisterServiceProcess is a documented function in KERNEL32 library. Though MSDN doesnt indicate this particular result of calling it.

Here in VFP we are not much spoiled with header files as those guys with C are. Whichever external function is, it has to be declared directly in VFP code. Differently in C the RegisterServiceProcess function is not prototyped in header files. That is why they have to resort to LoadLibrary and GetProcAddress functions at first.
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.242.191.65)
8 sec.Example: 'Reading parameters of streams in AVI file'
6.77 min.Function: 'SetVolumeMountPoint'
Function group: 'File System'
6.82 min.Function: 'IsWellKnownSid'
Function group: 'Security'
6.87 min.Example: 'Drawing Windows frame controls using the DrawFrameControl function'
Google
Advertise here!