Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to hide your program from the Close Program dialog (Win9* only)
Obtaining MAC address through Address Resolution Protocol (ARP) request
Opening access to the Microsoft Internet functions for the application
Printing text on the client area of the main VFP window
Terminating all running applications from a VFP program
Using an Event Object. Part A: running an application that creates an Event object
Using GetSysColor
Using the Semaphore object to allow only one instance of VFP application running
Validating the heap of the calling process
How to generate GUID values
Loading a string resource from an executable file
Obtaining OS memory performance information
Retrieveing information about the active window (even if it is not owned by the calling process)
Enumerating Processes -- WinNT
FindText -- the hopeless and useless Common Dialog
How to print picture stored in enhanced-format metafile (*.emf)
Retrieving list of all active RAS connections
Enumerating Processes -- Win9*
How to release and renew a lease on an IP address previously obtained through Dynamic Host Configuration Protocol (DHCP)
Pocket PC: base class
Retrieving information about the specified icon
URL: splitting into its component parts
Using Beep and Sleep functions to make the old tin buzz sing (WinNT only?)
Using the CreateFile
Saying "Hello World!" with VFP and WinAPI

User rating: 8/10 (1 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:
A hello world program is a frequently used programming example, usually designed to show the easiest possible application on a system that can actually do something (i.e. print a line that says "Hello World").


This message is great to start a day with!

 
#DEFINE STD_OUTPUT_HANDLE -11
 
DECLARE INTEGER AllocConsole IN kernel32
DECLARE INTEGER GetConsoleWindow IN kernel32
DECLARE INTEGER GetStdHandle IN kernel32 LONG nStdHandle
 
DECLARE INTEGER ShowWindow IN user32 AS ShowWindowA;
    INTEGER hWindow, INTEGER nCmdShow
 
DECLARE INTEGER WriteConsole IN kernel32;
    INTEGER hConsoleOutput, STRING @lpBuffer,;
    INTEGER nCharsToWrite, INTEGER lpCharsWritten,;
    INTEGER lpReserved
 
= AllocConsole()
= ShowWindowA(GetConsoleWindow(), 1)
= WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), "Hello World!", 12,0,0)
 
 
 

User rating: 8/10 (1 votes)
Rate this code sample:
  • ~
565 bytes  
Created: 2001-08-24 12:00:00  
Modified: 2006-05-19 09:20:21  
Visits in 7 days: 64  
Listed functions:
AllocConsole
GetConsoleWindow
GetStdHandle
ShowWindow
WriteConsole
Printer friendly API declarations
My comment:
   The original hello-world program in the Windows 1.0 SDK was a bit of a scandal. HELLO.C was about 150 lines long, and the HELLO.RC resource script had another 20 or so more lines. (...) Veteran C programmers often curled up in horror or laughter when encountering the Windows hello-world program.

— Charles Petzold, Programming Microsoft Windows with C#

* * *
What could be easier of that?
? "Hello World!"

or this
DEFINE WINDOW helloworld FROM 10,10 TO 20,50 SYSTEM CLOSE
ACTIVATE WINDOW helloworld
? "Hello World!"

* * *
Find more than 20 different ways of saying Hello World on FoxPro Wiki.
Read about Hello World program in Wikipedia.
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 (107.21.186.38)
20.43 min.Example: 'Accessing examples contained in this reference from a VFP application'
20.5 min.Example: 'Confining Windows calculator inside the VFP main window'
33.73 min.Function: 'CeRegDeleteValue'
33.77 min.Example: 'Printing Image File, programmatically set print page orientation to landscape'
3.59 hrs.Example: 'How to print a bitmap file'
 Function: 'JetRollback'
Function group: 'Extensible Storage Engine (ESE, Jet Blue)'
9.77 hrs.Example: 'Retrieving window and menu help context identifiers'
 Example: 'Using File Mapping for enumerating files opened by Visual FoxPro'
13.05 hrs.Example: 'Writing to INI file'
 Function: 'RegDeleteValue'
Google
Advertise here!