Vote for this Product at ClarionShop

CapeSoft
WinEvent
Version 2.7
(c) 2000 by Custom Business Software cc
www.capesoft.com
Updated Saturday 12 August 2000


Contents

Introduction
The Usual Legal Stuff
Installation
How to read this manual
Example Program
WinAlert Functions
Comms Functions (Some New)
Taskbar Functions (Changed)
Window
Behavior Functions
Windows System Functions (Some New)
Reference Section


Introduction

Welcome to WinEvent. This small library package allows you to leverage the power of Windows 3.11, Windows 95, and the Win32 API. In addition to the WinAlert functions (which allow you access to the native Windows messages) there are also now Comms (Rs232) functions, Taskbar functions and Windows Behavior & System functions.

All the functionality provided in WinEvent is built into Windows itself in one way or another. The main advantage of WinEvent is two fold.

1) It provides the functions in a simple easy-to-use manner, avoiding the complexities of the Windows API.
2) The functions are (mostly) cross-compatible between 16 and 32 bit implementations of your program. The Taskbar functions and some advanced comms functions are only available in 32 bit programs, but all the other functions are the same in 16 and 32 bit programs.

WinEvent functionality is divided into 5 areas:

1) Windows message capturing functions (WinAlert)

WinAlert allows your CW programs more access to the native Window messages. This is in itself nothing new. Using the sub-classing technique access to the Windows messages has been available since almost the first days of CW.

WinAlert provides a simple wrapper to subclassing, which removes the complexities and makes the code both simple to follow, easy to implement, and consistent with the rest of the Clarion language. In essence one new major function, and a couple of support functions allow the flexibility and ease of use that we've come to expect from Clarion.

In addition it comes with a template that makes adding this wrapper to your applications even easier. You can use the template to alert messages on individual windows. In addition a utility template makes it possible to enable Auto Shut Down across your entire application.
2) RS 232 Port functions

Very often developers need simple access to a Comms port. This simple functionality is built into the Windows API, but is quite complex ad difficult to code. In addition to this the APIs for 16 bit and 32 bit Windows are very different. The Comms section of the WinEvent package provides some simple easy-to-use functions that allow you to read and write to comms ports. In addition almost all the functions are the same in 16 and 32 bit ( the library takes care of the API differences ) so it's easier to move from one platform to another. The library also corrects a bug in the Windows functions that affect comms at speeds of greater than 19200. Some advanced functions to test specific hardware handshaking lines for their current status are only supported in 32 bit as no 16 bit equivalent exists.
3) Taskbar functions

Users of Windows 95, and Windows NT 4.0, will be familiar with the Taskbar that usually sits at the bottom of the screen. The taskbar functions allow you to add / change and delete an icon from the "Tray" ( the area at the right hand side of the taskbar ) as well as detect when the mouse has been clicked on an icon in the tray. This is very useful for apps which are running in the background on a full time basis. In addition, you can make use of a function that prevents your program from appearing on the main area of the Taskbar itself.
4) Window behavior functions

A small group of functions that allow you to change the behavior of a window. This includes the ability to make a window permanently "on top", and also the ability to bring the window to the front.
5) System functions

These functions return system information to your application. The Windows, and Dos (if applicable) version numbers are available to your application. Also you are able to get the current free disk space in 16 and 32 bit. This is useful for detecting low disk space conditions before they occur. A function for playing a wav file is also included.

The Usual Legal Stuff

WinEvent is copyrighted 1996, 1999 by Custom Business Software cc . It is distributed as ShareWare. Registration costs US$30 and includes a copy of the 32 bit version, as well as slightly more functionality. The taskbar functions and some of the advanced comms functions are only available in the 32 bit version.

If you continue to use WinEvent in your applications, after an initial trial period of 30 days, then you must register it. Custom Business Software assumes no responsibility for applications created which incorporate WinEvent. WinEvent is used entirely at your own risk. You may not distribute any of the WinEvent files except Nuclear.Dll.

We welcome your comments, suggestions, and
criticisms. Please do not hesitate to contact us if you have a problem, or a suggestion. (And DEFINITELY don't hesitate to contact us regarding payment !!)

You can contact CapeSoft in one of the following ways:

CapeSoft Support

Email: support@capesoft.com
Telephone: +27 21 705 8584
Fax: +27 21 705 8587
Post: PO Box 511, Plumstead, 7801, South Africa

WinEvent may be purchased from:

CapeSoft Sales

Web www.capesoft.com
Email sales@capesoft.com
Telephone: +27 21 705 8584
Fax: +27 21 705 8587
Post: PO Box 511, Plumstead, 7801, South Africa

ClarionShop

Web    Buy now at ClarionShop
www.clarionshop.com     
 

Installation

To install WinEvent run the supplied installation file.


Distribution

In 16-bit mode you will need to distribute the NUCLEAR.DLL (which is installed into your \Clarion\3rdParty\Bin directory) with your application.

In 32-bit mode no additional files are required for shipping.


How To Read this Manual

This manual is split into two sections. This first section contains a general overview of the WinEvent features. Each of the WinEvent function areas is dealt with and the templates provided are discussed here.

The second section is the Technical Reference. In this section the individual functions are described, along with their syntax. This is particularly useful as most of these functions are designed to be used in simple embed points etc.


Example Program

Included in the WinEvent package is a simple example program that demonstrates all of WinEvents features. This example is in the \Clarion\3rdParty\Examples\Winevent\Windemo directory and is called WinDemo.

There is also an example of a barcode collector program. This is stored in \Clarion\3rdParty\Examples\Winevent\Barcode


WinAlert Functions

The Concept

First some terminology. An Event is the Clarion word for a message that is provided to you via the ACCEPT loop. A Message is the Windows equivalent. Part of the job of the Accept command is to filter out many of these Messages, and pass on only those Events that are usually required.

The idea is to use a new function, called WinAlert in the same way you would use the Alert function for keystrokes. This allows you to get at the messages before the Accept command does, taking further action where it is required. In addition to simply spotting the message, you can also specify its action at the same time. Some messages require an immediate reply (usually True or False) to the procedure that sent the message. However most messages would be required simply so that you can gain more control over the things that are happening. In this case a user event, is posted to the Accept loop, after storing the value of the Message.

To further complicate the issue Messages can also have additional data tagged on with them. This data is stored in 2 variables, often going by the somewhat cryptic names of wParam and lParam. The w and l represent the data type (w for Word -ie a Short and l for Long). On receiving the User event, WinMessageEvent you can use 2 new support functions, WinParam1() and WinParam2() to get the values of these parameters when the message arrived, as well as the WinEvent() function to see which windows message triggered the event.

The Classic Example

One of the most frequently asked questions on the Internet's cw-talk mailing list, is "How do I get my application to terminate automatically when the user shuts down Windows ?" Using WinEvent the answer is both simple and elegant.

Using the Template

Run the WinEvent utility template, "Add Auto Shut Down" by choosing Template Utility from the application menu.

Using Code

You simply add the following line of code in the "After Opening Window" embed of your window.

WinAlert(WM_QueryEndSession,,Return1)

And the following in the "Before Closing Window" embed.

WinAlert()

Note that you need to add these lines to all windows that may be open at the time that Windows is shut down. If a window without this code is open, and has the focus, then the application will not shut down.

For those that care

Basically when you ask Windows to shut itself down it polls each running application by sending it the WM_QueryEndSession message. If all the applications respond by returning True, then they are each, in turn, instructed to close. In the above line of code you are telling the WinEvent library, that when the window receives this message, then it must return True. The utility template automatically adds an instance of the WinEvent extension template to each of your procedures.

Using WinAlert in Applications

The WinEvent extension template, which is included, assist's you in using the WinAlert functions. It organizes in one place the three items that are required, namely Alerting the message, handling any action that may be required, and unAlerting the message before closing the window. The template leads you through the options that you have, and provides you with the required embed point for processing the WinMessageEvent. You may alert as many Windows messages as you like.

Using WinAlert in a Hand Coded Project

This details how to add WinAlert functionality to a hand-coded project. For a detailed description of each of the functions, see the Reference section of this document.

Adding WinAlert to a function

1) Use the WinAlert function to alert the message. This should be called before the Accept command, but after the window is opened.
2) Use the WinAlert function, with no parameters, before Closing the window.
3) Use the WinEvent, WinControl, WinParam1 and WinParam2 functions to examine the message.


Enabling WinAlert in the root module

1) Include the (supplied in \clarion4\libsrc ) map file, EventMap.Clw, in your Global Map.
2) Include the (supplied in \clarion4\libsrc ) equates file, EventEqu.Clw in your main module's data section.
3) Add the Event416.Lib or Event432.Lib file to your project for Stand-Alone compile mode or EvLib416.Lib / EvLib432.Lib for Local compiles. All these library files are in your \clarion4\lib directory.

Comms Functions


Using Comms functions in an Application

Add the Enable WinEvent Functions extension template to your Global extensions.

Using Comms functions in a Hand Coded Project

1) Include the (supplied in \Clarion4\libsrc ) map file, EventMap.Clw, in your Global Map.
2) Add the Event416.Lib or Event432.Lib file to your project for Stand-Alone compile mode or EvLib416.Lib / EvLib432.Lib for Local compiles. All these library files are in your \Clarion4\Lib directory.

Functions supplied

Newport
ReadPort
WritePort
ResetPort
ClosePort
KillAllPorts
SetHandShake
CtsHigh (32 bit only)
DsrHigh (32 bit only)
RingHigh (32 bit only)
CdHigh (32 bit only)
SetRts (32 bit only)
SetDtr (32 bit only)


For a detailed description of each of the functions, see the reference section.


Taskbar Functions

There are a number of Taskbar functions which allow your application to interact with the Windows 95 Taskbar. These functions allow you to add icons to the Taskbar's tray, and also allow you to prevent your application from appearing on the taskbar.

Functions supplied

WinTaskbarAddIcon (32 bit only)
WinTaskbarChangeIcon (32 bit only)
WinTaskbarRemoveIcon (32 bit only)
WinNotOnTaskbar (32 bit only)

For a detailed description of each of the functions, see the reference section.

Template Supplied

An Extension template has been provided to add an icon to the tray. This icon will automatically be put in the tray when the window is opened, and automatically removed when the window is closed. You can also use the functions in hand code to add, change and remove icons at will.

There is also an extension template called WinNotOnTaskBar which does the necessary procedure calls to ensure that your window doesn't appear on the Taskbars main area. Only windows that normally appear on the taskbar (ie normally your frame window) are affected by this template.

Changed : If you place an Icon in the tray, then you will also probably want to capture mouse events when the user interacts with this icon. In WinEvent this is done automatically for you. The template also takes care of all the details - there are embed points so you can add your code for the event, and there are buttons on the AddIcon template to easily get to those embed points.

If you have hand-coded handling these events then you should be aware that the method has changed and your old code will no longer work. In the past the event came through as WinMessageEvent. This has been changed - the mouse events are now separated and come through as WinMessageEvent+500+x where x is 512 (mouse move) or 513(mouse left down) or 514(mouse left up) or 515(double left click) or 516(mouse right down) or 517(mouse right up).

Note : The message is ultimately processed by the Accept command. If your program spends a long time processing between calls to the Accept loop then you may notice a delay between clicking on the Icon, and the execution of your embedded code. For better responses make sure your program frequently returns to the Accept command.


Window Behavior Functions

Functions Supplied

WinOnTop
WinNotOnTop
WinBringToFront

For a detailed description of each of the functions, see the reference section.


Windows System Functions

Functions Supplied

WindowsVersion
WindowsRelease
DosVersion
DosRelease
GetFreeDiskSpace
GetDiskSpace (NEW)
Sound

For a detailed description of each of the functions, see the reference section.


Reference Guide

WinAlert functions

WinAlert
WinEvent
WinControl
WinParam1
WinParam2

WinChangeUserEvent

Comms Functions

NewPort
ResetPort
ClosePort
KillAllPorts
WritePort
ReadPort
SetHandShake
CtsHigh
DsrHigh
RingHigh
CdHigh
SetRts (NEW)
SetDtr (NEW)

Taskbar Functions

WinTaskBarAddIcon
WinTaskBarRemoveIcon
WinTaskBarChangeIcon
WinNotOnTaskBar

Windows Behavior Functions

WinOnTop
WinNotOnTop
WinBringToFront

Windows System Functions

WindowsVersion
WindowsRelease
DosVersion
DosRelease
GetFreeDiskSpace
GetDiskSpace (NEW)
Sound

_____________________________________________________

WinAlert(<FromMessage>, <ToMessage>, <Action> )
_____________________________________________________
Parameters
FromMessage short
The [first] Windows message to alert.

ToMessage short
The last Windows message to alert. If this parameter is omitted then only the FromMessage is alerted.

Action short
This defines the action required when the alerted message(s) are received. If this parameter is omitted then it defaults to PostUser + PassOn.

Purpose
This function works in a very similar way to the normal Clarion ALERT function. Where the ALERT function traps keystrokes, the WINALERT function traps Windows Messages.
However in addition to merely spotting the messages you can also specify the action required when the message comes along. The messages are automatically trapped for the current window. In other words you must open the Window before alerting the Windows messages for that window.

NOTE :: If all three parameters are omitted then the WinAlerts for that window are removed. This must be done before closing a window if any messages were alerted for that window.

The actions are split into two groups, and a single action from each group (ie up to 2 actions) are allowed. The actions are as follows.

Group 1
Equate        Meaning
Return0     : Return 0 to the function that sent the message.
Return1     : Return 1 to the function that sent the message.
PassOn     : Pass the message on to the Clarion window for processing.

Group 2
Equate        Meaning
PostUser     : Post a User Event to the Accept loop.
PostClarion     : Post an equivalent Clarion Event (if the is one) to the Accept loop. This action is only available in the registered version of the library.

NOTE : The PostClarion action is only available in the registered version of WinEvent.

Depending on the message, and the effect you require, the above options should cater for all eventualities. The only case where additional coding would be necessary would be when the action includes PostUser. This posts a user event (usually 500h, but can be changed) to the Accept loop. On receiving this event you can then call the function WINEVENT() to determine the actual event. WINEVENT is described more fully below, but behaves
essentially the same as the regular Clarion EVENT() function.

Complication
If more than one Windows message is alerted, and both alerted messages are received in close succession, then WinEvent() returns only the last received of the messages. It should be noted here, that this applies only to alerted messages. Unalerted messages (and there are plenty of those) have no effect whatsoever.

Returns
Nothing

Example
  code
  open(window)
  WinAlert(WM_QueryEndSession,Return0)
  !!! All the normal processing goes here
  WinAlert() ! DONT FORGET THIS !!!!!
  Close(Window)

See Also
WinChangeUserEvent () : To change the User event posted back to your App.
____________________________________________________

WinEvent(), WinControl(), WinParam1(), WinParam2()
_____________________________________________________

Parameters
None

Purpose
The WinEvent function is used when a User Event is received to determine which Windows message caused the event. It is not cleared after use and remains available until the next Alerted Windows message is received. The WinParam1 and WinParam2 functions return the windows parameters for that message. The WinControl function returns the handle of the specific window that received the message. You can then use this handle to check which control received the event.

Complication
If more than one Windows message is alerted, and both alerted messages are received in close succession, then WinEvent() returns only the last received of the messages.

Returns
The last alerted Windows message received, and the parameters that went with it.

Example
  code
  alert
  case Event()
  of WinMessageEvent
    case WinEvent()
    of WM_MouseMove
      ! something goes here can also use WinParam1() and WinParam2() here.
    end
  end

See Also
WinAlert : For alerting windows messages
WinParam1 : To get the 1st message parameter.
WinParam2 : To get the 2nd windows parameter.
_____________________________________________________

WinChangeUserEvent (WinMessageEvent)
_____________________________________________________

Parameters
WinMessageEvent short
The Event to post when an alerted windows message is received.

Purpose
WinMessageEvent is an equate defined in the WM.CLW file. If you want to change it from it's default value of 500h then change it in this file, and call the WinChangeUser function early in your application. Once changed it remains changed for all alerted windows messages

Returns
Nothing

Example
  code
  WinChangeUser(WinMessageEvent)
_____________________________________________________

NewPort (mode string, <in buffer size>, <out buffer size>)
_____________________________________________________

Purpose
Opens a port for sending or receiving.

Parameters
mode ( string ) : This is a mode string such as would be accepted by the Dos MODE
command.

in buffer size (long) ( optional parameter - default 512 bytes )
out buffer size (long) ( optional parameter - default 512 bytes )
These are the sizes Windows must use for the In and Out buffers.

Note that in 32 bit mode these buffers are ignored. 32 bit communications under Windows
makes use of a different method to 16 bit comms, and the buffer sizes are not necessary.

Returns : Long
< 0 if an error has
occurred. Otherwise a port number used by readport and writeport.

Examples
    PortId = NewPort('Com1:9600,n,8,1')
    PortId = NewPort('Com2:9600,n,8,1',1024)
    PortId = NewPort('Com3:9600,n,8,1',1024,1024)
_____________________________________________________

ResetPort (mode string)
_____________________________________________________

Purpose
Resets the parameters for a port while the port is open. Note that this function can only be called for a port that has already been opened using the NewPort command.

Parameters
mode (string) This is a mode string such as would be accepted by the Dos MODE command.

Returns : long
< 0 if an error
occurred. Otherwise 0.

Example
  result = ResetPort('Com1:9600,n,8,1')
_____________________________________________________

ClosePort (PortId long)
_____________________________________________________

Purpose
Closes a port so it can be used by another program.

Parameters
PortId (long) This is the port number as returned by the NewPort function.

Returns : long
Nothing

Example
  pid = NewPort ('Com1:9600,n,8,1')
  ! some code goes here
  ClosePort(Pid)
_____________________________________________________

KillAllPorts ( )
_____________________________________________________

Purpose
Closes all open ports.

Returns
Nothing

Example
  KillAllPorts()

_____________________________________________________

WritePort (PortId long, String string, Length long)
_____________________________________________________

Purpose
Writes a string into the transmission buffer.

Parameters
PortId (long) This is the port number as returned by the NewPort function.

String (string) This is the string to send.

Length (long) This is the number of bytes to send. If 0 then the string is clipped and sent.

Returns : long
< 0 if an error. Otherwise number of bytes sent.

Example
    pid = NewPort ('Com1:9600,n,8,1')
    buf = 'abcdefghij'
    bytessent = WritePort(pid,buf,10)

_____________________________________________________

ReadPort (PortId long, String string, Length long)
_____________________________________________________

Purpose
Read bytes out of the receive buffer.

Parameters
PortId (long) This is the port number as returned by the NewPort function.

String (string) This is the string in which to put the received bytes.

Length (long) This is the maximum number of bytes to receive. If 0 then the receive string will be filled if possible.

Returns : long
< 0 if an error. Otherwise number of bytes received. If 0 then the receive buffer is empty.

Example
    pid = NewPort ('Com1:9600,n,8,1')
    bytesreceived = ReadPort(pid,buf,0)
_____________________________________________________

SetHandShake (PortId long, HandShake long)
_____________________________________________________

Purpose
To Set or Remove port handshaking

Parameters
PortId (long) This is the port number as returned by the NewPort function.

HandShake (long) This is one of the following : 0 = No Handshaking ; 1 = Xon/Xoff

Returns : long
< 0 if an error. 0 if successful.

Example
    pid = NewPort('Com1:9600,n,8,1')
    result = SetHandShake(pid,1)

_____________________________________________________

CtsHigh (Pid Long)
_____________________________________________________

Purpose
Returns the current status of the CTS (line. For advanced programming only.

Parameters
PortId (long) This is the port number as returned by the NewPort function.

Returns
1 if high. 0 if low.

Example
    pid = NewPort('Com1:9600,n,8,1')
    result = CtsHigh(pid)

_____________________________________________________

DsrHigh (Pid Long)
_____________________________________________________

Purpose
Returns the current status of the DSR (Data Send Ready) line. For advanced programming only.

Parameters
PortId (long) This is the port number as returned by the NewPort function.

Returns
1 if high. 0 if low.

Example
    pid = NewPort('Com1:9600,n,8,1')
    result = DsrHigh(pid)
_____________________________________________________

RingHigh (Pid Long)
_____________________________________________________

Purpose
Returns the current status of the RI (Ring Indicator) line. For advanced programming only.

Parameters
PortId (long) This is the port number as returned by the NewPort function.

Returns
1 if high. 0 if low.

Example
    pid = NewPort('Com1:9600,n,8,1')
    result = RingHigh(pid)
_____________________________________________________

CdHigh (Pid Long)
_____________________________________________________

Purpose
Returns the current status of the CD (Carrier Detect) line. For advanced programming only.

Parameters
PortId (long) This is the port number as returned by the NewPort function.

Returns
1 if high. 0 if low.

Example
    pid = NewPort('Com1:9600,n,8,1')
    result = CdHigh(pid)

_____________________________________________________

SetRts (Pid Long, Value Long)
_____________________________________________________

Purpose
Sets the current status of the RTS (Ready to Send) line. For advanced programming only.

Parameters
PortId (long) This is the port number as returned by the NewPort function.

Value (long) Set to 0 to Clear the RTS line, Set to 1 to Set the RTS line.

Returns
Nothing

Example
    pid = NewPort('Com1:9600,n,8,1')
    SetRts(pid,1)
_____________________________________________________

SetDtr (Pid Long, Value Long)
_____________________________________________________

Purpose
Sets the current status of the DTR (Data Terminal Ready) line. For advanced programming only.

Parameters
PortId (long) This is the port number as returned by the NewPort function.

Value (long) Set to 0 to Clear the DTR line, Set to 1 to Set the DTR line.

Returns
Nothing

Example
    pid = NewPort('Com1:9600,n,8,1')
    SetDtr(pid,1)
_____________________________________________________

WinTaskbarAddIcon(IconName String,< Tips String>),long
_____________________________________________________

Purpose
Adds an Icon to the TaskBar's "Tray" area. This icon belongs to the window that's open when the function is called. At least one window must be open when this function is called. When the user clicks on this icon then an event is generated and sent to the owner window. The event generated is the WinUserEvent ( usually 0500h ). This event is generated whenever a WinAlerted message is received. You can then use the WinEvent() function to return the specific message that triggered the event. If the user clicked on an icon in the tray, then the WinEvent() function will return the number 25000.

Parameters
IconName (string)
This is the name of the icon to display. At the moment the icon is an ICO file stored on the disk. Later releases may allow you to use icons built into your application.

Tips (string)
This parameter is optional. If you put a string in here, then this will be the tip displayed when the mouse rests on the icon in the tray.

Returns : long
Icon Id. This Id is used by the Remove and Change functions

Example
id long
  code
  open(window)
  id = WinTaskBarAddIcon('happy.ico','click on me....')
  accept
    !! usual window processing goes here
    if event() = 0500h
      if WinEvent() = 25000
        ! the user has clicked on the icon in the tray.
        ! do something here, like a popup menu...
      end
    end
  end
  close(window)

_____________________________________________________

WinTaskbarRemoveIcon(<Id ushort>)
_____________________________________________________

Purpose
Removes an Icon from the Taskbar's tray.

Parameters
Id (short)
This is the Id number as returned by the Add function. If this parameter is omitted then all icons placed by this window will be removed.

Returns
Nothing

Example
id long
  code
  open(window)
  id = WinTaskBarAddIcon('happy.ico','click on me....')
  WinTaskBarAddIcon(id) ! or ....
  WinTaskBarAddIcon()

_____________________________________________________

WinTaskbarChangeIcon(Id ushort, IconName string, Tips string)
_____________________________________________________

Purpose
Changes the icon and / or
tool tip for a specific icon that is already placed in the tray. Use
this function to update the icon to display your program status.

Parameters
Id (ushort) : The Icon identifier as returned by the Add function.

IconName (string) : The name of the icon to use.

Tips ( string ) : The new
tool tip for the icon.

Returns
Nothing

Example
id long
  code
  open(window)
  id = WinTaskBarAddIcon('happy.ico','click on me....')
  WinTaskBarChangeIcon(id,'sad.ico','Im sooo sad')

_____________________________________________________

WinNotOnTaskbar()
_____________________________________________________

Purpose
Applications using this function do not appear on the Windows 95 Task bar. This is normally
used in conjunction with the WinTaskBarAddIcon when you want a background program to
appear on the Taskbar's tray, and not on the taskbar itself. It must be called before the first
window of the application is opened.

Parameters
None

Returns
Nothing

Example
  code
  WinNotOnTaskBar()
  open(window)

_____________________________________________________

WinOnTop()
_____________________________________________________

Purpose
Makes your window float on top of other windows applications.

Parameters
None

Returns
Nothing

Example
  code
  open(window)
  WinOnTop()
_____________________________________________________

WinNotOnTop()
_____________________________________________________

Purpose
Reverses the effect of the WinOnTop() function.

Parameters
None

Returns
Nothing

Example
  code
  open(window)
  WinOnTop()
  WinNotOnTop()
_____________________________________________________

WinBringToFront()
_____________________________________________________

Purpose
Brings your window to the front of the open windows. This would be used if your program wanted to bring itself to the front because some event has
occurred that needs action.

Parameters
None

Returns
Nothing

Example
  code
  open(window)
  WinBringToFront()

_____________________________________________________

WindowsVersion()
_____________________________________________________

Purpose
Returns the version of windows that is running. This may return a different number for 16 and 32 bit programs. For example a 16 bit program, running under Windows 95 will return 3 as the windows version number. The version release number is 95. A 32 bit program running under windows 95 will return 4 as the windows version number. The release number is 0.

Parameters
None

Returns
Long containing Windows version number. This together with the release number (WindowsRelease() ) gives you the version number of windows.

Example
  code
  ver = WindowsVersion()

_____________________________________________________

WindowsRelease()
_____________________________________________________

Purpose
Returns the release of windows that is running. This may return a different number for 16 and 32 bit programs. For example a 16 bit program, running under Windows 95 will return 3 as the windows version number. The version release number is 95. A 32 bit program running under windows 95 will return 4 as the windows version number. The release number is 0.

Parameters
None

Returns
Long containing Windows release number. This together with the version number (WindowsVersion() ) gives you the version number of windows.

Example
  code
  ver = WindowsVersion()
  rel = WindowsRelease()

_____________________________________________________

DosVersion()
_____________________________________________________

Purpose
Returns the version of Dos that is running. This is only valid for 16 bit programs. For example a 16 bit version of a program running on Windows 95 will return 7 as the version number, and 0 as the release number.

Parameters
None

Returns
Long containing Dos version number. This together with the release number (DosRelease() ) gives you the version number of Dos.

Example
  code
  ver = DosVersion()

_____________________________________________________

DosRelease()
_____________________________________________________

Purpose
Returns the release of Dos that is running. This is only valid for 16 bit programs. For example a 16 bit version of a program running on Windows 3.11 and Dos 6.22 will return 6 as the version number, and 22 as the release number.

Parameters
None

Returns
Long containing Dos release number. This together with the version number (DosVersion() ) gives you the version number of dos.

Example
code
ver = DosVersion()
rel = DosRelease()
_____________________________________________________

GetFreeDiskSpace (<drive long>)
_____________________________________________________

Purpose
Returns the amount of free disk space, in bytes.

Parameters
Drive : Optional. 0 = current drive. 1 = A, 2 = B etc.

Returns
Real containing number of free bytes on the disk. In version 2.6 and earlier of WinEvent this was a Long. However maximum value is currently still 2 gigs.

Example
free real
  code
  free = GetFreeDiskSpace()
_____________________________________________________

GetFreeDiskSpace (<drive long>)
_____________________________________________________

Purpose
Returns the amount of free disk space, in bytes.

Parameters
Drive : Optional. 0 = current drive. 1 = A, 2 = B etc.

Returns
Real containing total number of bytes on the disk.
However maximum value is currently 2 gigs.

Example
total real
  code
  total = GetDiskSpace()
_____________________________________________________

Sound (WavFileName String)
_____________________________________________________

Purpose
Plays a Wav file through the speaker.

Parameters
WavFileName (string) : The name of the Wav file on the disk, including path if necessary.

Returns
Nothing

Example
  code
  sound('alarm.wav')


[End of document]