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
Creating a console window for Visual FoxPro application

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
Versions:
click to open
Before you begin:
The following code explains how to create and use console (DOS-like) window with Visual FoxPro application.



See also:
  • Running MSDOS Shell as a child process with redirected input and output (smarter RUN command)
  • Running external applications from VFP using WinExec
  • Using ShellExecute for performing operations on files
  • Running external applications from VFP using CreateProcess
  • Running an external program from FoxPro and waiting for its termination
  •  
      Members area. Log in to view this example.
     
      User name:
      Password:
     
     
      Forgot your password?
     
      Sign up for
    the Membership
     
     


    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    4578 bytes  
    Created: 2004-11-09 21:04:19  
    Modified: 2011-12-10 09:20:22  
    Visits in 7 days: 150  
    Listed functions:
    AllocConsole
    CloseHandle
    FillConsoleOutputAttribute
    FillConsoleOutputCharacter
    FreeConsole
    GetConsoleScreenBufferInfo
    GetConsoleWindow
    GetLastError
    GetStdHandle
    ReadConsole
    SetConsoleCursorPosition
    SetConsoleTextAttribute
    SetConsoleTitle
    SetForegroundWindow
    ShowWindow
    WriteConsole
    Printer friendly API declarations
    My comment:
    Unsolved issues:

  • the closing of opened console window automatically closes the whole FoxPro session; the SetWindowLong can not change attributes for the console window (error=5, access denied);

  • main FoxPro window stops redrawing itself after a console window is created.

    And of course, the main unsolved issue is finding a practicality in console windows.

    * * *
    I noticed that in VFP6 the code works a bit different -- methods ClearScreen and SetCursorPos. You may try to declare and call SetConsoleCursorPosition with just two parameters -- INTEGER and @STRING -- instead of INTEGER, SHORT, SHORT.
  • 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:
    Emerson Reed | 2013-06-07 10:22:05
    I'm receiving a "Declare DLL call caused an exception." error in the following line:
    = FillConsoleOutputCharacter(THIS.hStdout, 32,;
        nBufsize, 0,0,0)
    Please, could you take a look at it?
    I'm using VFP 9 and Windows 7 Professional (32 bits).

    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 (50.16.132.180)
    3 sec.Example: 'Converting a hexadecimal string to an integer'
    7 sec.Example: 'Retrieving graphic capabilities of your display'
    Google
    Advertise here!