GUI ScreenIO for Windows

Calling Windows APIs

GUI ScreenIO includes an entry point that you can use to access some of the more useful Windows APIs, without requiring a Windows SDK (Software Developer's Kit) or any detailed knowledge about Windows programming. 

All you need to do is to load the required parameters, set the 88-item of the desired API to TRUE (does that sound familiar?), and call GSWINAPI.  

We provide copybooks for each API that we support, and the copybook comments usually give you all the instructions that you'll need. 

 For example, here's how you obtain the Windows directory using the GetWindowsDirectory API:

* -------------------: Set size of the buffer that will
*                    : receive the Windows directory. 
* -------------------: Call the API to get the directory.
* -------------------: If function failed,
*                    : display the error message.
       MOVE WIN32API-ERROR-TEXT TO my-error-message
       do whatever to display my-error-message.


Client Server

When you run your applications under the Client/Server, some APIs will behave differently.  By and large these APIs are designed to just do the most natural thing automatically without you having to think about it. 

There are three different types of APIs with regard to Client/Server use.

  1. Some APIs ALWAYS run on the server.
  2. Some APIs are selectable to run on the client or the server.
  3. Some APIs ALWAYS run on the client.

For a complete list, see the WIN32API.COB COPYBOOK.

You can select where the API should run for the second set of APIs (above) by setting a switch which appears in the WIN32API  copybook.  (The default for this second set is to run on the client).  Setting the switch named WIN32API-EXECUTE-API-ON-SERVER to true will force server side execution.  

NOTE: This switch is ignored when NOT running under the Client/Server, and all APIs will run on the current machine (obviously).  This means you can produce ONE version of your application which will work stand-alone or on the server and do not have to make two versions.


Copy the WIN32API copybook to my system.  This copybook is need for all APIs.

Low-level Functions

This group of functions essentially provides you direct access to the API involved. 

Windows API Description
ChooseColor Standard Windows common dialog to choose a color.

Note: This is provided in support of printing applications only and you may not use this to change colors of controls appearing on your panels

ChooseFont Standard Windows common dialog used to select a font.

Note: This is provided in support of printing applications only and you may not use this to change fonts of controls appearing on your panels

CopyFile Copies files using the Windows API. 

To copy a file from a client to the server, use CopyFileFromClient.
CreateDirectory Creates a directory (and any needed higher level directories).  
DriveToUNC Return a UNC for a Drive letter based file.
GetOpenFileName Windows common dialog to obtain the name and location of a file to be opened.  
GetCommandLine Gets the command line of the currently executing application, including the complete path, drive, directory and exe name followed by command line arguments.
GetComputerName Gets the name of the computer
GetLogicalDrives Obtain a list of Valid Drive letters
GetUserName Gets the name of the logged in user
GetEvnironmentalVariable Gets the value of an environmental variable
SetEnvironmentalVariable Sets the value of an environmental variable (temporarily)
GetFileTime Gets the time the specified file was created, last accessed, and last modified.  This has been enhanced to provide the times in both Windows FILETIME and SYSTEMTIME formats.
GetPrinters Obtains a list of printers known to the machine, including the default printer.  Can be uses to obtain a list of printers on either the server or the client machine
GetSaveFileName Windows common dialog to obtain the name and location of a file to be saved; usually used in conjunction with a SaveAs command.  
GetSystemTime Determines the System time in UTC format used by Windows.
GetVersionEx Returns Windows version information.   
GetWindowsDirectory Returns the pathspec of the Windows directory.   
GetFolderPath Returns the pathspec of various Windows Directoryies
LowerCase Converts a data element to Lower Case
QueryDOSDevice Get a list of all DOS Devices or find out if a particular device exists and if it is mapped to a remote location
UpperCase Converts a data element to Upper Case
SimulateKeys Insert keystrokes into the keyboard buffer
KeyState Test the state of toggle keys or shift keys
PlaySound Plays a sound specified by a given filename.
PrintDLG Invokes the Standard Windows Printer Dialog box to allow choosing a printer
This series of low level Print APIs are made available to replace APIs of similar names provided by some compiler manufacturers.  This set is Client/Server aware and can be uses to send any print data to a printer.


You may want to investigate our PrinteFile API below for easier programming.

MessageBox Displays a standard messagebox (the hard way).  We don't recommend this because it's MUCH easier to do it this way.   
ShellExecute Given a filespec, launches the application associated with the file's type and passes it the filespec and other arguments. 
WinExec Launches an application and returns to your program.
Window-Position Allows you to adjust the Z-Order (stacking) or position of windows on the screen

High-level Functions

The following group of functions provide API functionality in a simplified format.  Most of these would normally require several low-level API calls and advanced knowledge of windows internals; we have encapsulated the functionality in a high-level wrapper to make these operations easier to use.

Function Set Description
BITS-TO-BYTES Converts an array of Bit flags into Bytes.  8 bits per byte.
BYTES-TO-BITS Extracts and array of bit flags from one or more bytes.  
Clipboard Functions Customized GUI ScreenIO functions that make it easy to save and retrieve data from the Windows clipboard.   
CopyFileFromClient Copies files from a client to the server if running in client/server mode, else performs CopyFile.
FindFile Finds files and retrieves date time and size
PrintFile Send a file to the Windows printer spooling system.  Works also in Client/Server mode to transmit print files from the server to the client, and then to the client's printer.
PrintScreen Sends a screen image of a given panel to the printer.  Also works in Client Server mode. Will also print entire desktop if desired.
Registry Functions Customized GUI ScreenIO functions that make it a breeze to save and retrieve data from the Windows Registry.
INI File Functions Allows use of the INI file manipulation routines. which allows you to store and access program data in standard windows .ini files.
BrowseForFolder Allows you to browse for folders (directories) rather than files.
SENDMAIL Allows you to send email from your programs via a standard SMTP server.
GETWEBPAGE Used to fetch a web page, web image, or other data from a web server.  This is NOT a web browser, but a simple file-fetching utility.

More APIs will be implemented as we perceive the need.  Suggestions are appreciated!

2000-2019 Norcom, all rights reserved 


Send feedback to Norcom