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:
01528164
Vues:
109
You have to call FreeConsole() to release the console - after that you should be able to close the window.

+++ Rick ---

>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)
>
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform