Using Win32 functions in Visual FoxPro Image Gallery
Console
..msdn
AllocConsole
FillConsoleOutputAttribute
FillConsoleOutputCharacter
FreeConsole
GetConsoleScreenBufferInfo
GetConsoleWindow
GetStdHandle
ReadConsole
SetConsoleCursorPosition
SetConsoleTextAttribute
SetConsoleTitle
WriteConsole
Code examples:
Creating a console window for Visual FoxPro application
Saying "Hello World!" with VFP and WinAPI
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: 99  
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-2018 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.6.39), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (23.22.240.119)
2 sec.Function: 'PathGetShortPath'
Function group: 'Shell Lightweight Utility APIs -- Path Functions'
4 sec.Function: 'CreateStreamOnHGlobal'
Function group: 'COM'
6 sec.Function: 'gethostbyaddr'
Function group: 'Windows Sockets 2 (Winsock)'
13 sec.Function: 'GetMonitorCapabilities'
Function group: 'Monitor Configuration (Vista)'
14 sec.Function: 'socket'
Function group: 'Windows Sockets 2 (Winsock)'
17 sec.Function: 'AVIStreamTimeToSample'
Function group: 'Windows Multimedia'
19 sec.Function: 'InternetAttemptConnect'
Function group: 'Internet Functions (WinInet)'
21 sec.Function: 'InternetOpenUrl'
Function group: 'Internet Functions (WinInet)'
22 sec.Function: 'WNetAddConnection'
Function group: 'Windows Networking'
24 sec.Function: 'WNetGetLastError'
Function group: 'Windows Networking'
Google
Advertise here!