Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FoxPro writing to Windows Console
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
01528144
Message ID:
01528157
Vues:
89
J'aime (1)
This one is even simpler. But a console window cannot be closed gracefully. I have not checked for a solution yet.
* Using Win32 Functions in Visual FoxPro
* example=119
* Saying "Hello World!" with VFP and WinAPI


#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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform