You are on page 1of 418

• FiveWin 1.9.

2 - January 97 - Norton Guide

• Programming
1. FiveWin Programming Guide

• Reference
1. FiveWin Reference Guide

• About...
1. Developers
2. Tech Support
3. Distribution
4. Register Process
5. WhatsNew

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


FiveWin - Programming Guide .
--------------------------------------------------------------------------------

0. Organizing your working desktop


0.1 Installing the software .
0.2 Required tools .
0.3 Dos coding and Windows testing .

1. The components of a Windows application


1.1 The business-application point of view .
1.2 The main window .
1.3 The PullDown Menu .
1.4 The ButtonBar .
1.5 The MessageBar .
1.6 Dialog Boxes .
1.7 Controls management .

2. Resources Management
2.1 What are resources ? .
2.2 EXE resources vs. DLL resources .
2.3 Multimedia applications .

3. DataBases Management
3.1 Reusing all your MsDos designs .
3.2 Using FiveWin DataBase objects .
3.3 DataBases and Non-Modal programming .
3.4 Network programming .

4. Browses Management
4.1 FiveWin own TWBrowse class .
4.2 Placing browses in resources .
4.3 Using FiveWin indexed filters ( SELECT clause ) .
4.4 Drawing bitmaps inside browses .
4.5 Browsing arrays .
4.6 Browsing everything you want .

5. Printing
5.1 Basic concepts about printing in Windows .
5.2 Quick printing techniques! .
5.3 Managing the printer as an object .
5.4 Managing the FiveWin Report engine - I .
5.5 Managing the FiveWin Report engine - II .
5.6 Mixing graphics and text .
5.7 Previewing your print-works .

6. Debugging
6.1 Using the FiveWin debugger .
6.2 Debugging techniques .
6.3 Low level debugging techniques .

7. Documenting
7.1 Developing Windows Help files .
7.2 Managing HLP files from your applications .

8. Windows advanced
8.1 Managing DLLs - Dynamic Link libraries .
8.2 Managing DDE - Dynamic Data Exchange .
8.3 Managing MAPI - Mail services .
8.4 Managing ODBC - Open DataBase Connectivity and SQL .
8.5 Managing VBXs - Visual Basic Control files .

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


8.6 Event-Driven programming .
8.7 Extending FiveWin .
8.8 Special Memory considerations .

9. Object Oriented Programming in FiveWin


9.1 FiveWin architecture .
9.2 Classes and Objects .
9.3 FiveWin and Windows API relationship .
9.4 Developing business OOPS-based applications .

10. Distributing your applications


10.1 Developing an installation program .

11. InterNet development


11.1 Developing IntraNet/InterNet applications with FiveWin .

2.1 What are resources ?


--------------------------------------------------------------------------------

Resources are one of the most important parts of Windows programming.


To understand them you should consider that your program can be
divided in two parts:

- What the program does -behaviors-


- The different pieces used to build the program -Data-

Once again we are talking about Object Oriented Programming. Obviously,


both parts are highly dependant upon each other.

Some of the pieces used to build your program may be stored in a


separate .DLL file or even inside the EXE file. Those
pieces, let's call them resources, can be managed and changed
externally from the program. This is probably the most important
reason for the birth of what is called "Visual Programming".

"Visual Programming" is mainly about resources. The programmer may


draw resources using the mouse and certain design programs. In the
next stage, those resources get related to some behaviors. From that
moment you are building, and using, Objects!

FiveWin has been designed to obtain high performance from Windows


resources. FiveWin proposes a way of programming based on resource
usage. We are convinced that drawing screens and other resources
is the easiest and quickest way to develop a program. Thanks to this
technology you can easily build 'Data-driven' programs. This means that
your user interface is based on external and modifiable data. You can
easily modify a screen and use it without having to recompile or relink.

The most important part of this process is to understand how to build


an Object from a resource, and how to define -redefine- its
behaviors. There are three main ways to build an Object in xBase:

1. @ nRow, nCol ...

This kind of construction builds an Object and displays it.


When you do, @ ... GET ... you are building a GET Object
with Clipper, and you also display it.

This way of building Objects is not based on resources.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


2. DEFINE <ObjectClass> <ObjectName>

This is the main way of building an Object in xBase. The Object


is created, but it is not shown. To display it and activate it,
you do:

ACTIVATE <ObjectClass> <ObjectName>

This system was proposed and used by dBase IV, and it is


going to be the most important way to build Objects in xBase.
This system it is also not based on resources.

3. REDEFINE <ObjectClass> <ObjectName> ID <Identifier>

In this case you are using resources. The Object is already


created in the resource, but you need a way to modify and define
its behaviors. This is why the REDEFINE command is going to be
the most important command to modify behaviors in xBase.

Once you have redefined its behaviors, the Object will be activated
using the command:

ACTIVATE <ObjectClass> <ObjectName>

In many cases the Objects are contained by a 'container' Object.


This would be the case of a Window or a Dialog Box which contains
certain controls. To activate those controls it is not necessary
to use the command ACTIVATE ... for each of them. It is enough to
ACTIVATE the container Object.

Lets review now, step by step, the process you should follow
to use resources in your programs:

1. You need a resource designer. We like to use Borland's


Resource WorkShop. This designer comes with Borland's products
for Windows, such as C++ and Turbo Pascal. You should contact
Borland or a software distributor and get one! You'll thank us!

2. Using that designer you may start drawing the different screens
of your program. This is a standard system for Windows programming.
The screens you design must be stored inside a DLL. In the
\FiveWin\DLL directory there is an 'empty' DLL you may use to store
your screens in. (make a copy for every new project). You should tell
the resource editor to 'open' and use that DLL. Select open file
and type the name of that DLL.

3. When you design your screens you should give a name to each of them.
This name will let you select them from inside your program. You should
specify a unique identifier, a number, for each element of a screen.
This number will be used by the REDEFINE command to tell FiveWin which
Object you are using.

Practice with your resource editor to understand it and to become


familiar with its usage.

After that, from inside your program you should tell FiveWin that
your program is going to use resources. To do this, use the
following command at the beginning of your program:

#include 'FiveWin.ch'

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


SET RESOURCES TO <DLLFileName>

And when you are about to end the execution of your program, you
should tell FiveWin that you have finished using them:

SET RESOURCE TO // Release the resource

To use any of the Dialog Boxes you have defined in your DLL all you
have to do is the following:

function TestDialogBox()

local oDlg
local cName := "FiveWin"

DEFINE DIALOG oDlg NAME "MyDialog"

REDEFINE GET ID 110 VAR cName OF oDlg

REDEFINE BUTTON ID 120 OF oDlg ACTION nMsgBox( "Hello" )


REDEFINE BUTTON ID 130 OF oDlg ACTION oDlg:End()

ACTIVATE DIALOG oDlg

return

In this example we are building a Dialog Box from the screen "MyDialog"
stored inside the DLL we have specified in a SET RESOURCES TO "MyDLL.dll"
earlier in the program.

In that screen there is a GET Object and two PushButtons (Command


Buttons). From the resource editor we have assigned a value of 110 to the
GET control and 120 to the first button and 130 to the second.

Remember that the syntax for redefining is:

REDEFINE <ObjectClass> <ObjectName> ;


ID <Identifier> ;
OF <ContainerObjectName> ;
...

Every kind of control will have certain extensions typical to this


command. As an example, BUTTON has the clause ACTION to let us
specify what the Object will do when the button is pressed.

Review the source code of \EXAMPLES\FwBorl.prg where you will find several
examples of using resources from DLLs.

When you get used to this system you will understand that it is the
easiest and quickest way of building programs.

2.2 EXE resources vs. DLL resources


--------------------------------------------------------------------------------

There are two main ways to store the resources of your applications:

1.- Inside your .EXE file


2.- Inside an external DLL

Both systems are very powerful, but there are some important
differences you should know:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


1.- The biggest benefit of storing an .RC file (using Microsoft
resource compiler RC.EXE -included with Microsoft, Borland, Symantec...-)
is that you may use DEFINEs as a replacement for the controls IDs.

This means you don't have to remember 'strange' numbers, and also
that under any source code or resources modification you will
make fewer mistakes.

Sample:

REDEFINE GET cName ID 110 OF oDlg // using an ID number 110

Instead of that:

#define ID_NAME 110

REDEFINE GET cName ID ID_NAME OF oDlg

This one has the benefit that you may create a .CH file with all
those #define's and the resource editor let you use it when modifying
the .RC file:

MyApp.RC

#include "WinApi.ch" // provided with FiveWin


#include "MyApp.ch" // your IDs definitions are here !!!

Clients DIALOG ...


CONTROL ... ID_NAME,

Based on our experience we do recommend storing a .RC file inside your


.EXEs because it is much easier to control IDs and avoid errors.

The SAMPLES\Build.bat batch file we provide with FiveWin, automatically


will call RC.EXE if detects a file with extension .RC with the same
name of our application. Basically what we do in build.bat is:

RC -K MyApp

This will store MyApp.RC resources inside your MyApp.EXE file.

There is no need to specify a command SET RESOURCES TO ... in your


application if you take this route, because your EXE file already
knows how to locate the resources inside itself.

The only disadvantage of this system is that every time you build your
EXE you have to compile the RC and place it inside the EXE again -though
this process is extremely fast!-

2.- The big benefit of storing resources inside a DLL is that


you may really have Data Driven DialogBoxes, because if you modify
the DLL resources (using your resource editor) there will be no
need to recompile again your EXE! This may be a great advantage
when developing very large applications.

We provide an empty DLL to be copied when you develop a new application


as an empty storage system where you may place all your resources:

COPY screens.dll MyApp.dll // we provide an 'empty' screens.dll

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Now you edit it with your resource editor:

WorkShop MyApp.dll // Or open it as a DLL

Later in your application you specify:

SET RESOURCES TO "MyApp.dll"

And you are ready to start using your resources. Remember that if you
decide to put your resources inside your app (using .RC and RC.EXE)
there is no need to specify SET RESOURCES TO... as the .EXE already
has all them inside.

The great disadvantage of this system is that you are not allowed
to use labels if you use a DLL to store resources ! Neither Borland
resource editor nor Microsoft let you use a .CH or .H file where
you may store your #define's if you store your resources inside a DLL.

Both systems are excellent, and we do recommend you to test both of


them and decide by yourself which system suits better your needs.

2.3 Multimedia applications


--------------------------------------------------------------------------------

Multimedia applications typically refers to applications that extensively


use sound and vision to interact with the final user. But, in fact, a
multimedia application may use more ways to get a better interaction with
the final user mainly using new external devices controlled by the
application, such as touch screens, electric pens, plastic card readers,
fax-modems, voice recorders, artificial vision, etc...

FiveWin offers all the necessary extensions to develop sophisticated


multimedia applications. Here we are going to see how to use sound, vision
and how to manipulate any external device we may find useful. Also,
we are going to explain some techniques that conveniently used will let us
make our applications look like any Multimedia app we may have seen.

Sound: There are two principal ways to reproduce sounds in our apps:
Playing a WAV file and playing a MDI file.

WAV files are digital recordings of sounds. A WAV file it may be a person
voice, a song, noises, etc... We have the following functions to reproduce
them:

* SndPlaySound( <cFileName>, <nMode> ) --> <lSuccess>


Plays a WAV file from disk.
(see Functions2 section SndPlaySound() full explanation)

* MsgSound() which it is exactly as the above SndPlaySound()


Plays a WAV file from disk.
but using the FiveWin Msg... functions style.

* SndPlayRes( <cResName>, <nMode> ) --> <lSuccess>


Plays a WAV file from resources.
(see Functions2 section SndPlaySound() full explanation)

Vision: There are two principal ways to display images in our apps:
Managing Bitmaps BMP files and reproducing animated Video files.

BMP bitmaps files are the way Windows uses to store digital pictures and
later show them again at the screen or at the printer. You may store

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


your digital images at any other file format (using some convenient
DLLs libraries) but later they will be turned into Bitmaps as Windows
is the only way that knows to manipulate them. We have the following
bitmaps support:

* Class TBitmap: Controls that show a related bitmap file.

* Class TBtnBmp: Controls that show one or two bitmap files,


and that behaves like a PushButton, thus the user may click
them and perform an action.

* Functions to dynamically load and display a bitmap:

LoadBitmap( <hInst>, <cBmpName> ) --> <hBitmap>


(see Functions2 section LoadBitmap() full explanation)

DrawBitmap( <hDC>, <hBitmap>, <nRow>, <nCol>, <nWidth>, <nHeight>,


<nRaster> ) --> nil
(see Functions1 section DrawBitmap() full explanation)

PalBmpDraw( <hDC>, <nCol>, <nRow>, <hPalBmp>, <nWidth>, <nHeight>,


<nRaster> ) --> nil
(see Functions2 section PalBmpDraw() full explanation)

DeleteObject( <hBitmap> ) (for LoadBitmap(), for a TBitmap object


see TBitmap METHOD End() )
(see Functions1 section DeleteObject() full explanation)

AVI Animated video files is the way Windows stored a sequence of bitmaps
mixed with audio (recorded from a video camera, cartoons, etc...). FiveWin
implements the Class TVideo to easily reproduce them. (See Class TVideo
full explanation).

Windows has a powerful subsystem named MCI (Media Control Interface) that
lets you easily access to any kind of device which it is MCI compatible.
The first thing you should do when studying a new device to manipulate is
to check if it is MCI compatible. FiveWin implements the Class TMCI to
easily manage any kind of MCI compatible device (See Class TMCI full
explanation).

To finally make your application look in a unique way (the final user
will not recognize that he is using a Windows application) there are some
easy techniques that could be used. You can easily avoid using a frame
in your main window, so there will not be a visible caption and typical
Windows small pushbuttons on the corners. Basically this can be done
doing:

DEFINE WINDOW oWnd STYLE nOr( WS_POPUP, WS_VISIBLE ) COLOR ...

ACTIVATE WINDOW oWnd MAXIMIZED ;


ON PAINT ... (you could draw a full Bitmap on the window surface,
you could fill it with certain drawing effects, etc...)

See SAMPLES\Install.prg for a working sample of this technique of avoiding


display the window frame and related buttons.

Multimedia applications open a wide range of possibilities where only


your imagination and your Windows expertise are the limits. Once you start
practising with these concepts you will easily recognize these elements
on most existing Multimedia applications, and you will start incorporating
them in your own FiveWin apps.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


3.1 Reusing all your MsDos designs
--------------------------------------------------------------------------------

FiveWin imposes no restriction at all to your current DataBase designs


and techniques acquired in MsDos. You may feel free to continue
working as you normally do with DataBases.

There are just some points you should keep in mind for a better
understanding of Windows processes:

1.- By default any Windows task is given a maximum of 20 files


opened at the same time. In order to have the same conditions as we
have in MsDos you have to use the SetHandleCount() function that
FiveWin supplies:

SetHandleCount( <nMaxFiles> ) --> <nMaxFilesAutorized>

If your application is going to manage 40 files at the same time, you


will have to do at the beginning of your application:

SetHandleCount( 40 )

Remember that DBFs that use memos also open an associated file DBT, and
also remember that normally when Windows is printing it opens some
temporary files (also FiveWin opens some more when doing PREVIEWs of
printing works). If you get an error it may be that there are not
enough files available. Increase its number with SetHandleCount().
There is a maximum of 255 files available per application.

Also it is not a good idea to give 255 files to all your applications
for you will consume a lot of memory resources!

2.- If you are working with NonModal designs, the same DataBase may
get opened several times at the same time! By the same user! Clipper
allows this but, in fact, your application is acting like an application
for a NetWork. You have to provide Multi-User control to your application!

For this, if you are using Windows 3.1 loading SHARE.EXE before loading
Windows, this is a MUST! If you are using Windows 3.11 or Windows 95
(pre-releases versions) this is no needed as these new versions
automatically load SHARE.EXE when starting.

Converting an application for working in a NetWork is quite easy.


Review this documentation for our recommendations and guidance for
NetWork programming. Don't worry if you have never code a multi-user
application. It is really easy!

3.- FiveWin offers you a powerful DataBase Class that in fact saves
you a lot of tedious work. Just give a little of your time to understand
the FiveWin DataBase Class and you will save a lot of your precious
time!

DataBase objects saves you from coding a _lot_ of source code lines!
Go for DataBase objects right now!

4.- If you are working with older versions of CA-Clipper (older than
5.2 d) you may have serious troubles working with some CA-Clipper
RDDs. Some of them cause big problems in MsDos but in Windows they
may crash your system. DbfCdx is not working properly even in version

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


5.2 d. There is a late patch for 5.2 d but we have not tested it yet,
since we work most of the time, with Comix and SixDriver.

We do recommend working with compound indexes CDX as they save a lot


of work. Get Comix or SixDriver and use them! They are excellent!

3.2 Using FiveWin DataBase objects


--------------------------------------------------------------------------------

FiveWin DataBase objects have been designed with the purpose of reducing
the size of your code when you have to manipulate a DBF. They simplify very
much all the work required to work with DataBases and they are totally
compatible with the standard way of manipulating DBFs in Clipper.

1. What is a DataBase Object ?

A DataBase object works mainly as a buffer, where you manipulate the


Data, and lately you save it to the real DBF.

2. How do I create a DataBase object ?

After you do the typical USE <cDbfName> ALIAS ..., then following this
sentence you write:

local oDbf

USE <cDbfName> [ ALIAS ... INDEX ... ... ]

DATABASE oDbf

FiveWin will create automatically a DataBase object and will keep its
reference inside the oDbf variable.

The DataBase object will have as DATA the name of the fields of your
DBF. Sample:

USE Customer // Customer has a field called "First"


DATABASE oDbf

oDbf:Load() // Loads values from the real DBF

MsgInfo( oDbf:First ) // There is a DATA "First" there,


// ready to be used!

3. Why a FiveWin DataBase object reduces my code ?

Traditionally all Clipper programmers need to declare and use LOCAL


variables as buffers where they manipulate the DBF values, and later
they save the contents to the real DBF. This is a must if you are
coding for NetWorking, as you can not manipulate the fields directly
when you are sharing a DataBase (you have to lock, replace and then
unlock).

Another alternative used by Clipper programmers is to use an array


as a buffer, where they load the initial DBF values, then they are
manipulated and later they are saved to disk. Normally those operations
are named Scatter() and Gather(). The disadvantage of using arrays
is that you can not use your fields names directly, instead you have
to define labels (#defines) with the risk of altering those sequences
and generating errors.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


FiveWin DataBase objects solve those problems totally, as you no
longer need to declare local variables one for each field. You just
need to declare one local variable for holding the DataBase Object.

In fact, the DataBase object keeps internally an array, in the same


way as you would use an array for a buffer, but with the benefit that
now you can use the names of the fields to manipulate each field!

4. What cautions may I have when using DataBase objects ?

Clipper restricts symbols names up to 10 characters length, so you


can not use fields names with 10 characters, as in Clipper OOPS
when you are assigning a DATA, Clipper internally places an underscore
at the beginning of the DATA name:

// ABCDEFGHIJ ==> Your field name

MsgInfo( oDbf:Abcdefghij ) // Will work fine!

oDbf:Abcdefghij = ... // Will not work!


// as Clipper will do:
// oDbf:_Abcdefghij
// so exceeding 10 characters

Remember: If you are going to use FiveWin DataBase objects then


you can not use fields with names longer than 9 characters !!!

5. Where can I find a working sample ?

Look at SAMPLES\Dbf01.prg for a working sample using a FiveWin


DataBase object.

Enjoy DataBase objects, they are extremely powerful and saves you
from a lot of work! And they are 100% compatible with your existing
code !!!

DataBases and Non-Modal programming


--------------------------------------------------------------------------------

If you choose to develop your application using a Non-modal style you may
be aware of certain design rules:

1. What is a Non-modal application ?

If you use MDI windows in your app, or if you use DialogBoxes with the
clause NOWAIT, then you are implementing Non-modal designs.

A non-modal design will let user select several things at the same time.
If you place a browse inside a MDIChild window, that MdiChild window
may be opened several times! Or if a DialogBox is editing a certain
Database, it may be issued several times.

2. How a non-modal design affects my DataBases manipulation design ?

A non-modal design works exactly as if you were working on a NetWork,


so NetWork programming rules have to be used. If a MdiChild window
opens several times (at the same time) the same DataBase it will be
the same situation as if different users were being opening several
times those Databases on a NetWork.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


3. Does Clipper offer DataBase capabilities for Non-modal programming ?

Yes! Clipper let you open the same physical database in different alias,
though acting in the same way as if you were working on a NetWork.

Important: In order to let Clipper manage the same DataBase on


different alias, you HAVE to specify different ALIAS:

USE Customer ALIAS Cust1 NEW


USE Customer ALIAS Cust2 NEW

From that moment you have to use Cust1 or Cust2 to reference your fields.

4. How difficult is coding for a NetWork ?

If you have never coded for a NetWork, don't be afraid. In next item
in this documentation we explain the foundation for doing NetWork
coding with Clipper. It is quite easy!

Network programming
--------------------------------------------------------------------------------

If you have never design a NetWork application with Clipper, don't be afraid!
They are not so difficult. There are some rules you have to follow:

1. All DataBases will be opened 'SHARED' by default, except if you


specify 'EXCLUSIVE' clause, and also depending on your SET EXCLUSIVE ...
state (see USE... and SET EXCLUSIVE... Clipper commands).

2. Once the DataBase is USEd as SHARED, several users on a NetWork


may use it, or several non-modal MdiChild windows or Non-modal DialogBoxes
may access the DataBase info at the same time.

3. You can not manipulate the contents of a field directly. Before


replacing the value of a field you have to lock the record. Basically this
is the typical procedure:

if MyAlias->( RLock() ) // Lock the record


MyAlias->Field := <NewValue> // Modify the contents
MyAlias->( DbUnLock() ) // UnLock the record
else
MsgAlert( "The DataBase is in use now! Try again!" )
endif

4. Some Database operations (as building an entire INDEX) may


require that you open a DataBase in EXCLUSIVE mode or that you lock
the entire Database, not just a record.

Use USE ... EXCLUSIVE to open a DataBase as exclusive or use the


function FLock() to entirely lock a file.

5. Get yourself some book about NetWork coding for learning


advanced tips and tricks! You will become a NetWork programming master
pretty soon!

4.1 FiveWin own TWBrowse class


--------------------------------------------------------------------------------

FiveWin implements its own browse which has some important differences from
the traditional MsDos Clipper TBrowse. This difference is based on the fact
that we wanted FiveWin browsers to execute as fast as possible. Windows is

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


a graphical environment, so applications user interface tends to be slower
than their MsDos equivalents. If you want to work in the MsDos way, FiveWin
also provides a new class TCBrowse, which it is a column based browse.

FiveWin TWBrowse does not work with column objects, instead of those, it
holds an codeblock (DATA bLine) which returns an array. The contents of
this array is used to display each visible column content. This makes an
important difference: Lets suppose we have a 10 columns browse, which
also has 25 rows on the screen. If we were working with traditional browse
to fully repaint the browse we were doing the following:

10 columns x 25 rows = 250 codeblocks evaluations.

FiveWin TWBrowse = 25 codeblocks evaluations only !!!

This fact makes FiveWin TWBrowses extremely fast, though it changes a little
the way you are used to work with browsers. The main idea is that DATA bLine
holds a codeblock that returns an array:

<oBrw>:bLine = { || { "One", "Two", "Three", ... } }

The second difference is that being in a graphical environment our users


wanted to also show bitmaps (graphics) as browse elements. How could we
distinct from normal data and bitmaps handles ? The solution was that a
character string holds normal data, and numeric values are considered
bitmap handles:

<oBrw>:bLine = { || { nHBitmap, "One", "Two", "Three", ... } }

When FiveWin TWBrowse evaluates this codeblock, it detects there is a numeric


value as an element of that array, so that number is treated as a handle
of a bitmap, and it is automatically painted on its column position. As
you can use expressions to return that numeric value, you have an easy
way to paint different bitmaps based on any condition:

<oBrw>:bLine = { || { If( Clients->Balance > 0, hBmpPlus, hBmpNeg ),;


Clients->Last, Clients->First,;
Str( Clients->Balance ) } }

Important: Always use character expressions as elements for the bLine array!
A number will means a bitmap handle. An invalid bitmap handle
(if by mistake you supply a number instead of a string expression)
will cause strange results!

Besides this difference, the TWBrowse object is almost identical to a


MsDos Clipper TBrowse. We have just used 'Hungarian notation' (we specify
the type of a DATA -instvar- preceding the DATA name) to specify the type
of each TWBrowse object DATA:

FiveWin TWBrowse Clipper MsDos TBrowse


================ ====================

DATAs bGoTop GoTopBlock


bGoBottom GoBottomBlock
bSkip SkipBlock

nTop (in pixels) nTop


nLeft " nLeft
nBottom " nBottom
nRight " nRight

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


nRowPos RowPos
nRowCount() (METHOD) RowCount
nColPos ColPos
(left visible column)
IsColVisible() (METHOD)

lHitTop HitTop
lHitBottom HitBottom

nClrText, nClrPane ColorSpec


nClrBackHead, nClrForeHead
nClrBackFocus, nClrForeFocus

METHODs GoUp() Up()


GoDown() Down()
GoTop() GoTop()
GoBottom() GoBottom()
GoLeft() Left()
GoRight() Right()

PageUp() PageUp()
PageDown() PageDown()

Refresh() RefreshAll()
DrawSelect() RefreshCurrent()
(DrawLine(nLine))

SetCols() (All of them) SetColumn()


GetColSizes() ColWidth()
ShowSizes()

FiveWin TWBrowse Clipper MsDos TColumn


================ =====================

DATAs aHeaders (All of them) Heading


bLine (All of them) Block
aSizes (All of them) Width

Beside these, FiveWin TWBrowse offers much more built-in functionality


that traditional MsDos Clipper browse:

METHODs KeyDown() (KEYBOARD) No equivalents!


KeyChar()

LButtonDown() (MOUSE) "


LButtonUp()
MouseMove()
LDblClick()
RButtonDown()
RButtonUp()
nAtCol()

lEditCol() (Automatic editing) "

VScroll() (SCROLLBARS) "


HScroll()

Skip() "

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


SetFilter() (Index based ) "
filters

Report() (Automatic Reporting) "

SetArray() (Arrays editing) "


SetTree() (Trees) "

Finally, FiveWin implements easy xBase commands to build a whole browse


with just one xBase command (there is no equivalent for this in MsDos
Clipper TBrowse):

From source code: @ <nRow>, <nCol> LISTBOX <oLbx> ;


FIELDS <Expression,...> ;
HEADERS <Title,...> ;
COLSIZES <Size,...> ;
etc...

From Resources: REDEFINE LISTBOX <oLbx> ;


FIELDS <Expression,...> ;
HEADERS <Title,...> ;
COLSIZES <Size,...> ;
etc...

See FiveWin Browse xBase commands and the Class TWBrowse explanation
in this manual for a full description of the above xBase commands. Remember
that FiveWin also provides a new powerful Class TCBrowse in case that you
want to work with column objects. TCBrowse is also a fast browse, though
not as fast as TWBrowse.

Using Borland's Resource WorkShop


--------------------------------------------------------------------------------

* How to place a FiveWin Browse in a DialogBox:

1. Select the custom control toolbar button (it shows a little key on
it).

2. You will be prompted for the name of the custom control to use:
Write TWBrowse.

3. Draw the browse area on the Dialog Box and double click on it.

4. Add the following styles at the bottom:

... | WS_TABSTOP | WS_BORDER | WS_VSCROLL | WS_HSCROLL

5. To check that everything is ok from inside the Resource WorkShop,


select the PullDown menu option: "Edit as text"

The text may show an entry like this:

CONTROL "", 110, "TWBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP |


WS_VSCROLL | WS_BORDER, 4, 23, 117, 104

Instead 110 you will select the desired ID for your browse control.

6. Review the RC and DLLs we provide in the SAMPLES directory to see how
we do it.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


4.3 Using FiveWin indexed filters ( SELECT clause )
--------------------------------------------------------------------------------

FiveWin Browses implement a powerful feature that allows us to retrieve


just a part of a DataBase similar as a FILTER, but based on Indexes which
makes it extremely fast and efficient (Clipper SET FILTER must not
be used with medium-big DataBases). Advanced Clipper RDDs like
Comix or SixDriver implements some features that allow similar
results. Anyhow we decided to keep the SELECT clause for users of
standard Clipper.

Lets see a sample of its use: Suppose you have a clients database indexed
by surname. Lets suppose that you just want to review clients whose
names start with L, M, N. Then you do:

REDEFINE LISTBOX oBrw FIELDS Surname, Address, ...


... SELECT Surname FOR "L" TO "N" ...

This will make the browse just show from "L" up to "N" surnames.

We called them Indexed Filters and we manage them using the LISTBOX ...
FIELDS ... SELECT ... clause:

...

SELECT <cField> FOR <uValue1> [ TO <uValue2> ] ;


...

Basically what FiveWin does is a SEEK of the <uValue1> when going TOP:
to find the first element to be showed. If <uValue2> is provided (it
is optional) we do a SEEK of the <uValue2> when going BOTTOM: (to find
the last element to be showed). If <uValue2> is not provided then we
use the following index value to stop the records showed.

From <uValue1> to <uValue2> (if defined) we check that <cField> is


included in that range.

In order to make this powerful clause work properly some requirements


are necessary:

* The DataBase showed on the browse ( LISTBOX ... FIELDS ... ) must be
indexed and the active Key must be the same as the <uValue1> we are
going to seek. Please check carefully the types of the index expression
and the type of the <uValue1> and <uValue2> (this one if defined).

* FiveWin does not check it <uValue1> exists. This is very important:


You have to check it YOURSELF: How ? Just do a SEEK <uValue1>. If
exist ( If Find() ) then proceed with the browse. There are many
different possible default behaviors when the <uValue1> is not
found, this is why we have decided that it is your responsibility
to decide what to do if <uValue1> is not found.

FiveWin also offers a :SetFilter() method to change dynamically the


current SELECTion, without having to create again the DialogBox (or the
window):

:SetFilter( <cExpression>, <uValue1>, [<uValue2>] )

Sample:

The browse gets defined with:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


SELECT StrZero( Page, 3 ) + StrZero( 1, 4 ) ;
FOR StrZero( nPage, 3 ) + StrZero( 1, 4 ) ;
TO StrZero( nPage, 3 ) + StrZero( 9999, 4 ) ;

And later we do:

(previously, we have changed the value of Page and nPage variables)

oBrw:SetFilter( "StrZero( Page, 3 ) + StrZero( 1, 4 )",;


StrZero( nPage, 3 ) + StrZero( 1, 4 ),;
StrZero( nPage, 3 ) + StrZero( 9999, 4 ) )
oBrw:GoTop()
oBrw:Refresh()

This clause has been extensively tested, and we guaranty it works properly.
If you don't get a proper behavior it could be that you are not using
it properly. Please review your code and check that all the rules
that we show here are being observed in your code.

If you get strange behavior it is a clear sign that you have some
other problems. We offer an extensive working sample in the
IDE\SOURCE\DOC.prg. Review and you will see how to get all the power
from this really useful clause.

4.4 Drawing bitmaps inside browses


--------------------------------------------------------------------------------

FiveWin requires that all expressions to be shown on a browse to be of


character type. The reason for this is that if you specify a number we
understand it is a handle of a bitmap so there you want to show a
bitmap:

See SAMPLES\FwBrow.prg:

@ 1, 1 LISTBOX oLbx FIELDS aHBitmaps[ Max( 1, Clients->Nivel ) ],;


Clients->Nombre, Clients->Direccion,;
Clients->Telefono,;
Str( Clients->Edad, 3 ) ;
HEADERS "L", "Name", "Address", "Phone", "Age" ;
FIELDSIZES 16, 240, 310, 114, 24 ;
SIZE 284, 137 OF oDlg

aHBitmaps is an array of bitmaps handles, previously loaded with LoadBitmap()


or ReadBitmap() functions:

local aHBitMaps:= { ReadBitmap( 0, "..\bitmaps\Level1.bmp" ), ; // BitMaps de


14 x 32
ReadBitmap( 0, "..\bitmaps\Level2.bmp" ), ;
ReadBitmap( 0, "..\bitmaps\Level3.bmp" ), ;
ReadBitmap( 0, "..\bitmaps\Level4.bmp" ),;
ReadBitmap( 0, "..\bitmaps\Level5.bmp" ) }

// Quick Browse sample

#include "FiveWin.ch"

static oWnd

//----------------------------------------------------------------------------//

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


function Main()

local oBrush, oBar, oBmp

SET 3DLOOK ON // Microsoft 3D Look

DEFINE BRUSH oBrush STYLE TILED // FiveWin new predefined Brushes

DEFINE WINDOW oWnd FROM 4, 4 TO 25, 75 ;


TITLE FWVERSION + " - Browsing power" ;
MENU BuildMenu() ;
BRUSH oBrush

DEFINE BUTTONBAR oBar OF oWnd

DEFINE BUTTON FILENAME "..\bitmaps\OpenPrj.bmp" OF oBar ;


ACTION OpenDbf() MESSAGE "Browse any DBF..."

DEFINE BUTTON FILENAME "..\bitmaps\Exit.bmp" OF oBar ;


ACTION If( MsgYesNo( "Do you want to End ?", "Please, Select" ),
oWnd:End(), ) ;
MESSAGE "End this session"

DEFINE BUTTON FILENAME "..\bitmaps\Edit.bmp" OF oBar GROUP ;


MESSAGE "Using a Browse with dynamic Bitmap selection" ACTION Clients() ;
TOOLTIP "Edit"

DEFINE BUTTON FILENAME "..\bitmaps\Ques2.bmp" OF oBar ;


MESSAGE "How to get FiveWin 1.2" ACTION WinHelp( "Order.hlp" )

SET MESSAGE OF oWnd TO FWVERSION + FWCOPYRIGHT

@ 4, 16 BITMAP oBmp FILENAME "..\bitmaps\Tutanka1.bmp" ADJUST SIZE 280, 200


OF oWnd ;
ON CLICK ( oBmp:lStretch := ! oBmp:lStretch,
oBmp:Refresh( .t. ) )

ACTIVATE WINDOW oWnd ;


ON RESIZE oBmp:Center()

return nil

//----------------------------------------------------------------------------//

function BuildMenu()

local oMenu

MENU oMenu

MENUITEM "&Information"
MENU
MENUITEM "&About..." ;
ACTION MsgAbout( FWCOPYRIGHT, FWVERSION ) ;
MESSAGE "Some information about this demo"
SEPARATOR
MENUITEM "&Exit demo..." ACTION ;
If( MsgYesNo( "Do you want to end ?", "Please, Select" ), oWnd:End,)
;
MESSAGE "End the execution of this demo"
ENDMENU

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


MENUITEM "&Clients Control" ACTION Clients()

MENUITEM "&Utilities"
MENU
MENUITEM "&Calculator..." ACTION WinExec( "Calc" ) ;
MESSAGE "Calling Windows Calculator"

MENUITEM "C&alendar..." ACTION WinExec( "Calendar" ) ;


MESSAGE "Calling Windows Calendar"

SEPARATOR

MENUITEM "&Writing..." ACTION WinExec( "Write" ) ;


MESSAGE "Calling Windows Write"
ENDMENU

ENDMENU

return oMenu

//----------------------------------------------------------------------------//

function Clients()

local oDlg
local oLbx
local aHBitMaps:= { ReadBitmap( 0, "..\bitmaps\Level1.bmp" ), ; // BitMaps de
14 x 32
ReadBitmap( 0, "..\bitmaps\Level2.bmp" ), ;
ReadBitmap( 0, "..\bitmaps\Level3.bmp" ), ;
ReadBitmap( 0, "..\bitmaps\Level4.bmp" ),;
ReadBitmap( 0, "..\bitmaps\Level5.bmp" ) }

if ! File( "clientes.dbf" )
DbCreate( "Clientes.dbf", { { "Nombre", "C", 40, 0 },;
{ "Direccion", "C", 50, 0 },;
{ "Telefono", "C", 12, 0 },;
{ "Edad", "N", 2, 0 },;
{ "Productos", "C", 10, 0 },;
{ "Nivel", "N", 2, 0 } } )
endif

USE Clientes

if RecCount() == 0
APPEND BLANK
endif
INDEX ON Clientes->Nombre TO CliName
SET INDEX TO CliName
GO TOP

DEFINE DIALOG oDlg FROM 3, 3 TO 26, 79 TITLE "Clients Management"

@ 0, 1 SAY " &Clients List" OF oDlg

@ 1, 1 LISTBOX oLbx FIELDS aHBitmaps[ Max( 1, Clientes->Nivel ) ],;


Clientes->Nombre, Clientes->Direccion,;
Clientes->Telefono,;
Str( Clientes->Edad, 3 ) ;
HEADERS "L", "Name", "Address", "Phone", "Age" ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


FIELDSIZES 16, 222, 213, 58, 24 ;
SIZE 284, 137 OF oDlg

// Lets use different row colors


oLbx:nClrText = { || SelColor( Clientes->Nivel ) }
oLbx:nClrForeFocus = { || SelColor( Clientes->Nivel ) }

// Uncomment this to quickly calculate the desired columns width


// Right click with the mouse over the browse and you will
// see the columns sizes!
// oLbx:bRClicked = { || oLbx:ShowSizes() }

@ 13, 1 BUTTON "&New" OF oDlg ACTION EditClient( oLbx, .t. ) ;


SIZE 40, 12
@ 13, 8 BUTTON "&Modify" OF oDlg ACTION EditClient( oLbx, .f. ) ;
SIZE 40, 12
@ 13, 15 BUTTON "&Delete" OF oDlg ACTION DelClient( oLbx ) SIZE 40, 12
@ 13, 22 BUTTON "&Search" OF oDlg ACTION SeekClient( oLbx ) SIZE 40, 12

@ 13, 29 BUTTON "&Print" OF oDlg ;


ACTION oLbx:Report( "clients Report", .t. ) ; // .t. --> wants preview
SIZE 40, 12

@ 13, 36 BUTTON "&Exit" OF oDlg ACTION oDlg:End() SIZE 40, 12

ACTIVATE DIALOG oDlg

USE

AEval( aHBitmaps, { | hBmp | DeleteObject( hBmp ) } )

return nil

//----------------------------------------------------------------------------//

static function SelColor( nNivel )

local nColor := CLR_BLACK

do case
case nNivel == 1
nColor = CLR_HRED

case nNivel == 2
nColor = CLR_HGREEN

case nNivel == 3
nColor = CLR_HBLUE
endcase

return nColor

//----------------------------------------------------------------------------//

static function EditClient( oLbx, lAppend )

local oDlg
local lFivePro
local lDialog
local lObjects
local nNivel

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


local cName
local cAddress
local cPhone
local nAge
local lSave := .f.
local nOldRec := RecNo()

DEFAULT lAppend := .f.

if lAppend
GOTO BOTTOM
SKIP
endif

lFivePro = "F" $ Clientes->Productos


lDialog = "D" $ Clientes->Productos
lObjects = "O" $ Clientes->Productos
nNivel = max( 1, Clientes->Nivel )
cName = Clientes->Nombre
cAddress = Clientes->Direccion
cPhone = Clientes->Telefono
nAge = Clientes->Edad

DEFINE DIALOG oDlg FROM 8, 2 TO 25, 65 ;


TITLE If( lAppend, "New Customer", "Customer Update" )

@ 1, 1 SAY "&Name:" OF oDlg


@ 1, 6 GET cName OF oDlg
@ 2, 1 SAY "&Address:" OF oDlg
@ 2, 6 GET cAddress OF oDlg

@ 3, 1 TO 7, 8 LABEL "&Products" OF oDlg


@ 4, 1 CHECKBOX lFivePro PROMPT "&FivePro" OF oDlg
@ 5, 1 CHECKBOX lDialog PROMPT "&Dialog" OF oDlg
@ 6, 1 CHECKBOX lObjects PROMPT "&Objects" OF oDlg

@ 3, 9 TO 7, 17 LABEL "&Nivel" OF oDlg


@ 4, 9 RADIO nNivel PROMPT "&Novice", "A&vanced", "&Expert" OF oDlg

@ 4, 16 SAY "&Phone:" OF oDlg


@ 4, 21 GET cPhone OF oDlg SIZE 60, 11 PICTURE "@R 99-999-9999999"

@ 6, 16 SAY OemToAnsi( "&Age:" ) OF oDlg


@ 6, 21 GET nAge OF oDlg SIZE 20, 11

@ 9, 9 BUTTON "&Acept" OF oDlg SIZE 50, 12 ACTION ( lSave := .t. ,


oDlg:End() )
@ 9, 19 BUTTON "&Cancel" OF oDlg SIZE 50, 12 ACTION oDlg:End()

ACTIVATE DIALOG oDlg CENTERED

if lSave .and. !empty( cName )

if lAppend
APPEND BLANK
endif

Clientes->Nombre := cName
Clientes->Direccion := cAddress
Clientes->Productos := If( lFivePro, "F", "" ) + ;
If( lDialog, "D", "" ) + ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


If( lObjects, "O", "" )

Clientes->Nivel := nNivel
Clientes->Telefono := cPhone
Clientes->Edad := nAge

oLbx:Refresh() // We want the ListBox to be repainted

else

if Empty( cName ) .and. lSave


MsgAlert( "Please write a name" )
endif

GOTO nOldRec

endif

return nil

//---------------------------------------------------------------------------//

static function DelClient( oLbx )

if MsgYesNo( "Are you sure to delete this record ?" )


DELETE
PACK
oLbx:Refresh() // Repaint the ListBox
endif

return nil

//----------------------------------------------------------------------------//

static function SeekClient( oLbx )

local cNombre := Space( 30 )


local nRecNo := RecNo()

SET SOFTSEEK ON

if MsgGet( "Search", "Customer Name", @cNombre,;


"..\bitmaps\lupa.bmp" )

if ! DbSeek( cNombre )
MsgAlert( "I don't find that customer" )
GO nRecNo
else
oLbx:UpStable() // Corrects same page stabilizing Bug
oLbx:Refresh() // Repaint the ListBox
endif
endif

return nil

//----------------------------------------------------------------------------//

function OpenDbf()

local cFile := cGetFile( "Clipper DataBase (*.dbf) | *.dbf", "Select a DBF" )

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


if ! Empty( cFile )
USE ( cFile )

// Quick and easy browses!


// Fully integrated into a Dialog Box !!!

Browse( "FiveWin Automatic Browse Power",;


"Easy Browses without pain...",;
{ || MsgInfo( "This will be executed from first button...",
"Info1" ) },;
{ || MsgInfo( "You can atach any action to the buttons...",
"Info2" ) },;
{ || MsgInfo( "We also provide full source code of this...",
"Info3" ) },;
{ || MsgInfo( "So you can adapt it to your necesities", "Info4" )
} )
USE
endif

return nil

//---------------------------------------------------------------------------//

// Reviewing arrays - using FiveWin TWBrowse

#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

local oDlg, oBrw


local aSample := { "The standard", "has", "a name...",;
"CA-Clipper 5.", "Wellcome", "to", "FiveWin",;
"the CA-Clipper 5", "Windows", "Library" }
local nItem := 1

DEFINE DIALOG oDlg FROM 2, 2 TO 20, 50 TITLE "FiveWin TWBrowse Power!!!"

@ 1, 2 LISTBOX oBrw FIELDS aSample[ nItem ] ;


HEADERS "Reviewing Array" ;
FIELDSIZES 200 ;
OF oDlg ;
SIZE 100, 100 ;
ON CLICK MsgInfo( "Click" ) ;
ON RIGHT CLICK ShowPopup( oBrw, nRow, nCol )

oBrw:bGoTop = { || nItem := 1 }
oBrw:bGoBottom = { || nItem := Eval( oBrw:bLogicLen ) }
oBrw:bSkip = { | nWant, nOld | nOld := nItem, nItem += nWant,;
nItem := Max( 1, Min( nItem, Eval( oBrw:bLogicLen ) )
),;
nItem - nOld }
oBrw:bLogicLen = { || Len( aSample ) }
oBrw:cAlias = "Array" // Just put something
oBrw:bKeyChar = { | nKey | MsgInfo( nKey ) } // Controlling keystrokes

@ 1, 20 BUTTON "&End" OF oDlg ACTION oDlg:End()

ACTIVATE DIALOG oDlg CENTERED

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


return nil

4.6 Browsing everything you want


--------------------------------------------------------------------------------

The major advantage of FiveWin TWBrowse (strongly based on Clipper TBrowse


model) is the capability of browsing anything you may need.

FiveWin TWBrowse is a generic browser machine capable of browsing information


of any type, though as DataBase browsing is usually more common, we have
added certain built-in functionality to quickly build DataBases browsers.

There are certain DATAs and METHODs in a TWBrowse object, that conveniently
initialized will let you browse anything:

DATAs bLine It will be used to display each browse line.


It must return an array with all the columns
elements to represent.

bSkip Used to skip certain amount of lines. This


codeblock is evaluated every time the current
selected line is going to change. bSkip receives
a numeric parameter indicating the desired
number of lines to be skipped, and it has to
confirm that number returning it, or an
alternative number with the real number of lines
to skip:

bSkip = { | nWant, nDo | ..., nDo }

nWant represent the desired number of lines to


skip. nDo will indicate the final number of
lines to skip.

bGoTop These codeblocks are evaluated for navigating


bGoBottom through the represented data. Properly assigned
will let you browse anything.

bLogicLen You must assign here the logical total length


of the browse, to properly set the browse
scrollbar.

As an example, lets see how we can browse an array just manipulating


these DATAs:

@ 1, 2 LISTBOX oBrw FIELDS aSample[ nItem ] ;


HEADERS "Reviewing Array" ;
FIELDSIZES 200 ;
OF oDlg ;
SIZE 100, 100 ;
ON CLICK MsgInfo( "Click" )

oBrw:bGoTop = { || nItem := 1 }
oBrw:bGoBottom = { || nItem := Eval( oBrw:bLogicLen ) }
oBrw:bSkip = { | nWant, nOld | nOld := nItem, nItem += nWant,;
nItem := Max( 1, Min( nItem, Eval( oBrw:bLogicLen ) )
),;
nItem - nOld }
oBrw:bLogicLen = { || Len( aSample ) }
oBrw:cAlias = "Array" // Just put something
oBrw:bKeyChar = { | nKey | MsgInfo( nKey ) } // Controlling keystrokes

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


5. Printing

Basic concepts about printing in Windows


--------------------------------------------------------------------------------

The major difference between managing the printer in MsDos and in Windows
is the fact that in Windows we manage the printer in graphical mode.

This means that we are going to manage different sizes of fonts, that we
are going to manage text and drawings, that we may need to preview all
that on the screen, and the most important thing: that different printers
may have different resolutions, and we have to control all that.

FiveWin automatize all these processes giving you maximum power with minimum
complexity. FiveWin categorizes all printing works in these different
types:

* Quick printing techniques!


* Managing the printer object
* The Report Engine

Quick printing techniques!


--------------------------------------------------------------------------------

Besides the sophisticated FiveWin Report Engine, FiveWin offers you


RAD (rapid application development) techniques to quickly prototype
your printouts, with no work at all on your side!:

* Generating a full report from the current workarea:

Just call the function Report() and you will get a full paged
report automatically generated from the current workarea!

* Generating an automatic report from any Browse !!!:

If you do <oBrw>:Report() where <oBrw> is a reference to your


browse, FiveWin will generate a full report with the same contents
of your browse. So, the easiest way to implement a report in your
browse is placing a bitmap button on your DialogBox with the
action <oBrw>:Report().

* Making a printer HardCopy of any window or control !!!:

If you have a Dialog and you want to obtain a printout of it,


the easiest way is just doing: <oDlg>:HardCopy( <nZoom> ) where
<oDlg> is your Dialog object and <nZoom> is a scale factor -
a value of 3 is normally recommended to obtain natural dimensions-
You can use a bitmap instead of the Dialog, or any window or
control!

Combining these techniques you can very quickly prototype your


first application printouts. Don't forget them!

Remember to use these techniques on the first stages of your


application.
Managing the printer as an object
--------------------------------------------------------------------------------

FiveWin manages the printer as an object, so controlling the printing

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


process is as easy as manipulating, from an object oriented point of view,
the printer object.

* How to create a Printer object ?

FiveWin provides a TPrinter Class to manage the printer as an object,


and some specific xBase commands to easier much more that manipulation:

PRINT oPrn NAME "My Printout" PREVIEW

PAGE
...
oPrn:Say( nRow, nCol, cText, ... )
...
ENDPAGE

ENDPRINT

The PRINT command is building there a TPrinter object. From that moment
on we may manipulate it directly, using all the DATA and METHODs offered
by the TPrinter Class.

* How to manipulate the Printer Object ?

Normally you create several pages using the commands:

PAGE
...
ENDPAGE

And from inside that section you send messages to the Printer object.
The most common message used is <oPrn>:Say() :

oPrn:Say( nRow, nCol, cText, ... )

Remember that the coordinates where you are printing depend upon the
specific printer resolution you may be using. In order to control this,
you have to ask the printer object about its specific resolution:

oPrn:nVertRes() is the number of pixels in vertical


oPrn:nHorzRes() is the number of pixels in horizontal

Now, you divide those values by the number of rows and cols that you
want to manage, and increase nRow, nCol according to those steps.
See SAMPLES\TestPrn2.prg

* How to define a font that adapts to a specific Printer Object ?

To create a font object that adapts its size to the specific resolution
of a printer, we use as always the container clause OF :

local oPrn, oFont

PRINT oPrn

DEFINE FONT oFont NAME "Arial" SIZE 0, -10 OF oPrn

...

PAGE
...

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


oPrn:Say( nRow, nCol, cText, oFont, ... )
...
ENDPAGE

ENDPRINT

oFont:End()

Remember to destroy the font once you have finished printing.


FiveWin Report Engine
--------------------------------------------------------------------------------

We want to thank our friend Ignacio Ortiz de Zu.iga for his excellent
work and contribution to the FiveWin Report engine,

--------------------------------------------------------------------------------

( many thanks also to Roger Seiler for his great help on documenting the
FiveWin Report Engine)

All the reports have the following construction:

LOCAL oReport

REPORT oReport ...


COLUMN ...
COLUMN ...
END REPORT

ACTIVATE REPORT oReport ...

As you can see the basic construction is very simple. Here is the
complete syntax with all the optional bells and whistles:

REPORT [ <oReport> ] ;
[ TITLE <bTitle, ...> [< LEFT | CENTER | CENTERED | RIGHT > ] ];
[ HEADER <bHead, ...> [< LEFT | CENTER | CENTERED | RIGHT > ] ];
[ FOOTER <bFoot, ...> [< LEFT | CENTER | CENTERED | RIGHT > ] ];
[ FONT <oFont, ...> ] ;
[ PEN <oPen, ...> ] ;
[ < lSum:SUMMARY > ] ;
[ < file: FILE | FILENAME | DISK > <cRptFile> ] ;
[ < resource: NAME | RESNAME | RESOURCE > <cResName> ] ;
[ < toPrint: TO PRINTER > ] ;
[ < toScreen: PREVIEW > ] ;
[ TO FILE <toFile> ] ;
[ TO DEVICE <oDevice> ] ;
[ CAPTION <cName> ]

GROUP [ <oRptGrp> ] ;
[ ON <bGroup> ] ;
[ HEADER <bHead> ] ;
[ FOOTER <bFoot> ] ;
[ FONT <uFont> ] ;
[ < lEject:EJECT > ]

COLUMN [ <oRptCol> ] ;
[ TITLE <bTitle, ...> ] ;
[ AT <nCol> ] ;
[ DATA <bData, ...> ] ;
[ SIZE <nSize> ] ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ PICTURE <cPicture, ...> ] ;
[ FONT <uFont> ] ;
[ < total: TOTAL > [ FOR <bTotalExpr> ] ] ;
[ < ColFmt:LEFT | CENTER | CENTERED | RIGHT > ] ;
[ < lShadow:SHADOW > ] ;
[ < lGrid:GRID > [ <nPen> ] ]

ENDREPORT

ACTIVATE REPORT <oReport> ;


[ FOR <for> ] ;
[ WHILE <while> ] ;
[ ON INIT <uInit> ] ;
[ ON END <uEnd> ] ;
[ ON STARTPAGE <uStartPage> ] ;
[ ON ENDPAGE <uEndPage> ] ;
[ ON STARTGROUP <uStartGroup> ] ;
[ ON ENDGROUP <uEndGroup> ] ;
[ ON STARTLINE <uStartLine> ] ;
[ ON ENDLINE <uEndLine> ] ;
[ ON CHANGE <bChange> ]

With the command COLUMN (syntax above) you indicate all the
columns that the report will have indicating the data and the
title of each column. This can be very simple. For example:

COLUMN TITLE "Name" DATA Test->Name

------------------------
REP02.PRG

IMPLEMENTING TOTALS:

If you want a Total on any column just add the word TOTAL in the
command, for example:

COLUMN TITLE "Salary" DATA Test->Salary TOTAL

------------------------
REP03.PRG

HEADERS & FOOTERS:

You can put any header and footer on the report by declaring them
in the REPORT command. For example:

REPORT oReport TITLE "My First Report" ;


HEADER "This is the header" ;
FOOTER "This is the footer"

You can even specify how it will be written: left, centered or right,
adding the word LEFT, RIGHT or CENTER|CENTERED. For example:

REPORT oReport TITLE "My First Report" ;


HEADER "This is the header" RIGHT ;
FOOTER "This is the footer" CENTER

Remember: by default Titles are centered and Headers and Footers are
written on the left side.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


-------------------------
REP04.PRG

MULTILINE TITLES, HEADERS AND FOOTERS:

If you want more than one line for a title just put a comma between
each title. For example:

REPORT oReport ;
TITLE "My First Report", "with FiveWin"

The same happens with headers and footers.

The report engine NEVER puts a white line between the header and the
title or between the title and the column titles. It is up to you to
put the blank lines wherever you want them. For example, if you want
to put a blank line between the header and the title, just indicate a
second line on the header with nothing on it -- just an empty chain:

REPORT oReport TITLE "My Report ;


HEADER "My Header", " "

-------------------------
REP05.PRG

USING EXPRESSIONS:

You can put almost anything you want in your reports because you can
use any expression that returns a character string, remember this is
the key to do almost anything you want. For example, if you want to
put the date() on the report plus the current page number, just
do the following:

REPORT oReport TITLE "My Report" ,;


"date:"+DtoC(Date()) ;
FOOTER "Page Number: "+ ;
Str(oReport:nPage,3)

You can put expressions rather than character strings in almost


anywhere: Titles, Headers, footers, Column titles, column data, etc...

--------------------------
REP06.PRG

REPORT DESTINATION:

By default, the report is sent to the printer, but you can change it
when you create the report:

REPORT oReport .... ;


TO PRINTER => (The default)

REPORT oReport .... ;


PREVIEW => (To Screen)

REPORT oReport .... ;


TO FILE <cFile> => (Txt format)

When you send the report to the screen (PREVIEW), the report engine
creates all the pages until you push the button Preview, and then
you will immediately see the first page created.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


When you create a Report you can specify a caption for it. This
caption would be the title of the preview Window if you send the
report to the screen, or it will be the description on the spooler if
you send it to the printer. (In previous releases we used the word
NAME for this.)

-------------------------------
REP07.PRG

USING FONTS:

You can use any font you want with your reports. This is the way you
use them:

First you have to define them with the command DEFINE FONT oFont ....

DEFINE FONT oFont1 NAME "ARIAL" SIZE 0,-10


DEFINE FONT oFont2 NAME "ARIAL" SIZE 0,-10 BOLD

The size (width,height) specs. use different units of measure when


printed versus displayed on screen. On screen, the units are pixels,
but when printed, the units are font "points". Thus, for printed
text, we only use the second size specification (height) to give the
point size, leaving the "width" as "0". The point size is given as
a negative number, i.e. "10 point" is "-10". Remember that point
size for proportionally spaced type is different than "pitch," which
is the term often used for non-proportionally spaced "typewriter" type
like Courier. Point size refers to letter height, whereas pitch
refers to the number of equal-spaced letters printed per inch. Regular
"pica" sized typewriter type is 10 pitch - 10 letters per inch. But
represented in point size, this is 12 point -- very confusing because
the smaller "elite" typewriter type is 12 pitch - 12 letters per inch,
which is 9 point. (With "pitch," the bigger the number, the smaller
the font -- just the opposite of how "point" size works.) Now to add
to the confusion, remember that in this Report Engine, we let FiveWin
know that we're working with point size instead of pixels by using
negative numbers for points (and we must use points instead of pitch
for equal-spaced fonts like Courier). In this case, the "-" sign
isn't mathematical -- it doesn't mean (as math rules would suggest)
that your point size gets smaller as the integer gets bigger. Just
the reverse. The bigger the integer, the bigger the point size. If
you're still confused, there's a fellow named Guttenberg on CIS who
can explain it all to you.

When you create the report, you specify the fonts you want to use,
separating each one with a comma.

For example:

REPORT oReport TITLE ..... ;


FONT oFont1, oFont2, oFont3

The first font in the list (oFont1) will be the standard font, so if
you do not specify a font for a specific column it will use the
standard font (oFont1).

If you want a column to use the second font just do the following:

COLUMN TITLE ... DATA .... FONT 2

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


As you can see, you indicate the ordinal number in the list of fonts
defined when you create the report.

Again, you can use an expression this way:

COLUMN TITLE ... DATA ... ;


FONT iff(Test->Salary>1000,2,1)

Remember to release the fonts after the report is done.

Now here is the complete syntax:

Defining a font: DEFINE FONT <oFont> ;


[ NAME <cName> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ FROM USER ];
[ BOLD ] ;
[ ITALIC ] ;
[ UNDERLINE ] ;
[ WEIGHT <nWeight> ] ;
[ OF <oDevice> ] ;

[ NESCAPEMENT <nEscapement> ] ;

ACTIVATE FONT <oFont>

DEACTIVATE FONT <oFont>

RELEASE FONT <oFont>

SET FONT ;
[ OF <oWnd> ] ;
[ TO <oFont> ]

<oFont> A reference to the Font Object.

<cName> The name of the font. Example: Arial, Roman, etc...

<nWidth>, Dimensions of the font -- pixels for screen fonts, but


<nHeight> points for printed fonts. For printed fonts, use
"0" for <nWidth> and use <nHeight> for the points with
a minus sign in front of the points number.

<oWnd> A reference to the Window container.

<oDevice> The device owner of the font.

<nWeight> The weight of the font.

<nEscapement> The escapement of the font.

CLAUSES

FROM USER Displays the Font selection Dialog Box.

BOLD To create the font with bold feature.

ITALIC To create the font with italic feature.

UNDERLINE To create the font with underline feature.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


------------------------------
REP08.PRG

CONFIGURING COLUMNS:

When you create the columns, you can specify a lot of behavior:

- PICTURE: As same as GETS


- SIZE: Length of the column (number of Chars)
- AT: Print at specific column (better not use it)
- FONT: Font to use (number in the list of fonts)
- TOTAL: if the column should have a total

If you specify that the column has a total, the DATA should be a
number. But if not, do not worry -- the report engine does not break.
The TOTAL clause can have also a FOR condition. For example:

COLUMN DATA ... TOTAL FOR Test->Name = "Peter"

- LEFT|CENTER|CENTERED|RIGHT: You can also specify the way the text is


going to be printed, left, center or right. By default, everything is
left formated except numeric data which is right.

----------------------------
REP09.PRG

MULTILINE COLUMNS:

This is something you will really love: suppose you need to put
another column but you do not have enough width on the paper to do it?

You could use a smaller font, but this is not the best way. The best
way is to use multi lines for columns. That means that one database
register can use more than one line on the report. So we can do
something like this:

Name Salary
=================== ===========
Test->First Test->Salary
Test ->Last

This is as simple as:

COLUMN DATA Test->First, Test->Last

Just separate with a comma the data you want to be printed.

You can do the same with the column title, like this:

COLUMN DATA Test->First, Test->Last ;


TITLE "First Name" ,"Last Name"

If you put a TOTAL on that column, all the numeric data will be added.
All the data will have the same picture, but I will explain later
how to change this behavior.

--------------------------
REP10.PRG

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


MAKING GROUPS:

To make a group means to have a subtotal on a particular kind of


data. With the report form you can make two groups. With other report
generators you can make up to 9, but with FiveWin Report Engine you
have no limit.

If you want the totals of the groups to be printed you must totalize
at least one column.

The data, of course, should be sorted in accord with the group


expression.

To make a Group just do the following:

REPORT oReport ....


COLUMN ....
COLUMN ....

GROUP ON Test->State EJECT

END REPORT

The report will totalize each column that has been created with the
TOTAL clause for every State and will make a page eject when the
State changes.

You can even specify a Header, a Footer and a font to use for that
group (just one line on Headers and Footers):

GROUP ON Test->State ;
FOOTER "Total State:" ;
FONT 2 ;
EJECT

Remember, you can have all the groups you want.

--------------------------
REP11.PRG

SUMMARY REPORTS:

If you specify the clause SUMMARY when you create the report:

REPORT oReport TITLE ... SUMMARY

it will only print the information about groups. So the clause


SUMMARY should only be used when there is at least one group defined.

When you use the SUMMARY clause the report engine does not put any
group separator line.

---------------------------
REP12.PRG

CONTROLLING THE FLOW OF THE REPORT:

When you activate the report, it is possible to define FOR and WHILE
conditions. For example:

ACTIVATE REPORT oReport ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


WHILE Test->State = "A" ;
FOR Test->Salary > 1000

Because the report engine can make a report even from an array, by
default the WHILE condition is "!Eof()". So if you change the WHILE
condition, you must take care that if you are making a report from a
database it is a good practice to include in the WHILE condition the
text ".and. !Eof()":

ACTIVATE REPORT oReport ;


WHILE Test->State = "AZ" .AND. !Eof() ;
FOR Test->Salary > 100000

You can even control the flow of the report in the same manner as you
do with other windows.

When you activate the report you can indicate functions that will be
called when the report is in a particular state:

ACTIVATE REPORT oReport ;


ON INIT ... ;
ON END .... ;
ON STARTPAGE ....;
ON ENDPAGE ... ;
ON STARTGROUP .... ;
ON ENDGROUP .... ;
ON STARTLINE ... ;
ON ENDLINE .... ;
ON CHANGE ...

The INIT function is called just one time on the first page after the
column titles are printed.

The END function is called just one time on the last page after the
Grand totals are printed.

The STARTPAGE is called on every start of a page. This is one of the


most used because in this clause you will put bitmaps, lines, boxes,
etc...

The ENDPAGE is called on every end of a page, when all the text is
printed (not very useful).

The STARTGROUP is called on every start of a group and before the


header of the group is printed (if there is one).

The ENDGROUP is called on every end of a group.

The STARTLINE is called on every start of a line of the report body.


When STARTLINE is evaluated, the report engine is controlling if the
following line will fit in the current page, and if not, it will do
an Eject and start a new page. Be carefull when using STARTLINE,
because if you use Multiline columns there will be at least two
STARTLINES for each record processed.

The ENDLINE is called on every end of line of the body report. When
ENDLINE is evaluated all the line has been printed and the current
report line is been incremented.

The CHANGE is called on every "SKIP" if you are listing a database.


For practical purposes, this function is called before the SKIP and

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


not after. This is also a clause you will use a lot.

In the source code we have include a blank line on StartGroup and a


sound beep when the report is finished.

IMPORTANT: Be careful when using these clauses. Remember you are


inside the report flow, so you must take care of all the databases,
indexes, etc.. that the report is using.

FiveWin Report Engine - II .


--------------------------------------------------------------------------------

Report xBase commands .


--------------------------------------------------------------------------------

Report Classes
--------------------------------------------------------------------------------
Class TReport .
Class TrColumn .
Class TrGroup .
Class TrLine .

Report Samples See SAMPLES\Report directory


--------------------------------------------------------------------------------
REP01.PRG A very simple report .
REP02.PRG Implementing totals .
REP03.PRG Headers and footers .
REP04.PRG Multi line on title, headers and footers .
REP05.PRG The power of expressions .
REP06.PRG To printer, to screen and to file. And caption use. .
REP07.PRG Using fonts .
REP08.PRG Configuring the columns .
REP09.PRG Multi lines on columns .
REP10.PRG Making groups .
REP11.PRG Summary reports .
REP12.PRG Controlling the flow of the report .
REP13.PRG Understanding the report object .
REP14.PRG Going backwards .
REP15.PRG Printing arrays .
REP16.PRG Shadows and grids .
REP17.PRG Changing the aspect .
REP18.PRG Bitmaps .
REP19.PRG Boxes and lines .
REP20.PRG Printing memos .
REP21.PRG All together .

Report Classes
--------------------------------------------------------------------------------
Class TReport .
Class TReport
-------------------------------------------------------------------------------

DATAs
-------------------------------------------------------------------------------
oDevice The target device where to print
oTitle A TRLine object which contains the report title
oHeader A TRLine object which contains the report header
oFooter A TRLine object which contains the report footer
oRptWnd The related report window
oBrush An optional brush to use at the report

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


aGroups An array with all the report TRGroups objects defined
aColumns An array with all the report TRColumns objects defined
aFont An array with all the report TFont objects defined
aCols Internally used while printing. Don't use them!
aText Internally used while printing. Don't use them!
aData Internally used while printing. Don't use them!
aPen An arrays of pens to use with the report
bFor A codeblock which holds the FOR clause. By default: {|| .t. }
bWhile A codeblock which holds the WHILE clause. By default: {|| .not.
EOF() }
bInit A codeblock which holds the ON INIT clause.
bEnd A codeblock which holds the ON END clause.
bStartLine A codeblock which holds the ON NEWLINE clause.
bEndLine A codeblock which holds the ON ENDLINE clause.
bStartPage A codeblock which holds the ON NEWPAGE clause.
bEndPage A codeblock which holds the ON ENDPAGE clause.
bStartGroup A codeblock which holds the ON NEWGROUP clause.
bEndGroup A codeblock which holds the ON ENDGROUP clause.
bSkip A codeblock which holds how to skip to the next report line.
bStdFont A codeblock which returns the default report font order to use.
bPreview An optional codeblock to evaluate on the preview of the report
bChange A codeblock which holds the ON CHANGE clause
cRptFile -not available yet- The Data-driven file which holds the report.
cResName -not available yet- The resource name which holds the report.
cTotalChr The character to use for drawing the report total lines. Default:
"="
cGroupChr The character to use for drawing the report group totals. Default:
"-"
cTitleUpChr The character to use for drawing the report column title up line.
Default: "="
cTitleDnChr The character to use for drawing the report column title down line.
Default: "="
cFile -not available yet- The name of the target file to produce.
cName The name of the document to generate.
cPageTotal
cGrandTotal
nWidth The width of the target device. Pixels per inch.
nHeight The height of the target device. Pixels per inch.
nMargin The report left margin after stabilizing the report.
nRow The current report row being printed.
nPage The current report page being printer.
nMaxTitle The largest number of title lines used on all column titles.
nMaxData The largest number of data lines used on all columns body.
nSeparator The spaces width between columns.
nLeftMargin The left margin of the page. Default: 0,2 inches.
nRightMargin The right margin of the page. Default: 0,2 inches.
nTopMargin The top margin of the page. Default: 0,2 inches.
nDnMargin The down margin of the page. Default: 0,2 inches.
nTitleRow Row where to start printing the report title.
nBottomRow Last row available to the report body. (without the footer).
nStdLineHeight The default report line height.
nRptWidth The width of the report. Automatic updated when Stabilizing.
nLogPixX
nLogPixY
nFirstdrow
nLastdrow
nTitleHeight
nCounter
lSummary Not detailed report body information, only report groups.
lTotal If there is any column with total to be calculated.
lFinish .t. when the report is finishing. Internally used.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


lStable .t. after the report has been stabilized.
lGroup If there is any report group defined.
lPrinter If the target device is the printer.
lScreen -Not available yet- If the target device is the screen.
lFirstRow .t. only when processing the first body line in each page.
Internally used.
lCreated If the report has been completely created
lPreview If a report preview is required
lBreak
lSpanish If Spanish language is used
lShadow If a shadow is going to be displayed
lGrid If a Grid is going to be displayed
Cargo Generic cargo slot

METHODs
-------------------------------------------------------------------------------
New Method constructor: creates a new report. .
AddColumn Add a TRColumn object to the report. .
DelColumn Del a TRColumn object from the report. .
InsColumn Insert a TRColumn object to the report. .
AddGroup Add a new TRGroup object to the report. .
DelGroup Del a TRGroup from the report. .
Stabilize Stabilizes the report before starting printing (activate). .
Skip Skip to next record on the current workarea -or equivalent-. .
Init Evaluate the ::bInit codeblock if defined. .
End Forces the termination of the report. .
StartLine Executes the codeblock defined on the start of a line. .
EndLine Ends printing the current line. .
StartGroup Executes the codeblock defined on the start of a group. .
EndGroup Executes the codeblock defined on the end of a group. .
StartPage Executes the codeblock defined on the start of a page. .
EndPage Executes the codeblock defined on the end of a page. .
NeedNewPage Returns .t. if a new page is needed. -internal used- .
NewLine Start a new line, and executes the startline codeblock. .
BackLine .
ColTitle Prints all report columns titles. .
TotalLine Prints every report columns Separator lines. .
PageTotal Prints all report column page & grand totals. .
Activate Starts executing the report. .
Play .
Margin Modify any of the top, left, bottom & right report margins. .
Say Draws a text .
SayBitmap Draws a bitmap .
Box Draws a box .
Line Draws a line .
Shadow Shadows an area .
KillShadow .
Grid Places a grid on the report .
Inc2Pix Turns inches into pixels .

Class TrColumn .
Class TRColumn
-------------------------------------------------------------------------------

DATA
oReport Its TReport object container.
aData An array with all data codeblocks.
aTitle An array with all titles codeblocks.
aPicture An array with all pictures.
bDataFont A codeblock that returns the font to use for the data.
bTitleFont A codeblock that returns the font to use for the title.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


bTotalFont A codeblock that returns the font to use for the total.
bTotalExpr A codeblock to return when a total must be calculated.
cTotalPict A string holding the PICTURE to use for the data.
nWidth The width of the column in pixels.
nDataHeight The height of the column data.
nTitleHeight The height of the column title.
nTotal The accumulated total already calculated for the column.
nCol The column position if defined.
nSize The width in characters in pixels if defined by the user.
nPad The relative position inside the column: LEFT, CENTER, RIGHT
nPen The Report pen elements to use
lTotal If the column has total
lShadow If the column has to be filled with a shadow background
lGrid If the column has to be bordered with lines
-------------------------------------------------------------------------------

METHODS
New Method constructor: creates a new column.
Stabilize Stabilizes the column. It is called by the report stabilize.
SayTitle Prints its title.
SayData Prints its data.
SayTotal Prints its total.

Class TRGroup FiveWin Report Engine Group objects


-------------------------------------------------------------------------------

DATAs
-------------------------------------------------------------------------------
oReport Its TReport object container.
aTotal An array of numeric totals, one for each report column.
bGroup A codeblock which holds the group expression.
bHeader A codeblock that returns the header of the group.
bFooter A codeblock that returns the footer of the group.
bHeadFont A TFont object to use to print the group header.
bFootFont A TFont object to use to print the group footer.
cValue It keeps the latest group evaluated expression.
nCounter
lEject If eject is to be performed on each group change.

METHODs
-------------------------------------------------------------------------------
New Method constructor: creates a new TRGroup object. .
Reset Resets the accumulated total value of all aTotal to 0. .
Header Prints the header of the group. .
Footer Prints the footer of the group. .
Total Prints the totals of the group. .
HeaderHeight Returns the height of the group header. .
FooterHeight Returns the height of the group footer. .
Evaluate Calculates the group expression .
Check Checks if the group condition has changed .

Class TrGroup .

Class TRLine FiveWin Report Engine Line objects .


-------------------------------------------------------------------------------

DATAs
-------------------------------------------------------------------------------
oReport Its TReport object container.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


aLine An array of codeblocks with all the line data elements.
aFont An array of codeblocks with all the fonts to be used. .
aRow Internally used during printing.
aWidth An array with each line element width.
aPad An array with each line element pad type: LEFT, CENTER, RIGHT
nCol Internally used to print the line.
nHeight The height of the line.
nWidth The largest width defined of its elements.

METHODs
-------------------------------------------------------------------------------
New Method constructor: creates a new TRLine object. .
Stabilize Stabilizes the line. Called by the report stabilize method. .
Say Prints the line. .

Class TrLine .

Previewing your print-works


--------------------------------------------------------------------------------

You may generate an impressive preview of your printouts just specifying


the clause PREVIEW when building a printer object:

PRINT oPrn NAME "My Printout" PREVIEW


...
PAGE
...
oPrn:Say( nRow, nCol, cText, ... )
...
ENDPAGE
...
ENDPRINT

This will cause the printout to be reviewed first in screen, giving the
user the ability to preview and interactively select what to print or to
cancel the printout work.

FiveWin uses standard Windows Metafiles files to store each of the


printout pages. In order to manage those metafiles, FiveWin looks for
the temporary directory on your system. Remember to set a TEMP directory
on your autoexec.bat:

SET TEMP=c:\temp

FiveWin will store temporarily the metafiles files inside that directory,
and will delete them once the preview is finished. All these operations
are managed automatically by FiveWin.

8. Windows advanced
8.1 Managing DLLs - Dynamic Link libraries
--------------------------------------------------------------------------------
What is and how to use a DLL ? .

DLLs management xBase commands


--------------------------------------------------------------------------------
DLL [STATIC] FUNCTION <FunName> ... DLLs run-time linking and use .

SAMPLES
--------------------------------------------------------------------------------
DllCall.prg Dynamic linking at runtime sample .

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


DllClear.prg Utility for removing left open DLLs in Windows .

DLL Commands
--------------------------------------------------------------------------------

Defining a external DLL DLL [STATIC] FUNCTION <FunName>( ;


function to be called [ <Param1> AS <Type> ] ;
at RunTime [ <ParamN> AS <Type> ] ) ;
AS <return> [PASCAL] LIB <DllName>

FiveWin lets you declare an external DLL function to be called at RunTime


by its own name! See DllCall.prg example.

<FuncName> The name of the DLL function. Remember Clipper only uses
10 characters maximum length.

<Param1> Name of a parameter.

Length in bytes
<Type>, BYTE, CHAR 1
<return> WORD, BOOL, HANDLE, HWND, HDC 2
LONG, STRING, LPSTR, PTR 4
DOUBLE 8

<DllName> Name of the DLL.

We recommend to develop a C language based connection functions when you


are going to develop an intensively work with some DLLs. See "using
Windows API". Examples:

Calling SndPlaySound() at RunTime:

#include "FiveWin.ch"

function Main()

SndPlaySound( "tada.wav", 0 )

return

DLL FUNCTION SndPlaySound( cFile AS LPSTR, nType AS WORD ) AS BOOL ;


PASCAL LIB "MMSYSTEM.DLL"

Designing the same DLL connection using C language:

#include <WinTen.h>
#include <Windows.h>
#include <MMSystem.h>
#include <ClipApi.h>

//----------------------------------------------------------------------------//

CLIPPER SNDPLAYSOU() // ND()


{
_retl( sndPlaySound( _parc( 1 ), _parni( 2 ) ) );
}

//----------------------------------------------------------------------------//

In this situation it is necessary to use a specific LIB so the linker will

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


know how the DLL connection must be done at RunTime. Example:

TEST.DLL // Is a commercial DLL we are going to use

IMPDEF.EXE TEST.DEF TEST.DLL // IMPDEF.EXE is a tool Microsoft and


// Borland provides

Now, edit TEST.DEF -which it is an ascii file- and rename the symbols
with 10 characters or less with an underscore:

LESS10 ---> _LESS10

Then do:

IMPLIB.EXE TEST.LIB TEST.DEF

When linking use that .LIB !

Review our \WinApi directory C -only registered users- source code to see a
lot of examples of doing this.

Warning: SndPlaySound() is already built inside FiveWin.lib. It has been


used just in this example for learning purposes.

Dll.ch
#ifndef _DLL_CH
#define _DLL_CH

#define VOID 0
#define BYTE 1
#define CHAR 2
#define WORD 3
#define _INT 4 // conflicts with Clipper Int()
#define BOOL 5
#define HDC 6
#define LONG 7
#define STRING 8
#define LPSTR 9
#define PTR 10
#define _DOUBLE 11 // conflicts with BORDER DOUBLE

#translate NOREF([@]<x>) => <x>

//----------------------------------------------------------------------------//

#xcommand DLL [<static:STATIC>] FUNCTION <FuncName>( [ <uParam1> AS <type1> ] ;


[, <uParamN> AS <typeN> ] )
;
AS <return> [<pascal:PASCAL>] LIB <*DllName*> ;
=> ;
[<static>] function <FuncName>( [NOREF(<uParam1>)] [,NOREF(<uParamN>)]
) ;;
local hDLL := If( ValType( <DllName> ) == "N", <DllName>,
LoadLibrary( <(DllName)> ) ) ;;
local uResult ;;
local cFarProc ;;
if hDLL > 32 ;;
cFarProc = GetProcAddress( hDLL, <(FuncName)>, [<.pascal.>],
<return> [,<type1>] [,<typeN>] ) ;;
uResult = CallDLL( cFarProc [,<uParam1>] [,<uParamN>] ) ;;
If( ValType( <DllName> ) == "N",, FreeLibrary( hDLL ) ) ;;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


else ;;
MsgAlert( "Error code: " + LTrim( Str( hDLL ) ) + " loading " +
<DllName> ) ;;
end ;;
return uResult

//----------------------------------------------------------------------------//

#xcommand DLL32 [<static:STATIC>] FUNCTION <FuncName>( [ <uParam1> AS <type1> ]


;
[, <uParamN> AS <typeN> ] )
;
AS <return> [<pascal:PASCAL>] LIB <*DllName*> ;
=> ;
[<static>] function <FuncName>( [NOREF(<uParam1>)] [,NOREF(<uParamN>)]
) ;;
local hDLL := If( ValType( <DllName> ) == "N", <DllName>,
LoadLib32( <(DllName)> ) ) ;;
local uResult ;;
local cFarProc ;;
if hDLL >= 0 .and. hDLL <= 32 ;;
MsgAlert( "Error code: " + LTrim( Str( hDLL ) ) + " loading " +
<DllName> ) ;;
else ;;
cFarProc = GetProc32( hDLL, <(FuncName)>, [<.pascal.>], <return>
[,<type1>] [,<typeN>] ) ;;
uResult = CallDLL32( cFarProc [,<uParam1>] [,<uParamN>] ) ;;
If( ValType( <DllName> ) == "N",, FreeLib32( hDLL ) ) ;;
end ;;
return uResult

#endif

//----------------------------------------------------------------------------//
// This sample shows how to make a Dynamic Linking at RunTime!
// Using Borland BWCC.DLL DLLs

#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

BWCCMessageBox( 0, OemToAnsi( "Using Borland's BWCC DLL" ),;


OemToAnsi( "Hello World!" ), 0 )

BWCCMessageBox( 0, OemToAnsi( "(C) F. Pulp.n y A. Linares, 1993-4" ),;


"FiveWin 1.5", 2 )

SndPlaySound( "Ahhhhh.wav", 0 )

return nil

//----------------------------------------------------------------------------//

DLL FUNCTION BWCCMessageBox( hWnd AS WORD, cText AS LPSTR, cTitle AS LPSTR,;


nType AS WORD ) AS WORD PASCAL LIB "BWCC.DLL"

DLL FUNCTION SndPlaySound( cFile AS LPSTR, nType AS WORD ) AS BOOL ;


PASCAL LIB "MMSYSTEM.DLL"

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


//----------------------------------------------------------------------------//
// Utility for removing opened DLLs in Windows

#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

local cDllName := Space( 40 )


local hDll

if MsgGet( "DLL to remove from memory", "Name DLL:", @cDllName )


hDll = LoadLibrary( cDllName )

for n = 1 to 10
FreeLibrary( hDll )
next
endif

return

8.2 Managing DDE - Dynamic Data Exchange


--------------------------------------------------------------------------------
What is DDE ? .

DDE management xBase commands


--------------------------------------------------------------------------------
DEFINE DDE <oDde> ... .

DDEML Classes
--------------------------------------------------------------------------------
TDDEMLServer DDE Server Class .
TDDEMLClient DDE Client Class .

SAMPLES
--------------------------------------------------------------------------------
DDEMLSVR.prg DDEML Server sample .
DDEMLCLI.prg DDEML Client sample .
What is DDE ?
--------------------------------------------------------------------------------

Dynamic data exchange (DDE) is a form of interprocess communication that


uses shared memory to exchange data between applications. Applications can
use DDE for one-time data transfers and for ongoing exchanges in which the
applications send updates to one another as new data becomes available.

Dynamic data exchange differs from the clipboard data-transfer mechanism


that is also part of the Windows operating system. One difference is that
the clipboard is almost always used as a one-time response to a specific
action by the user--such as choosing the Paste command from a menu. Although
DDE may also be initiated by a user, it typically continues without the
user's further involvement.

FiveWin implements two Classes TDDEMLServer and TDDEMLClient to easily


manage a DDE Client-Server session.
DDE Commands Dynamic Data Exchange xBase management
--------------------------------------------------------------------------------

Defining a new DDE DEFINE [ DDE | LINK ] <oDde> ;


connection [ SERVICE <cService> ] ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ TOPIC <cTopic> ] ;
[ ITEM <cItem> ] ;
[ ACTION <uAction> ] ;
[ VALID <uEnd> ] ;

Activating the DDE ACTIVATE [ DDE | LINK ] <oDde>

Deactivating the DDE DEACTIVATE [ DDE | LINK ] <oDde>

Ending the connection RELEASE [ DDE | LINK ] <oDde>

<oDde> A reference to the DDE Object.

<cService> The service which establishes the connection.

<cTopic> The topic which establishes the connection.

<cItem> The item which establishes the connection.

<uAction>

<uEnd> An action to execute when the DDE is finished.


#ifndef _DDE_CH
#define _DDE_CH

#define WM_DDE_FIRST 992 // 0x03E0


#define WM_DDE_INITIATE (WM_DDE_FIRST)
#define WM_DDE_TERMINATE (WM_DDE_FIRST+1)
#define WM_DDE_ADVISE (WM_DDE_FIRST+2)
#define WM_DDE_UNADVISE (WM_DDE_FIRST+3)
#define WM_DDE_ACK (WM_DDE_FIRST+4)
#define WM_DDE_DATA (WM_DDE_FIRST+5)
#define WM_DDE_REQUEST (WM_DDE_FIRST+6)
#define WM_DDE_POKE (WM_DDE_FIRST+7)
#define WM_DDE_EXECUTE (WM_DDE_FIRST+8)
#define WM_DDE_LAST (WM_DDE_FIRST+8)

//----------------------------------------------------------------------------//

#xcommand DEFINE <dde:DDE,LINK> <oDde> ;


[ SERVICE <cService> ] ;
[ TOPIC <cTopic> ] ;
[ ITEM <cItem> ] ;
[ ACTION <uAction> ] ;
[ VALID <uEnd> ] ;
=> ;
<oDde> := TDde():New( <cService>, <cTopic>, <cItem>, [<{uAction}>],;
[<{uEnd}>] )

#xcommand ACTIVATE <dde:DDE,LINK> <oDde> => <oDde>:Activate()

//----------------------------------------------------------------------------//

Class TDde
--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
nService The service on which to establish the connection.
nTopic The topic on which to establish the connection.
nItem The item on which to establish the connection.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


bAction Action to be performed
bEnd Action to perform when ending the DDE link (VALID)
oWndServer Container TWindow object of the TDDE object.
lActive If the DDE connection is still active

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
Activate To initiate a conversation with server applications
responding to the specified application and topic names.
Execute To send a string to the server to be processed as a
series of commands.
End Ends the DDE connection

Class TDDEMLServer DDEML Server Object management


--------------------------------------------------------------------------------

DATAs
--------------------------------------------------------------------------------
hInst A handle of the DDEML instance session
hConv A handle of the DDEML conversation
cService The name of the service
hService The handle of the service
lConnecting If the server is in the process of connecting with a Client
hSz2 Some processes require to hold a hSZ2 handle stored here
aClients An array with all the attended Clients
bOnConnect The action to perform when connecting to a client
bOnRequest The action to perform on a client request
bOnDisconnect The action to perform when a client disconnects
bOnExecute The action to perform on a Client Execute command

METHODs
--------------------------------------------------------------------------------
New Constructor METHOD
Connect Automatically called when a Client wants to connect
ConnectConfirm Automatically called when a Client has finally connected
Disconnect Automatically called when a Client has disconnected
Execute Automatically called when a Client has sent a command
Request Automatically called when a Client has done a request
Return Use this method to return data to a Client Request

Class TDDEMLClient DDEML Client Object management


--------------------------------------------------------------------------------

DATAs
--------------------------------------------------------------------------------
hInst A handle of the DDEML instance session
hConv A handle of the DDEML conversation
cService The name of the service
hService The handle of the service
cTopic The name of the topic to keep the conversation about
hTopic The handle of the topic
nTimeOut The timeout to wait for an answer. Default 1000. Use -1 for
ASync.

METHODs
--------------------------------------------------------------------------------
New Constructor METHOD
Connect To connect to a Server
Disconnect To disconnect from the Server

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


End Disconnects from the Server. Same as above
Execute Sends a command to the Server.
Request Request data from the Server.

// FiveWin DDEML Class TDDEMLServer demonstration

#include "FiveWin.ch"

extern DbUseArea, DbGoTop, DbSkip, DbGoBottom

static oWnd, oServer

//----------------------------------------------------------------------------//

function Main()

USE c:\FiveWin.19\samples\Customer

DEFINE WINDOW oWnd TITLE "DDEML Server"

ACTIVATE WINDOW oWnd ;


ON INIT InitServer()

oServer:End() // Destroyes the DDEML Server

return nil

//----------------------------------------------------------------------------//

function InitServer()

if oServer == nil
oServer = TDDEMLServer():New()

// Enable the application as a remote NetDDE server !!!


oServer:SetNetDDE( .t. )

oServer:bOnConnect = { || oWnd:Say( 3, 0, "Connected!" ) }

oServer:bOnExecute = { | cCommand | ;
MsgInfo( "Command: " + cCommand,;
"Server: Command Received" ) }

oServer:bOnRequest = { | cRequest, cTopic | ;


RequestData( cRequest ) }

oServer:bOnDisconnect = { || MsgInfo( "The client has disconnected!" ) }

endif

return nil

//----------------------------------------------------------------------------//

function RequestData( cRequest )

local cResult := &( cRequest ) // Clipper powerfull macros... <g>

return oServer:Return( cResult )

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


//----------------------------------------------------------------------------//
// FiveWin Class TDDEMLClient demonstration

#include "FiveWin.ch"

static oWnd, oClient

//----------------------------------------------------------------------------//

function Main()

local oBar, cData

DEFINE WINDOW oWnd TITLE "DDEML Client"

DEFINE BUTTONBAR oBar 3D OF oWnd

DEFINE BUTTON OF oBar ;


ACTION InitClient() ;
TOOLTIP "Connect to the Server"

DEFINE BUTTON OF oBar ;


ACTION RequestData() ;
TOOLTIP "Make a Request"

DEFINE BUTTON OF oBar ;


ACTION oClient:Execute( "Any command" ) ;
TOOLTIP "Send a command"

DEFINE BUTTON OF oBar ;


ACTION If( oClient != nil,;
( oClient:End(), oClient := nil ),) ;
TOOLTIP "Disconnect"

SET MESSAGE OF oWnd TO "FiveWin - DDEML management" NOINSET

ACTIVATE WINDOW oWnd

return nil

//----------------------------------------------------------------------------//

function InitClient()

if oClient == nil

oClient = TDDEMLClient():New()

if oClient:NetConnect( "ANTONIO", "DdeMlSvr.exe" )


MsgInfo( "Connection Established!" )
else
MsgInfo( "Cannot connect to server" )
endif

endif

return nil

//----------------------------------------------------------------------------//

function RequestData()

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


local n

for n = 1 to 20
oWnd:Say( n, 2, oClient:Request( "CUSTOMER->Last" ) )
oClient:Request( "CUSTOMER->( DbSkip() )" )
next
SysRefresh()

return nil

//----------------------------------------------------------------------------//
8.1 Managing MAPI - Mail Services
--------------------------------------------------------------------------------
What is MAPI ? .

MAPI management xBase commands


--------------------------------------------------------------------------------
DEFINE MAIL ... Creating a Mail object .
ACTIVATE MAIL ... Sending the Mail .

SAMPLES
--------------------------------------------------------------------------------
TestMail.prg Sending and receiving mail .
What is MAPI ?
--------------------------------------------------------------------------------

MAPI is the brief name for Mail Application Programming Interface.


MAPI is a Windows group of services specifically designed for exchanging
mail.
// FiveWin - Windows MAPI (mail services) support demonstration
// This is only for Windows for WorkGroups, Windows NT and Windows 95 !!!

#include "FiveWin.ch"
#include "Mail.ch"

static oWnd

//----------------------------------------------------------------------------//

function Main()

local oBar

DEFINE WINDOW oWnd TITLE "Using Windows MAIL Services"

DEFINE BUTTONBAR oBar 3D SIZE 33, 33 OF oWnd

DEFINE BUTTON OF oBar ACTION MsgInfo( MAPILogOn() ) ;


MESSAGE "LogOn in the mail system" TOOLTIP "LogOn"

DEFINE BUTTON OF oBar ;


ACTION ( MAPILogOff(), MsgInfo( "MAIL LogOff done!" ) ) ;
MESSAGE "LogOff from the mail system" TOOLTIP "LogOff"

DEFINE BUTTON OF oBar GROUP ;


ACTION InteractiveMessage() ;
MESSAGE "Send an interactive message" TOOLTIP "Interactive"

DEFINE BUTTON OF oBar ;


ACTION DirectMessage();

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


MESSAGE "Send a direct message" TOOLTIP "Direct"

DEFINE BUTTON OF oBar GROUP ACTION oWnd:End() TOOLTIP "End"

SET MESSAGE OF oWnd TO "FiveWin - Windows MAIL support" CENTERED

ACTIVATE WINDOW oWnd ;


VALID MsgYesNo( "Want to end ?" )

return nil

//----------------------------------------------------------------------------//

function InteractiveMessage()

local oMail

DEFINE MAIL oMail ;


SUBJECT "Testing..." ;
TEXT "This is real xBase power at your fingertips!" ;
FROM USER ;
RECEIPT

ACTIVATE MAIL oMail

MsgInfo( oMail:nRetCode )

return nil

//----------------------------------------------------------------------------//

function DirectMessage()

local oMail

DEFINE MAIL oMail ;


SUBJECT "FiveWin Mail-control power" ;
TEXT "This is real xBase power at your fingertips!" ;
TO "LOLO", "Lolo Linares"

ACTIVATE MAIL oMail

MsgInfo( oMail:nRetCode )

return nil

8.4 ODBC - Open DataBase connectivity and SQL


--------------------------------------------------------------------------------
What is ODBC ? .
When and why of ODBC ? .
What is SQL ? .
How do I use ODBC ? .

ODBC - xBase commands


--------------------------------------------------------------------------------
DEFINE ODBC ... .
ODBC ... EXECUTE ... .

ODBC - OOPS management


--------------------------------------------------------------------------------
DATA ... .

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


METHODS ... .

Working samples
--------------------------------------------------------------------------------
TestOdbc.prg A sample showing how to manage a DataBase using ODBC .

Bibliography
--------------------------------------------------------------------------------
Microsoft documentation .

What is ODBC ?
--------------------------------------------------------------------------------

ODBC is the standard proposed by Microsoft Windows for using DataBases


from any Windows application. You may think about ODBC as we think about
the Clipper RDD system.

Clipper RDD system -replaceable Data drivers- is an open architecture


to be used in Clipper applications. Just for Clipper.

Windows ODBC system -Open DataBase connectivity- is an open architecture


to be used in ALL Windows applications.

As Clipper has an internal engine to support all RDD connections, likewise


ODBC has a common engine (in ODBC.DLL) which lets all ODBC drivers connect
easily, using the same way.

ODBC is supported through a little DLL -about 40 Ks- that serves as an


interface between Windows applications and any kind of ODBC driver:

+----------------+ +------------+ +-----------+ +------------+


| Your Windows | | Windows | | Your ODBC | | Your |
| application |-->| ODBC.DLL |-->| Driver |-->| DataBase |
+----------------+ +------------+ +-----------+ +------------+

The ODBC driver has to follow the ODBC.DLL rules, so we don't have to
worry about it as we know that it will always be used in the same
way. ODBC lets Windows applications use any kind of DataBases in the
same way!

FiveWin encapsulates this process and offers you a powerful xBase


and OOPS management:

+--------------+ +-----------------+ +------------+


| Your | | ODBC Objects | | Windows |
| FiveWin |----->| easily managed |----->| ODBC.DLL |
| application | | through xBase | | |
+--------------+ +-----------------+ +------------+

ODBC.DLL offers a lot of functions to manage different ODBC services.


FiveWin manages them all with the standard Clipper DBFs management methods.

We are building a Clipper RDD to manage ODBC, so in future versions of


FiveWin, managing ODBC will be as easy as:

USE "MyDataBase" VIA "ODBC"

Right now we offer a powerful ODBC class to easily manage ODBC. When our
ODBC RDD is ready, then we will manage FiveWin ODBC objects through the
Clipper RDD driver.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Clipper ODBC RDD coming in FiveWin 2.0!

+--------------+ +----------+ +-----------------+ +------------+


| Your | | standard | | ODBC Objects | | Windows |
| FiveWin |--->| Clipper |-->| easily managed |---->| ODBC.DLL |
| application | | DBF use | | through xBase | | |
+--------------+ +----------+ +-----------------+ +------------+

When and why of ODBC ?


--------------------------------------------------------------------------------

Though ODBC is a very nice concept and, of course, some ODBC drivers work
quite well, we believe from our experience and conversations with FiveWin
users that ODBC it is not at all as easy and fast as CA-Clipper standard
DataBase management power (especially if you use the SixDriver or Comix!).

We recommend that you keep using your CA-Clipper DBFs designs and your
existing routines and applications.

There are some circumstances where using ODBC may be extremely useful.
We think FiveWin ODBC capabilities are really useful by offering
downsizing to companies. Imagine a company which uses DataBases that
can be accessed through ODBC. You can take your CA-Clipper and
FiveWin and convert those DataBases into standard CA-Clipper DBFs and
indexes (managed with your RDDs). This is a good opportunity for you to
gain business. Many companies are willing to downsize to PC platforms.
CA-Clipper and FiveWin-ODBC may be the key!

Of course you may use ODBC if you want to or if you need to. In these
circumstances remember not all ODBC drivers are as powerful as
Clipper, and you will discover, possibly a big surprise, that sometimes
your 'normal' Clipper processes can not be performed in ODBC!

We have not covered all the possibilities and situations in FiveWin ODBC
that you may face when trying to manage ODBC drivers. However we have offered
an open architecture which you may use and extend to suit your particular
needs.

What is SQL ?
--------------------------------------------------------------------------------

Microsoft Windows has chosen SQL as the standard method to manage ODBC
drivers. SQL is the programming system to manage ODBC architecture.

SQL means Structured Query Language, and in some aspects it is very


similar to what we are used to with Clipper and xBase dialects.

There are different levels of SQL, according to SQL historic evolution.


Right now we may find:

SQL - core level


SQL - Level 1
SQL - Level 2

The core level is the most basic and standard system. All ODBC drivers
accept most of SQL core level rules. Level1 and Level2 offer more
powerful capabilities. The first thing you need to identify when using
an ODBC driver is exactly at which level it operates. ODBC driver
manufacturers may provide an extensive documentation and samples.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Some drivers DON'T accept all ODBC capabilities. Carefully review your
ODBC driver documentation to learn its capabilities.

SQL is managed using functions and SQL commands.

SQL functions are managed in the same way as we manage Clipper functions.
They are just functions.

SQL commands are strings which contains a SQL statement to be executed:

Sample:

"SELECT * FROM Dialog"

To execute this statement, we use it as an argument to a function call:

SQLExecDirect( ..., "SELECT * FROM ..." )

FiveWin offers an ODBC Class that automatically does all these in a


very easy way.

How do I use ODBC ?


--------------------------------------------------------------------------------

First, the most important thing you have to do is to properly configure


ODBC used in Windows.

ODBC drivers and Windows MUST be properly configured at the USER level
to function correctly. You can not develop an ODBC application that
will work unless everybody has ODBC properly installed in their computers.
ODBC is not 'self-contained' like the CA-Clipper DBFs management
(where you can generate your DBFs and indexes on the fly!).

ODBC requires some specific installation. Basically, Windows needs to


know exactly, in advance, which DataBases are going to be used through
ODBC, where they are and what drivers will they use.

There is a ODBC xBase driver, provided by Microsoft but it is not


AT ALL as powerful as CA-Clipper RDDs. Keep this in mind.

ODBC - xBase commands


--------------------------------------------------------------------------------
DEFINE ODBC ... .
ODBC ... EXECUTE ... .

ODBC - xBase Commands


--------------------------------------------------------------------------------

Using a DataBase through DEFINE ODBC <oDbc> ;


ODBC [ NAME <cName> ] ;
[ USER <cUser> ] ;
[ PASSWORD <cPassword> ] ;
[ CONNECT <cConnect> ] ;
[ FROM USER ]

Executing a SQL statement ODBC <oDbc> [ SQL | EXECUTE ] <cCommand>

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<oDbc> A variable which holds the reference to the object ODBC.

<cName> The name of the DataBase to use.

<cUser> The name of the user who is going to manage the DataBase.

<cPassword> An optional password required to use the DataBase.

<cConnect> Some ODBC drivers require a connection string, which


normally includes the <cName>, <cPassword>, and other
extra required information.

<cCommand> A character string which holds the ODBC statement to


execute.

CLAUSES

FROM USER Means that we want to select interactively the DataBase


to use.

ODBC - xBase Commands


--------------------------------------------------------------------------------

Using a DataBase through DEFINE ODBC <oDbc> ;


ODBC [ NAME <cName> ] ;
[ USER <cUser> ] ;
[ PASSWORD <cPassword> ] ;
[ CONNECT <cConnect> ] ;
[ FROM USER ]

Executing a SQL statement ODBC <oDbc> [ SQL | EXECUTE ] <cCommand>

<oDbc> A variable which holds the reference to the object ODBC.

<cName> The name of the DataBase to use.

<cUser> The name of the user who is going to manage the DataBase.

<cPassword> An optional password required to use the DataBase.

<cConnect> Some ODBC drivers require a connection string, which


normally includes the <cName>, <cPassword>, and other
extra required information.

<cCommand> A character string which holds the ODBC statement to


execute.

CLAUSES

FROM USER Means that we want to select interactively the DataBase


to use.

Class TDbOdbc ODBC DataBase management


--------------------------------------------------------------------------------

FiveWin implements the Class TDbOdbc to simulate the xBase management


style on any ODBC used table.

DATAs

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
hStmt The handle of the SQL statement to process.
oOdbc A reference to the related TOdbc session object
aFields Array containing all the DataBase fields description
nRetCode Returned code from the latest operation
cLastComm The latest executed SQL command

METHODs
--------------------------------------------------------------------------------
New Constructor from source code
End Ends control and make it disappear
Cancel Cancels the current in process SQL statement
Execute Execute an SQL statement
GetCurName Gets the current assigned cursor name
GetOptions
InitFields Loads all DataBase fields descriptions into ::aFields
LastCommand Last executed command
LastError Retrieves the last error
FieldGet Retrieves the contents of a field
FieldGetBlob Retrieves the contents of a BLOB field into a disk file
FieldName Retrieves the name of a field
FieldType Retrieves the type of a field
FieldLen Retrieves the len of a field
FieldDec Retrieves the number of decimals of a field
ParamData
Prepare Prepares a SQL command so next time won't be parsed again
PutData Changes the current cursor pointed table values
RowCount Retrieves the number of fields of the DataBase
SetCurName Sets a name for the cursor in use
SetOptions Set several SQL options
SetParam Sets a param description for next SQL statement
Skip Skip to the next record

// FiveWin ODBC management !!!

// ODBC = Open DataBase Connectivity

#include "FiveWin.ch"

static oWnd

//----------------------------------------------------------------------------
//

function Main()

local oBrush

// SET 3DLOOK ON

DEFINE BRUSH oBrush FILE "..\bitmaps\odbcdem.bmp"

DEFINE WINDOW oWnd FROM 1, 1 TO 20, 75 TITLE "Testing ODBC" ;


MENU BuildMenu() BRUSH oBrush

@ 2, 2 BITMAP FILE "..\bitmaps\ODBC.bmp" OF oWnd

@ 12, 2 BITMAP FILE "..\bitmaps\ODBC2.bmp" OF oWnd

ACTIVATE WINDOW oWnd

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


return nil

//----------------------------------------------------------------------------
//

function BuildMenu()

local oMenu

MENU oMenu
MENUITEM "Use &ODBC" ACTION TestOdbc()
ENDMENU

return oMenu

//----------------------------------------------------------------------------
//

function TestOdbc()

local oDbc, oDlg


local oName, cName

DEFINE ODBC oDbc CONNECT "DSN=Dialog" FROM USER

cName = oDbc:FieldGet( 1 )

DEFINE DIALOG oDlg FROM 2, 2 TO 14, 60 TITLE "ODBC Management"

@ 2, 2 SAY oDbc:FieldName( 1 ) OF oDlg


@ 2, 6 GET oName VAR cName OF oDlg COLOR "W+/RB"

@ 5, 10 BUTTON "&Next" OF oDlg ;


ACTION ( oDbc:Skip(),;
cName := oDbc:FieldGet( 1 ),;
oName:Refresh() )

ACTIVATE DIALOG oDlg

oDbc:End()

return nil

//----------------------------------------------------------------------------
//
8.6 Event-Driven programming
--------------------------------------------------------------------------------
What are event-driven applications ? .
How may I control events ? .
Do I need to care about events ? .

Events management xBase commands


--------------------------------------------------------------------------------
... ON <EventName> <uAction> ... .

Events management Object Oriented management


--------------------------------------------------------------------------------
Following are some of the most used events related codeblocks.
You may review a certain class documentation to find the
related event codeblock you are looking for.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


TWindow Class
bInit Code Block to execute on initialization
bMoved Code Block to execute after moving the window
bLClicked Code Block to execute when left clicking the mouse
bKeyDown Code Block to execute when pressing a key
bPainted Code Block to execute when painting the Window
bRClicked Code Block to execute when right clicking the mouse
bResized Code Block to execute after resizing a Window
bLDblClick Code Block to execute when left double clicking the mouse
bWhen Code Block for WHEN clause
bValid Code Block for VALID clause
bKeyChar Code Block to execute when pressing a no-control key
bMMoved Code Block to execute when moving the mouse
bGotFocus Code Block to execute when receiving the focus
bLostFocus Code Block to execute when losing the focus

TWBrowse Class
bSkip Like Clipper TBrowse:skipBlock. We provide a default fast
DataBase skipper.
bGoTop Like Clipper TBrowse:goTopBlock. We provide a default
DataBase bGoTop.
bGoBottom Like Clipper TBrowse:goBottomBlock. We provide a default
DataBase bGoBottom.
bChange CodeBlock to perform when moving from row to row

TReport Class
bInit A codeblock which holds the ON INIT clause.
bEnd A codeblock which holds the ON END clause.
bStartLine A codeblock which holds the ON NEWLINE clause.
bEndLine A codeblock which holds the ON ENDLINE clause.
bStartPage A codeblock which holds the ON NEWPAGE clause.
bEndPage A codeblock which holds the ON ENDPAGE clause.
bStartGroup A codeblock which holds the ON NEWGROUP clause.
bEndGroup A codeblock which holds the ON ENDGROUP clause.
bSkip A codeblock which holds how to skip to the next report line.
bChange A codeblock which holds the ON CHANGE clause

follow the following recommendations:

FiveWin 1.9.2 upgrade has a set of new funtions to analize the


DGroup of your application. A new ErrorSysW.prg uses these
functions to analize your DG memory and help you in properly fine
tune it.

Basically there are two main rules:

1. Reduce the amount of static variables used in your app. This


is very easy just using a static array instead of several
variables:

static one
static two
static three

change them into

static aVars := {,,}

where

#define ONE aVars[ 1 ]

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define TWO aVars[ 2 ]
etc...

This does not have sense with few statics, but it do has sense
when you are managing a large amount of statics (I know of
customers that use over 1000 statics). FW 192 has a new function
that counts the number of statics variables your app has.

2. There is a powerfull utility named DGPIG (it can be found


on the CA-Clipper forum) produced by Michael Devore (CauseWay)
that analizes LIBs and OBJs and reports about DG consume. Clipper
OBJs consume 8 bytes which it is normal and can not be fixed. But
the problem normally comes from C language modules. There are many
ways why a C module can consume DG space. Normally for declaring
a literal inside the C code or cause declaring a static array.
This both problems can be fixed using the C clause 'far' that
forces them into a different data segment:

This is a sample:

// Correct way:
static far char Alert[] = "Alert";

CLIPPER nMsgBox()
{
_MsgBox( Alert, 0 );
}

// wrong way:
CLIPPER nMsgBox()
{
_MsgBox( "Alert", 0 );
}

//wrong way
static byte Buffer[200];

//right way
static far byte Buffer[200];

DGPIG will report you about these problems.

Just keep this in mind:

The less initial DGroup your app consumes (FW 192 reports you
this initial size), and the less Clipper static variables you
manage, the larger Clipper stack you may have:

<----------------------------- 64 Ks -------------------------------->
DATA,_BSS (SYMP) | STACK_C | HEAP_C | CLIPPER STACK | CLIPPER STATICS
<----------- initial DG size ------->

Clipper will use the remaining DG space for its stack.

From FiveWin 1.9.2 we are allocating dynamic heap when building GETs and
MultiGets from source code ( @ ..., ... GET ... ), so we have been able
to successfully reduce the LNK (or DEF) file HeapSize value down to
1024 bytes and the applications are working successfully. This was not
possible before as Gets and MultiGets used that area for internal working.
Doing this HeapSize reduction you will get an extra 7,5 Ks for your
Clipper stack!

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


9. Object Oriented Programming in FiveWin
FiveWin Architecture
-------------------------------------------------------------------------------

If you have some experience with Object Oriented Programming (OOPS), or if


you just are starting out, we are sure you will be delighted to know about
the OOPS structure that FiveWin implements.

FiveWin's OOPS implementation is done on four basic levels:

1.- xBase Commands


2.- Classes and Objects
3.- Functions and Data Structures
4.- The Windows API

xBase commands are the highest level of abstraction, that is, it is the
level at which you don't care about how things work and you only care about
functionality, that is "to make it work".

xBase commands originally came from dBase, and they have been evolving
towards a standard named "xBase". These commands are built over Objects.
These Objects, and their classes are the second level of abstraction.

To use Classes and Objects it is necessary that you have some OOPS
skills. FiveWin uses our library Objects to use the OOPS capability
of CA-Clipper. You can contact us to get the latest commercial release
of Objects, at a very low price, which includes all the documentation,
examples and source code so you will be able to utilize the incredible
world of OOPS technology.

Objects are also based on functions (methods) and data. This is the next
level of abstraction. You may realize as we progress through this document
that the complexity grows and there are more details to understand.

Finally most of the functions we use are based on the Windows API.

Maximum productivity is reached quickly at the xBase command level. As you


move down towards Windows API your power and possibilities are greater but
obviously your productivity decreases. As application programers you should
try to be at a intermediate level: a balance between productivity and
power.

In spite of the low popularity achieved by dBase IV, that version did a big
advance to consolidate the commands for creating and managing Objects
although it did not offer OOPS.

So in xBase the standard is established that for creating an


Object we to use the command:

DEFINE <ObjectClass> <ObjectName> [ ADDITIONAL CLAUSES ]

Note that if we use that command for create any Object, in some way
we are using a generic building 'message'. This is why we recommend
implementing that syntax for creating new Objects.

To activate any Object, we use:

ACTIVATE <ObjectClass> <ObjectName>

Finally, although this is not always necessary in Clipper, to destroy

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


an Object we use the command:

RELEASE <ObjectClass> <ObjectName>

These commands get processed in their correspondents messages sent


to the Object we are managing. So:

DEFINE WINDOW oWnd ==> Get transformed in ==> oWnd := TWindow():New( ... )

The use of these commands let us use a unique and common syntax for all
the Objects. You may think that this is one of the targets of OOPS:
We must concentrate in our goal and not in a particular implementation,
that means, we should use a unique interface.

As FiveWin includes the latest version of Objects, you may use it to


build new classes from the Classes that FiveWin offers you. Review the
FiveWin Classes hierarchy and inspect the design and the code of its
classes to understand how you should use the power of OOPS inheritance.

In FiveWin we have implemented for the first time a mixed system for
developing Object Oriented environments. The system we have developed lets
you use the power of OOPS and also the extensibility offered by 'pointers',
in Clipper named 'CodeBlocks'.

There is certain international discussions between these two approaches.


There is no an agreement about what is the optimum system. This is why
we have decided to build a mixed system which uses both technologies.

When in a program we need to modify a behavior temporarily, as a example,


defining a behavior for an event, we use the system based on pointers,
that is, based on CodeBlocks. The reason for this is that we may suppose
that behavior will not be necessary again in the future, so there is
no need for building a new Class.

When we do:

ACTIVATE WINDOW oWnd ;


ON PAINT ...

We are modifying the behavior for that window when it receives the
PAINT event. This system is based on CodeBlocks. It is logical because
that behavior will not be reused in the future.

But, if we were building a system that it is going to be reused in the


future, then it has all sense to build a new class: this is the
traditional OOPS way.

So, at FiveWin's TMsgBar Class, which is a class that will be used


frequently in other programs, we inherit a new Class form TWindow
and we redefine the method PAINT.

We are convinced that a good OOPS architecture should use this two
building models. As you get more OOPS experience you will understand
our point of view.

OOPS is marvelous, but still there are some aspects that should evolve.
The construction of this mixed model may be a good way for discovering
new possibilities.

Starting with OOPS


--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


What is an Object ? Definition of an Object .
What is a Class ? Definition of a Class .

Three main rules of an OOPS system .


--------------------------------------------------------------------------------
Encapsulation Data and Methods are an inseparable unit .
Polimorphism The same message applied to different Objects .
Inheritance Creating new Classes from existing ones .

What is an Object
--------------------------------------------------------------------------------

From the moment a human is born, they start recognizing and classifying the
world around. Our brain has the automatic mechanisms to organize our world
into Classes.

An Object is a collection of Data that has some typical behaviors which


differentiate it from other kinds of Objects.

Object : Data + Behaviors --> Data + Methods

Data: What the Object HAS.


Behaviors: What the Object DOES.

Example: What is a chair ? Even a child will tell us:

A chair has (DATA) :

* four legs
* a certain color
* some dimensions
* some weight
* a surface to sit on
* etc...

A chair's Behaviors (METHODS) :

* Can be built
* Can be moved from one place to another
* Supports someone if he/she sits on it
* Can be destroyed
* etc...

In these behaviors we see what the chair DOES and what can
be DONE TO the chair:

The chair does: * Supports someone if he/she sits on it

Someone may destroy the chair --> Something is done to the


chair.

The actions that get DONE TO an Object are EVENTS.

Data: What the Object HAS.


Behaviors: What the Object DOES.
Events: What is DONE to the Object.

Now lets see how we take those concepts into programming languages:

What is a Window ?

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


A Window is an Object that HAS:
* Coordinates on the screen.
* A caption
* Some controls on its surface
* A color
* etc...

A Window DOES:
* Resize
* Iconize
* Change its position
* etc...

Some EVENTS may happen to a Window:


* The mouse Clicks on it
* The user presses a key
* The Window gets resized
* etc...

How can we get a certain action from an Object ?

Send it a Message!

oWindow:Message( params,... )

A message usually has the same name of the Method:

oWindow:Refresh() ---> Will execute ---> METHOD Refresh() CLASS TWindow

What is a Class
--------------------------------------------------------------------------------

A Class is a group of rules which controls how the Object gets created
and what the behaviors of those Objects are.

A Class is something abstract: A collection of immaterial rules.

An Object is something real: It is a collection of Data. An Object is


something material.

I have a chair. I can touch it. I can use it. The chair exists!

I speak about 'chairs' with someone. I don't mind what chairs. It is


a concept that exists in everybodys mind. It is an abstraction of the
material world!

In computing, a Class is a bunch of code, rules for creating and


managing Objects.

In computing, an Object is a bunch of Data, real information being


managed according to its Class rules!

How do we create a Class with Clipper ?

CLASS TWindow

DATA nTop, nLeft, nBottom, nRight

METHOD New() CONSTRUCTOR


METHOD Display()

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


ENDCLASS

That is the header declaration. We can see the Data that a Window
Object will have: nTop, nLeft, nBottom, nRight

and the behaviors a Window may perform: New() and Display()

Typically the New() behavior is called a 'CONSTRUCTOR' method as it


is the way to build a new Object!

When in our code we do:

TWindow():New( 3, 3, 20, 40 )

We are creating an Object! That Object is a special kind of ARRAY in


Clipper which has some specific Data!

That Data can have different values from one Object to another, but it will
always be the same kind of Data.

Three main rules of an OOPS system


--------------------------------------------------------------------------------

We say a language system is an OOPS system when it has the following


three rules:

* Encapsulation
* Polimorphism
* Inheritance

Using CA-Clipper with OBJECTS.LIB we get these three rules, so from


that moment we may say :

CA-Clipper with Objects.LIB is a true Object Oriented Programming System!

Polimorphism The same message applied to different Objects


--------------------------------------------------------------------------------

The same message sent to Objects of different Classes, invokes different


methods.

Suppose we have a ball and a glass. Then I take a hammer and I hit them:

My message --> HammerHit

Object Ball --> start jumping from one place into another.

Object Glass --> Gets destroyed into a lot of small pieces.

Now I have a TReport() Object and a TLabel() Object:

I send them the message :Print()

oReport:Print()
oLabel:Print()

I get different results on my printer!

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Inheritance Creating new Classes from existing ones
--------------------------------------------------------------------------------

We may create new Classes from the ones we already have! We say we 'inherit'
new Classes from the previous ones.

In those Classes we use what we already have, but we may:

* Modify some behaviors!

* Add some new Data!

Using Inheriting Classes we build a Class Hierarchy!

In Clipper we do:

CLASS TDialog FROM TWindow

...

ENDCLASS

TDialog Objects have all the functionality of a TWindow Object but


we add some new Data and we modify some behaviors!

FiveWin and Windows API relationship .


--------------------------------------------------------------------------------
Object Oriented messages structure .
Windows API messages structure .

Windows API / FiveWin OOPS elements & messages equivalence:


--------------------------------------------------------------------------------
Windows API FiveWin OOPS engine

WindowProc( HWND hWnd, oWnd:HandleEvent( ;


WORD wMessage, nMsg,
WORD wParam, nWParam,
LONG lParam ) nLParam )

Handle hWnd Object oWnd (oWnd:hWnd also)

Numeric WM_MESSAGE OOPS Message oWnd:Message(...)

Returned values to Windows API

zero 0 - Message already processed


Non zero - Message already processed and
Windows API required value returned

Default Windows API behavior required


return DefWindowProc( ... ) the Method just return nil

Object Oriented messages structure .


-------------------------------------------------------------------------------
-

Microsoft Windows it is NOT a true Object Oriented environment. The main


reason for this is because it has been written using a non-true Object

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Oriented language, C language. C was used instead of C++ because at that
time it was not available.

You may read in many places that Windows is Object Oriented. This is not
true. In order to be Object Oriented is should offer the three main rules
of an Object Oriented environment: Encapsulation, Polymorphism and
Inheritance.

Windows should be Object Oriented and this would greatly help programmers
to write Windows applications. This is why Borland, Microsoft, CA and other
manufacturers have developed C++ classes libraries to convert Windows into
a true Object Oriented environment.

The problem with this latest approach is that there is still no standard.
If you review Microsoft, Borland and CA Class hierarchies you will find
many differences. These hierarchies are extremely large and most of
the time all of their features are not required in standard Windows
business applications.

Windows provides a very primitive way of simulating OOPS, it is called


'SubClassing', not in the Object Oriented sense, but in a simple way
of changing a windows procedure by another.

In order to make Windows a OOPS environment, it is required that all


created windows and controls are automatically 'SubClassed', that is,
we change the standard Windows API behavior mechanisms for the OOPS
mechanisms provided by an OOP language, like C++, Clipper 5 or any other
language with real OOPS capabilities.

Microsoft MFC, Borland OWL, CA CommonView and Clipper-FiveWin have been


built using the same construction rules. The same construction processes
are in all those products. FiveWin offers the simplest and fastest
Class hierarchy structure. We have developed it in that way to get
the best performance and size results. When you are in the OOPS arena
you run the risk of starting to create Classes without a strong reason and
you then run into the danger of huge performance decrease.

The process of converting Windows into a real OOPS environment has to be


taken in two steps:

* Automatically SubClassing all windows and controls as


soon as they are created. That allows us to change standard
Windows behaviors.

* Designing a base general events processing mechanism to


convert Windows messages into OOPS-language messages in
order to take advantage of polymorphism and code reusability.

Thanks to OOPS inheritance it is possible to create a base TWindow Class


which knows how to process most of all Windows API messages, and then
we may inherit new Classes from it which redefine Methods and easily let
us change the desired behaviors.

In FiveWin, the 'SubClassing' is done automatically through the TWindow


Methods :Link() -to perform the SubClass process- and :UnLink() to
restore the original procedures before the window gets destroyed. Those
processes are quite sophisticated. Don't modify them.

FiveWin changes all the standard windows procedures to a single one


which just gets the Clipper Object from the window handle and then
automatically calls :HandleEvent() method. So :HandleEvent() receives all

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Windows API messages, and automatically calls the appropriate Object Method.

Windows API messages structure


-------------------------------------------------------------------------------
-

If you review the examples provided in the Petzold book, you will realize
all Windows applications have the same structure:

* Creating the application main window


* Start running the main get-message loop
* Taking decisions based on received messages

Almost all that we see in a Windows environment is a window. The PushButtons,


the Scrollbars, the CheckBoxes, the Dialogs, etc... are all windows.

Windows sends messages to all windows informing them about what is


happening and about what every window has to do. That is why Windows
API requires the programmer to provide a window procedure for every
window which will be called by Windows in order to give us the messages.

In all Windows applications there must be a typical defined window


function:

long WINAPI WndProc( HWND hWnd, WORD wMessage, WORD wParam, LONG lParam )

That is the function Windows API uses to sends messages to our defined
window. Let's review those parameters:

* hWnd The Window API handle of our window. Windows


identifies every window using a 'handle': a numeric
value Windows API internally generates. This value
must NOT be manipulated, it is a 'read-only' value.

* wMessage A numeric value that identifies any of the


Windows API different messages. All these different
messages values are provided in a header file
provided by Microsoft called Windows.h. FiveWin has
its own WinApi.ch which includes the most used messages
identifiers values. If you need to know about them,
please review Windows.h supplied by Microsoft or
Borland or any other Windows tools manufacturer.

* wParam A numeric value, a 'WORD' is a number of two


bytes so it is in the range 0-216 which is used
to provide the window function with some parameter
value. This parameter may be many different things
according to the sent message.

* lParam A numeric value, a 'LONG' is a number of four


bytes so it is in the range 0-232 which is used
to provide the window function with some extra parameter
value. This parameter may be many different things
according to the sent message.

The window function typically performs a C switch statement, a Clipper


DO CASE... ENDCASE statement and performs different actions according
to the message received and its parameters, provided by Windows API.

In all Petzold examples we will find C code like this:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


switch( wMsg )
{
case WM_PAINT:
...
return 0;

case WM_COMMAND:
...
return ...;

...

default:
return DefWindowProc( hWnd, wMsg, wParam, lParam );
}

Windows provides a mechanism for processing unattended messages, that


is default behaviors to be performed in case we don't care about
all sent messages. That is why all window functions have a default call
at the bottom of them to the Windows API function DefWindowProc( ... )
Default window procedure provided by Windows API.

Our window tells Windows API what to do according to the different values
the window function returns. Typically there are these possibilities:

* return 0 Means we have performed an action


and we don't want Windows to do anything.

* return non-zero In some cases Windows API requires some


values.

* If we want We call DefWindowProc( ... ) and returns


standard behavior its value to Windows API.

This process is the main conversation system between Windows API and
our defined windows. In this process we have to connect to the Clipper
Object Oriented kernel in order to convert it into an Object Oriented
process.

9.4 Developing business OOPS-based applications


--------------------------------------------------------------------------------

Based on the fact that FiveWin integrates its own Object Oriented Engine,
it gives you the freedom to create all the new classes you may need so you
have the real capability to create truly OOP based applications.

The main advantadge of coding using OOP is that our applications increase very
much in modularity, so they are better structured and you will be able to code
much more keeping a much better and simpler organization.

How can you properly code in OOP ? The key for it is to be able to recognize
'objects' in your code. And only through practise you will be able to
easily recognize those objects. Once you start recognizing those objects,
your code will be turning more and more OOP.

How can you recognize an Object ? Look at the variables you are using.
If some variables are clearly related to different aspects of the 'same',
there is a high probability that there is an object there:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


local cLastName, cAddress, nAge

Now, you realize they all belong to a customer, so you create a new
TCustomer Class:

CLASS TCustomer

DATA cLastName, cAddress, nAge

...

ENDCLASS

So, your code changes into:

local oCustomer := TCustomer():New()

And you will do:

oCustomer:cLastName = ...
oCustomer:cAddress = ...
oCustomer:nAge = ...

You have recognized an object, and your code is simpler now.

Now, you will be able to recognize several actions that are performed
on TCustomers objects. Those different actions may become METHODs:

CLASS TCustomer

DATA cLastName, cAddress, nAge

function NewCustomer() ---> METHOD New()

function EditCustomer() ---> METHOD Edit()

function DelCustomer() ---> METHOD Del()

ENDCLASS

10. Distributing your applications


// FiveWin installation program ver 1.0

// Please feel free to use it for your own installations,


// and modify it to suit your needs

#include "FiveWin.ch"
#include "Install.ch"

#define MERGEPAINT 12255782 // 0xBB0226


#define SRCAND 8913094

static oWnd, hBmpText1, hBmpText2, oMeter, nPercent := 0


static cTarget := "c:\FiveWin.18 "

//----------------------------------------------------------------------------//

function Main()

SET 3DLOOK ON

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


hBmpText1 = LoadBitmap( GetResources(), "Inst1" )
hBmpText2 = LoadBitmap( GetResources(), "Inst2" )

DEFINE WINDOW oWnd STYLE nOr( WS_POPUP, WS_VISIBLE ) COLOR "W/N"

ACTIVATE WINDOW oWnd MAXIMIZED ;


ON INIT DlgInstall() ;
ON PAINT ( FillBlue(), SayBitmaps() )

DeleteObject( hBmpText1 )
DeleteObject( hBmpText2 )

return nil

//----------------------------------------------------------------------------//

function DlgInstall()

local oDlg
local lLib := .t., lSamples := .t., lInclude := .t., lManual := .t.,;
lUtil := .t., lSource := .t., lGroup := .t.
local nTotal := 2760000
local oRequired

DEFINE DIALOG oDlg RESOURCE "Install" OF oWnd

REDEFINE CHECKBOX lLib ID ID_LIB OF oDlg ;


ON CHANGE ( nTotal += If( lLib, 550000, -550000 ),;
oRequired:SetText( nTotal ) )

REDEFINE CHECKBOX lSamples ID ID_EXAMPLES OF oDlg ;


ON CHANGE ( nTotal += If( lSamples, 1150000, -1150000 ),;
oRequired:SetText( nTotal ) )

REDEFINE CHECKBOX lInclude ID ID_HEADERS OF oDlg ;


ON CHANGE ( nTotal += If( lInclude, 90000, -90000 ),;
oRequired:SetText( nTotal ) )

REDEFINE CHECKBOX lManual ID ID_MANUALS OF oDlg ;


ON CHANGE ( nTotal += If( lManual, 600000, -600000 ),;
oRequired:SetText( nTotal ) )

REDEFINE CHECKBOX lUtil ID ID_UTILITIES OF oDlg ;


ON CHANGE ( nTotal += If( lUtil, 20000, -20000 ),;
oRequired:SetText( nTotal ) )

REDEFINE CHECKBOX lSource ID ID_SOURCE OF oDlg ;


ON CHANGE ( nTotal += If( lSource, 350000, -350000 ),;
oRequired:SetText( nTotal ) )

REDEFINE GET cTarget ID ID_TARGET OF oDlg

REDEFINE SAY oRequired PROMPT nTotal PICTURE " 999,999,999" ;


ID ID_REQUIRED OF oDlg

REDEFINE SAY PROMPT DiskSpace() PICTURE " 999,999,999" ;


ID ID_AVAILABLE OF oDlg

REDEFINE CHECKBOX lGroup ID ID_GROUP OF oDlg

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


REDEFINE METER oMeter VAR nPercent TOTAL 100 ID ID_METER OF oDlg

REDEFINE BUTTON ID ID_CONTINUE OF oDlg ;


ACTION ( CopyFiles( lLib, lSamples, lInclude, lManual,;
lUtil, lSource ),;
If( lGroup, BuildGroup(),),;
MsgInfo( "FiveWin successfully installed!" ),;
oDlg:End() )

REDEFINE BUTTON ID ID_INFO OF oDlg ;


ACTION ShellAbout( FWVERSION, FWCOPYRIGHT,;
LoadIcon( GetInstance(), "FiveWin" ) )

REDEFINE BUTTON ID 230 OF oDlg ;


ACTION ( MsgStop( "Installation cancelled" ), oDlg:End() )

ACTIVATE DIALOG oDlg CENTERED

oWnd:End()

return nil

//----------------------------------------------------------------------------//

function SayBitmaps()

local hDC := oWnd:GetDC()

DrawBitmap( hDC, hBmpText1, 3, 3, 0, 0, SRCAND )


DrawBitmap( hDC, hBmpText1, 0, 0, 0, 0, MERGEPAINT )

DrawBitmap( hDC, hBmpText2, 433, 133, 0, 0, SRCAND )


DrawBitmap( hDC, hBmpText2, 430, 130, 0, 0, MERGEPAINT )

oWnd:ReleaseDC()

return nil

//----------------------------------------------------------------------------//

function FillBlue()

local hWnd := oWnd:hWnd


local aRect := GetClientRect( hWnd )
local oBrush
local nTop := aRect[ 1 ]
local nBottom := aRect[ 3 ]
local nBlue := 200
local nSteps := ( aRect[ 3 ] - aRect[ 1 ] ) / 3
local n

oWnd:GetDC()

aRect[ 3 ] = 0

for n = 1 to nSteps

aRect[ 3 ] += 3

DEFINE BRUSH oBrush COLOR RGB( 0, 0, nBlue )


FillRect( oWnd:hDC, aRect, oBrush:hBrush )

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


RELEASE BRUSH oBrush

aRect[ 1 ] += 3
nBlue -= 1
next

oWnd:ReleaseDC()

return nil

//----------------------------------------------------------------------------//

function CopyFiles( lLib, lSamples, lInclude, lManual, lUtil, lSource )

nPercent = 0 ; oMeter:Refresh() ; SysRefresh()


cTarget = AllTrim( cTarget )

if ! File( cTarget )
lMkDir( cTarget )
lMkDir( cTarget + "\Examples" )
lMkDir( cTarget + "\Icons" )
lMkDir( cTarget + "\IDE" )
lMkDir( cTarget + "\lib" )
lMkDir( cTarget + "\Manual" )
lMkDir( cTarget + "\Source" )
endif

if lLib
nPercent = 10 ; oMeter:Refresh() ; SysRefresh()
LZCopyFile( "d:FiveWin.li_", cTarget + "\lib\FiveWin.lib" )
nPercent = 20 ; oMeter:Refresh() ; SysRefresh()
LZCopyFile( "d:WinApi.li_", cTarget + "\lib\WinApi.lib" )
nPercent = 30 ; oMeter:Refresh() ; SysRefresh()
LZCopyFile( "d:501_520.li_", cTarget + "\lib\501_520.lib" )
nPercent = 40 ; oMeter:Refresh() ; SysRefresh()
endif

if lManual
LZCopyFile( "d:readme.tx_", cTarget + "\Readme.txt" )
nPercent = 42 ; oMeter:Refresh() ; SysRefresh()
LZCopyFile( "d:Fw16.hl_", cTarget + "\manual\Fw16.hlp" )
nPercent = 52 ; oMeter:Refresh() ; SysRefresh()
endif

return nil

//----------------------------------------------------------------------------//

function BuildGroup()

local oDde

DEFINE DDE oDde SERVICE "Progman" TOPIC "Progman"

ACTIVATE DDE oDde

oDde:Execute( "[DeleteGroup( FiveWin 1.6 )]" )


oDde:Execute( "[CreateGroup( FiveWin 1.6 )]" )
oDde:Execute( "[ShowGroup( FiveWin 1.6, 1 )]" )
oDde:Execute( "[AddItem(" + cTarget + "\Readme.txt, Readme.txt )]" )

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


oDde:Execute( "[AddItem(" + cTarget + "\manual\Fw16.hlp, Fw16.hlp )]" )
oDde:Execute( "[AddItem(" + cTarget + "\ide\ide.exe, IDE, " + ;
cTarget + "\IDE\FwIde.ico )]" )

oDde:Execute( "[AddItem( c:\command.com, MsDos, " + ;


cTarget + "\Icons\MsDos.ico,,,," + cTarget + ")]" )

oDde:Execute( "[AddItem(" + cTarget + "\examples\Tutor01.exe, Tutor01," + ;


cTarget + "\icons\Tutor.ico )]" )

oDde:Execute( "[AddItem(" + cTarget + "\examples\Tutor02.exe, Tutor02," + ;


cTarget + "\icons\Tutor.ico )]" )

oDde:Execute( "[AddItem(" + cTarget + "\examples\Tutor03.exe, Tutor03," + ;


cTarget + "\icons\Tutor.ico )]" )

oDde:Execute( "[AddItem(" + cTarget + "\examples\Tutor04.exe, Tutor04," + ;


cTarget + "\icons\Tutor.ico )]" )

oDde:Execute( "[AddItem(" + cTarget + "\examples\Tutor05.exe, Tutor05," + ;


cTarget + "\icons\Tutor.ico )]" )

oDde:Execute( "[AddItem(" + cTarget + "\examples\Tutor06.exe, Tutor06," + ;


cTarget + "\icons\Tutor.ico )]" )

oDde:Execute( "[AddItem(" + cTarget + "\examples\Tutor07.exe, Tutor07," + ;


cTarget + "\icons\Tutor.ico )]" )

oDde:Execute( "[AddItem(" + cTarget + "\examples\Tutor08.exe, Tutor08," + ;


cTarget + "\icons\Tutor.ico )]" )

oDde:Execute( "[AddItem(" + cTarget + "\examples\AllTest.bat, Build


Examples," + ;
cTarget + "\icons\Build.ico,0,2,1 )]" )

RELEASE DDE oDde

return nil

//----------------------------------------------------------------------------//

11. InterNet development


IntraNet/InterNet applications development using Clipper & FiveWin
-------------------------------------------------------------------------------
-

FiveWin powerfull Class TSocket implementation lets you build robust and
powerfull IntraNet/InterNet databased applications.

FiveWin Class TSocket offers an easy and object oriented WinSock.dll TCP/IP
management. Review SAMPLES\\TestSock.prg to see the foundation of a WEB
self contained DataBased WEB pages server.

No extra software is required (as WebSite, Windows NT IIS, Personal WEB


server or similar), so FiveWin turns itself into one of the most powerfull
tools to develop IntraNet/InterNet databased applications.

Class TSocket - InterNet TCP/IP object oriented implementation


SAMPLES\\TestSock.prg - Self contained IntraNet/InterNet databased WEB server

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


API support
--------------------------------------------------------------------------------
WINAPI\WinSock.c
WINAPI\WinINet.prg

Classes
--------------------------------------------------------------------------------
Class TSocket InterNet TCP/IP object oriented implementation .
Class TWebServer WEB pages and Proxy server with dynamic HTML support .
Class TInternet Microsoft WinINet.dll object oriented management .
Class TFTP WinINet.dll FTP object oriented management .
Class TFTPFile WinINet.dll FTP files object oriented management .

Samples
--------------------------------------------------------------------------------
SAMPLES\\SockCli Sockets client client/server sample
SAMPLES\\SockServ Sockets server client/server sample
SAMPLES\\FiveGen A databased-dictionary application with automatic WEB
mgement
SAMPLES\\GALLERY\ICopyFiles FTP sending and receiving files sample

--------------------------------------------------------------------------------
Class TSocket InterNet TCP/IP sockets support
--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
nPort socket port number
cIPAddr socket IP address
nTimeOut connection timeout value
nBackLog listen backlog value
nSocket socket handle
hFile handle of a file transmited in chunks
bAccept codeblock to evaluate on accept event.
bRead codeblock to evaluate on read event.
bWrite codeblock to evaluate on write event.
bClose codeblock to evaluate on close event.
bConnect codeblock to evaluate on connect event.

METHODS
--------------------------------------------------------------------------------
New( nPort ) Constructor. nPort = port to use for the socket.
Accept( nSocket ) Constructor. Builds a new socket to accept a incomming
connection
End() Generic destructor.
HandleEvent() manages asyncronous connections events.
GetData() Retrieves incomming data.
SendBin() sends binary data.
SendChunk() sends chunks of a file (::hFile ).
SendData() sends data.
Listen() Sets the socket in listening state.
Close() Closes the socket.
Connect( cIPAddr ) Connects to a specified IP address.
Refresh() Determines the status of the socket.
OnAccept() Accept incomming event method.
OnRead() Read incomming event method.
OnWrite() Write incomming event method.
OnClose() Close event action.
OnConnect() On connect event method.

--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Class TWebServer InterNet WEB pages and Proxy server
--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
nPort socket port number
cIPAddress socket IP address
nTimeOut connection timeout value
nBackLog listen backlog value
nSocket socket handle

METHODS
--------------------------------------------------------------------------------
New Constructor from source code.
ReDefine Constructor for resources.
cGetPRG Generates the source code of the button.
New( nPort ) Constructor. nPort specifies the port to use
Accept Constructor. Creates a clone from the listening host socket
End Closes the connection
GetText Retrives the data that arrives to the socket
SenData Sends data throught the socket
Listen Turns the socket into a listening host socket

--------------------------------------------------------------------------------

Class TInternet Microsoft 32 bits WinINet.dll object oriented support


--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
hWinINet handle to opened WinINet.dll
hSession handle of current session
aFTPs Array of all TFTP objects in use

METHODS
--------------------------------------------------------------------------------
New Constructor
End Generic destructor
FTP( cFTPSite ) Generates a new TFTP object and connects to it

--------------------------------------------------------------------------------

Class TFTP Microsoft WinINet.dll FTP object oriented management


--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
oInternet TInternet container object
cSite URL address
hFTP handle of the FTP connection
cUserName user name to login
cPassword password to login

METHODS
--------------------------------------------------------------------------------
New( cFTPSite, oInternet ) Constructor. cFTPSite = URL to connect to.
oInternet = previous created TInternet object
End() generic destructor
DeleteFile( cFileName ) deletes a remote FTP file
Directory( cMask ) as Clipper Directory() but on a FTP site!

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
Class TFTPFile Microsoft WinINet.dll FTP files object oriented management
--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
oFTP TFTP container object
cFileName name of the file
hFile Internet handle of the file
lBinary binary management vs. ascii management

METHODs
--------------------------------------------------------------------------------
New( cFileName, oFTP ) Constructor. cFileName = name of the file to manage.
oFTP = a previous built TFTP object.
End() generic destructor
OpenRead() opens the file for reading
OpenWrite() opens the file for writting
Write( cData ) write data to the file
Read( nBytes ) read n bytes from the file
Seek( nBytes, nFrom ) skips + / - bytes file pointer

--------------------------------------------------------------------------------
FiveWin Internet software layers
--------------------------------------------------------------------------------

The following picture illustrates the FiveWin Internet foundation layers:

FiveWin Classes
TInternet, TFTP, TFTPFile | FiveWin Class TWebServer
-----------------------------------------------------
Microsoft WinINet.dll | FiveWin Class TSocket
-----------------------------------------------------
Berkeley University WinSock.dll
-----------------------------------------------------
Hardware
-----------------------------------------------------

The bottom software layer is WinSock.dll, a DLL that comes with Microsoft
that originally was developed by Berkeley University (the famous sockets!).
FiveWin implements a direct connection to this DLL (WINAPI\WinSock.c), so
you may directly use all its functions.

On top this DLL Microsoft builds the 32 bits WinINet.dll, a high level
Internet layer wich is very usefull to manage FTP services. FiveWin is
managing this 32 bits DLL thanks to our own 16-32 bits automatic thunk
system, used everytime you manage FiveWin DLL32 commands (DLL.CH). In
fact all the WinINet.dll support has been built using FiveWin high level
DLL32 commands (SOURCE\WINAPI\WinINet.prg).

On top of the WinINet.dll layer, FiveWin implements three classes that


let you easily manage WinINet.dll in an object oriented way: Class
TInternet, TFTP and TFTPFile. These classes simplify so much the
WinINet.dll management. Class TFTPFile lets you use remote FTP files
as if they were files on your own computer ( FOpen(), FWrite(), etc...).
There is a nice sample SAMPLES\GALLERY\ICOPYFIL that shows how to send
and receive FTP files directly from your FiveWin app without using
any Internet extra software.

On top of the WinSock.dll, FiveWin implements a powerfull object oriented

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Class TSocket, which makes so easy to have full control of WinSock power
sockets. With this Class you may solve whatever Internet need you may have.

Using Class TSocket we have implemented Class TWebServer, a complete


WEB pages server totally built-in inside your FiveWin application. Your
applications may transmit WEB pages that are visible all over Internet.

The real power of this design is based on the FiveWin dynamic HTML own
foundation. Before an object TWebServer sends WEB pages on the Internet,
FiveWin mixes standard HTML codes with your own Clipper code requires.
Simply place any Clipper expression between << >> and those expressions
will be expanded in your HTML files. This means live access to your
databases and remote management of your application. Microsoft is trying
to implement now a solid dynamic HTML standard. You already have all
this power.

FiveWin Class TWebServer transparently manages HTTP cookies, queries,


mimes extensions and so on. Finally, Class TWebServer recognizes Proxy
requires, so not only sends HTML files through the Internet but you
may use it to let all Intranet users access the Internet world through
it. Companies are very aware of Internet security risks so they don't
want to let all employees to directly access the Internet, this is why
they implement 'firewalls'. The 'firewall' concept requires a Proxy server
that really access the Internet. FiveWin Class TWebServer offers a
fully configurable Proxy server, and all this built in in your own
FiveWin application.

--------------------------------------------------------------------------------
#include "FiveWin.ch"

function Main()

local oWnd, oBar, oWebServer

DEFINE WINDOW oWnd TITLE "Web Server"

DEFINE BUTTONBAR oBar OF oWnd 3D

DEFINE BUTTON OF oBar ;


ACTION ( oWebServer := TWebServer():New( 81 ),;
oWebServer:Activate(), oWebServer:Explore() )

ACTIVATE WINDOW oWnd

return nil

--------------------------------------------------------------------------------
FiveWin dynamic HTML own implementation
--------------------------------------------------------------------------------

To get the best results from FiveWin Class TWebServer and dynamic
HTML generation a mixure of JavaScript (or VBScript), standard HTML
and Clipper code is required.

JavaScript is a very easy to learn language. It behaves like a mixure


between C and Clipper. Normally you may not need more than two days
to really master it. (I learned it myself on a weekend! <g>)

Get yourself familiar with HTML code. HTML is such an easy language
that you will be surprised how fast you may get it. basically there
are two main operations you will be dealing with: GET and POST.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


GET means the client is requiring some page. POST means the user
filled some controls info (GETs, radios, etc...) and he is sending
it to you. Have a look at SAMPLES\FIVEGEN to see how far we can go
just easily mixing these concepts.

FiveWin Class TWebServer automatically define some private variables


that will be in scope for you to solve some information comming from
the Internet HTTP protocol:

* When a page is requested as follows:

<filename.html>?<parameters>

FiveWin declares a 'parameters' variable that holds the <parameter>


expression. Sometimes, scripting languages use Escape() function
to turns high character codes into lower ones. FiveWin implements
UnEscape() function to change back the effect of Escape().

* When a cookie has been defined on the client (see SAMPLES\FIVEGEN


to see how to manipulate cookies with JavaScript), FiveWin defines
a 'Cookie' variable that holds the cookie value. A cookie is just
a string variables that hold some client defines values.

* When the user has completed some controls requested info and has
submited it to you, FiveWin declares a 'Query' variable that holds
the original user query values.

You will become familiar to these concepts once you start managing them
just a little. You will be surprised how far you can get using your
loved Clipper and developing Internet applications using FiveWin.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

Comandos

1. xBase Commands
1.1 xBase commands alphabetically ordered .
1.2 xBase common elements .
1.3 FiveWin Header files .

2. Classes and Objects


2.1 Classes alphabetically ordered .
2.2 Classes hierarchy .
2.3 Objects engine syntax .

3. Functions
3.1 Alphabetically ordered A-G .
3.2 Alphabetically ordered H-Z .
3.3 By cathegory .

Appendix I: Bibliography

xBase commands .
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Bar Defining Button bar Objects .
Bitmaps Defining/Redefining Bitmaps .
Browse Defining Browse controls .
Brushes Defining Brushes .
Buttons Defining/Redefining PushButtons .
CheckBox Managing Logical Checkbox .
Clipboard Managing Windows Clipboard .
ComboBox Defining/Redefining ComboBox controls .
Cursor Mouse Cursors managed as objects .
DDE Using Windows Dynamic Data Exchange .
Dialogs Managing Dialogs .
DLL Using DLLs at Run-time .
Folders FiveWin Folders Class .
Fonts Defining Fonts for Windows .
GETs Defining/Redefining typical GETs .
HELP Setting and manipulating a HELP file .
Icons Defining/Creating Icons for Windows .
Ini Managing .INI files .
ListBox Managing ListBoxes controls .
MDI Multiple Document Interface Windowing .
Menus Defining/Redefining and activating Menus .
Meter Defining/Redefining Meter controls .
MRU Most Recently used items. See Menus explanation .
MsgBar Using Message Bars controls .
ODBC Managing DataBases through ODBC .
Pages Multiple DialogBox pages management .
Pen Defining Pen controls .
Printer Using the Printer .
PushButtons Defining/Redefining Button Controls .
RadioButtons Defining/Redefining RadioButton Controls .
Reports FiveWin report engine .
Resources Resources Commands .
Say @ ... SAY and Defining SAY Objects .
ScrollBars ScrollBar controls .
Tabs Defining and managing Tabs controls .
Timers Defining and managing Timers .
Trees Defining and managing Trees .
Video Defining and activating multimedia Video controls .
VBXs Managing Visual Basic eXtension (.VBX) controls .
Windows Defining and activating Windows .

FiveWin Headers User defined xBase Commands .

Bar Commands
--------------------------------------------------------------------------------

Creating a Button Bar DEFINE BUTTONBAR [ <oBar> ] ;


from source code [ SIZE | BUTTONSIZE | SIZEBUTTON <nWidth>,;
<nHeight> ] ;
[ 3D | 3DLOOK ] ;
[ TOP | LEFT | RIGHT | DOWN | FLOAT ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ CURSOR <oCursor> ]

Creating a ButtonBar @ <nRow>, <nCol> BUTTONBAR [ <oBar> ] ;


from source code and [ SIZE <nWidth>, <nHeight> ] ;
placing it at a specific [ BUTTONSIZE <nBtnWidth>, <nBtnHeight> ] ;
location [ 3D | 3DLOOK ] ;
[ TOP | LEFT | RIGHT | BOTTOM | FLOAT ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ CURSOR <oCursor> ] ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Defining a DEFINE BUTTON [<oBtn>] ;
button of the [ OF | BUTTONBAR <oBar> ] ;
buttonbar [ NAME | RESNAME | RESOURCE <cResName1>;
[,<cResName2>] ] ;
[ FILE | FILENAME | DISK <cBmpFile1>;
[,<cBmpFile2>] ] ;
[ ACTION | EXEC <uAction> ] ;
[ GROUP ] ;
[ MESSAGE <cMsg> ] ;
[ ADJUST ] ;
[ WHEN <uWhen> ] ;
[ TOOLTIP <cToolTip> ]
[ ON DROP <bDrop>]

To redefine a button REDEFINE BUTTON [<oBtn>] ;


placed on a dialogbox [ ID <nId> ] ;
in a resource. [ OF | BUTTONBAR <oBar> ] ;
(just a button, not a [ NAME | RESNAME | RESOURCE <cResName1>
[,<cResName2>] ] ;
buttonbar) [ FILE | FILENAME | DISK <cBmpFile1> [,<cBmpFile2>]
] ;
[ ACTION | EXEC <uAction> ] ;
This lets you have buttons [ MESSAGE <cMsg> ] ;
with bitmaps inside [ ADJUST ] ;
DialogBoxes without [ WHEN <uWhen> ] ;
having to use Borland's [ UPDATE <lUpdate> ] ;
BWCC.DLL [ TOOLTIP <cToolTip> ] ;

To create a bitmap @ <nRow>, <nCol> BUTTON [<oBtn>] ;


button from source code, [ NAME | RESNAME | RESOURCE <cResName1>
[,<cResName2>] ] ;
and place it at any [ FILE | FILENAME | DISK <cBmpFile1> [,<cBmpFile2>]
] ;
container window [ SIZE <nWidth>, <nHeight> ] ;
[ ACTION <uAction> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ MESSAGE <cMsg> ] ;
[ WHEN <uWhen> ] ;
[ ADJUST ] ;
[ UPDATE ] ;

Comment: You may also place a buttonbar on a


DialogBox. To do it, just create the buttonbar
from the ON INIT clause when activating the
DialogBox.

At the ON INIT clause, a DialogBox behaves like


a standard window.

<oBar> A reference to the Bar Object.

<nWidth> The width and height of the buttons of the bar.


<nHeight> By default is 28x28 pixels.

<oWnd> A reference to the container Window of the bar.

<oCursor> A reference to the mouse cursor object to use for


the bar.

<oBtn> A reference to the BitmapButton Object.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<cBmpFile1> The name of the Bitmap to display. Optionally
<cBmpFile2> you may specify a second bitmap for animation.
This is used for accessing bitmaps stored on the
hard disk (my.bmp)

<cResName1> The resource name of the Bitmap to display. Optionally


<cResName2> you may specify a second bitmap for animation.
This is used for accessing bitmaps stored in a
Resource file (and .rc file or a .dll file)

<uAction> The action to be performed when clicking the Button.

<cMsg> The message to display on the message bar of the


container Window of the Bar Object which contains
the BitmapButton.

<uWhen> An expression that indicates if the button of


the buttonbar is enabled or not.

<nId> The identifier for the button placed at a DialogBox.

<cToolTip> The text to show on a associated floating tooltip.

<bDrop> The action to be performed when

CLAUSES

3D To display the buttonbar with a gray 3D look.


3DLOOK

TOP The position of the buttonbar respect its window


LEFT container. Right clicking on the buttonbar also popups
RIGHT a menu to select dinamically a new position.
DOWN

FLOAT Places the buttonbar on a floating window.

For the buttons on the buttonbar

ADJUST To automatically adjust the bitmap to the size of


button.

GROUP Starts a new "group" of buttons in the ButtonBar.


You may have as many groups as you need.

UPDATE For bitmap buttons placed on a DialogBox (without


a buttonbar). The button will update its image
automatically when doing a oDlg:Update().

Example: SAMPLES\TestBar.prg

Bitmap Commands
--------------------------------------------------------------------------------

Creating a bitmap from @ <nRow>, <nCol> BITMAP [ <oBmp> ] ;


source code [ NAME | RESNAME | RESOURCE <cResName> ] ;
[ FILE | FILENAME | DISK <cBmpFile> ] ;
[ NOBORDER | NO BORDER ] ;
[ SIZE <nWidth>, <nHeight> ] ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ OF | WINDOW | DIALOG <oWnd> ] ;
[ ON CLICK | ON LEFT CLICK <uLClick> ] ;
[ ON RIGHT CLICK <uRClick> ] ;
[ SCROLL ] ;
[ ADJUST ] ;
[ CURSOR <oCursor> ] ;
[ PIXEL ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <WhenFunc> ] ;
[ VALID <uValid> ] ;
[ DESIGN ] ;

Creating a bitmap REDEFINE BITMAP [ <oBmp> ] ;


resources [ ID <nId> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ NAME | RESNAME | RESOURCE <cResName> ] ;
[ FILE | FILENAME | DISK <cBmpFile> ] ;
[ ON ClICK | ON LEFT CLICK <uLClick> ] ;
[ ON RIGHT CLICK <uRClick> ] ;
[ SCROLL ] ;
[ ADJUST ] ;
[ CURSOR <oCursor> ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <WhenFunc> ] ;
[ VALID <uValid> ] ;

<nRow>, <nCol> The coordinates on screen. We simulate Text coordinates.

<oBmp> A reference to the Bitmap Object.

<cResName> The name of the bitmap resource bitmap when loading a bitmap
from a .RC, .RES or a .DLL file .

<cBmpFile> The name of the BMP file when loading a bitmap directly
from a BMP file.

<nWidth> The desired width of the bitmap.

<nHeight> The desired height of the bitmap.

<oWnd> The container window of the Bitmap control.

<uLClick> The action(s) to be performed when left clicking over the


Bitmap.

<uRClick> The action(s) to be performed when right clicking over the


Bitmap.

<oCursor> A reference to the Cursor Object to display over this control.

<cMsg> The associated message of this control.

<nId> The numeric resource identifier of the Control.

<WhenFunc> An expression indicating when this control will be


active or not.

<uValid>

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


CLAUSES

NO BORDER It does not place a border around the control.


NOBORDER

UPDATE This control may be updated from TDialog:Update() METHOD

PIXEL To use pixel coordinates instead of Text coordinates

SCROLL Enable the use of scrollbars to scroll the bitmap into its
visible area. This let the user review bitmaps larger than
the control.

ADJUST Automatically adjusts the bitmap(s) to the size of the


control.

DESIGN Allows the user to move and resize with the mouse

Browse Commands
--------------------------------------------------------------------------------

Defining a Browse Object @ <nRow>, <nCol> LISTBOX [ <oBrw> ] ;


from source code FIELDS <cFields,...> ;
[ ALIAS <cAlias>] ;
[ FIELDSIZES | SIZE | COLSIZES <aColSizes,...> ] ;
[ HEAD | HEADER | HEADERS | TITLE <aHeaders,...> ]
;
[ ID <nId> ] ;
[ SIZE <nWidth>, <nHeigth> ] ;
[ SELECT <cField> FOR <uValue1> [ TO <uValue2>] ] ;
[ ON CHANGE <uChange> ] ;
[ ON RIGHT CLICK <uRClick> ] ;
[ ON [LEFT] CLICK <uLClick> ] ;
[ ON [LEFT] DBLCLICK <uDblClick> ] ;
[ FONT <oFont>] ;
[ CURSOR <oCursor>] ;
[ COLOR | COLORS <nClrFore> [,<nClrBack>] ] ;
[ MESSAGE <cMsg>] ;
[ UPDATE ] ;
[ PIXEL ] ;
[ WHEN <uWhen> ] ;
[ DESIGN ] ;
[ VALID <ValidFunc> ] ;
[ ACTION <uAction,...> ] ;
[ OF | DIALOG <oDlg> ]

Redefining a Browse REDEFINE LISTBOX [ <oBrw> ] ;


from resources FIELDS [ <cFields,...>] ;
[ ALIAS <cAlias> ] ;
[ ID <nId> ] ;
[ FIELDSIZES | SIZES | COLSIZES <aColSizes,...> ] ;
[ HEAD | HEADER | HEADERS <aHeaders,...> ] ;
[ SELECT <cField> FOR <uValue1> [ TO <uValue2> ] ]
;
[ ON CHANGE <uChange> ] ;
[ ON RIGHT CLICK <uRClick> ] ;
[ ON [LEFT] CLICK <uLClick> ] ;
[ ON [LEFT] DBLCLICK <uDblClick> ] ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ FONT <oFont> ] ;
[ CURSOR <oCursor> ] ;
[ COLOR | COLORS <nClrFore> [,<nClrBack>] ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <uWhen> ] ;
[ VALID <ValidFunc> ] ;
[ ACTION <uAction,...> ] ;
[ OF | WINDOW | DIALOG <oDlg> ]

<oBrw> A reference to the TWBrowse Object.


<nRow> Position on container window. We simulate text
<nCol> coordinates.

<cFields> A list of text expressions to display as columns.


If an expression is of numeric type, TWbrowse
will manage it as the handle of a bitmap to be
displayed.

<aColSizes> A list of sizes for each column in pixels.


<aHeaders> A list of text expressions for headers.
<nId> Is the numeric identifier of the TWBrowse control.

<nWidth> The desired size of the TWbrowse control in pixels.


<nHeigth>

<uChange> An action to be performed when selecting a new row.

<uRClick> An action to be performed when right clicking

<uLClick> An action to be performed when left clicking

<uLDblClick> An action to be performed when Double Left clicking

<oFont> A reference to the Font Object to be used with the LISTBOX.

<ValidFunc> An expression or function to be validated when the


ListBox loses its focus.

<nClrFore> Foreground color as a RGB number, or as a xBase string

<nClrBack> Background color as a RGB number

<uAction,...>

<cField> Must be the Field key of the current INDEX !!!

<oDlg> The object that contain the TWbrowse control.

CLAUSES

DESIGN Allows the user to move and resize with the mouse

PIXEL To use pixel coordinates instead of Text coordinates.

Brush Commands
--------------------------------------------------------------------------------

Defining a Brush from DEFINE BRUSH <oBrush> ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


source code [ STYLE <Style> ] ;
[ COLOR <nRGBColor> ] ;
[ FILE | FILENAME | DISK <cBmpFile> ];
[ RESOURCE | NAME | RESNAME <cBmpRes> ]

RELEASE BRUSH <oBrush>

Assigning a Brush to an SET BRUSH ;


Window [ OF <oWnd> ] ;
[ TO <oBrush> ]

<oBrush> A reference to the Brush Object.

<Style> One of the styles listed below.

<nRGBColor> A color in RGB format. Use nRGB() function.

<cBmpFile> The name of a BMP file to use to build the Brush.

<cBmpRes> The name of a BMP in the resource.

<oWnd> A reference to the owner Window (Container) of the Brush.

DIFFERENT STYLES:

New styles: BORLAND, TILED, BRICKS


Standard styles: DIAGONAL, HORIZONTAL, VERTICAL, FDIAGONAL, BDIAGONAL,
CROSS, DIAGCROSS

PushButton Commands
--------------------------------------------------------------------------------

Creating Buttons from @ <nRow>, <nCol> BUTTON [ <oBtn> ]


source code [ PROMPT <cCaption> ] ;
[ NAME | RESNAME | RESOURCE <cResName1>;
[,<cResName2>] ] ;
[ FILE | FILENAME | DISK <cBmpFile1>;
[,<cBmpFile2>] ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ ACTION <uAction> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ MESSAGE <cMsg> ] ;
[ WHEN <WhenFunc> ] ;
[ ADJUST ] ;
[ DEFAULT ] ;
[ HELP | HELPID | HELP ID <nHelpId> ] ;
[ FONT <oFont> ] ;
[ PIXEL ] ;
[ DESIGN ] ;
[ UPDATE ] ;
[ VALID <ValidFunc> ] ;
[ CANCEL ] ;

Using Buttons from REDEFINE BUTTON [<oBtn>] ;


resources [ ID <nId> ] ;
[ PROMPT <cCaption> ] ;
[ OF | BUTTONBAR <oBar> | ] ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ | WINDOW | DIALOG <oDlg> ] ;
[ NAME | RESNAME | RESOURCE <cResName1>;
[,<cResName2>] ] ;
[ FILE | FILENAME | DISK <cBmpFile1>;
[,<cBmpFile2>] ] ;
[ ACTION | EXEC> <uAction> ] ;
[ MESSAGE <cMsg> ] ;
[ ADJUST ] ;
[ WHEN <WhenFunc> ] ;
[ HELP | HELPID | HELP ID <nHelpId> ] ;
[ VALID <ValidFunc> ] ;
[ CANCEL ] ;

DEFINE BUTTON [ <oBtn> ] ;


[ OF | BUTTONBAR <oBar> ] ;
[ NAME | RESNAME | RESOURCE <cResName1>;
[,<cResName2>] ] ;
[ FILE | FILENAME | DISK <cBmpFile1>;
[,<cBmpFile2>] ] ;
[ ACTION | EXEC <uAction> ] ;
[ GROUP ] ;
[ MESSAGE <cMsg> ] ;
[ ADJUST ] ;
[ WHEN <WhenFunc> ] ;

<nRow>, <nCol> The coordinates of the Button. They mimic text mode
coordinates.

<oBtn> A reference to the Button Object.

<oBar> A reference to the Button

<cCaption> The label of the Button.

<cBpFile1> The file name of the bitmap as a Picture Button.


<cBmpFile2> When a second bitmap is provided it is displayed as the
Button in a depressed state.

<nHelpId> The help topic identifier of the Button.

<oWnd> The container window of the Button.

<uAction> The action to be performed when the Button is pressed.

<oFont> A reference to the Font Object to use with the Button.

<nWidth> The dimensions of the Button.


<nHeigth>

<cResName1> The bitmap resource to display as a Picture Button.


<cResName2> When a second bitmap resource is provided it is displayed
as the Button in a depressed state.

<cMsg> The associated message of this control

<WhenFunc> It is an expression to evaluate indicating if the control is


or not enable.

<nId> The numeric resource identifier of the Control.

<ValidFunc> An expression to validate when the control is going to

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


lose the focus.

CLAUSES

DEFAULT For default PushButtons: Automatically executes when


the user press Enter, even from other controls.

Use this clause only when building the Button from


source code. When using resources, this clause must
be specifies from the resource editor.

DESIGN Allows the user to move and resize with the mouse

PIXEL To use pixel coordinates instead of Text coordinates.

UPDATE This control may be updated from TDialog:Update() METHOD

CANCEL

CheckBox Commands
--------------------------------------------------------------------------------

Creating a CheckBox @ <nRow>, <nCol> CHECKBOX [ <oCbx> VAR ] <lVar> ;


from source code [ PROMPT <cCaption> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ HELPID | HELP ID <nHelpId> ] ;
[ FONT <oFont> ] ;
[ ON CLICK | ON CHANGE <uClick> ] ;
[ VALID <ValidFunc> ] ;
[ COLOR | COLORS <nClrFore>;
[,<nClrBack>] ];
[ DESIGN ] ;
[ PIXEL ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <WhenFunc> ] ;

Using a CheckBox from REDEFINE CHECKBOX [ <oCbx> VAR ] <lVar> ;


a resource Dialog Box [ ID <nId> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ HELPID | HELP ID <nHelpId> ] ;
[ ON CLICK | ON CHANGE <uClick> ];
[ VALID <ValidFunc> ];
[ COLOR | COLORS <nClrFore>;
[,<nClrBack>] ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <WhenFunc> ] ;

<nRow>, <nCol> The coordinates of the CheckBox. They mimic text mode
coordinates.

<oCbx> A reference to the CheckBox Object.

<lVar> The logical variable to be managed by the CheckBox.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<cCaption> The label of the CheckBox

<oWnd> The container window of the CheckBox.

<nWidth>, The dimensions of the CheckBox in pixels.


<nHeight>

<nHelpId> The help topic value of the CheckBox.

<oFont> A reference to the Font Object to be used with the CheckBox.

<uClick> An action to be performed when the CheckBox changes.

<ValidFunc> An expression or function to be validated when the


CheckBox loses its focus.

<nClrFore> Foreground color as a RGB number, or as a xBase string


<nClrBack> Background color as a RGB number

<cMsg> The associated message of this control.

<WhenFunc> When expression code block.

<nId> The numeric resource identifier of the Control.

CLAUSES

DESIGN Allows the user to move and resize with the mouse

PIXEL To use pixel coordinates instead of Text coordinates.

UPDATE This control may be updated from TDialog:Update() METHOD

Mouse Cursor xBase commands


--------------------------------------------------------------------------------

Creating a cursor from DEFINE CURSOR <oCursor> ;


resources [ RESOURCE | RESNAME | NAME <cResName> ] ;
[ ARROW | ICON | SIZENS | SIZEWE | SIZENWSE,;
SIZENESW | IDEAM | CROSS ]

<oCursor> A reference to the cursor object

<cResName> A string with the name of the cursor resource name.


It may also be a numeric identifier.

DDE Commands Dynamic Data Exchange xBase management


--------------------------------------------------------------------------------

Defining a new DDE DEFINE [ DDE | LINK ] <oDde> ;


connection [ SERVICE <cService> ] ;
[ TOPIC <cTopic> ] ;
[ ITEM <cItem> ] ;
[ ACTION <uAction> ] ;
[ VALID <uEnd> ] ;

Activating the DDE ACTIVATE [ DDE | LINK ] <oDde>

Deactivating the DDE DEACTIVATE [ DDE | LINK ] <oDde>

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Ending the connection RELEASE [ DDE | LINK ] <oDde>

<oDde> A reference to the DDE Object.

<cService> The service which establishes the connection.

<cTopic> The topic which establishes the connection.

<cItem> The item which establishes the connection.

<uAction>

<uEnd> An action to execute when the DDE is finished.

DialogBoxes xBase commands


--------------------------------------------------------------------------------

DialogBox creation from DEFINE DIALOG <oDlg> ;


source code and redefinition [ NAME | RESNAME | RESOURCE <cResName> ] ;
for resources [ TITLE <cTitle> ] ;
[ FROM <nTop>, <nLeft> TO <nBottom>, <nRight>
] ;
[ LIBRARY | DLL <hResources> ] ;
[ VBX ] ;
[ STYLE <nStyle> ] ;
[ COLOR | COLORS <nClrText> [,<nClrBack> ] ] ;
[ BRUSH <oBrush> ] ;
[ WINDOW | DIALOG | OF <oWnd> ] ;
[ PIXEL ] ;
[ ICON <oIco> ] ;
[ FONT <oFont> ] ;
[ HELP | HELPID <nHelpId> ] ;

Making the DialogBox work ACTIVATE DIALOG <oDlg> ;


[ CENTER | CENTERED ] ;
[ NOWAIT | NOMODAL ] ;
[ WHEN <uWhen> ] ;
[ VALID <uValid> ] ;
[ ON [ LEFT ] CLICK <uClick> ] ;
[ ON INIT <uInit> ] ;
[ ON MOVE <uMoved> ] ;
[ ON PAINT <uPaint> ] ;
[ ON RIGHT CLICK <uRClicked> ]

<oDlg> The variable that is going to hold the


DialogBox object. It is a 'reference' to the
DialogBox object.

<cResName> The name of the DialogBox inside resource.


The resource may be stored in a .RC file or in
a .DLL file. Normally you use the 'Rename' option from
a resource editor to give a name to the resource
element.

<cTitle> The title of the DialogBox. You may also change the
title of a resource DialogBox. This means that you
may use the same DialogBox for different purposes by
just changing its title.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<nTop>, <nLeft> The coordinates of the DialogBox when creating the
<nBottom>, <nRight> DialogBox from source code.

<hResources> An optional handle to a resource DLL. This is useful


when using several DLLs at the same time that hold
different resources. By default this handle is
the application handle (when using .RC) or the handle
of the DLL when using SET RESOURCES TO...

<nStyle> An optional DialogBox style. There are several samples


in the SAMPLES\ subdirectory showing you how to
manipulate this value. If you are using a DialogBox
from a resource then you have to select the style from
inside the resource editor.

<nClrText>, The fore and back colors of the DialogBox.


<nClrBack>

<oBrush> An optional brush to use to fill the surface of the


DialogBox.

<oWnd> An optional container object of the DialogBox. By


default we use the window that is currently active.
If you want to show DialogBoxes control messages
on the bottom line of the screen you have to specify
its container.

<oIco> An optional ICON to show when the DialogBox has been


minimized.

<oFont> An optional Font to use for all the DialogBoxes.

<uWhen> WHEN clause that permits the DialogBox to start


executing.

<uValid> VALID clause to control the ending of the DialogBox.

<nHelpId> The Help topic identifier of the dialog.

<uClick> Optional action to perform when the left mouse


button is clicked over the DialogBox surface.
Three parameters: nRow, nCol, nFlags are automatically
supplied:

nRow The row position (in pixels) where the


mouse was when it was clicked.

nCol The col position (in pixels) where the


mouse was when it was clicked.

nFlags A numeric flag which contains information


about special keys being pressed at the
same time: (values are 'ORed')

Value Description

MK_CONTROL Set if CTRL key is down.


MK_MBUTTON Set if middle button is down.
MK_RBUTTON Set if right button is down.
MK_SHIFT Set if SHIFT key is down.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define MK_LBUTTON 0x0001
#define MK_RBUTTON 0x0002
#define MK_SHIFT 0x0004
#define MK_CONTROL 0x0008
#define MK_MBUTTON 0x0010

You may inspect them using FiveWin lAnd()


function:

if lAnd( nFlags, MK_CONTROL )


...

if lAnd( nFlags, MK_SHIFT, MK_CONTROL )


...

<uInit> An optional action to perform when the DialogBox is


created but not shown on the screen. In this situation
the DialogBox behaves like a Window, and we may do all
kind of operations as we do with a window, (like placing
a ButtonBar on it!)

<uMoved> An optional action to be performed when the DialogBox


is moved.

<uPaint> An optional action to be performed when the DialogBox


has just been painted.

<uRClicked> An optional action to be performed when the right mouse


button has been clicked on the DialogBox surface. You
can use the same three parameters as in <uClick>.

CLAUSES

VBX You may specify this when using a VBX control in the
DialogBox.

PIXEL When you want the DialogBox coordinates (creating


the DialogBox from source code) to be in pixels.

CENTER If you want the DialogBox to appear centered


CENTERED on the screen.

NOWAIT If the DialogBox has to behave NonModal. NonModal


NOMODAL means that other DialogBoxes may be working at the
same time! NonModal programming requires some special
care:

* Take care of local variables: If you are using some


locals then remember you will go out of the scope
of the function where the DialogBox nonmodal has
been created and this may cause problems (only if
you don't remember it). Clipper works perfectly in
these circumstances as it keeps 'live references'
of the local variables inside the codeblocks. But
only these will be 'alive' out of the function.

* The same DialogBox may be executed several times.


Be aware of your DBF management. In these circums-
tances your computer is like a NetWork! because
a DBF may be opened several times. It is a good
idea to start learning NetWork programming

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


-it is really easy!-

* Normally we recommend that you not develop NonModal


applications for novice Windows-users. As soon
as your clients get more and more used to Windows,
NonModal programming is highly recommended. See
MDI programming (in this documentation) for
a very elegant and powerful NonModal programming
style.

DLL Commands
--------------------------------------------------------------------------------

Defining a external DLL DLL [STATIC] FUNCTION <FunName>( ;


function to be called [ <Param1> AS <Type> ] ;
at RunTime [ <ParamN> AS <Type> ] ) ;
AS <return> [PASCAL] LIB <DllName>

FiveWin lets you declare an external DLL function to be called at RunTime


by its own name! See DllCall.prg example.

<FuncName> The name of the DLL function. Remember Clipper only uses
10 characters maximum length.

<Param1> Name of a parameter.

Length in bytes
<Type>, BYTE, CHAR 1
<return> WORD, BOOL, HANDLE, HWND, HDC 2
LONG, STRING, LPSTR, PTR 4
DOUBLE 8

<DllName> Name of the DLL.

We recommend to develop a C language based connection functions when you


are going to develop an intensively work with some DLLs. See "using
Windows API". Examples:

Calling SndPlaySound() at RunTime:

#include "FiveWin.ch"

function Main()

SndPlaySound( "tada.wav", 0 )

return

DLL FUNCTION SndPlaySound( cFile AS LPSTR, nType AS WORD ) AS BOOL ;


PASCAL LIB "MMSYSTEM.DLL"

Designing the same DLL connection using C language:

#include <WinTen.h>
#include <Windows.h>
#include <MMSystem.h>
#include <ClipApi.h>

//----------------------------------------------------------------------------//

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


CLIPPER SNDPLAYSOU() // ND()
{
_retl( sndPlaySound( _parc( 1 ), _parni( 2 ) ) );
}

//----------------------------------------------------------------------------//

In this situation it is necessary to use a specific LIB so the linker will


know how the DLL connection must be done at RunTime. Example:

TEST.DLL // Is a commercial DLL we are going to use

IMPDEF.EXE TEST.DEF TEST.DLL // IMPDEF.EXE is a tool Microsoft and


// Borland provides

Now, edit TEST.DEF -which it is an ascii file- and rename the symbols
with 10 characters or less with an underscore:

LESS10 ---> _LESS10

Then do:

IMPLIB.EXE TEST.LIB TEST.DEF

When linking use that .LIB !

Review our \WinApi directory C -only registered users- source code to see a
lot of examples of doing this.

Warning: SndPlaySound() is already built inside FiveWin.lib. It has been


used just in this example for learning purposes.

Folders xBase Commands


--------------------------------------------------------------------------------

Creating a folder @ <nRow>, <nCol> FOLDER [<oFolder>] ;


from source code [ OF | WINDOW | DIALOG <oWnd> ] ;
[ PROMPT | PROMPTS | ITEMS <cPrompt,...> ] ;
[ DIALOG | DIALOGS | PAGE | PAGES <cDlgName1>
[,<cDlgNameN>] ] ;
[ PIXEL ] ;
[ DESIGN ] ;
[ COLOR | COLORS <nClrFore> [,<nClrBack>] ] ;
[ OPTION <nOption> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ MESSAGE <cMsg> ]

Creating a folder REDEFINE FOLDER [<oFolder>] ;


from resources [ ID <nId> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ PROMPT | PROMPTS | ITEMS <cPrompt,...> ] ;
[ DIALOG | DIALOGS | PAGE | PAGES <cDlgName1>
[,<cDlgNameN>] ] ;
[ COLOR | COLORS <nClrFore> [,<nClrBack>] ] ;
[ OPTION <nOption> ] ;
[ ON CHANGE <uChange> ]

<nRow>, <nCol> The coordinates where to locate the folder control

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


(only from source code, not from resources).

<oFolder> A reference to the folder object just created.

<oWnd> The container object of the folder control.

<cPrompt,...> A list with the text to show as each page prompts.

<cDlgName1,...> A list with the resources names of the DialogBoxes to


manage.

<nClrFore> The color to display the prompts text.

<nClrBack> The color to fill the folder surface.

<nOption> An optional initial option to use different from 1.

<nWidth>, <nHeight> The dimensions of the folder control.

<cMsg> An optional message to display on its container MsgBar


if defined.

<nId> The numeric resource identifier of the control.

<uChange> An action to be performed when changing the folder


selected page.

CLAUSES

PIXEL To use pixel coordinates instead of text coordinates.

DESIGN Allows the user to interactively move and resize the


control.

Font Commands
--------------------------------------------------------------------------------

Defining a font DEFINE FONT <oFont> ;


[ NAME <cName> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ FROM USER ];
[ BOLD ] ;
[ ITALIC ] ;
[ UNDERLINE ] ;
[ WEIGHT <nWeight> ] ;
[ OF <oDevice> ] ;
[ NESCAPEMENT <nEscapement> ] ;

ACTIVATE FONT <oFont>

DEACTIVATE FONT <oFont>

RELEASE FONT <oFont>

SET FONT ;
[ OF <oWnd> ] ;
[ TO <oFont> ]

<oFont> A reference to the Font Object.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<cName> The name of the font. Example: Arial, Roman, etc...

<nWidth>, Dimensions of the font.


<nHeight>

<oWnd> A reference to the Window container.

<oDevice> The device owner of the font.

<nWeight> The weight of the font.

<nEscapement> The escapement of the font.

CLAUSES

FROM USER Displays the Font selection Dialog Box.

BOLD To create the font with bold feature.

ITALIC To create the font with italic feature.

UNDERLINE To create the font with underline feature.

GET Commands
--------------------------------------------------------------------------------
Creating a GET from @ <nRow>, <nCol> GET [ <oGet> VAR ] <uVar> ;
source code [ OF | WINDOW | DIALOG <oWnd> ] ;
[ PICTURE <cPict> ] ;
[ VALID <ValidFunc> ] ;
[ WHEN <WhenFunc> ] ;
[ COLOR | COLORS <nClrFore>;
[,<nClrBack>] ] ;
[ SIZE <nWidth>, <nHeight> ];
[ FONT <oFont> ] ;
[ HSCROLL ] ;
[ CURSOR <oCursor> ] ;
[ PIXEL ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <WhenFunc> ] ;
[ CENTER | CENTERED> ] ;
[ RIGHT ] ;
[ READONLY | NO MODIFY ] ;
[ DESIGN ] ;
[ ON CHANGE <uChange> ] ;
[ PASSWORD ] ;

@ <nRow>, <nCol> GET [ <oGet> VAR <uVar> ] ;


For editing Memos [ OF | WINDOW | DIALOG <oWnd> ] ;
[ MULTILINE | MEMO | TEXT ] ;
[ COLOR | COLORS <nClrFore>;
[,<nClrBack>] ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ FONT <oFont> ] ;
[ DESIGN ] ;
[ CURSOR <oCursor> ] ;
[ PIXEL ] ;
[ MESSAGE <cMsg> ] ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ UPDATE ] ;
[ WHEN <WhenFunc> ] ;
[ CENTER | CENTERED ] ;
[ RIGHT ] ;
[ ON CHANGE <uChange> ] ;
[ HSCROLL ] ;
[ READONLY | NO MODIFY ] ;
[ VALID <ValidFunc> ] ;

Using a GET from a REDEFINE GET [ <oGet> VAR ] <uVar> ;


resource Dialog Box [ ID <nId> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ HELPID | HELP ID <nHelpId> ] ;
[ VALID <ValidFunc> ] ;
[ PICTURE <cPict> ] ;
[ COLOR | COLORS <nClrFore>;
[,<nClrBack>] ] ;
[ FONT <oFont> ] ;
[ CURSOR <oCursor> ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <WhenFunc> ] ;
[ ON CHANGE <uChange> ] ;
[ READONLY | NO MODIFY ] ;

For editing Memos REDEFINE GET [ <oGet> VAR ] <uVar> ;


[ MULTILINE | MEMO | TEXT ] ;
[ ID <nId> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ HELPID | HELP ID <nHelpId> ] ;
[ COLOR | COLORS <nClrFore> [,<nClrBack>] ] ;
[ FONT <oFont> ] ;
[ CURSOR <oCursor> ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <WhenFunc> ] ;
[ READONLY | NO MODIFY> ] ;
[ VALID <ValidFunc> ] ;
[ ON CHANGE <uChange> ] ;

<nRow>, <nCol> The coordinates of the GET. We simulate Text coordinates.

<oGet> A reference to the GET Object.

<uVar> The variable which the GET Object is manipulating.

<oWnd> The container window of the GET.

<cPict> Typical xBase PICTURE clause.

<ValidFunc> Validating expression or function. The same as in MsDos.

<WhenFunc> When Clause. Not available yet!

<cColor> The color of the GET. Not available yet!

<nWidth>, The dimensions in pixels of the GET.


<nHeight>

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<oFont> A reference to the Font Object to be used with the GET.

<oCursor> A reference to the Cursor Object to dispay over this control.

<cMsg> The associated message of this control.

<nId> The numeric resource identifier of the Control.

<nHelpId> Help topic identifier for GETs from resources.

<nClrFore> Foreground color as a RGB number, or as a xBase string


<nClrBack> Background color as a RGB number

<uChange> An action to be performed when the Get changes.

CLAUSES

MULTILINE To use a multiple lines GET control to allow memo


MEMO editing.
TEXT

UPDATE This control may be updated from TDialog:Update() METHOD

CENTER If the GET containts has to appear centered

RIGHT If the GET containts has to appear right justified.


Important: In order to right justify a GET from a DialogBox,
it has to be defined at the resource as MultiLine and
right and has to use the default font!

PIXEL To use pixel coordinates instead of Text coordinates.

PASSWORD Enter as Password.

DESIGN Allows the user to move and resize with the mouse

HSCROLL Horizontal Scroll

READ ONLY Disables editing in this control.


NO MODIFY

Managing HLP files from your applications


--------------------------------------------------------------------------------

SET HELP TO <cHLPFile> Sets the default HELP file of the application
--------------------------------------------------------------------------------

Help management Functions


--------------------------------------------------------------------------------
WinHelp() Activates Windows WinHelp program .
GetHelpFile() Retrieves the default help file selected .
GetHelpTopic() Retrieves the default help Topic .
HelpIndex() Shows the default help file index .
HelpSearch() Search DialogBox in the default Help file .
HelpSetPos() Changes the position of the WinHelp Window .
HelpSetTopic() Selects a help default topic .
HelpTopic() Reviews a Topic .
SetHelpFile() Selects the default Help File .

Icons Commands

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------

Creating an Icon @ <nRow>, <nCol> ICON [ <oIcon> ] ;


control from source [ NAME | RESOURCE | RESNAME <cResName> ] ;
code [ FILE | FILENAME | DISK <cIcoFile> ] ;
[ BORDER ] ;
[ COLOR | COLORS <nClrFore>;
[,<nClrBack>] ] ;
[ ON CLICK <uClick> ] ;
[ OF | WINDOW | DIALOG <oWnd> ];
[ UPDATE ] ;
[ WHEN <WhenFunc> ] ;

Redefing an Icon REDEFINE ICON <oIcon> [ ID <nId> ] ;


from Resources [ NAME | RESOURCE | RESNAME <cResName> ] ;
[ FILE | FILENAME | DISK <cIcoFile> ] ;
[ ON CLICK <uClick> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ UPDATE ] ;
[ WHEN <WhenFunc> ] ;

<nRow>, <nCol> Are the coordinates on the screen. We simulate text


coordinates.

<oIcon> Is a reference to the Icon Object.

<cResName> Is the name of the icon resource if we are loading the icon
from a RC, RES or a DLL.

<cIcoFile> Is the name of a ICO file if we are loading the ICO directly
from disk.

<uClick> Is the action to be performed when the mouse clicks over the
icon.

<oWnd> Is the container Object of the Icon.

<WhenFunc> An expression to evaluate in order to determine if the


control is available or not.

<nClrFore> Foreground color as a RGB number, or as a xBase string

<nClrBack> Background color as a RGB number

Defining an Icon DEFINE ICON <oIcon> ;


without showing it [ NAME | RESOURCE | RESNAME <cResName> ] ;
[ FILE | FILENAME | DISK <cIcoFile> ]
[ WHEN <WhenFunc> ]

<oIcon> Is a reference to the Icon Object.

<cResName> Is the name of the icon resource if we are loading the icon
from a RC, RES or a DLL.

<cIcoFile> Is the name of a ICO file if we are loading the ICO directly
from disk.

CLAUSES

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


UPDATE Indicates if this control has to be updated when doing
a <oDlg>:Update() of its container.

BORDER Create a border arround the control.

INI Commands
--------------------------------------------------------------------------------

Managing an INI file INI <oIni> ;


[ FILE | FILENAME | DISK <cIniFile> ]

GET <uVar> ;
[ SECTION <cSection> ] ;
[ ENTRY <cEntry> ] ;
[ DEFAULT <uDefault> ] ;
[ OF | INI <oIni> ]

SET ;
[ SECTION <cSection> ] ;
[ ENTRY <cEntry> ] ;
[ TO <uVal> ] ;
[ OF | INI <oIni> ]

ENDINI

<oIni> A reference to the INI Object.

<cIniFile> The name of the INI file.

<uVar> A variable with the value loaded from the INI file.
This value gets automatically converted to the type
of the variable. So it is important to properly
initialize the variable before loading its value.

<cSection> [SECTION] -Typical formats inside .INI-


<cEntry> Entry=Value

<uDefault> A default value to use when that Entry is not found.

<uVal> The new value to set.

Class TIni INI files management as objects


--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
cIniFile INI physical filename

METHODs
--------------------------------------------------------------------------------
New Constructor from source code
Get Retrieves data from the INI file.
Set Writes data into the INI file.
DelEntry Deletes an INI section entry.
DelSection Deletes an entire INI section.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


ListBox xBase Commands
--------------------------------------------------------------------------------
[ <multi: MULTI, MULTIPLE, MULTISEL> ] ;
[ <sort: SORT> ] ;

Creating a ListBox @ <nRow>, <nCol> LISTBOX [ <oLbx> VAR ] <cnVar> ;


from source code [ ITEMS | PROMPTS <aList> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ ON CHANGE <uChange> ] ;
[ ON [ LEFT ] DBLCLICK <uLDblClick> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ VALID <uValid> ] ;
[ COLOR | COLORS <nClrFore> [,<nClrBack>] ] ;
[ PIXEL ] ;
[ DESIGN ] ;
[ FONT <oFont> ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <uWhen> ]
[ BITMAPS <acBitmaps> ] ;
[ ON DRAWITEM <uBmpSelect> ] ;
[ MULTI | MULTIPLE | MULTISEL ] ;
[ SORT ] ;

Creating a ListBox REDEFINE LISTBOX [ <oLbx> VAR ] <cnVar> ;


from resources [ ITEMS | PROMPTS <aItems> ] ;
[ FILES | FILESPEC <cFileSpec> ] ;
[ ID <nId> ] ;
[ ON CHANGE <uChange> ] ;
[ ON [ LEFT ] DBLCLICK <uLDblClick> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ HELPID | HELP ID <nHelpId> ] ;
[ BITMAPS [ SIZE <nSize> ] ] ;
[ VALID <uValid> ] ;
[ COLOR | COLORS <nClrFore> [,<nClrBack>] ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <uWhen> ]
[ BITMAPS <acBitmaps> ] ;
[ ON DRAWITEM <uBmpSelect> ] ;

<nRow>, <nCol> The coordinates of the ListBox. They mimic text mode
coordinates.

<oLbx> A reference to the ListBox object.

<cnVar> A Clipper variable, string or numeric, where FiveWin will


automatically select the item selected in the ListBox.

<aList> An Clipper array of strings, used to fill the ListBox items.

<nWidth>, <nHeight> The dimensions of the ListBox in pixels.

<uChange> A codeblock to evaluate everytime a item of the ListBox is


selected.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<uLDblClick> A codeblock to evaluate when the user left double clicks the
mouse over the listbox.

<oWnd> A reference to the container object of the ListBox, normally


a window or a DialogBox.

<uValid> A codeblock that holds the VALID clause of the ListBox.

<nClrFore> The color of the text of the ListBox items.

<nClrBack> The color of the background of the ListBox items.

<oFont> An optional font object to use when painting the ListBox items.

<cMsg> The message to show at the messageBar of the ListBox container


if defined (a window or a DialogBox normally).

<uWhen> A codeblock that holds the WHEN clause of the ListBox.

<cFileSpec> A 'mask' to use to automatically show files from disk.


i.e.: "*.*"

<nId> The control numeric identifier when managing resources.

<nHelpId> The help identifier for the ListBox.

<nSize> An optional size for the bitmaps used when doing a


ownerdraw ListBox.

<acBitmaps>

<uBmpSelect>

CLAUSES

PIXEL To specify that <nRow> and <nCol> must be trated as pixels,


and not simulated as MsDos text rows and cols.

DESIGN To let the user move around the control with the mouse.

UPDATE To specify that this control should be repainted (:Refresh())


when issuing a <oDlg>:Update() of its container DialogBox.

MULTI |
MULTIPLE | Alows Multiple selection.
MULTISEL

SORT

MDI Commands - Multiple Document Interface = MDI


--------------------------------------------------------------------------------

See below for a full explanation about Windows MDI use.

Creating a MDI frame Window is


done in a very similar way to
a normal Window. The difference
is just specify MDI.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


DEFINE WINDOW <oWnd> ;
[ FROM <nTop>, <nLeft> TO <nBottom>, <nRight> ] ;
[ TITLE <cTitle> ] ;
[ STYLE <nStyle> ] ;
[ MENU <oMenu> ] ;
[ BRUSH <oBrush> ] ;
[ ICON <oIcon> ] ;
[ MDI ] ;
[ COLOR | COLORS <nClrFore> [,<nClrBack>] ] ;
[ VSCROLL | VERTICAL SCROLL ] ;
[ HSCROLL | HORIZONTAL SCROLL ] ;
[ MENUINFO <nMenuInfo> ] ;
[ NONE | SINGLE ] ;
[ OF <oParent> ]

DEFINE WINDOW <oWnd> ;


[ FROM <nTop>, <nLeft> TO <nBottom>, <nRight> ] ;
[ TITLE <cTitle> ] ;
[ COLOR | COLORS <nClrFore> [,<nClrBack>] ];
[ OF <oParent> ] ;
[ BRUSH <oBrush> ] ; // Contained Objects
[ CURSOR <oCursor> ] ;
[ ICON <oIcon> ] ;
[ MENU <oMenu> ] ;
[ STYLE <nStyle> ] ; // Styles
[ BORDER <NONE | SINGLE> ] ;
[ NOSYSMENU | NO SYSMENU> ] ;
[ NOCAPTION | NO CAPTION | NO TITLE> ] ;
[ NOICONIZE | NOMINIMIZE> ] ;
[ NOZOOM | NO ZOOM | NOMAXIMIZE | NO MAXIMIZE> ] ;
[ VSCROLL | VERTICAL SCROLL> ] ;
[ HSCROLL | HORIZONTAL SCROLL> ] ;

See Window creating commands, as all the items are the same except:

MDI Specify that the main Window is going to be a MDI Window

<nMenuInfo> Is the position of the PopUp at the PullDown menu where


Windows automatically reports which child Window is
activated.

Activation Commands are the same as with a normal Window.

To create a ChildWindow of the main MDI Window, we do it again in a


similar way as creating a Window:

DEFINE WINDOW [<oWnd>] ;


[ MDICHILD ] ;
[ FROM <nTop>, <nLeft> TO <nBottom>, <nRight> ] ;
[ TITLE <cTitle> ] ;
[ BRUSH <oBrush> ] ;
[ CURSOR <oCursor> ] ;
[ MENU <oMenu> ] ;
[ ICON <oIco> ] ;
[ OF <oParent> ] ;
[ VSCROLL ] ;
[ HSCROLL ] ;
[ COLOR | COLORS <nClrFore> [,<nClrBack>] ] ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ PIXEL ] ;

ACTIVATE WINDOW <oWnd> ;


[ ICONIZED | NORMAL | MAXIMIZED> ] ;
[ ON [ LEFT ] CLICK <uLClick> ] ;
[ ON RIGHT CLICK <uRClick> ] ;
[ ON MOVE <uMove> ] ;
[ ON RESIZE <uResize> ] ;
[ ON PAINT <uPaint> ] ;
[ ON KEYDOWN <uKeyDown> ] ;
[ ON INIT <uInit> ] ;
[ ON UP <uUp> ] ;
[ ON DOWN <uDown> ] ;
[ ON PAGEUP <uPgUp> ] ;
[ ON PAGEDOWN <uPgDn> ] ;
[ ON LEFT <uLeft> ] ;
[ ON RIGHT <uRight> ] ;
[ ON PAGELEFT <uPgLeft> ] ;
[ ON PAGERIGHT <uPgRight> ] ;
[ VALID <uValid> ] ;

<oWnd> Window Object container of the window

<uLClick> An action to be performed when the left button of the mouse


is clicked over the Window.

<uRClick> An action to be performed when the right button of the mouse


is clicked over the Window.

<uMove> An action to be performed every time the Window is moved.

<uResize> An action to be performed every the Window is resized.

<uPaint> An action, generally drawing action, to be performed


every the Window is painted.

<uKeyDown> An action to be performed every a key is pressed


being the Window focused.

<uInit> An action to be performed, generally some initialization,


when the Window is being initialized.

<uUp> An action to be performed when the vertical scrollbar


is upwards pressed.

<uDown> An action to be performed when the vertical scrollbar


is downards pressed.

<uPgUp> An action to be performed when the vertical scrollbar


has been pagedown clicked.

<uPgDn> An action to be performed when the vertical scrollbar


has been pageup clicked.

<uLeft> An action to be performed when the horizontal scrollbar


has been leftwards clicked.

<uRight> An action to be performed when the horizontal scrollbar


has been righwards clicked.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<uPgLeft> An action to be performed when the horizontal scrollbar
has been pageleft clicked.

<uPgRight> An action to be performed when the horizontal scrollbar


has been pageright clicked.

<uValid> An action to validate to let the window be closed.

<nTop> Window coordinates on screen. We simulate text coordinates.


<nLeft>
<nBottom>
<nRight>

<nStyle> Determines the characteristics of the window. These


characteristics are define by the following constants
(defined in WINAPI.CH):

Constant Purpose

WS_BORDER Window has a border.

WS_CAPTION Window has a title bar (implies the


WS_BORDER style). This style cannot be
used with the WS_DLGFRAME style.

WS_CHILD A child window. Cannot be used with


the WS_POPUP style.

WS_CHILDWINDOW Same as the WS_CHILD style.

WS_CLIPCHILDREN Excludes the area occupied by child


windows when drawing within the parent
window. Used when creating the parent
window.

WS_CLIPSIBLINGS Clips child windows relative to each other;


that is, when a particular child window
receives a paint message, the
WS_CLIPSIBLINGS style clips all other
overlapped child windows out of the
region of the child window to be
updated. (If WS_CLIPSIBLINGS is not
specified and child windows overlap, it
is possible, when drawing within the
client area of a child window, to draw
within the client area of a neighboring
child window.) For use with the
WS_CHILD style only.

WS_DISABLED Window will be initially disabled.

WS_DLGFRAME Defines a window with a double border


but no title.

WS_GROUP Specifies the first control of a group of


controls in which the user can move from
one control to the next by using the arrow
keys. All controls defined with the
WS_GROUP style after the first control
belong to the same group. The next control

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


with the WS_GROUP style ends the style
group and starts the next group (that is,
one group ends where the next begins).
Only dialog boxes use this style.

WS_HSCROLL Window has a horizontal scroll bar.

WS_MAXIMIZE Window should be of maximum size.

WS_MAXIMIZEBOX Creates a window that has a Maximize button.

WS_MINIMIZE Define window that is initially


minimized. For use with the
WS_OVERLAPPED style only.

WS_MINIMIZEBOX Creates a window that has a Minimize button.

WS_OVERLAPPED Defines an overlapped window. An


overlapped window has a title and a
border.

WS_OVERLAPPEDWINDOW Creates an overlapped window having the


WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU,
WS_THICKFRAME, WS_MINIMIZEBOX, and
WS_MAXIMIZEBOX styles.

WS_POPUP Creates a pop-up window. Cannot be used


with the WS_CHILD style.

WS_POPUPWINDOW Creates a pop-up window that has the


WS_BORDER, WS_POPUP, and WS_SYSMENU
styles. The WS_CAPTION style must be
combined with the WS_POPUPWINDOW style
to make the System menu visible.

WS_SYSMENU Creates a window that has a System-menu


box in its title bar. Used only for
windows with title bars.

WS_TABSTOP Specifies one of any number of controls


through which the user can move by
using the TAB key. The TAB key moves
the user to the next control specified
by the WS_TABSTOP style. Only dialog
boxes use this style.

WS_THICKFRAME Creates a window with a thick frame


that can be used to size the window.

WS_VISIBLE Creates a window that is initially


visible. This applies to overlapped,
child, and pop-up windows. For
overlapped windows, the y parameter is
used as a ShowWindow function
parameter.

WS_VSCROLL Creates a window that has a vertical


scroll bar.

Note: If this parameter is used it will override the


values of the following parameters:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


cBorder
lCaption
lSysmenu
lmin
lMax
lVScroll
lHScroll

In order to combine several styes use the function nOr():

nOr( nStyle1, nStyle2, ... )

<uKeyDown> An actionto perform when pressing a key.

<oParent> The container of the window.

<oBrush> Brush Object attached to the window

<oCursor> Cursor Object attached to the window

<oIcon> Icon Object attached to the window

<oMenu> Menu Object attached to the window

<nClrFore> The colors to use for the windows. They may be


<nClrBack> numeric RGB colors or xBase string colors.

<nMenuInfo> The popup position in the pulldown menu of the


window, where the MDI environment will automatically
place information.

<cTitle> The caption of the window.

CLAUSES

MDI To be created as an MDI environment.

BORDER <NONE | SINGLE> The style of the border.

NOSYSMENU | NO SYSMENU To avoid using the typicall system menu.

NOCAPTION | NO CAPTION | NO TITLE To avoid using a caption.

NOICONIZE | NOMINIMIZE To avoid the iconize button.

NOZOOM | NO ZOOM | NOMAXIMIZE | NO MAXIMIZE To avoid the maximize button.

VSCROLL | VERTICAL SCROLL To automatically show a vertical scrollbar.

HSCROLL | HORIZONTAL SCROLL To automatically show a horizontal scrollbar.

PIXEL To interpret the coordinates as pixel based instead character


based

You must specify the clause MDICHILD to have all the possibilities Windows
MDI offers.

MDI programming explanation

What is MDI ?

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


As soon as you start getting comfortable with Windows you will face one
of the more powerful features of it: Multiple Document Interface Windowing.

Most of the Windows commercial applications we use (the Windows Program


Manager is written using MDI) take advantage of the possibilities of MDI.

Basically MDI environment is a main Window which has several child Windows
inside which can be resized, tiled, cascaded, maximized, created and destroyed
very easily. In fact, a MDI environment is like a whole Window environment
all by itself.

These features, which may seem very common to you, won't work if you
try to get create them using standard Windows. Well, you could do it, but it
would mean a lot of code to be written.

Windows, instead, offers the MDI system to create these systems.

Why MDI ?

To make things easier! We automatically get a lot of nice and powerful


features without the need to code them. Windows takes control of everything!

The elements of a MDI environment

There is just one big difference to understand about MDI programming:

Windows keeps an 'invisible' Window which extends the entire the client area
of the 'frame' Window:

+---------------------------------------+
MDI Frame --------->|+-------------------------------------+|
(is the external || +---------------+ ||
and main Window) || | | ||
|| | <-------------- Child Windows
|| | | || | (In fact they
MDI Client ----------------> | +----------------+ || | are children of
(you don't realize || +-----| | || the MDI client
it is there and || | <--------------| Window)
extends the entire || | | ||
internal area of |+-------------------------------------+|
the MDI frame) +---------------------------------------+

The real 'trick' of the MDI programming is the MDI Client Window which Windows
has implemented.

Developing a MDI environment in C language is a very complicated task. In


fact, it is one of the most difficult tasks for beginners. But you are lucky
because doing it with CA-Clipper and FiveWin it is a very, very easy task!

How to do MDI with FiveWin

To create the main MDI frame Window we use the standard FiveWin Windows
creation commands. The only difference is that you must specify the
MDI clause. See above.

Now, you start creating the child Windows with the same easy commands.
You don't have to worry about the 'ghost' MDI Client Window.

FiveWin automatically manages and talks to the MDI Client Window.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


To create a MDI Child Window you again use the standard Window creation
commands, but you must specify the clause MDICHILD.

All that you already know about FiveWin is still the same! You only have
to remember a few items:

A MDI Frame Window Object has 'DATA' named oWndClient, which is another
Windows Object -the 'ghost' MDI Client!-.

In fact, the surface you see inside the MDI frame is the MDI Client!!!
Don't forget that. So, if -for example- you plan to place a bitmap on
the surface of the MDI frame Window, you really have to place it on the
MDI Client. So do this:

@ 2, 2 BITMAP ... OF oWnd:oWndClient

if you forget that, and you just do OF oWnd, you will be placing the bitmap
_behind_ the MDI Client, so you will not see the bitmap!!! Remember that!
That is the omly 'trick' about MDI programming.

MDI Object Oriented Implementation

If you go deeper in FiveWin architecture, you will discover there are some
very powerful Classes supporting all the Windows MDI implementation.

We have developed three main Classes which inherit from base Window Class:

Class TWindow
|
|-- Class TMdiFrame
|-- Class TMdiClient
+-- Class TMdiChild

All of them implement new methods to encapsulate all the power Windows
offers to MDI programming.

Remember this:

TMdiFrame is the main Window. It has data named oWndClient which is


a TMdiClient Window.

oWndClient has a Clipper array with all the Child Windows you create.
The name of that data is aWnd. It is a normal Clipper array. You may use
as you wish.

New MDI directions in FiveWin

In previous releases of FiveWin, we planned to develop some new Classes


inheriting from TMdiChild to suit some of the 'normal' business applications
situations you will face. But now, we have found an easier approach:

Most of the MDI Child Windows you will use will be very similar to each other
-once again we stress about business applications development not just
'fancy' programming-. They will have a ButtonBar attached and a main control
which automatically resizes to extend the whole visible area of the
Child Window.

So, we are giving you a really powerful way of developing MDI environments
which is quick and clean:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


The way we suggest that you manage MDI child Windows is as follows:

* First, you create the MDI frame. See above syntax.

* Next you start creating -when you need them- the child Windows:
Using the above syntax:

DEFINE WINDOW [<oWnd>] ;


[ MDICHILD ] ;
[ FROM <nTop>, <nLeft> TO <nBottom>, <nRight> ] ;
[ TITLE <cTitle> ] ;
[ MENU <oMenu> ] ;
[ ICON <oIco> ] ;
[ OF <oParent> ]

* Now you create a ButtonBar for this Child Window. Use the standard
syntax:

DEFINE BUTTONBAR oBar OF <oWndChild> // The name of your MDI Child

Attach the buttons in a normal way. Every button will have the actions
you define:

DEFINE BUTTON OF oBar ACTION ...

DEFINE BUTTON OF oBar ACTION ...

...

Using this approach easily enhances the functionality of the MDI


Child Window without the need to develop a new Class -you are free to
do it, but only when really necessary!-

* The last step is to create a Control -whatever Class of control you need-
and attach it to the Child Window:

@ 0, 0 GET <oControl>... MEMO OF <oWndChild>

@ 0, 0 LISTBOX <oControl> BROWSE ... OF <oWndChild>

etc... -any Class of Control-

And now, we tell the MDI Child to use that control as its main Control:

<oWndChild>:SetControl( <oControl> )

To start using it, you ACTIVATE the Window in the normal way:

ACTIVATE WINDOW <oWndChild> ...

And that is all!

Doing it this way you will be mastering MDI programming in a few minutes
without the need to create new Classes or learning very difficult MDI
programming rules.

Let CA-Clipper and FiveWin do the hard work for you. This is the power
of OOPS and xBase!

See the new version of \IDE\IDE.prg for a real full example on MDI

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


programming.

Menus Commands
--------------------------------------------------------------------------------

Creating a pulldown menu MENU [ <oMenu> ] [POPUP]


from source code MENUITEM [ <oMenuItem> PROMPT ] <cPrompt> ;
[ MESSAGE <cMsg> ];
[ CHECK | CHECKED | MARK ] ;
[ ENABLED | DISABLED ] ;
[ FILE | FILENAME | DISK <cBmpFile> ];
[ RESOURCE | RESNAME | NAME <ResName> ];
[ ACTION <uAction> ] ;
[ BLOCK <bAction> ] ;
[ OF | MENU | SYSMENU <oMenu> ];
[ ACCELERATOR <nState>, <nVirtKey> ] ;
[ HELP ] ;
[ HELP ID | HELPID <nHelpId> ] ;
[ WHEN <uWhen> ]

SEPARATOR [<oMenuItem>]

MENUITEM...

MRU <oMru> ;
[ INI | ININAME | FILENAME | NAME | DISK
<cIniFile> ] ;
[ SECTION <cSection> ] ;
[ SIZE | ITEMS <nItems> ] ;
[ MESSAGE <cMsg> ] ;
[ ACTION <uAction> ]

ENDMENU

Creating a pulldown menu DEFINE MENU <oMenu> ;


from resources [ RESOURCE | NAME | RESNAME <cResName> ];
[ POPUP ] ;

REDEFINE MENUITEM [ <oMenuItem> ;


PROMPT <cPrompt> ] ;
[ ID <nId> OF | MENU <oMenu> ] ;
[ ACTION <uAction> ] ;
[ BLOCK <bAction> ] ;
[ MESSAGE <cMsg> ] ;
[ CHECK | CHECKED | MARK ] ;
[ ENABLED | DISABLED ] ;
[ FILE | FILENAME | DISK <cBmpFile> ];
[ RESOURCE | RESNAME | NAME <cResName> ] ;
[ ACCELERATOR <nState>, <nVirtKey> ] ;
[ WHEN <uWhen> ]

Activating a Popup Menu ACTIVATE POPUP <oMenu> ;


[ AT <nRow>, <nCol> ] ;
[ OF | WINDOW | DIALOG <oWnd> ]

Redefining the System REDEFINE SYSMENU <oMenu> ;


Menu of a Window [ OF | WINDOW | DIALOG <oWnd> ]

-MenuItems same as above...-

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


ENDSYSMENU

<oMenu> A reference to the Menu Object.

<oMenuItem> A reference to one of the menuitems of the menu. Each


menuitem of a menu object is also an object. SEPARATOR
clause also may specify an optional menuitem variable to
store its related value.

<cMsg> The associated message of this control.

<cBmpFile> The name of a BMP file to be used as the label for a


menuitem of the menu.

<cResName> The resource name of the menu.

<uAction> The action to be performed for a specific menuitem.

<bAction> The same action as above expressed as a codeblock.

<nRow>, <nCol> The coordinates where to place the Popup Menu.

<oWnd> The container window of the Menu.

<nState> The state of they accelerator key (see VKEY.CH)

<nVirtKey> ASCII value of the accelerator key.

<nHelpId> The help topic identifier of a specific menuitem.

<uWhen> An expression to be bloquified and evaluated to check


if a menuitem should be enabled or disabled.

<nId> The numeric resource identifier of the menuitem.

<cPrompt> The label of the menuitem.

<bAction> The action to be performed when the Button is pressed.

<oMru> A reference to a new MRU object created

<cIniFile> The name of the related INI file to use with a MRU object.

<cSection> The section inside the INI file where to store the MRU items.

<nItems> The number of items to be managed by the MRU object.

<uAction> The action to perform when selecting a MRU item.

CLAUSES

CHECK If the menuitem has to appear initially as checked.


CHECKED
MARK

ENABLED If the menuitem has to appear initially as enabled.


by default it is enabled.

DISABLED If the menuitem has to appear initiall as disabled.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


HELP If the menuitem has to appear by the op right of the
pulldown menu.

POPUP To create a popup menu instead of a pulldown menu.

Meter Commands
--------------------------------------------------------------------------------

Creating a Meter @ <nRow>, <nCol> METER [ <oMeter> VAR ] <nActual> ;


from source code [ TOTAL <nTotal> ] ;
[ SIZE <nWidth>, <nHeight> ];
[ OF <oWnd> ] ;
[ UPDATE ] ;
[ PIXEL ] ;
[ FONT <oFont> ] ;
[ PROMPT <cPrompt> ] ;
[ NOPERCENTAGE ] ;
[ COLOR | COLORS <nClrPane>, <nClrText> ] ;
[ BARCOLOR <nClrBar>, <nClrBText> ] ;
[ DESIGN ] ;

Creating a Meter REDEFINE METER [ <oMeter> VAR ] <nActual> ;


from resources [ TOTAL <nTotal> ] ;
[ ID <nId> ] ;
[ OF <oWnd> ];
[ UPDATE ] ;
[ FONT <oFont> ] ;
[ PROMPT <cPrompt> ] ;
[ NOPERCENTAGE ] ;
[ COLOR | COLORS <nClrPane>, <nClrText> ] ;
[ BARCOLOR <nClrBar>, <nClrBText> ] ;

<nRow>, <nCol> The coordinates on the screen. We simulate text coordinates.

<oMeter> A reference to the Meter Object.

<nActual> The numerical variable represented by the Meter.

<nTotal> The total amount represented by the Meter.

<nWidth>, The dimensions of the Meter in pixels.


<nHeight>

<oWnd> A reference to the container Window Object of the Meter.

<nId> A numerical value identifying the Meter from resources.

<oFont> The font to use to display the percentadge of the meter.

<cPrompt> To display an optional text inside the meter.

<nClrPane> The colors of the unfilled parts of the meter


<nClrText>
<nClrBar> The colors of the filled parts of the meter.
<nClrBText>

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


CLAUSES

UPDATE If this control has to be updated everytime its container


is updated <oDlg>:Update().

PIXEL If the coordinates of the meter are pixel based.

NOPERCENTAGE To avoid showing the '%' sign.

DESIGN Allows the user to move and resize with the mouse

MessageBar xBase commands


--------------------------------------------------------------------------------

Creating a MsgBar from SET MESSAGE OF <oWnd> ;


source code TO <cPrompt> ;
(traditional dBase way) [ CENTERED ] ;
[ FONT <oFont> ] ;
[ CLOCK | TIME ] ;
[ DATE ] ;
[ KEYBOARD ] ;
[ COLOR | COLORS <nClrFore>;
[,<nClrBack>] ] ;
[ NOINSET ]

An alternative way DEFINE MESSAGE OF <oWnd> ;


(Objects creation way) TO <cPrompt> ;
[ PROMPT <cMsg> ]
[ CENTERED ] ;
[ FONT <oFont> ] ;
[ CLOCK | TIME> ] ;
[ DATE ] ;
[ KEYBOARD ] ;
[ COLOR | COLORS <nClrFore>;
[,<nClrBack>] ] ;
[ NOINSET ]

Defining yours onw DEFINE MSGITEM [ <oMsgItem> ] ;


MsgItems. [ OF <oMsgBar> ] ;
[ PROMPT <cPrompt> ] ;
[ SIZE <nSize> ] ;
[ FONT <oFont> ] ;
[ COLOR | COLORS <nClrFore>;
[, <nClrBack>] ] ;
[ ACTION <uAction> ] ;

<oWnd> A reference to its container window

<cPrompt> The default msg to show

<oFont> An optional reference to a font object to use to


display the msg.

<nClrFore> Foreground color as a RGB number, or as a xBase string

<nClrBack> Background color as a RGB number

<oMsgItem> A reference of the MsgItem objet.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<oMsgBar> A reference of its container MsgBar.

<nSize> Size of the MsgItem.

<uAction>

CLAUSES

CENTERED If the text should show centered

CLOCK | TIME Time in the MsgBar.

DATE Date in the MsgBar.

KEYBOARD Keyboard status in the MsgBar.

NOINSET For a non-inset MsgBar appearance

ODBC - xBase Commands


--------------------------------------------------------------------------------

Using a DataBase through DEFINE ODBC <oDbc> ;


ODBC [ NAME <cName> ] ;
[ USER <cUser> ] ;
[ PASSWORD <cPassword> ] ;
[ CONNECT <cConnect> ] ;
[ FROM USER ]

Executing a SQL statement ODBC <oDbc> [ SQL | EXECUTE ] <cCommand>

<oDbc> A variable which holds the reference to the object ODBC.

<cName> The name of the DataBase to use.

<cUser> The name of the user who is going to manage the DataBase.

<cPassword> An optional password required to use the DataBase.

<cConnect> Some ODBC drivers require a connection string, which


normally includes the <cName>, <cPassword>, and other
extra required information.

<cCommand> A character string which holds the ODBC statement to


execute.

CLAUSES

FROM USER Means that we want to select interactively the DataBase


to use.

Multiple DialogBox Pages xBase commands


--------------------------------------------------------------------------------

Creating a folder
from source code

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Creating a folder REDEFINE PAGES <oPag> ;
from resources [ ID <nId> ] ;
[ OF <oWnd> ] ;
[ DIALOGS <DlgName,...> ] ;
[ OPTION <nOption> ]

<oPag> A reference to the TPages object just created.

<nId> The numeric resource identifier of the control.

<oWnd> The container object of the TPages control.

<DlgName,...> A list with the resources names of the DialogBoxes


to manage. Important: These DialogBoxes must have
the style STYLE WS_CHILD | WS_VISIBLE at the RC
or DLL file.

<nOption> An optional initial option to use different from 1.

Pen Control
--------------------------------------------------------------------------------

Defining a Pen Control DEFINE PEN <oPen> ;


[ STYLE <nStyle> ] ;
[ WIDTH <nWidth> ] ;
[ COLOR <nRGBColor> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;

Activating the Pen Control ACTIVATE PEN <oPen>

<oPen> Reference to a Pen Object.

<nStyle> An optional Pen Style.

<nRGBColor> Pen color as a RGB number, or as a xBase string.

Printing Commands
--------------------------------------------------------------------------------

Using the Printer PRINT [ <oPrint> ] ;


[ TITLE | NAME | DOC <cDocument> ] ;
[ FROM USER ] ;
[ PREVIEW ]
[ TO <xModel> ]

PAGE

<oPrint>:Say( <nRow>, <nCol>, <cText>,;


[<oFont>], [<nWidth>],;
[<nClrText>] )

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


...

ENDPAGE
ENDPRINT

<oPrint> A reference to the Printer Object.

<cDocument> The name of the document to be generated. It is the name


that appears at the Spooler.

<nRow>, The starting coordinates of the print measured in


<nCol> printer resolution units. This means that different
printers will generate different looking reports.

In order to avoid this (you want the same looking printout


with different printers!) you need first to calculate the
resolution of the printer, and then, divide those dimensions
by the number of rows and columns that you want:

See SAMPLES\TestPrn2.prg

<cText> The value to print. It may be of any type. FiveWin


will automatically convert it into a string expression.

<oFont> A font object to use when printing the <cText>


value. See the FONT xBase commands to properly build a font.
It is an optional parameter.

Important: If you want a specific dimension for that


font independently from the printer used, you must specify
the OF ... clause when creating the font, and after the
printer object has been created:

local oPrn, oFont

PRINT oPrn
DEFINE FONT oFont NAME "Arial" SIZE 0, -8 OF oPrn
PAGE
...
ENDPAGE
ENDPRINT

oFont:End()

Important: You have to :End() the font object once you


have finished and completed your printout work.

<nWidth> A specific printer units width to use when


printing the <cText> value. It is an optional parameter.

<nClrText> An optional color to use when printing the


<cText> value. It is an optional parameter.

CLAUSES

PAGE Starts a new page

ENDPAGE Ends the current printed page

ENDPRINT Ends printing

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


FROM USER Lets the user interactively select the printer to use.
If you don't specify this clause, FiveWin will use the
default printer installed in your system.

PREVIEW Invokes the FiveWin preview system, which lets the user
interactively preview the printout before sending it to
the printer.

PushButton Commands
--------------------------------------------------------------------------------

Creating Buttons from @ <nRow>, <nCol> BUTTON [ <oBtn> ]


source code [ PROMPT <cCaption> ] ;
[ NAME | RESNAME | RESOURCE <cResName1>;
[,<cResName2>] ] ;
[ FILE | FILENAME | DISK <cBmpFile1>;
[,<cBmpFile2>] ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ ACTION <uAction> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ MESSAGE <cMsg> ] ;
[ WHEN <WhenFunc> ] ;
[ ADJUST ] ;
[ DEFAULT ] ;
[ HELP | HELPID | HELP ID <nHelpId> ] ;
[ FONT <oFont> ] ;
[ PIXEL ] ;
[ DESIGN ] ;
[ UPDATE ] ;
[ VALID <ValidFunc> ] ;
[ CANCEL ] ;

Using Buttons from REDEFINE BUTTON [<oBtn>] ;


resources [ ID <nId> ] ;
[ PROMPT <cCaption> ] ;
[ OF | BUTTONBAR <oBar> | ] ;
[ | WINDOW | DIALOG <oDlg> ] ;
[ NAME | RESNAME | RESOURCE <cResName1>;
[,<cResName2>] ] ;
[ FILE | FILENAME | DISK <cBmpFile1>;
[,<cBmpFile2>] ] ;
[ ACTION | EXEC> <uAction> ] ;
[ MESSAGE <cMsg> ] ;
[ ADJUST ] ;
[ WHEN <WhenFunc> ] ;
[ HELP | HELPID | HELP ID <nHelpId> ] ;
[ VALID <ValidFunc> ] ;
[ CANCEL ] ;

DEFINE BUTTON [ <oBtn> ] ;


[ OF | BUTTONBAR <oBar> ] ;
[ NAME | RESNAME | RESOURCE <cResName1>;
[,<cResName2>] ] ;
[ FILE | FILENAME | DISK <cBmpFile1>;
[,<cBmpFile2>] ] ;
[ ACTION | EXEC <uAction> ] ;
[ GROUP ] ;
[ MESSAGE <cMsg> ] ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ ADJUST ] ;
[ WHEN <WhenFunc> ] ;

<nRow>, <nCol> The coordinates of the Button. They mimic text mode
coordinates.

<oBtn> A reference to the Button Object.

<oBar> A reference to the Button

<cCaption> The label of the Button.

<cBpFile1> The file name of the bitmap as a Picture Button.


<cBmpFile2> When a second bitmap is provided it is displayed as the
Button in a depressed state.

<nHelpId> The help topic identifier of the Button.

<oWnd> The container window of the Button.

<uAction> The action to be performed when the Button is pressed.

<oFont> A reference to the Font Object to use with the Button.

<nWidth> The dimensions of the Button.


<nHeigth>

<cResName1> The bitmap resource to display as a Picture Button.


<cResName2> When a second bitmap resource is provided it is displayed
as the Button in a depressed state.

<cMsg> The associated message of this control

<WhenFunc> It is an expression to evaluate indicating if the control is


or not enable.

<nId> The numeric resource identifier of the Control.

<ValidFunc> An expression to validate when the control is going to


lose the focus.

CLAUSES

DEFAULT For default PushButtons: Automatically executes when


the user press Enter, even from other controls.

Use this clause only when building the Button from


source code. When using resources, this clause must
be specifies from the resource editor.

DESIGN Allows the user to move and resize with the mouse

PIXEL To use pixel coordinates instead of Text coordinates.

UPDATE This control may be updated from TDialog:Update() METHOD

CANCEL

RadioButtons Commands

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------

Creating a RadioButton Menu @ <nRow>, <nCol> RADIO [ <oRadMenu> VAR ] <nVar>


;
from source code [ PROMPT | ITEMS <cItems,...> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ HELPID | HELP ID <nHelpId,...> ] ;
[ ON CLICK | ON CHANGE <uChange> ]
[ COLOR | COLORS <nClrFore>;
[,<nClrBack>] ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <uWhen> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ VALID <ValidFunc> ] ;
[ DESIGN ] ;
[ 3D ] ;
[ PIXEL ] ;

Creating a RadioButton Menu REDEFINE RADIO [ <oRadMenu> VAR ] <nVar> ;


from resources [ ID <nId,...> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ HELPID | HELP ID <nHelpId,...> ] ;
[ ON CLICK | ON CHANGE <uChange> ]
[ COLOR | COLORS <nClrFore>;
[,<nClrBack>] ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <uWhen> ] ;
[ VALID <ValidFunc> ] ;

<nRow>, <nCol> The coordinates of the RadioButton Menu. We simulate


text coordinates.

<oRadMenu> A reference to the RadMenu Object.

<nVar> The numeric variable which controls the RadioButton


Menu.

<cItems> A list of strings defining the prompts to be used


as radio elements.

<oWnd> A reference to the container Window of the Radio


Button Menu.

<nHelpId> A list of numeric help identifier to associate to


each radio control.

<uChange> An action to be performed when a new radio is


selected at the RadioButton Menu.

<cMsg> The associated message of this control

<WhenFunc> It is an expression to evaluate indicating if the control is


or not enable.

<nWidth> The dimensions of the control.


<nHeigth>

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<ValidFunc> An expression to validate when the control is going to
lose the focus.

CLAUSES

3D 3D look.

UPDATE This control may be updated from TDialog:Update() METHOD

DESIGN Allows the user to move and resize with the mouse.

PIXEL To use pixel coordinates instead of Text coordinates.

Report xBase commands


--------------------------------------------------------------------------------

General syntax: REPORT ...


COLUMN ...
COLUMN ...
[ GROUP ... ]
ENDREPORT

ACTIVATE REPORT ...

REPORT [ <oReport> ] ;
[ TITLE <bTitle, ...> [< LEFT | CENTER | CENTERED | RIGHT > ] ];
[ HEADER <bHead, ...> [< LEFT | CENTER | CENTERED | RIGHT > ] ];
[ FOOTER <bFoot, ...> [< LEFT | CENTER | CENTERED | RIGHT > ] ];
[ FONT <oFont, ...> ] ;
[ PEN <oPen, ...> ] ;
[ < SUMMARY > ] ;
[ < FILE | FILENAME | DISK > <cRptFile> ] ;
[ < NAME | RESNAME | RESOURCE > <cResName> ] ;
[ < TO PRINTER > ] ;
[ < PREVIEW > ] ;
[ TO FILE <toFile> ] ;
[ TO DEVICE <oDevice> ] ;
[ CAPTION <cName> ]

GROUP [ <oRptGrp> ] ;
[ ON <bGroup> ] ;
[ HEADER <bHead> ] ;
[ FOOTER <bFoot> ] ;
[ FONT <uFont> ] ;
[ < EJECT > ]

COLUMN [ <oRptCol> ] ;
[ TITLE <bTitle, ...> ] ;
[ AT <nCol> ] ;
[ DATA <bData, ...> ] ;
[ SIZE <nSize> ] ;
[ PICTURE <cPicture, ...> ] ;
[ FONT <uFont> ] ;
[ < TOTAL > [ FOR <bTotalExpr> ] ] ;
[ < LEFT | CENTER | CENTERED | RIGHT > ] ;
[ < SHADOW > ] ;
[ < GRID > [ <nPen> ] ]

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


ENDREPORT

ACTIVATE REPORT <oReport> ;


[ FOR <for> ] ;
[ WHILE <while> ] ;
[ ON INIT <uInit> ] ;
[ ON END <uEnd> ] ;
[ ON STARTPAGE <uStartPage> ] ;
[ ON ENDPAGE <uEndPage> ] ;
[ ON STARTGROUP <uStartGroup> ] ;
[ ON ENDGROUP <uEndGroup> ] ;
[ ON STARTLINE <uStartLine> ] ;
[ ON ENDLINE <uEndLine> ] ;
[ ON CHANGE <bChange> ]

Using Resources
--------------------------------------------------------------------------------

You may store your application's resources in a DLL, or embed them


inside your EXE file use the Microsoft RC.EXE resource compiler.

To use resources from inside a DLL:

Using DLLs as resources SET RESOURCES TO <cDllName> [,<cDllName>... ]

Selecting one of the SET RESOURCES TO <cDllName>


opened resources

Ending the use of the SET RESOURCES TO


resource

<cDllName> Is the name of a DLL where resources have been


placed. It is possible to specify multiple DLLs for resources.

After opening several DLLs as resources it is necessary


to select the one we are going to use. To do so we
must again issue the command:

SET RESOURCES TO <TheSameResourceName>

It is similar to selecting a certain Work Area.

To use resources from inside your EXE:

No special command is required. Just call:

RC.EXE -K MyApp.rc MyApp.exe

After linking your EXE, provide an RC file with all the resource
definitions for your application. The SAMPLES\Build.bat we provide
automatically calls RC.EXE if a RC is defined with the same name as
the .prg you are building with build.bat. Applications requiring
multiple .prgs, must have their own .rmk file or batch file to build
them. Use the above mentioned RC.EXE syntax to embed your resources
into your final .exe

RC.EXE is the Windows resource compiler and it is a utility you may

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


get from any Windows C/C++ compiler. FiveWin does not provide RC.EXE.

SAY commands
--------------------------------------------------------------------------------

Defining a SAY object @ <nRow>, <nCol> SAY [ <oSay> PROMPT | VAR ]


<cText> ;
from source code [ OF | WINDOW | DIALOG <oWnd> ] ;
[ PICTURE <cPicture> ] ;
[ COLOR | COLORS <nClrFore>;
[,<nClrBack>] ] ;
[ FONT <oFont> ] ;
[ CENTERED | CENTER ] ;
[ RIGHT ] ;
[ BORDER ] ;
[ PIXEL | PIXELS ]
[ SIZE <nWidth>, <nHeight> ] ;
[ DESIGN ] ;
[ UPDATE ] ;
[ SHADED | SHADOW ] ;
[ BOX ] ;
[ RAISED ] ;

Redefining a SAY object REDEFINE SAY <oSay> ;


from resources [ PROMPT <cText> ] ;
[ ID <nId> OF | WINDOW | DIALOG <oDlg> ] ;
[ CENTERED ]
[ COLOR | COLORS <nClrFore>;
[,<nClrBack>] ] ;
[ PICTURE <cPicture> ] ;
[ UPDATE ] ;
[ FONT <oFont> ] ;

<nRow>, <nCol> The coordinates of the Say Object. We simulate Text


coordinates.

<oSay> A reference to the Say Object.

<cText> The label of the Say Object.

<oWnd> The container dialog of the Say control.

<cPicture> The typical PICTURE clause for a SAY.

<cColor> The COLOR string for the SAY. Not available yet!

<oFont> The Object font to be used with the SAY. The Font must
be created previously using DEFINE FONT... .

<nClrFore> Foreground color as a RGB number, or as a xBase string

<nClrBack> Background color as a RGB number

<nWidth>, The dimensions of the control.


<nHeigth>

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<oSay> A reference to the Say Object.

<cText> The caption to assign to the Say Object. Specifying it


change the text on the resource.

<nId> The numeric resource identifier of the Say Object.


Is has to be assigned from the resource editor.

<oWnd> The container dialog of the Say Object.

CLAUSES

CENTERED Center text.


CENTER

RIGHT Right justification.

BORDER Create a border arround the control.

DESIGN Allows the user to move and resize with the mouse

PIXEL To use pixel coordinates instead of Text coordinates.

UPDATE This control may be updated from TDialog:Update() METHOD

SHADED
SHADOW

BOX Place the say objet in a box.

RAISED

ScrollBar Controls Commands


--------------------------------------------------------------------------------

Creating a ScrollBar @ <nRow>, <nCol> SCROLLBAR [<oSbr>] ;


from source code [ HORIZONTAL | VERTICAL ] ;
[ RANGE <nMin>, <nMax> ] ;
[ PAGESTEP <nPgStep> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ UP | ON UP <uUpAction> ] ;
[ DOWN | ON DOWN <uDownAction> ] ;
[ PAGEUP | ON PAGEUP <uPgUpAction> ] ;
[ PAGEDOWN | ON PAGEDOWN <uPgDownAction> ] ;
[ ON THUMBPOS <uPos> ] ;
[ PIXEL ] ;
[ COLOR | COLORS <nClrFore>;
[,<nClrBack>] ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <WhenFunc> ] ;
[ VALID <ValidFunc> ] ;
[ DESIGN ] ;
[ OF | WINDOW | DIALOG <oDlg> ]

Creating a ScrollBar REDEFINE SCROLLBAR [ <oSbr> ] ;


from resources [ ID <nID> ] ;
[ RANGE <nMin>, <nMax> ] ;
[ PAGESTEP <nPgStep> ] ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ UP | ON UP | ON LEFT <uUpAction> ] ;
[ DOWN | ON DOWN | ON RIGHT <uDownAction> ] ;
[ PAGEUP | ON PAGEUP <uPgUpAction> ] ;
[ PAGEDOWN | ON PAGEDOWN <uPgDownAction> ] ;
[ ON THUMBPOS <uPos> ] ;
[ COLOR | COLORS <nClrFore>;
[,<nClrBack>] ] ;
[ OF | WINDOW | DIALOG <oDlg> ]
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <WhenFunc> ] ;
[ VALID <ValidFunc> ] ;

For 'non-true ScrollBars'


(when using WS_VSCROLL or WS_HSCROLL styles )

DEFINE SCROLLBAR [ <oSbr> ] ;


[ HORIZONTAL | VERTICAL ] ;
[ RANGE <nMin>, <nMax> ] ;
[ PAGESTEP <nPgStep> ] ;
[ UP | ON UP <uUpAction> ] ;
[ DOWN | ON DOWN <uDownAction> ] ;
[ PAGEUP | ON PAGEUP <uPgUpAction> ] ;
[ PAGEDOWN | ON PAGEDOWN <uPgDownAction> ] ;
[ ON THUMBPOS <uPos> ] ;
[ COLOR | COLORS <nClrFore>;
[,<nClrBack>] ] ;
[ MESSAGE <cMsg> ] ;
[ WHEN <WhenFunc> ] ;
[ VALID <ValidFunc> ] ;
[ OF | WINDOW | DIALOG <oDlg> ]

<nRow>, <nCol> The coordinates of the ScrollBar.


We simulate Text coordinates.

<oSbr> A reference to the ScrollBar Object.

<oDlg> The container window of the ScrollBar.

<nMin>, <nMax> The range of values to be represented by the scrollbar.

<nPgStep> The increment of value when PageUp or PageDown is


selected on the Scrollbar. That is, when clicking
between the thumb and the top arrow or when clicking
between the thumb and the bottom arrow.

<nWidth> The dimensions in pixels of the ScrollBar.


<nHeight>

<uUpAction> An action to be performed when going up is selected on


the scrollbar. That is, when clicking on the top arrow or
when pressing the key K_UP.

<uDownAction> An action to be performed when going down is selected on


the scrollbar. That is, when clicking on the bottom arrow or
when pressing the key K_DOWN.

<uPgUpAction> An action to be performed when page up is selected on


the scrollbar. That is, when clicking between the thumb

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


and the top arrow.

<uPgDownAction> An action to be performed when page down is selected on


the scrollbar. That is, when clicking between the thumb
and the bottom arrow.

<uPos> An action to be performed when the thumb is moved by the


user and left on a different position. The new position
is automatically provided as nPos value.

<nId> The numeric resource identifier of the Control.

<nClrFore> Foreground color as a RGB number, or as a xBase string

<nClrBack> Background color as a RGB number

<ValidFunc> An expression to validate when the control is going to


lose the focus.

<cMsg> The associated message of this control

<WhenFunc> It is an expression to evaluate indicating if the control is


or not enable.

CLAUSES

HORIZONTAL To use a horizontal or vertical scrollbar. Only useful


VERTICAL when creating from source code.

PIXEL To use pixel coordinates instead of Text coordinates.

DESIGN Allows the user to move and resize with the mouse

UPDATE This control may be updated from TDialog:Update() METHOD

Tabs xBase Commands


--------------------------------------------------------------------------------

Creating a tab @ <nRow>, <nCol> TABS [<oTabs>] ;


from source code [ OF | WINDOW | DIALOG <oWnd> ] ;
[ PROMPT | PROMPTS | ITEMS <cPrompt,...> ] ;
[ ACTION | EXECUTE <uAction> ] ;
[ PIXEL ] ;
[ DESIGN ] ;
[ COLOR | COLORS <nClrFore> [,<nClrBack>] ] ;
[ OPTION <nOption> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ MESSAGE <cMsg> ]

Creating a tab REDEFINE TABS [<oTabs>] ;


from resources [ ID <nId> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ PROMPT | PROMPTS | ITEMS <cPrompt,...> ] ;
[ ACTION | EXECUTE <uAction> ] ;
[ COLOR | COLORS <nClrFore> [,<nClrBack>] ] ;
[ OPTION <nOption> ]

<nRow>, <nCol> The coordinates where to locate the tab control

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


(only from source code, not from resources).

<oTabs> A reference to the tab object just created.

<oWnd> The container object of the tab control.

<cPrompt> A list of strings, one for each tab.

<uAction> The action to execute when selecting any tab.

<nClrFore> The color to display the prompts text.

<nClrBack> The color to fill the folder surface.

<nOption> An optional initial option to use different from 1.

<nWidth>, <nHeight> The dimensions of the tab control.

<cMsg> An optional message to display on its container MsgBar


if defined.

<nId> The numeric resource identifier of the control.

CLAUSES

PIXEL To use pixel coordinates instead of text coordinates.

DESIGN Allows the user to interactively move and resize the


control.

Timers Commands
--------------------------------------------------------------------------------

Defining a new Timer DEFINE TIMER <oTimer> ;


[ INTERVAL <nInterval> ] ;
[ ACTION <uAction> ] ;
[ OF | WINDOW | DIALOG <oWnd> ]

ACTIVATE TIMER <oTimer>

DEACTIVATE TIMER <oTimer>

RELEASE TIMER <oTimer>

<oTimer> A reference to the Timer Object.

<nInterval> Defines the timer interval in thousandths of seconds.

<uAction> The action to be performed when the interval period is


reached.

<oWnd> A reference to the container Window Object.

Managing Trees (Linked-Lists data structures)


--------------------------------------------------------------------------------

Creating a tree TREE [<oTree>] ;


[ BITMAPS <cBmpOpen>, <cBmpClose> ]

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


TREEITEM [<oItem> PROMPT ] <cLabel> ;
[ RESOURCE <cResName1> [, <cResName2> ] ] ;
[ FILENAME <cBmpOpen> [, <cBmpClose> ] ] ;
[ OPENED | OPEN ]

...

[ TREE <oSubTree> ]
[ TREEITEM ... ]
[ ... ]
[ ENDTREE ]

ENDTREE

<oTree> A reference to the TTree object just created.

<cBmpOpen> Optional bitmaps files or resources names for


<cBmpClosed> the tree nodes open and close states images.

<oItem> A reference to the TTreeItem object just created.

<cLabel> The prompt of an TreeItem element.

<cResName1> Optional bitmaps resources names for the item


<cResName2> open and closed states images. The Tree
<cBmpOpen> and <cBmpClosed> are used by default
if <cResName1> and <cResName2> are not specified.

<cBmpOpen> Optional bitmaps file names for the item


<cBmpClosed> open and closed states images. The Tree
<cBmpOpen> and <cBmpClosed> are used by default
if <cResName1> and <cResName2> are not specified.

<oSubTree> A reference to the TTree object just created.

Video Commands
--------------------------------------------------------------------------------

Defining a video Control @ <nRow>, <nCol> VIDEO <oVideo> ;


from source code [ SIZE <nWidth>, <nHeigth> ] ;
[ FILE | FILENAME | DISK <cAviFile> ] ;
[ OF | WINDOW | DIALOG <oWnd> ]

Redefining a Video Control DEFINE VIDEO <oVideo> ;


from resources [ID <nId> ] ;
[ FILE | FILENAME | DISK <cAviFile> ] ;
[ OF | WINDOW | DIALOG <oWnd> ]
[ WHEN <uWhen> ] ;
[ VALID <uValid> ] ;

Activating the Video ACTIVATE VIDEO <oVideo>

<nRow>, <nCol> The control coordinates. We simulate Text coordinates.

<oVideo> A reference to the Video Object.

<nWidth>, The Control dimensions.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<nHeight>

<cAviFile> The name of the AVI file to be played.

<oWnd> A reference to the container Window of the Control.

<WhenFunc> It is an expression to evaluate indicating if the control is


or not enable.
<ValidFunc> An expression to validate when the control is going to
lose the focus.

Window Commands
--------------------------------------------------------------------------------

Creating a new Window:

DEFINE WINDOW <oWnd> ;


[ FROM <nTop>, <nLeft> TO <nBottom>, <nRight> ] ;
[ TITLE <cTitle> ] ;
[ <color: COLOR, COLORS> <nClrFore> [,<nClrBack>] ];
[ OF <oParent> ] ;
[ BRUSH <oBrush> ] ;
[ CURSOR <oCursor> ] ;
[ ICON <oIcon> ] ;
[ MENU <oMenu> ] ;
[ STYLE <nStyle> ] ;
[ BORDER [ NONE | SINGLE ] ] ;
[ NOSYSMENU | NO SYSMENU ] ;
[ NOCAPTION | NO CAPTION | NO TITLE ] ;
[ NOICONIZE | NOMINIMIZE ] ;
[ NOZOOM | NO ZOOM | NOMAXIMIZE | NO MAXIMIZE ] ;
[ VSCROLL | VERTICAL SCROLL ] ;
[ HSCROLL | HORIZONTAL SCROLL ]

<oWnd> A reference to the Window Object.

<nTop> Window coordinates on screen. We simulate text coordinates.


<nLeft>
<nBottom>
<nRight>

<cTitle> The title of the Window.

<oParent> A reference to the Parent Window.

<oBrush> An already created Brush Object to be used as background


of the Window. Use DEFINE BRUSH ... to create it. This
parameter is optional.

<oCursor> A reference to the Cursor Object to display over this control.

<oIcon> A reference to an Icon Object to be used by the Window.


Use DEFINE ICON ... to create it. This parameter is optional.

<oMenu> An already created Menu Object. Use MENU ... ENDMENU inside
a function as in examples. This parameter is optional.

<nStyle> A numeric value which indicates a special API style.


[ Just for advanced FiveWin users.]

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<nClrFore> The colors to use for the windows. They may be
<nClrBack> numeric RGB colors or xBase string colors.

Activating a Window ACTIVATE WINDOW <oWnd> ;


[ ICONIZED | NORMAL | MAXIMIZED ] ;
[ ON LEFT CLICK <uLClick> ] ;
[ ON RIGHT CLICK <uRClick> ] ;
[ ON MOVE <uMove> ] ;
[ ON RESIZE <uResize> ] ;
[ ON PAINT <uPaint> ] ;
[ ON KEYDOWN <uKeyDown> ] ;
[ ON INIT <uInit> ]

<oWnd> A reference to the Window Object.

<uLClick> An action to be performed when the left button of the mouse


is clicked over the Window.

<uRClick> An action to be performed when the right button of the mouse


is clicked over the Window.

<uMove> An action to be performed every time the Window is moved.

<uResize> An action to be performed every the Window is resized.

<uPaint> An action, generally drawing action, to be performed


every the Window is painted.

<uKeyDown> An action to be performed every a key is pressed


being the Window focused.

<uInit> An action to be performed, generally some initialization,


when the Window is being initialized.

FiveWin Header Files


--------------------------------------------------------------------------------
Colors.ch Color constants definitions
Constant.ch Text to Graphics constants definitions
DDE.ch Commands for Dynamic Data Exchange
Dialog.ch Dialog Boxes
DLL.ch Dynamic Linking Libraries calling at RunTime
FiveWin.ch FiveWin main header file
Folder.ch Folders and Tabs management
Font.ch Fonts management
Ini.ch INI Files
Mail.ch Windows MAPI email support
Menu.ch Managing Menus
Objects.ch Object Oriented Engine of FiveWin
ODBC.ch Open DataBase connectivity support
Print.ch Using the Printer
Report.ch Report engine
SQL.ch ODBC header
TcBrowse.ch Column based new Browse
Tree.ch Trees support
Video.ch Video media AVI Support
VKey.ch Windows keys values
WinApi.ch Windows API definitions
ClipApi.h Clipper internal management declarations

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


WinTen.h To avoid conflicts with Windows API Pascal names
xBase common elements
--------------------------------------------------------------------------------

We have paid particular attention into the syntax of FiveWin such as using
the same clause to do the same thing in similar circumstances. This means
that as soon as you learn these few rules, you may control a lot of
different FiveWin features.

We will keep extending this basic concept to manage all the different parts
of the Windows API. Having just a unique xBase interface to manage the
Windows API will let you concentrate in the goal of your application and
not in the details.

xBase clauses Description


--------------------------------------------------------------------------------

DEFINE All the objects in FiveWin get created using the


key word DEFINE:

DEFINE <Class> <Object> [<more clauses>]

As example, to create a window we do:

DEFINE WINDOW oWnd ...

To create a Dialog Box: DEFINE DIALOG oDlg ...


To create an icon: DEFINE ICON oIco ...
To create a report: DEFINE REPORT oRpt ...

Remember to use DEFINE to create anything!

ACTIVATE Everything in FiveWin start working using the


key ACTIVATE:

ACTIVATE <Class> <Object> [<more clauses>]

As example, to activate a window we do:

ACTIVATE WINDOW oWnd ...

To activate a Dialog Box: ACTIVATE DIALOG oDlg ...


To activate a report: ACTIVATE REPORT oRpt ...
To activate a timer: ACTIVATE TIMER oTmr ...

Remember to use ACTIVATE to make things work!

:End() Though this is an OOPS message, we use it extensively


in FiveWin to end the execution of something:

<Object>:End()

As example, to end the execution of a window we use:

oWnd:End()

To end a Dialog Box: oDlg:End()


To end a report: oRpt:End()
To end a timer: oTmr:End()

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


We use the OOPS message instead of a xBase command,
because we may issue it from many different places,
where it is not possible to use an xBase command:

REDEFINE BUTTON ID ID_END OF oDlg ;


ACTION oDlg:End()

OF Every time we need to specify the owner or


container of an Object, we use OF:

REDEFINE BUTTON ID ID_OK OF oDlg

The clause OF means: "belongs to", "it is contained


in", "its owner is".

For example, to specify the owner of a DialogBox:

DEFINE DIALOG oDlg RESOURCE "Test" OF oWnd

For a child window: DEFINE WINDOW oWnd2 TITLE "Test" ;


OF oWnd1

For a control: REDEFINE GET cName ID ID_NAME OF oDlg


For a font: DEFINE FONT oFont NAME "Arial" ;
SIZE 0, -20 OF oPrn

RESOURCE You may use any of these clauses to specify


RESNAME that an Object has to be built from resources.
NAME
DEFINE ... RESOURCE <cResourceName>

For example, to create an icon from resources, we do:

DEFINE ICON oIco RESOURCE "MyIcon"

To create a Dialog Box:

DEFINE DIALOG oDlg RESOURCE "Clients"

To create a cursor:

DEFINE CURSOR oCrs RESOURCE "Eye"

Remember: Always use RESOURCE clause to create


an Object from resources stored inside the same
EXE (rc resources) or stored inside a DLL.

FILENAME You may use any of these clauses to specify


FILE than an Object has to be loaded from a file in disk.
DISK
DEFINE ... FILENAME <cFileName>

For example to use a button bitmap which picture


is inside a BMP file we do:

DEFINE BUTTON OF oBar FILENAME "Exit.bmp"

To create a bitmap control from disk we do:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


REDEFINE BITMAP oBmp ID ID_PHOTO OF oDlg ;
FILENAME "Photo.bmp"

Remember: Always use FILENAME clause to use


a file stored at disk.

SIZE <nWidth>, Every time we have to specify some pixel dimensions


<nHeight> we use the SIZE clause.

Remember: Always use SIZE to specify certain dimensions.

Classes Hierarchy The relationship between Classes


-------------------------------------------------------------------------------
TcColumn Browse columns (for TCBrowse objects) .

TDDE Dynamic Data Exchange based on Win 3.0 .

TDDEMLServer Windows 3.1 DDEML Server management .


TDDEMLClient Windows 3.1 DDEML Client management .

TFile Low level files management as objects .


|
|--- TLex FiveWin lexical analyzer .
|--- TLibFile LIB files management .
|--- TTxtFile Ascii text files management .
+--- TObjFile OBJs intel binary files management .

TFont Font Class .

TWindow Window base Class .


|
|--- TDialog Dialog Boxes .
|
|--- TBar Button bar .
|
|--- TMdiFrame MDI support .
|--- TMdiClient MDI support .
|--- TMdiChild MDI support .
|
|--- TMsgBar Messages bar .
|
+--- TControl Base Class for controls .
|
|--- TBitmap Pictures in Bitmaps .
|--- TButton PushButtons .
|--- TCheckBox Logical checkboxes .
|--- TComboBox Get + ListBox functionality .
|--- TFolder FiveWin Folders .
|--- TGet Typical Clipper GET .
|--- TIcon Icons as controls .
|--- TListBox ListBox selection list .
|--- TMeter Meter controls .
|--- TMultiGet Gets for Memo editing .
|--- TPages Multiple DialogBox pages management .
|--- TRadio Radio controls .
|--- TScrollBar ScrollBars controls .
|--- TTabs FiveWin Tabs .
|--- TVbX Visual Basic controls .

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


+--- TWBrowse Browse controls .
|
+--- TCBrowse Browse with column objects

TLinkList Linked-Lists data structures (Trees) .


TTreeItem TreeItems Class (used by trees) .

TMenu Menu Class .


TMenuItem Menu MenuItems .

TBlock FiveWin disk-storable codeblocks .

TMCI Media Control interface .


+--- TVideo AVI Video controls .

TRadMenu Radio Controls Menu .

TOdbc ODBC Sessions management .


TDbOdbc ODBC each DataBase managed .

TPen Pen Class .

TPrinter Printer Class .

TReport Report engine .


TrColumn Report columns .
TrGroup Report Groups .
TrLine Report single line .
.

TTime Time Class .


TTimer Timer Class .

TDataBase DataBase Class .

2. Classes and Objects

Class TBar Inherits from TControl


--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
aButtons Array of TBtnBmp objects
nGroups Number of groups
nMode The position of the BtnBar on the window
nBtnWidth The height and width of its buttons. By default is 28x28
nBtnHeight The height of the Bar is automatically adjusted to the
height of the buttons.
l3D If the BtnBar has to be shown 3DLook

METHODS
--------------------------------------------------------------------------------
New Constructor from source code.
NewAt Constructor from source code at a certain location.
Add Add a BtnBmp to the bar.
AddGroup Adds a new logical group to the bar.
Adjust Adjust the Button bar to the dimensions of its container
window.
AdjMode Changes the BtnBar position to floating

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Del Deletes a button from the bar.
DelGroup Deletes a logical group from the bar.
Display Displays the button bar
cGenPRG Returns a string with the source code of the button bar
Float Turns the buttonbar into floating mode.
FloatClick Processes MouseClicks on the float mode buttonbar.
GetBtnTop Returns the appropriate nTop when adding a new button
GetBtnLeft Returns the appropriate nLeft when adding a new button
GoDown Turns the buttonbar into down mode.
GoLeft Turns the buttonbar into left mode.
GoRight Turns the buttonbar into right mode.
GoTop Turns the buttonbar into top mode.
LeftMode Changes the BtnBar position to the left of the window
MouseMove Activates the default message on window owner MsgBar
Paint Displays the ButtonBar. Use :Refresh() instead this.
RButtonDown Processes mouse right clicks on the buttonbar.
RightMode Changes the BtnBar position to the Right the window
TopMode Changes the BtnBar position to the Top of the window
Click Mouse left button event handler
SaveIni Saves the bar to an INI file
SetMsg Set the text of the message bar of its container window
GetBtnCol Computes the column of the new Button

Class TBitmap Bitmaps controls


--------------------------------------------------------------------------------

Inherits from TControl

DATA
--------------------------------------------------------------------------------
nX Relative origin coordinates of the picture.
nY Relative origin coordinates of the picture.
hBmpPal Handle and palette of the Bitmap
cBmpFile Name of the BMP file to display
cResName Name of the BMP resource to display
lStretch True if image has to be adjusted to all visible area
lScroll True if image may be scrolled into its own visible area
aHotAreas An array with some hot-areas on the bitmap
nVStep Units to scroll on vertical scroll
nHStep Units to scroll on horizontal scroll
nZoom Units to zoom the picture.

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
Define Constructor for resources
ReDefine Constructor for resources
End Ends control and make it disappear
Command Processes WM_COMMAND WinApi messages
Default Default initialization of the Bitmap
Destroy Destroy the bitmap object.
Display Displays the bitmap. Use :Refresh() instead to force it.
GotFocus Action to be performed when getting the focus
HScroll Horizontal ScrollBar messages dispatcher
Init Generic Control initialization method
Inspect Interactive load of Bitmap.
LButtonDown Action to be performed when clicking the mouse.
Load Load the bitmap from resources
LoadBmp Load bitmap from disk.
nHeight Retrieves height of the image.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


nWidth Retrieves width of the image.
nXExtra Retrieves the size of image which it is not visible
nYExtra The same for the other axis
Paint Draws the bitmap
Reload Load again a bitmap
Resize Changes the dimension of the bitmap
ScrollAdjust Updates the values on the scrollbars
ScrollDown Scrolls the bitmap DOWN if lScroll is .t.
ScrollLeft Scrolls the bitmap LEFT if lScroll is .t.
ScrollRight Scrolls the bitmap RIGHT if lScroll is .t.
ScrollUp Scrolls the bitmap UP if lScroll is .t.
SetBmp Load bitmap from resource.
SetFore Set this bitmap palette as the main active palette
VScroll Vertical ScrollBar messages dispatcher
Zoom Zoom the picture.

Note: The ScrollXXX Methods assume that lScroll is TRUE AND that
the BitMap is larger than the visible area

Class TBlock
--------------------------------------------------------------------------------
DATA
cExpression A string with the block expression
bBlock the expression codeblock
--------------------------------------------------------------------------------
METHODS
New Creates a new codeblock
Eval / Exec Executes the codeblock

Class TBtnBmp Inherits from TControl


--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
bAction CodeBlock for the click event.
cMsg Message bar Text.
lPressed Is button is pressed.
lCaptured Is mouse is captured by the button.
lAdjust If the bitmap has to be resized to cover all its surface
hBmpPal1 The main image of button.
hBmpPal2 The image of button pressed for animated button.

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
NewBar Constructor from source code for Button Bar
ReDefine Creates a BtnBmp from resources
Click Mouse left button event handler
FreeBitMaps Releases all the bitmaps associated with this control
cGenPRG Generates the source code of this control
HandleEvent Generic events handler
LButtonDown Behavior when pressing the mouse
LButtonUp Behavior when releasing the mouse click
LoadBitmaps Load the bitmap/s from resources
Paint Draws the Button
MouseMove Behavior when moving the mouse over it
Release Destroy the Button image
SetFile Changes to a different BMP file

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Class TBrush
--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
hBrush Handle of the brush.
hBitmap Handle of Bitmap if the brush is an image.

METHODS
--------------------------------------------------------------------------------

New Constructor from source code.


cGenPRG Returns a string with the source code of the Brush.
End/Realise Destroy the Brush image.

Class TButton Inherits from TControl


--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
bAction CodeBlock for the click event.
lDefault The button has default style.

METHODS
--------------------------------------------------------------------------------
New Constructor from source code.
ReDefine Constructor for resources.
cGetPRG Generates the source code of the button.
Click Mouse left button event handler.
Colors Overrides control Color() management.
cToChar Generates a data template to build a Dialog.
GotFocus Action to be performed when getting the focus.
Init Action to be performed on init.
KeyDown Action to be performed when a key is pressed down.
LostFocus Action to be performed when losing the focus.
MouseMove Action to be performed when moving the mouse over.

CLASS TCBrowse FROM TWBrowse Column based browse .


--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
lRegistered Internal. Used to register a new class.
aColumns An array holding all the column objects
aArray Holds the array, when browsing an array
lNoHScroll Don't display the vertical scrollbar
lNoLiteBar Don't use a different color to hilite bar
lNoGrayBar Don't use a different color to lostfocus bar
lLogicDrop Use a combobox when editing a logical value
nAdjColumn Column index to expand to flush table window
lRepaint Bypass paint if false
nFreeze Freeze nFreeze left most columns
oDbf Holds DataBase object when used
oCtx Holds context object when used
lColDrag Allows column exchange by dragging
lLineDrag Allows column width resize with the mouse
nDragCol Column being mouse dragged

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


lAutoCtx True when managing a context object
hBmpCursor Bitmap handle to display on first column
bSeekChange Expression to eval when record changes
cSeek Last expression to seek on incremental search
nColOrder Column which index is the active one
nOClrForeHead
nOClrBackHead
cOrderType

METHODS
--------------------------------------------------------------------------------
New Constructor. Creates a new browse from source code .
ReDefine Constructor from resources .
Destroy Specific destroy for these objects. Internally called. .
GotFocus Method to execute on receiving focus event. Internal. .
LostFocus Method to execute on losing focus event. Internal .
BeginPaint Method to execute on beginpaint event. Internal .
Paint Method to execute on paint event. Internal. .
EndPaint Method to execute on Endpaint event. Internal .
Default Performs default initialization of the browse. Internal. .
DrawLine Draws a specific line of the browse. Internally used .
DrawSelect Draws the line that is currently selected. Internal .
DrawHeaders Draws the headers of all visible columns. Internal .
ResetSeek Resets the seek expression on incremental search .
SetOrder Selects a column index tag .
GoDown Select next browse row .
GoUp Select the previous browse row .
Seek Performs an incremental search based on nKey value .
PageUp Goes up one page .
PageDown Goes down one page .
KeyChar Method to handle WM_CHAR events. .
LButtonDown Left mouse click events manager .
LButtonUp Left mouse releasing events manager .
LDblClick Left double click events management .
lEditCol Edits a cell of the browse .
nAtCol Returns the column placed at a specific pixel position .
MouseMove Mouse Movements events manager .
Report Automatically generates a Report from the browse .
Reset Resets all browse navigation associated data .
ResetBarPos Set the scrollBar thumb according to the default tag .
SetArray Browses an array .
SetoDBF Browses a DataBase object .
SetContext Sets a context object to be used .
VertLine Controls the column width mouse resizing .
AddColumn Adds a new column to the browse .
SwitchCols Exchanges two columns without displaying them again .
Exchange Exchange two columns and displays them .

TcColumn
DATA
--------------------------------------------------------------------------------
cHeading Optional Header text
bData Mandatory Code block to return column data
cPicture Optional picture clause
bClrFore Optional Foreground Color block
bClrBack Optional Background Color block
nAlign Optional Alignment DT_LEFT or so on
nWidth Optional Width
lBitMap Optional Bitmap Flag
lEdit True if editing is allowable
lNoLite True to skip cell during SelectlLine()

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


cMsg Editing message
bValid Editing valid block
cError Bad valid error message
cOrder index tag name

METHODs
--------------------------------------------------------------------------------
New Method constructor. Creates a new column object .

Class TCheckBox Inherits from TControl


--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
None

METHODS
--------------------------------------------------------------------------------
New Constructor from source code.
ReDefine Constructor for resources.
Click Mouse left button event handler.
Default Default initialization.
cToChar Generates a data template to build a Dialog.
Init Generic initialization.
MouseMove Action to be performed when moving the mouse over.
Refresh Repaints the control.
cGenPRG Generates the source code of the control.

Class TClipBoard
--------------------------------------------------------------------------------

The clipboard provides a mechanism that makes it possible for applications


to pass data handles to other applications. Clipboard functions carry out
data interchange between Windows applications.

DATAs
--------------------------------------------------------------------------------
nFormat Type of data placed in Clipboard
oWnd Container object

METHODs
--------------------------------------------------------------------------------
New Constructor from source code
Clear Open, clear Clipboard contents and close it
Close Close the Clipboard to end using it
Empty Clear Clipboard contents if it's open
End Open, clear Clipboard contents and close it
GetData Get the content of Clipboard
GetText Get the text placed in the Clipboard
Open Open the Clipboard to start using it
SetData Set the content of Clipboard
SetText Places text in the Clipboard

Class TComponent FROM TControl Visual management of Non-Visual objects


--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
oObject Contained non-visual Object

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


aProperties Array of editable Properties.
aEvents Array of editable events.
hBmp handle of a related bitmap to represent the non-visual object.
bInspect CodeBlock to inspect the contained non-visual object.

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
Destroy Destroy the object.
Display Displays the control. Use :Refresh() to force repaint
LDblClick Action to be performed on left double click. Invokes bInspect
Paint Draws the control. This process occurs inside Display.

Class TComboBox Inherits from TControl


--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
aItems Array of Items of the ComboBox
nAt Index of the current select item
aBitmaps Array of Bitmaps of the ComboBox if ownerdraw style used
lOwnerDraw If it is an ownerdraw style ComboBox
nBmpHeight Height to use for painting the ownerdraw bitmaps
nBmpWidth Width to use for painting the ownerdraw bitmaps
bDrawItem CodeBlock to evaluate to select a ownerdraw bitmap to paint
cError Error description when using a ComboBox for browse cell editing
oGet Contained GET for DropDown ComboBoxes if STYLE CBS_DROPDOWN
specified
nStyle internally used when specifying a STYLE CBS_DROPDOWN ComboBox

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
ReDefine Constructor for resources
Add Add an item to the combobox items list
cToChar Generates a data template to build a DialogBox
Change Changed event response
Default Default initialization
DefControl Register the control as a contained child of a container object
Del Deletes an item
Destroy Destroys the control
DrawItem OwnerDraw items painting
FillMeasure Calculates the dimension of an ownerdraw item
Find Checks if a specific string is contained at its items list
FindString Returns the specific index position of an item in its list
Init Generic initialization on DialogBoxes
Insert Insert an item
LostFocus Action to be performed when loosing the focus
lValid ComboBox validation when loosing the focus
Modify Modify the text of an item
MouseMove Action to be performed when moving the mouse over it
Open Opens the ComboBox related list
Refresh Forces the control to be repainted
Reset Empty all contents of the ComboBox and the array aItems
Select To select a string in the list box of a combo box by index
Set To select a string in the list box of a combo box by text
SetBitmaps To set the bitmaps to be used by the ownerdraw
SetItems Changes the items shown in the combobox
ShowTooltip Shows its tooltip
VarGet Retrieves the associated Clipper variable value

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Class TComm
--------------------------------------------------------------------------------

Developed by a FiveWin user

DATA
--------------------------------------------------------------------------------
nDevice, nInQueue, nOutQueue, nId, nStop, nBaud, nData, nErr
cParity, cStyle, cChar
aStatus

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
Break Blocks the communication port.
Close Closes the communication port.
Error Shows the errors messages.
Escape Sends the escape sequence.
Flush Leaves empty the communication buffer.
SetUp Setups the communication port.
UnBreak Unlock the communication port.
Write Send a string to the communication port.

Class TControl Inherits from TWindow


-------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
bSetGet Code Block to manage the variable associated to the control
bChange Action to be performed when there is a major change
cCaption Text caption of the Control
lCaptured If the control has the mouse captured
lDrag If the control should be moved around
lMouseDown Is the mouse button down on the control
lUpdate If the control has to be updated when updating the Dialog
nLastRow The last screen row where the mouse was positioned.
nLastCol The last screen column where the mouse was positioned

METHODS
------------------------------------------------------------------------------
Change Virtual Method to execute when generic changing of the control
.
Click Virtual Method to execute when generic clicking of the control
.
cToChar Control Data to template convertor for creating Dialog Boxes.
Init Generic Control initialization method .
Default Default initialization .
EraseBkGnd Erase Background of control .
FWLostFocus Handle losing focus by control .
GetDlgCode Handle changing of controls .
GetNewId Generates an unique control ID .
GotFocus Action to be performed when getting the focus .
LostFocus Action to be performed when losing the focus .
End Ends control and make it disappear .
HandleEvent Generic control Handle Event method .

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


KeyDown Action to be performed when pressing a control key .
SetFocus Set keyboard focus to control .
Colors Returns the colors of the control .
DrawItem Generic base DrawItem procedure .
FillMeasure Generic Fill Measure method .
Set3DLook Enables the 3D look .
VarPut Modify the value of the associated variable through bSetGet .
VarGet Load again the variable value associated .
LButtonDown Action to be performed when clicking the mouse .
LButtonUp Action to be performed when releasing the mouse .
MouseMove Action to be performed when moving the mouse over .
KeyChar Action to be performed when pressing a key .
ForWhen WHEN clauses control .
Display Displays the control. Use :Refresh() to force repaint .
Paint Draws the control. This process occurs inside Display. .
SysCommand Handle system commands sent to the control .

Class TCursor Mouse cursors managed as objects


--------------------------------------------------------------------------------

DATAs
--------------------------------------------------------------------------------
hCursor Handle of the cursor.
lPredef If it is a Windows system predefined cursor.

METHODs
--------------------------------------------------------------------------------
New Constructor from source code .
End Destroys the cursor object

CLASS TDataBase DataBases management as objects


--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
cAlias The workarea alias where the DataBase object has been created
cFile The name of the DBF file associated
cDriver The name of the driver associated
lShared If the workarea is shared
lReadOnly If the workarea is readonly
bBoF CodeBlock to execute when BoF()
bEoF CodeBlock to execute when EoF()
nArea The workarea order used (i.e.: 1,2,3, ... )
lBuffer To use or not a buffer. It is a must for NetWorking!
aBuffer An editing buffer holding fields temporary data .

METHODs
--------------------------------------------------------------------------------
New Constructor
Skip Skips like DbSkip()
Activate Select its workarea as the one currently active
AddIndex Adds a new index
Append Adds a new record
Blank Empties the editing buffer
Bof Checks if beginning of file
Close Closes the workarea
CloseIndex Closes an index
Commit Flushes pending file buffers
Create Creates a new DataBase
CreateIndex Creates a new Index
ClearRelation Clear active relations
DeActivate Closes the database. It acts like DbCloseArea()

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


DbCreate Creates the DBF file from its structure in a array
Delete Mark a record for deletion
Deleted Return the deleted status of the current record
DeleteIndex Remove a specified order from an order bag
Eof Determine when End of file is encountered
Eval Evaluates a codeblock for records matching a scope/condition
FCount Return the number of fields in the current DBF file
FieldGet Retrieve the value of a field variable
FieldPut Set the value of a field variable
Found Determine if the previous search operation succeeded
GoTo Move to the record having the specified record number
GoTop Move to the first logical record
GoBottom Move to the last logical record
IndexKey Return the key expression of a specified index
IndexName Return the name of an order in the Order list
IndexBagName Return the Order bag name of a specified Order
IndexOrder Return the position of an Order in the current Order List
LastRec Determine the number of records in the current DBF file
Load Loads the record contents into the editing buffer
Lock Lock an open and shared database file
Pack Removes all record marked for deletion
ReCall Restore records marked for deletion
RecCount Determine the number of records in the current DBF file
RecLock Lock the current record
RecNo Return the current record number
Save Saves the editing buffer contents into the DBF file
SetBuffer Activates/Deactivates the editing buffer .
Seek Move to the record having the specified key value
SetOrder Set focus to an order in an Order list
SetRelation Relate two work areas
Skip Move relative to the current record
Skipper Try to skip a certain amount of records
UnLock Release all locks for the current work area
Use Use a database file in a work area
Used Determine whether a database file is in USE
Zap Remove all records from the current database file

Class TDbOdbc ODBC DataBase management


--------------------------------------------------------------------------------

FiveWin implements the Class TDbOdbc to simulate the xBase management


style on any ODBC used table.

DATAs
--------------------------------------------------------------------------------
hStmt The handle of the SQL statement to process.
oOdbc A reference to the related TOdbc session object
aFields Array containing all the DataBase fields description
nRetCode Returned code from the latest operation
cLastComm The latest executed SQL command

METHODs
--------------------------------------------------------------------------------
New Constructor from source code
End Ends control and make it disappear
Cancel Cancels the current in process SQL statement
Execute Execute an SQL statement
GetCurName Gets the current assigned cursor name
GetOptions
InitFields Loads all DataBase fields descriptions into ::aFields
LastCommand Last executed command

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


LastError Retrieves the last error
FieldGet Retrieves the contents of a field
FieldGetBlob Retrieves the contents of a BLOB field into a disk file
FieldName Retrieves the name of a field
FieldType Retrieves the type of a field
FieldLen Retrieves the len of a field
FieldDec Retrieves the number of decimals of a field
ParamData
Prepare Prepares a SQL command so next time won't be parsed again
PutData Changes the current cursor pointed table values
RowCount Retrieves the number of fields of the DataBase
SetCurName Sets a name for the cursor in use
SetOptions Set several SQL options
SetParam Sets a param description for next SQL statement
Skip Skip to the next record

Class TDbm Class DataBase Manager


--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
aFields Array of fields objects
aIndexes Array of index objects
oDict related dictionary (Class TDict) object

METHODS
--------------------------------------------------------------------------------
New Constructor
Redefine Constructor from the dictionary (considered as a resource)
AddField Adds a new field description
AddIndex Adds a new index description
ReadFields Load the fields descriptions from the dictionary object
ReadIndexes Load the indexes descriptions from the dictionary object
WriteFields Save the fields descriptions from the dictionary object
WriteIndexes Save the indexes descriptions from the dictionary object
Create Creates the DataBase file DBF from the aFields description

Class TDde
--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
nService The service on which to establish the connection.
nTopic The topic on which to establish the connection.
nItem The item on which to establish the connection.
bAction Action to be performed
bEnd Action to perform when ending the DDE link (VALID)
oWndServer Container TWindow object of the TDDE object.
lActive If the DDE connection is still active

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
Activate To initiate a conversation with server applications
responding to the specified application and topic names.
Execute To send a string to the server to be processed as a
series of commands.
End Ends the DDE connection

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Class TDDEMLServer DDEML Server Object management
--------------------------------------------------------------------------------

DATAs
--------------------------------------------------------------------------------
hInst A handle of the DDEML instance session
hConv A handle of the DDEML conversation
cService The name of the service
hService The handle of the service
lConnecting If the server is in the process of connecting with a Client
hSz2 Some processes require to hold a hSZ2 handle stored here
aClients An array with all the attended Clients
bOnConnect The action to perform when connecting to a client
bOnRequest The action to perform on a client request
bOnDisconnect The action to perform when a client disconnects
bOnExecute The action to perform on a Client Execute command

METHODs
--------------------------------------------------------------------------------
New Constructor METHOD
Connect Automatically called when a Client wants to connect
ConnectConfirm Automatically called when a Client has finally connected
Disconnect Automatically called when a Client has disconnected
Execute Automatically called when a Client has sent a command
Request Automatically called when a Client has done a request
Return Use this method to return data to a Client Request

Class TDDEMLClient DDEML Client Object management


--------------------------------------------------------------------------------

DATAs
--------------------------------------------------------------------------------
hInst A handle of the DDEML instance session
hConv A handle of the DDEML conversation
cService The name of the service
hService The handle of the service
cTopic The name of the topic to keep the conversation about
hTopic The handle of the topic
nTimeOut The timeout to wait for an answer. Default 1000. Use -1 for
ASync.

METHODs
--------------------------------------------------------------------------------
New Constructor METHOD
Connect To connect to a Server
Disconnect To disconnect from the Server
End Disconnects from the Server. Same as above
Execute Sends a command to the Server.
Request Request data from the Server.

Class TDialog Inherits from Class TWindow


--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
cResName Resource Name of the Dialog
hResources Handle of the Resource where to find the Dialog
lCentered Logical value if centering the Dialog when painting
lModal Logical value if the Dialog Box is modal

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


lModify Logical value to allow using the Controls -not
implemented-
bStart Action to be performed automatically just once at start

METHODS
--------------------------------------------------------------------------------
New Generic constructor method .
Define Alternative constructor .
Activate Starts interaction with the Dialog Box .
Close() Close dialog box .
Command Handle commands sent to dialog box .
cToChar Translate handle to structure item .
DefControl Connect control to dialog box .
Destroy Destroy dialog box .
Display Dialog box .
End End dialog box .
EraseBkGnd Erase background of dialog box .
FocusNext Give focus to next control in dialog box .
GetItem Get the handle of a certain control .
GotFocus Called when dialog receives focus .
HandleEvent Event handler for dialog boxes .
Init() Handle initialization of dialog box .
LostFocus Handles losing focus by dialog box .
QueryEndSession Check if application can be closed .
VbxFireEvent Handling of VBX events by dialog box .

Class TDict FiveWin DataDictionary


--------------------------------------------------------------------------------

DATAs
--------------------------------------------------------------------------------
aDbfs Array of Dbfs.
aFlds Array of fields.
aIndexes Array of index.
aViews Array of views.
aBrws Array of Browses.
cPath Full path of the data base file.

METHODs
--------------------------------------------------------------------------------
New Constructor from source code
Create Build all dictionary related files
Import Imports files from another data base.
Load Uses a data base file from disk.

Class TField
--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
cName Name of the field.
cType Type of the field.
nLen Length in numeric fields.
nDec Number of decimals in numeric fields.

METHODS
--------------------------------------------------------------------------------
New Constructor from source code.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Class TFile Low level files management as Objects
--------------------------------------------------------------------------------

Class TFile is the base class for binary files manipulation


From this class we inherit all file manager sub classes.

DATA
--------------------------------------------------------------------------------
cName File name.
hFile Handle of the file
nLen Length of the file
nBufferLen Buffer length.
nMode Opening Mode.

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
Create Creates the file.
End Ends control and make it disappear.
AppByte Adds a Byte to the end of the file.
AppStr Adds a String to the end of the file.
AppWord Adds a word to the end of the file.
cGetStr Retrieves a String from the file.
Close Closes the file.
Count Number of times that a string appears in the file. CRLF as
default.
DelBytes Deletes a specified number of bytes from the current position.
GoBottom Go to the bottom of the file.
GoTo Go to a specified file offset.
GoTop Go to the top of the file.
InsBytes Inserts a specified numbers of bytes always from current position.
lBoF True if at the begining of the file.
lEoF True if at the end of the file.
nGetByte Get a byte from the actual file offset.
nGetWord Get a word (two bytes) from the actual file offset.
nRecNo Actual offset position inside the file.
Open Open the file.
PutByte Write a byte at the current file offset.
PutStr Write a String at the current file offset.
PutWord Write a Word (two bytes) at the current file offset.
Seek Search for determinate String. Starts from the current position.
Skip Skips a determinate number of bytes.

Class TFolder FROM TControl


--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
aPrompts Array of Prompts
aDialogs Array of NonModal DialogBox objects
nOption Current selected page
nTabSize Size of the tabs
oFont2 Bold Font type
aEnable Array of enabled pages

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
ReDefine Constructor from Resource

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


AddItem Adds an Item to the Folder.
Default Default control initialization
DelItem Deletes an Item from the Folder.
Destroy Destroy the Folder object.
Display Displays the control. Use :Refresh() to force repaint
GetHotPos Returns the page index of a specified hotkey
GotFocus Event response code when receiving focus
Init Generic Control initialization method
LButtonDown Action to be performed when clicking the mouse
Paint Draws the control. This process occurs internally from Display.
Refresh Repaints the folder on the screen
ReSize Event response code when resizing the folder
SetOption Changes the current active folder page
Update Sends an Update message to all the contained Dialog objects.

Class TFont
--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
cFaceName Typeface name used (i.e.: "Arial" )
hFont The WinApi handle of the font
hFontOld The handle of the font that was selected previously
lBold If it is bold
lItalic If it is italic
lUnderline If it is underline
lStrikeOut If it is strikeout
nHeight The height of the font
nWidth The width of the font
nEscapement The escapement of the font
nOrientation The orientation of the font
nWeight The weight of the font
nCharSet The charset of the font
nOutPrecision The outprecision of the font
nClipPrecision The clipprecision of the font
nQuality The quality of the font
nPitchFamily The pitch family of the font

METHODS
--------------------------------------------------------------------------------
New Constructor method. Builds a new font
Choose Builds a new font interactively
End Finish the use of a font and release it
Activate Set a font as defined for a specific device context
DeActivate Deselects the current font from the device context

Class TGet Inherits from TControl


--------------------------------------------------------------------------------

DATAs
--------------------------------------------------------------------------------
oGet Standard MsDos Get related object to use its buffer contents
nClrFocusText Color for the get text when receiving focus
nClrFocusPane Color for the get back when receiving focus
nPos Position of the cursor (caret)

METHODs
--------------------------------------------------------------------------------
New Constructor from source code
ReDefine Constructor for resources
Assign Assigns the buffer value to the GET related variable

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


cGenPrg Generates the xBase source code of this control
Copy Copy the contents of the buffer in the Clipboard
Create Creates a GET control. Internally used
cText Get/Set the text of the TGet Object.
cToChar Generates a data template to build a Dialog
Cut Cut selected text and copies it at the clipboard.
Default Default control initialization
DispText Displays the buffer contents
EditUpdate Updates the variable and the display
GetDelSel Returns the text selected and deleted
GetSel Retrieves the selected text from the TGet editing buffer.
GetSelPos Returns the selected text positions
GotFocus Action to be performed when receiving the focus
HandleEvent Generic events handler
Init Generic control initialization
KeyChar Action to be performed when pressing a key
KeyDown Action to be performed when pressing a control key.
KeyUp Action to be performed when releasing a keystroke.
LButtonDown Action to be performed when clicking the mouse.
LButtonUp Action to be performed when releasing the mouse
LostFocus Action to be performed when losing the focus
lValid Validates the get
MouseMove Action to be performed when moving the mouse over
Move Action to be performed when moving the mouse over the control
Paste Paste the Clipboard contents into the editing buffer
RButtonDown Action to be performed when clicking the right button of mouse.
Refresh Repaints the control
Save Updates the variable value from the buffer
SelectAll Selects all the text.
SetPos Changes the cursor (caret) position.
SetSel Set a certain text as selected.
UnDo Undoes the last modification.

Class TGroup Inherits from TControl


--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
No data is added.

METHODS
--------------------------------------------------------------------------------
New Constructor from source code.
ReDefine Constructor from resource.
cToChar Control Data to template convertor for creating DialogBoxes.
HandleEvent Generic control Handle Event method.
Init Generic Control initialization method.

Class TIcon Inherits from TControl


--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
cIcoFile *.ICO filename if load it from disk.
cResName Resource name if load it from a resource ( DLL, RES, RC )
hIcon Windows handle of the icon.

METHODS
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


New Constructor from source code.
ReDefine Constructor from resource.
Destroy Destroy the object.
Display Displays the control. Use :Refresh() to force repaint.
End Ends control and make it disappear.
Init Generic Control initialization method.
Paint Draws the control. This process occurs inside Display.
SetFile Name of the icon file.
SetName Set a new name for the icon.

Class TIndex
--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
cDbfName DBF name.
cName Key name.
cTag Tag name.
cExpression Expression to evaluate for Index creation.
lUnique Logical Unique
lDdescending Ascending(default)/Descending
cComments Additional Comments
cType

METHODS
--------------------------------------------------------------------------------
New Constructor from source code.
Create Create a physical index file.

Class TIni INI files management as objects


--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
cIniFile INI physical filename

METHODs
--------------------------------------------------------------------------------
New Constructor from source code
Get Retrieves data from the INI file.
Set Writes data into the INI file.
DelEntry Deletes an INI section entry.
DelSection Deletes an entire INI section.

Class TLex FROM TFile


--------------------------------------------------------------------------------

FiveWin - Lexical analizer


It returns the different tokens found inside a file.

DATA
--------------------------------------------------------------------------------
aTokens Array of string tokens to identify
aIds Array of numeric identifiers for each found token
lSkipBlank To automatic skip spaces
lSkipCRLF To automatic skip carriage-return and line-feed
cToken Last read token string value
cSeparators A string with all separators

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


cText To analyze text from memory
nTxtPos Text index position when using cText
nTokNum Token identifier for numbers

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
lEoF Retrieves the total number of lines.
nGetByte Get a byte from the file.
nGetToken Get a token from the file.
SetText //

Class TLibFile FROM TFile


--------------------------------------------------------------------------------

Class TLibFile inherits from TFile and provides


manipulation for LIB files. See SAMPLES\TestLib.prg and TestLib2.prg

METHODS
--------------------------------------------------------------------------------
nSignature() Signature of a LIB file
nPageSize() Number of pages inside LIB
nDirPages() Number of pages of LIB dir
aModules() Array with all module names

Class TLibFile FROM TFile


--------------------------------------------------------------------------------

Class TLibFile inherits from TFile and provides


manipulation for LIB files. See SAMPLES\TestLib.prg and TestLib2.prg

METHODS
--------------------------------------------------------------------------------
nSignature() Signature of a LIB file
nPageSize() Number of pages inside LIB
nDirPages() Number of pages of LIB dir
aModules() Array with all module names

Class TLinkList Managing Linked-Lists data structures


--------------------------------------------------------------------------------

FiveWin implements a Class TLinkList to manage 'trees'. Trees are a


visual representation of Linked-Lists data structures. Using a TWBrowse
object we can visually represent the Link-List structure as a tree
where each leave is a TTreeItem object.

Windows 95 implements its own 'Tree' control, but thanks to Class TLinkList
and Class TTreeItem (and using a TWBrowse object) we may use trees under
Windows 3.1 and NT 3.51.

See xBase TREE ... ENDTREE explanation to understand how to create a


tree object. Once the tree is created, you may visualize it using the
TWBrowse Method SetTree( oTree ):

<oBrw>:SetTree( <oTree> )

DATAs
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


oFirst First item referenced by the LinkList
oLast Last item referenced by the LinkList

METHODs
--------------------------------------------------------------------------------
Add Adds an item to the LinkList
Draw Recalculates all drawing lines of the entire tree
End Destroyes the LinkList object
GetLast Returns the last item of the LinkList (including subtrees)
nCount Total Number of items
OpenAll Open all subtrees
Eval Evals a codeblock for each TreeItem of the LinkList.

Class TListBox Inherits from TControl


--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
aItems Array of Items of the ListBox
aBitmaps Array of related bitmaps handles for ownerdraw ListBox.
lOwnerDraw If it is a ownerdraw ListBox.
nBmpHeigth Height of bitmaps if ListBox is OwnerDraw
nBmpWidth Width of Bitmaps if Listbox is OwnerDraw
cFileSpec FileSpec to display a fields directory items.
bDrawItem Optional codeblock to select what bitmap to draw on a ownerdraw

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
ReDefine Constructor for resources
Add Add an Item to the list.
aSelections Array with selected items on a MultiSelect ListBox.
cGenPrn Generates the xBase source code of the control
Change Changed event handler.
cToChar Generates a data template to build a DialogBox
Default Default Listbox initialization
Del Deletes an Item.
Destroy Destroys the control. Automatically called.
DrawItem DrawItem event handler.
FillMeasure FillMeasure event handler.
GetItem Retrieves the text of any item.
GetPos Retrieves the index of the currently selected item.
GetSel Index number of the selected item. Zero if no item selected
GetSelCount Retrieves the number of selected items on a multiselect ListBox
GetSelItem Retrieves the current select item as text
GoBottom Go to the last item in the listbox
GoTop Go to the first item in the listbox
Init Generic control initialization
Insert Insert an Item.
IsMultipleSel Check if the ListBox is multiple selection style
Len Retrieves the length of the list.
LostFocus Behavior when losing the focus
Modify Modify the text of an Item.
MouseMove Behavior when moving the mouse over the control
Reset Empties the list.
Select Select an item by its order
Set Select an item by its text
SetBitmaps Sets the ownerdraw related bitmaps
SetItems Changes the items of the listbox
SetSel Selects a different item

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


SetSelItems Select a group of items on a multiselection ListBox
SwapDown Toggles an item with its following one
SwapUp Toggles an item with its preceding one
VScroll Vertical scroll events handler

Class TMail Windows MAPI management as objects


--------------------------------------------------------------------------------

FiveWin - Windows MAIL services Object Oriented implementation

DATAs
--------------------------------------------------------------------------------
cSubject Mail subject description
cNoteText Text of the mail
cMsgType
cConversationID
dDate Date of the mail
cTime Time of the mail
lReceipt Has received the mail
lFromUser Interactively select the mail subject, target, etc
aOrigin An array with all origin senders
aRecipients An array with all recipients receivers
aFiles An array with all related files to send attached

METHODs
--------------------------------------------------------------------------------
New Constructor from source code
Activate Start the mail.
End End the mail.

Class TMci Media Control Interface object oriented management


--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
nError Last MCI error
nId MCI device identifier
cType Type of Device
cFileName Name of the file associated with the MCI
oWnd Reference of the container window of the MCI Object

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
lOpen Opens the Mci file.
Play Start the reproduction of the file.
cGetError Retrieves any errors.
SetWindow Set the windows for the Mci object.
SendStr Send a Mci string command to the Mci object.

Class TMDIChild Inherits from Class TWindow


--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
oWndClient Client TWindow Object of the MDI structure
oControl TControl object that is showed in child window

METHODS
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


New Generic constructor method
Maximize Method to maximize the child window.
Restore Method to restore the child window.
Activate Make this window the active child window.
End Ends the MdiChild and close it if VALID is .t.
GotFocus Behavior when receiving the focus
Next Selects the next MdiChild
Prev Selects the prev MdiChild
ReSize Behavior when resizing the MdiChild
KeyDown Behavior when pressing a key
SetControl Selects which control of the MdiChild has to be resized
automatically

Class TMDIClient Inherits from Class TWindow


--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
aWnd Array of TMDIChild objects

METHODS
--------------------------------------------------------------------------------
New Generic constructor method
Tile Tile Child windows
Cascade Cascade child windows
ArrangeIcons Arrange all minimized document child windows. It does
not affect child windows that are not minimized.
NextWindow Activate the child window immediately behind the
currently active child window and place the currently
active child window behind all other child windows.
GetActive Retrieves the TMDIChild window that is active.
Add Add an TMDIChild object to ::aWnd instance array.
ChildNew Creates an New TMDIChild object an add it to ::aWnd
ChildActivate Activate a different TMDICchild window.
ChildMaximize Maximize a TMDICchild window.
ChildRestore Restore a TMDICchild window.
ChildClose Close a MdiChild window
ChildNext Selects the next MdiChild
Resize Resizes the MdiClient
lCloseAll Closes all the MdiChild Children
IconizeAll Iconizes all the Mdichild windows
KeyDown Behavior when pressing a key
MouseMove Behavior when moving the mouse over

--------------------------------------------------------------------------------
Class TMDIFrame Inherits from Class TWindow
--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
oWndClient The TMDIFrame's client window, an instance of TMDIClient.
oWndActive The TMDIFrame's active MDI child window.

METHODS
--------------------------------------------------------------------------------
New Generic constructor method
Tile Tile Child windows
Cascade Cascade child windows
CloseAll Close all the MdiChild windows
IconizeAll Iconizes all the MdiChild windows
ArrangeIcons Arrange all minimized document child windows. It does
not affect child windows that are not minimized.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


NextWindow Activate the child window immediately behind the
currently active child window and place the currently
active child window behind all other child windows.
Resize Behavior when resizing the MdiFrame
Command Controls the WM_COMMAND messages
End Ends the window execution if VALID is .t.
GotFocus Behavior when getting the focus
Select Select a MdiChild window
ChildNew Creates an New TMDIChild.
Release Destroy a TMDIFrame window and all his child objects

--------------------------------------------------------------------------------
Class TMenu
--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
hMenu The Windows handle of the Menu
aItems An array of MenuItems
oWnd A reference to the container Window of the Menu
lSysMenu If it is a System menu
lPopup If it is a popup menu
nHelpId The help topic identifier of this Menu
cVarName A variable name to identifier this object (visual editor)

METHODS
--------------------------------------------------------------------------------
New Creating a new Menu
Redefine Creates a menu from resource
NewSys Redefining a SysMenu
Activate PopMenu activating method
Add Adding a new menuitem to the Menu
AddEdit Adds standard editing menu options
AddHelp Adds standard help menu options
AddMdi Adds standard MDI menu options
Command Processes the user selection command
DelItems Invoked when destroying the menu. Destroys each menuitem
Destroy Destroys the menu
Disable Disables the entire menu
End Ends the menu
GetMenuItem Retrieves a reference to a MenuItem Object given its Id
GetPopup Retrieves a reference to a contained Popup given its position
HelpTopic Invoked when pressing enter over this menu
Hilite Hilites a specific menuitem
Init Called everytime the menu is going to be shown
Insert Inserts a new menuitem at a specified position
LastItem A reference to last processed MenuItem Object
Load Changes some menu properties based on a binary info
Refresh Repaints the menu
Release Destroy the Menu Object
Reset Reset to the original System Menu of a Window
Save Generates a binary representation of the menu
UnHilite DeHelites a specific menuitem

--------------------------------------------------------------------------------
Class TMenuItem
--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
cPrompt The label of the MenuItem

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


cMsg The text to be shown on the MsgBar of the main Window
nId A numeric identifier for this menuitem
nHelpId A numeric help topic identifier used to select invoked help
bAction The action to be performed when selecting the MenuItem
bWhen A codeblock to be avaluated to enable/disable the menuitem
lChecked Logical value if the menuitem is checked
lActive Logical value if the menuitem is enabled
lHelp If this is a menuitem help type (right placed)
oMenu A reference of its container Menu object
hBitmap A handle to a Bitmap if defined

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
ReDefine Constructor from resource
Destroy Called when the menuitem is destroyed.
Disable Disable the item.
Enable Enable the item.
End Ends control and make it disappear.
EveCount Number of total events for this class (used by the Object
Inspector).
Event Retrieve the event from the event array.
Load Set the properties of the menuitem based on a supplied binary
information.
PropCount Number of total property.
Property Retrieves the property from the property array.
Save Generates a binary representation of this object.
SetCheck Enables / Disables check.
SetPrompt Changes the associated menuitem prompt.
__HelpTopic Method invoked when pressing F1 when this menuitem is selected.

Menus Commands
--------------------------------------------------------------------------------

Creating a pulldown menu MENU [ <oMenu> ] [POPUP]


from source code MENUITEM [ <oMenuItem> PROMPT ] <cPrompt> ;
[ MESSAGE <cMsg> ];
[ CHECK | CHECKED | MARK ] ;
[ ENABLED | DISABLED ] ;
[ FILE | FILENAME | DISK <cBmpFile> ];
[ RESOURCE | RESNAME | NAME <ResName> ];
[ ACTION <uAction> ] ;
[ BLOCK <bAction> ] ;
[ OF | MENU | SYSMENU <oMenu> ];
[ ACCELERATOR <nState>, <nVirtKey> ] ;
[ HELP ] ;
[ HELP ID | HELPID <nHelpId> ] ;
[ WHEN <uWhen> ]

SEPARATOR [<oMenuItem>]

MENUITEM...

MRU <oMru> ;
[ INI | ININAME | FILENAME | NAME | DISK
<cIniFile> ] ;
[ SECTION <cSection> ] ;
[ SIZE | ITEMS <nItems> ] ;
[ MESSAGE <cMsg> ] ;
[ ACTION <uAction> ]

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


ENDMENU

Creating a pulldown menu DEFINE MENU <oMenu> ;


from resources [ RESOURCE | NAME | RESNAME <cResName> ];
[ POPUP ] ;

REDEFINE MENUITEM [ <oMenuItem> ;


PROMPT <cPrompt> ] ;
[ ID <nId> OF | MENU <oMenu> ] ;
[ ACTION <uAction> ] ;
[ BLOCK <bAction> ] ;
[ MESSAGE <cMsg> ] ;
[ CHECK | CHECKED | MARK ] ;
[ ENABLED | DISABLED ] ;
[ FILE | FILENAME | DISK <cBmpFile> ];
[ RESOURCE | RESNAME | NAME <cResName> ] ;
[ ACCELERATOR <nState>, <nVirtKey> ] ;
[ WHEN <uWhen> ]

Activating a Popup Menu ACTIVATE POPUP <oMenu> ;


[ AT <nRow>, <nCol> ] ;
[ OF | WINDOW | DIALOG <oWnd> ]

Redefining the System REDEFINE SYSMENU <oMenu> ;


Menu of a Window [ OF | WINDOW | DIALOG <oWnd> ]

-MenuItems same as above...-

ENDSYSMENU

<oMenu> A reference to the Menu Object.

<oMenuItem> A reference to one of the menuitems of the menu. Each


menuitem of a menu object is also an object. SEPARATOR
clause also may specify an optional menuitem variable to
store its related value.

<cMsg> The associated message of this control.

<cBmpFile> The name of a BMP file to be used as the label for a


menuitem of the menu.

<cResName> The resource name of the menu.

<uAction> The action to be performed for a specific menuitem.

<bAction> The same action as above expressed as a codeblock.

<nRow>, <nCol> The coordinates where to place the Popup Menu.

<oWnd> The container window of the Menu.

<nState> The state of they accelerator key (see VKEY.CH)

<nVirtKey> ASCII value of the accelerator key.

<nHelpId> The help topic identifier of a specific menuitem.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<uWhen> An expression to be bloquified and evaluated to check
if a menuitem should be enabled or disabled.

<nId> The numeric resource identifier of the menuitem.

<cPrompt> The label of the menuitem.

<bAction> The action to be performed when the Button is pressed.

<oMru> A reference to a new MRU object created

<cIniFile> The name of the related INI file to use with a MRU object.

<cSection> The section inside the INI file where to store the MRU items.

<nItems> The number of items to be managed by the MRU object.

<uAction> The action to perform when selecting a MRU item.

CLAUSES

CHECK If the menuitem has to appear initially as checked.


CHECKED
MARK

ENABLED If the menuitem has to appear initially as enabled.


by default it is enabled.

DISABLED If the menuitem has to appear initiall as disabled.

HELP If the menuitem has to appear by the op right of the


pulldown menu.

POPUP To create a popup menu instead of a pulldown menu.

--------------------------------------------------------------------------------
Class TMetaFile FROM TControl Windows WMF files management
--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
hMeta Handle of the MetaFile.
oPen Reference to a pen object.
nWidth Dimensions
nHeight Dimensions
nXorig Origin in X axis.
nYorig Origin in Y axis.
lZoom if Zoom is enabled.
lShadow If Shadow

METHODs
--------------------------------------------------------------------------------
New Constructor from source code
ReDefine Constructor from resource
Display Displays the control. Use :Refresh() to force repaint
End Ends control and make it disappear
Hide Hides the control.
Paint Draws the control. This process occurs inside Display.
SetCoors
SetFile Name of the metafile.
SetOrg Set the X and Y origin.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Shadow Activate / Deactivate Shadows.
ZoomIn Zoom in the image.
ZoomOut Zoom out the image.

--------------------------------------------------------------------------------
Class TMeter Inherits TControl
--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
nTotal Total amount to be represented by the Meter
nClrBar RGB color to use for the filled background of the meter
nClrBText RGB color to use for the filled text of the meter
cText The text to show on the meter
lPercentage If the % sign is to be painted

METHODS
--------------------------------------------------------------------------------
New Constructor from source code.
ReDefine Constructor from resources.
Default Default meter initialization.
HandleEvent Events dispatcher manager.
Init Control initialization.
Paint Paints the Meter.
Set Changes the value represented and
the value of the variable.
SetTotal

Meter Commands
--------------------------------------------------------------------------------

Creating a Meter @ <nRow>, <nCol> METER [ <oMeter> VAR ] <nActual> ;


from source code [ TOTAL <nTotal> ] ;
[ SIZE <nWidth>, <nHeight> ];
[ OF <oWnd> ] ;
[ UPDATE ] ;
[ PIXEL ] ;
[ FONT <oFont> ] ;
[ PROMPT <cPrompt> ] ;
[ NOPERCENTAGE ] ;
[ COLOR | COLORS <nClrPane>, <nClrText> ] ;
[ BARCOLOR <nClrBar>, <nClrBText> ] ;
[ DESIGN ] ;

Creating a Meter REDEFINE METER [ <oMeter> VAR ] <nActual> ;


from resources [ TOTAL <nTotal> ] ;
[ ID <nId> ] ;
[ OF <oWnd> ];
[ UPDATE ] ;
[ FONT <oFont> ] ;
[ PROMPT <cPrompt> ] ;
[ NOPERCENTAGE ] ;
[ COLOR | COLORS <nClrPane>, <nClrText> ] ;
[ BARCOLOR <nClrBar>, <nClrBText> ] ;

<nRow>, <nCol> The coordinates on the screen. We simulate text coordinates.

<oMeter> A reference to the Meter Object.

<nActual> The numerical variable represented by the Meter.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<nTotal> The total amount represented by the Meter.

<nWidth>, The dimensions of the Meter in pixels.


<nHeight>

<oWnd> A reference to the container Window Object of the Meter.

<nId> A numerical value identifying the Meter from resources.

<oFont> The font to use to display the percentadge of the meter.

<cPrompt> To display an optional text inside the meter.

<nClrPane> The colors of the unfilled parts of the meter


<nClrText>
<nClrBar> The colors of the filled parts of the meter.
<nClrBText>

CLAUSES

UPDATE If this control has to be updated everytime its container


is updated <oDlg>:Update().

PIXEL If the coordinates of the meter are pixel based.

NOPERCENTAGE To avoid showing the '%' sign.

DESIGN Allows the user to move and resize with the mouse

--------------------------------------------------------------------------------
Class TMultiGet Inherits from TControl
--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
lReadOny If the text does not allows editing
nPos The cursor position inside the control

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
ReDefine Constructor for resources
AdjClient Adjust its dimensions to its container object
Copy Copy the selected text into the clipboard
Create Specific interface to WinApi CreateWindow
cToChar Generates a data template to build a Dialog
Cut Deletes the selected text and copies it into Clipboard
Default Default object initialization
DelLine Deletes the specified line number. Default current one
Find Standard search text DialogBox
GetLine Retrieves the specified line number. Default current one
GetLineCount Retrieves the number of text lines
GetCol Retrieves the current cursor col
GetRow Retrieves the current cursor row
GotFocus Action to perform when getting the focus
Init Generic initialization
LostFocus Action to perform when losing the focus
MouseMove Action to perform when moving the mouse over it
Refresh Updates the text shown and forces repainting
Save Save the text into the associated variable

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


VScroll Vertical scrollbar events dispatcher
KeyChar Process the keyboard input
SetPos Changes the cursor position
Paint Draws the text
cText Get / Set the text of de TMultiGet Object.
GetSel Retrieves the selection from the TMultiGet editing buffer.

GET Commands
--------------------------------------------------------------------------------
Creating a GET from @ <nRow>, <nCol> GET [ <oGet> VAR ] <uVar> ;
source code [ OF | WINDOW | DIALOG <oWnd> ] ;
[ PICTURE <cPict> ] ;
[ VALID <ValidFunc> ] ;
[ WHEN <WhenFunc> ] ;
[ COLOR | COLORS <nClrFore>;
[,<nClrBack>] ] ;
[ SIZE <nWidth>, <nHeight> ];
[ FONT <oFont> ] ;
[ HSCROLL ] ;
[ CURSOR <oCursor> ] ;
[ PIXEL ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <WhenFunc> ] ;
[ CENTER | CENTERED> ] ;
[ RIGHT ] ;
[ READONLY | NO MODIFY ] ;
[ DESIGN ] ;
[ ON CHANGE <uChange> ] ;
[ PASSWORD ] ;

@ <nRow>, <nCol> GET [ <oGet> VAR <uVar> ] ;


For editing Memos [ OF | WINDOW | DIALOG <oWnd> ] ;
[ MULTILINE | MEMO | TEXT ] ;
[ COLOR | COLORS <nClrFore>;
[,<nClrBack>] ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ FONT <oFont> ] ;
[ DESIGN ] ;
[ CURSOR <oCursor> ] ;
[ PIXEL ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <WhenFunc> ] ;
[ CENTER | CENTERED ] ;
[ RIGHT ] ;
[ ON CHANGE <uChange> ] ;
[ HSCROLL ] ;
[ READONLY | NO MODIFY ] ;
[ VALID <ValidFunc> ] ;

Using a GET from a REDEFINE GET [ <oGet> VAR ] <uVar> ;


resource Dialog Box [ ID <nId> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ HELPID | HELP ID <nHelpId> ] ;
[ VALID <ValidFunc> ] ;
[ PICTURE <cPict> ] ;
[ COLOR | COLORS <nClrFore>;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[,<nClrBack>] ] ;
[ FONT <oFont> ] ;
[ CURSOR <oCursor> ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <WhenFunc> ] ;
[ ON CHANGE <uChange> ] ;
[ READONLY | NO MODIFY ] ;

For editing Memos REDEFINE GET [ <oGet> VAR ] <uVar> ;


[ MULTILINE | MEMO | TEXT ] ;
[ ID <nId> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ HELPID | HELP ID <nHelpId> ] ;
[ COLOR | COLORS <nClrFore> [,<nClrBack>] ] ;
[ FONT <oFont> ] ;
[ CURSOR <oCursor> ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <WhenFunc> ] ;
[ READONLY | NO MODIFY> ] ;
[ VALID <ValidFunc> ] ;
[ ON CHANGE <uChange> ] ;

<nRow>, <nCol> The coordinates of the GET. We simulate Text coordinates.

<oGet> A reference to the GET Object.

<uVar> The variable which the GET Object is manipulating.

<oWnd> The container window of the GET.

<cPict> Typical xBase PICTURE clause.

<ValidFunc> Validating expression or function. The same as in MsDos.

<WhenFunc> When Clause. Not available yet!

<cColor> The color of the GET. Not available yet!

<nWidth>, The dimensions in pixels of the GET.


<nHeight>

<oFont> A reference to the Font Object to be used with the GET.

<oCursor> A reference to the Cursor Object to dispay over this control.

<cMsg> The associated message of this control.

<nId> The numeric resource identifier of the Control.

<nHelpId> Help topic identifier for GETs from resources.

<nClrFore> Foreground color as a RGB number, or as a xBase string


<nClrBack> Background color as a RGB number

<uChange> An action to be performed when the Get changes.

CLAUSES

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


MULTILINE To use a multiple lines GET control to allow memo
MEMO editing.
TEXT

UPDATE This control may be updated from TDialog:Update() METHOD

CENTER If the GET containts has to appear centered

RIGHT If the GET containts has to appear right justified.


Important: In order to right justify a GET from a DialogBox,
it has to be defined at the resource as MultiLine and
right and has to use the default font!

PIXEL To use pixel coordinates instead of Text coordinates.

PASSWORD Enter as Password.

DESIGN Allows the user to move and resize with the mouse

HSCROLL Horizontal Scroll

READ ONLY Disables editing in this control.


NO MODIFY

--------------------------------------------------------------------------------
Class TMru
--------------------------------------------------------------------------------
MRU means: "Most Recent Used" and let you automatically manage
MRU lists on your menus !!! See SAMPLES\TestMru.prg for a test!

DATA
--------------------------------------------------------------------------------
aItems Array of MenuItems
nMaxItems Max Number of Items in the list.
cIniFile Name of the associated ini file.
cSection Section in the ini file
cMsg Message for all MRU MenuItems
oMenu oMenu container of the MRU list
oSeparator A reference of the SEPARATOR menuitem created above the Mru
nMenuPos oMenu container position of the MRU list
bAction Action to perform when selecting any of the MRU MenuItems

METHODS
--------------------------------------------------------------------------------
New Constructor from source code.
Save Add a new element to the MRU list.
Clear Clear all Mru items and also release the INI related section

--------------------------------------------------------------------------------
Class TMsgBar FROM TWindow
--------------------------------------------------------------------------------

DATAs
--------------------------------------------------------------------------------
cMsgDef The default message to show
lCentered If the message should look centered at screen
lInset If the message bar should look inset
lActive Activate the Msgbar
lDate If the message bar should look Date
lClock If the message bar should look Clock
lKbd If the message bar should look Keyboard status

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


oDate Related MsgItem object if DATE clause used
oTime Related MsgItem object if TIME clause used
oKbd Related MsgItem object if KEYBOARD clause used
oFontClock Font object for the Clock MsgItem
oFontDate Font object for the Date MsgItem
oFontKeyb Font object for the Keyboard MsgItem
aItem
nClrFore Foreground color as a RGB number
nClrBack Background color as a Rgb Number
nSizeItem

METHODs
--------------------------------------------------------------------------------
New Constructor from source code
AddItem Adds n Item to the MsgBar.
Adjust Adjust the MsgBar dimensions to its container window
ClockOff Turn off the clock.
ClockOn Turn on the clock.
DateOff Turn off the date.
DateOn Turn on the date.
Default Default initialization
DelItem Deletes an Item from the MsgBar.
Destroy Destroys the MsgBar. Automatically called.
GetItem Retrieves the number of items of the MsgBar.
Height Retrieves the MsgBar Height.
KeybOff Turn the keyboard off.
KeybOn Turn the Keyboard on.
LButtonDown Action to be performed when clicking the mouse
Paint Draws the control. This process occurs inside Display.
Refresh Repaints the control
SetMsg Set the text of the MsgBar
ShowMsgBar

--------------------------------------------------------------------------------
Class TMsgItem TMsgBar items objects
--------------------------------------------------------------------------------

DATAs
--------------------------------------------------------------------------------
oMsgBar Reference to its MsgBar container object.
cMsg shown text.
nSize width of the MsgItem.
nClrFore Foreground color as a RGB number.
nClrBack Background color as a RGB number.
nId Id number for the MsgItem.
bMsg Optional codeblock to evaluate to generate the cMsg text.
bAction Action to be preformed when clicking on it.
oFont Font object used.

METHODs
--------------------------------------------------------------------------------
New Constructor from source code
Click Action to be performed when clicking the mouse.
Refresh Repaints the item
SetFont Set the font for the MsgItem.
SetText Set the message for the MsgItem.
Show Makes the item visible

--------------------------------------------------------------------------------
Class TObjFile FROM TFile
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Class TObjFile inherits from TFile and provides
manipulation for OBJ files. See SAMPLES\TestObj.prg

OBJ files generated by any compiler are a database of variable length


records. TObjFile Class lets you read and write OBJ files, thus
giving you a chance to get a better understanding in compilers development.

DATA
--------------------------------------------------------------------------------
nRecId Record Identifier.
nRecLen Record Length.

METHODS
--------------------------------------------------------------------------------
New Constructor from source code.
Compiler Writes the compiler name into the OBJ
ExtDef Writes a External definition record inside the OBJ
GrpDef Writes a Group definition record inside the OBJ
LeData Writes a Data block record inside the OBJ
LNames Writes the list of the local names of the OBJ
ModEnd Writes the end of file record of the OBJ
PubDef Writes a Public definition record inside the OBJ
SegDef Writes a segment definition record inside the OBJ
SkipRec Go to next record inside the OBJ
THeadr Writes the header record of the OBJ

--------------------------------------------------------------------------------
Class TOdbc ODBC session management
--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
hEnv The handle of the environment used by the ODBC.
hDbc The handle of the DataBase connection used by the ODBC.
cConnect An optional connect string description provided.
cDSN The Data Server Name or the DataBases directory path
cUser An optional user name provided.
cPassword An optional password provided.

METHODs
--------------------------------------------------------------------------------
New Creates a new ODBC object
METHOD New( cDSN, cUser, cPassword, cConnect, lDlg ) CONSTRUCTOR

Execute Executes a SQL statement


METHOD Execute( cCommand )

End Ends using the ODBC object


METHOD End()

LastError Returns the last ODBC error description


METHOD LastError()

--------------------------------------------------------------------------------
Class TPages Multiple DialogBox Pages management
--------------------------------------------------------------------------------

DATAs
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


nOption Current selected page
aDialogs Array of NonModal DialogBox objects

METHODs
--------------------------------------------------------------------------------
New Method Constructor from source code
Redefine Method Constructor from resources
Init Generic control initialization
Default Control default initialization. Called from Init
Destroy Generic destructor method
SetOption Sets a different selected page
GoPrev Selects the previous page to the current one selected
GoNext Selects the next page to the current one selected

--------------------------------------------------------------------------------
Class TPanel FROM TControl
--------------------------------------------------------------------------------

TPanel Class. Mainly used for Automatic Alignment techniques

DATA
--------------------------------------------------------------------------------

METHODs
--------------------------------------------------------------------------------
New Constructor from source code

--------------------------------------------------------------------------------
Class TParser
--------------------------------------------------------------------------------

FiveWin - Parser machine

DATA
--------------------------------------------------------------------------------
aRules Array of Rules.

METHODs
--------------------------------------------------------------------------------
New Constructor from source code.
Add Adds a new rule to the aRules.

--------------------------------------------------------------------------------
CLASS TPen Pen management as objects
--------------------------------------------------------------------------------

DATAs
--------------------------------------------------------------------------------
hPen The handle of the pen
nStyle The Pen style

nStyle The Pen style


--------------------------------------------------------------------------------

It can be one of the following values:

PS_SOLID Creates a solid pen.


PS_DASH Creates a dashed pen. (Valid only when the pen width is 1.)
PS_DOT Creates a dotted pen. (Valid only when the pen width is 1.)
PS_DASHDOT Creates a pen with alternating dashes and dots. (Valid only

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


when the pen width is 1.)
PS_DASHDOTDOT Creates a pen with alternating dashes and double dots.
(Valid only when the pen width is 1.)
PS_NULL Creates a null pen.
PS_INSIDEFRAME Creates a pen that draws a line inside the frame of
closed shapes produced by graphics device interface (GDI)
output functions that specify a bounding rectangle (for
example, the Ellipse, Rectangle, RoundRect, Pie, and Chord
functions). When this style is used with GDI output
functions that do not specify a bounding rectangle (for
example, the LineTo function), the drawing area of the pen
is not limited by a frame.

Values

#define PS_SOLID 0
#define PS_DASH 1
#define PS_DOT 2
#define PS_DASHDOT 3
#define PS_DASHDOTDOT 4
#define PS_NULL 5
#define PS_INSIDEFRAME 6

nWidth Specifies the width, in logical units, of the Pen


nColor Specifies the color of the Pen as an RGB value

METHODs
--------------------------------------------------------------------------------
New Constructor Method
New Constructor Method
--------------------------------------------------------------------------------

Syntax: TPen():New( <nStyle>, <nWidth>, <nColor>, <oDevice> ) -->


<oPen>

Parameters:

<nStyle> The pen style.

It can be one of the following values:

PS_SOLID Creates a solid pen.


PS_DASH Creates a dashed pen. (Valid only when the pen width is 1.)
PS_DOT Creates a dotted pen. (Valid only when the pen width is 1.)
PS_DASHDOT Creates a pen with alternating dashes and dots. (Valid only
when the pen width is 1.)
PS_DASHDOTDOT Creates a pen with alternating dashes and double dots.
(Valid only when the pen width is 1.)
PS_NULL Creates a null pen.
PS_INSIDEFRAME Creates a pen that draws a line inside the frame of
closed shapes produced by graphics device interface (GDI)
output functions that specify a bounding rectangle (for
example, the Ellipse, Rectangle, RoundRect, Pie, and Chord
functions). When this style is used with GDI output
functions that do not specify a bounding rectangle (for
example, the LineTo function), the drawing area of the pen
is not limited by a frame.

Values

#define PS_SOLID 0

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define PS_DASH 1
#define PS_DOT 2
#define PS_DASHDOT 3
#define PS_DASHDOTDOT 4
#define PS_NULL 5
#define PS_INSIDEFRAME 6

<nWidth> The width of the Pen expressed in logical units.

<nColor> An RGB color. By default the device selected color will be


used.

<oDevice> An optional device object to use its width as the width


unit reference.

Release Destroy Method


End Destroy Method. Use this method to destroy a Pen.

--------------------------------------------------------------------------------
Class TPrinter
--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
hDC Handle of the Device Context of the Printer
hDCOut Handle of the current metafile in use if file output specified
aMeta Arrays of metafiles names generated in disk
cDevice The name of the output device
cDocument The name of the spooler document
cDriver The name of the printer driver in use
cModel Alternative printer to use
cPort The name of the port used
cDir The path for the metafiles storage. By default TEMP
nPage The page currently printed
nXOffset Coordinates of the virtual page origin
nYOffset Coordinates of the virtual page origin
lMeta If the output has to go to metafiles in disk
lModified If the printer device handle should be initialized again
lStarted If the printing already started
oFont Default font to use for printing

METHODS
--------------------------------------------------------------------------------
New Constructor from source code .
End Destroys the current printer object .
EndPage Ends the actual printed page. .
FillRect Fills a rectangle with a specified brush object. .
Box Draws a box. .
Cmtr2Pix Converts a centimeters coordinates into pixels coordinates .
DraftMode Select the draft mode for speed up the printing .
GetOrientation Retrieves the printer orientation. .
GetPhySize Retrieves the paper physical dimensions .
GetTextHeight Retrieves text Height for a specific font object .
GetTextWidth Retrieves text Width for a specific font object .
ImportWMF Imports a Windows metafile to be used as template .
Inch2Pix Converts a inches coordinates into pixels coordinates .
Line Draws a line. .
nHorzRes Retrieves the horizontal resolution. .
nHorzSize Retrieves the width of the physical dimensions .
nLogPixelX Retrieves the number of pixels per logical inch .
nLogPixelY Retrieves the number of pixels per logical inch .

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


nVertRes Retrieves the height of the printer page in raster lines .
nVertSize Retrieves the vertical dimensions in millimeters .
Pix2Inch Converts pixels coordinates into inches coordinates .
Pix2Mmtr Change from pixels to millimeters coordinates .
Preview Make a preview of the print work .
Rebuild Rebuilds all the associated handles and files of the printer
ResetDC Updates the associated device handle of the printer object .
Say Prints a text at a certain coordinates. .
SayBitmap Prints a Bitmap. .
SetAnisotropicMode Set the anisotropic mode. .
SetCopies Set the number of copies to print. .
SetHiInchMode Set the high inch mode. .
SetHiMetricMode Set the high metric mode. .
SetIsotropicMode Set the Isotropic mode. .
SetLandscape Set the printer orientation to Landscape .
SetLoInchMode Set the low inch mode. .
SetLoMetricMode Set the low Metric mode. .
SetPage Specifies the size of the paper to print on. .
SetPixelMode Set the Pixel mode. .
SetPortrait Set the printer orientation to Portrait .
SetPos Set a new position on the page for next printing .
SetSize Selects a different page dimensions .
SetTwipsMode Each logical unit is converted to 1/20 of a point .
SetFont Sets and retrieves the default printer font object .
Setup Standard Setup DialogBox for printing .
SetViewPortExt Sets the X and Y dimensions of the viewport .
SetWindowExt Sets the X and Y extents of the printer device .
StartPage Begins a new page .

--------------------------------------------------------------------------------
Class TRadio Inherits from TControl
--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
lChecked If the radio control is currently selected
oRadMenu Its related container TRadMenu Object
nPos Relative position within respect to the other Menu Radios
buttons

METHODS
--------------------------------------------------------------------------------
New Constructor from source code.
ReDefine Constructor from resource.
Click Mouse left button event handler.
cToChar Generates a data template to build a Dialog
Default Default control initialization.
Init Generic control initialization.
KeyDown Action to be performed when pressing a key.
lIsChecked Retrieves its current logical value
MouseMove Behavior when moving the mouse over it.
Refresh Repaints the control
SetCheck Changes its select/deselected state.

--------------------------------------------------------------------------------
Class TRadMenu Manages a group of TRadio controls
--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


aItems An array with all the Radio control items
bSetGet A codeblock to control the related numeric variable
bChange Action to perform when changing the radio selected
cMsg MsgBar text for its container window
lUpdate If the radio menu has to be updated from a TDialog:Update()

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
ReDefine Constructor from resources
nOption SETGET Method which simulates the nOption DATA
Refresh Forces the whole control to be repainted
Set3DLook Activates the 3D look if its container is a window
End End all the radio elements
Disable Disables all the radio elements
Enable Enables all the radio elements
SetOption Changes the current selected radio option
Select Select a different radio element
GoPrev Skips to previous radio element
GoNext Skips to next radio element

--------------------------------------------------------------------------------
Class TRColumn
-------------------------------------------------------------------------------

DATA
oReport Its TReport object container.
aData An array with all data codeblocks.
aTitle An array with all titles codeblocks.
aPicture An array with all pictures.
bDataFont A codeblock that returns the font to use for the data.
bTitleFont A codeblock that returns the font to use for the title.
bTotalFont A codeblock that returns the font to use for the total.
bTotalExpr A codeblock to return when a total must be calculated.
cTotalPict A string holding the PICTURE to use for the data.
nWidth The width of the column in pixels.
nDataHeight The height of the column data.
nTitleHeight The height of the column title.
nTotal The accumulated total already calculated for the column.
nCol The column position if defined.
nSize The width in characters in pixels if defined by the user.
nPad The relative position inside the column: LEFT, CENTER, RIGHT
nPen The Report pen elements to use
lTotal If the column has total
lShadow If the column has to be filled with a shadow background
lGrid If the column has to be bordered with lines
-------------------------------------------------------------------------------

METHODS
New Method constructor: creates a new column.
Stabilize Stabilizes the column. It is called by the report stabilize.
SayTitle Prints its title.
SayData Prints its data.
SayTotal Prints its total.

-------------------------------------------------------------------------------
Class TRect
--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
nTop Coordinates of the rect

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


nLeft "
nBottom "
nRight "

METHODS
--------------------------------------------------------------------------------

New Constructor for the rect


--------------------------------------------------------------------------------
Class TReport
-------------------------------------------------------------------------------

DATAs
-------------------------------------------------------------------------------
oDevice The target device where to print
oTitle A TRLine object which contains the report title
oHeader A TRLine object which contains the report header
oFooter A TRLine object which contains the report footer
oRptWnd The related report window
oBrush An optional brush to use at the report
aGroups An array with all the report TRGroups objects defined
aColumns An array with all the report TRColumns objects defined
aFont An array with all the report TFont objects defined
aCols Internally used while printing. Don't use them!
aText Internally used while printing. Don't use them!
aData Internally used while printing. Don't use them!
aPen An arrays of pens to use with the report
bFor A codeblock which holds the FOR clause. By default: {|| .t. }
bWhile A codeblock which holds the WHILE clause. By default: {|| .not.
EOF() }
bInit A codeblock which holds the ON INIT clause.
bEnd A codeblock which holds the ON END clause.
bStartLine A codeblock which holds the ON NEWLINE clause.
bEndLine A codeblock which holds the ON ENDLINE clause.
bStartPage A codeblock which holds the ON NEWPAGE clause.
bEndPage A codeblock which holds the ON ENDPAGE clause.
bStartGroup A codeblock which holds the ON NEWGROUP clause.
bEndGroup A codeblock which holds the ON ENDGROUP clause.
bSkip A codeblock which holds how to skip to the next report line.
bStdFont A codeblock which returns the default report font order to use.
bPreview An optional codeblock to evaluate on the preview of the report
bChange A codeblock which holds the ON CHANGE clause
cRptFile -not available yet- The Data-driven file which holds the report.
cResName -not available yet- The resource name which holds the report.
cTotalChr The character to use for drawing the report total lines. Default:
"="
cGroupChr The character to use for drawing the report group totals. Default:
"-"
cTitleUpChr The character to use for drawing the report column title up line.
Default: "="
cTitleDnChr The character to use for drawing the report column title down line.
Default: "="
cFile -not available yet- The name of the target file to produce.
cName The name of the document to generate.
cPageTotal
cGrandTotal
nWidth The width of the target device. Pixels per inch.
nHeight The height of the target device. Pixels per inch.
nMargin The report left margin after stabilizing the report.
nRow The current report row being printed.
nPage The current report page being printer.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


nMaxTitle The largest number of title lines used on all column titles.
nMaxData The largest number of data lines used on all columns body.
nSeparator The spaces width between columns.
nLeftMargin The left margin of the page. Default: 0,2 inches.
nRightMargin The right margin of the page. Default: 0,2 inches.
nTopMargin The top margin of the page. Default: 0,2 inches.
nDnMargin The down margin of the page. Default: 0,2 inches.
nTitleRow Row where to start printing the report title.
nBottomRow Last row available to the report body. (without the footer).
nStdLineHeight The default report line height.
nRptWidth The width of the report. Automatic updated when Stabilizing.
nLogPixX
nLogPixY
nFirstdrow
nLastdrow
nTitleHeight
nCounter
lSummary Not detailed report body information, only report groups.
lTotal If there is any column with total to be calculated.
lFinish .t. when the report is finishing. Internally used.
lStable .t. after the report has been stabilized.
lGroup If there is any report group defined.
lPrinter If the target device is the printer.
lScreen -Not available yet- If the target device is the screen.
lFirstRow .t. only when processing the first body line in each page.
Internally used.
lCreated If the report has been completely created
lPreview If a report preview is required
lBreak
lSpanish If Spanish language is used
lShadow If a shadow is going to be displayed
lGrid If a Grid is going to be displayed
Cargo Generic cargo slot

METHODs
-------------------------------------------------------------------------------
New Method constructor: creates a new report. .

New Method constructor: creates a new report.


-------------------------------------------------------------------------------

TReport::New( aTitle, aHead, aFoot, aFont, lSummary, cRptFile,;


cResName, lPrinter, lScreen, cFile, oDevice,;
cName, cTFmt, cHFmt, cFFmt ) --> Self

Method constructor: Creates a new report.

aTitle An array of codeblocks with all lines of the report title.


aHead An array of codeblocks with all lines of the report header.
aFoot An array of codeblocks with all lines of the report footer.
aFont An array of TFonts objects to be used in all the report.
lSummary If the report body should be printed or not. This is only
meaningful if some report have been defined.
cRptFile -not available yet- Report data-driven file name.
cResName -not available yet- Report resource definition.
lPrinter If printer is the target device.
lScreen If the screen is the target device.
cFile -not available yet- the name of the target output file.
oDevice The optional target device. By default: the printer.
cName The name of the document.
cTFmt The pad style for the title: "LEFT", "CENTER-ED", "RIGHT"

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


By default: "CENTERED".
cHFmt The pad style for the header: "LEFT", "CENTER-ED", "RIGHT"
By default: "LEFT".
cFFmt The pad style for the footer: "LEFT", "CENTER-ED", "RIGHT"
By default: "LEFT".

AddColumn Add a TRColumn object to the report. .


AddColumn Add a TRColumn object to the report.
-------------------------------------------------------------------------------

TReport::AddColumn( oColumn ) --> nil

Add a TRColumn object to the report. Automatically used by the xBase


commands.

DelColumn Del a TRColumn object from the report. .


DelColumn Del a TRColumn object from the report.
-------------------------------------------------------------------------------

TReport::DelColumn( nColumn ) --> nil

Del a TRColumn object from the report.

InsColumn Insert a TRColumn object to the report. .


InsColumn Insert a TRColumn object to the report.
-------------------------------------------------------------------------------

TReport::InsColumn( oColumn, nColPos ) --> nil

Insert a TRColumn object to the report, at the specified column


position.

AddGroup Add a new TRGroup object to the report. .


AddGroup Add a new TRGroup object to the report.
-------------------------------------------------------------------------------

TReport::AddGroup( oGroup ) --> nil

Add a new TRGroup object to the report.

DelGroup Del a TRGroup from the report. .


DelGroup Del a TRGroup from the report.
-------------------------------------------------------------------------------

TReport::DelGroup() --> nil

Del a TRGroup from the report.

Stabilize Stabilizes the report before starting printing (activate). .


Stabilize Stabilizes the report before starting printing (activate).
-------------------------------------------------------------------------------

TReport::Stabilize() --> nil

Stabilizes the report before starting printing. It is automatically called


when activating ( TReport::Activate() ) the report.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Skip Skip to next record on the current workarea -or equivalent-. .
Skip Skip to next record on the current workarea -or equivalent-.
-------------------------------------------------------------------------------

TReport::Skip() --> nSkipped

Skip to next record on the current workarea -or equivalent-.

By default returns 1 (one record).

Init Evaluate the ::bInit codeblock if defined. .


Init Evaluate the ::bInit codeblock if defined.
-------------------------------------------------------------------------------

TReport::Init() --> nil

End Forces the termination of the report. .


End Forces the termination of the report.
-------------------------------------------------------------------------------

TReport::End() --> nil

Forces the termination of the report.

According to FiveWin programming style, all objects activation state


must be finish using ::End(). A report object will finish when
receiving this message.

StartLine Executes the codeblock defined on the start of a line. .


StartLine Executes the codeblock defined on the start of a line.
-------------------------------------------------------------------------------

TReport::StartLine( nHeight ) --> nil

Executes the codeblock defined on the start of a line.

EndLine Ends printing the current line. .


EndLine Ends printing the current line.
-------------------------------------------------------------------------------

TReport::EndLine( nHeight ) --> nil

Ends printing the current line.

StartGroup Executes the codeblock defined on the start of a group. .


StartGroup Executes the codeblock defined on the start of a group.
-------------------------------------------------------------------------------

TReport::StartGroup( nGroup ) --> nil

Executes the codeblock defined on the start of a group. Automatically


called by the TReport::Activate() method.

EndGroup Executes the codeblock defined on the end of a group. .


EndGroup Executes the codeblock defined on the end of a group.
-------------------------------------------------------------------------------

TReport::EndGroup( nGroup ) --> nil

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Executes the codeblock defined on the end of a group. Automatically
called by the TReport::Activate() method.

StartPage Executes the codeblock defined on the start of a page. .


StartPage Executes the codeblock defined on the start of a page.
-------------------------------------------------------------------------------

TReport::StartPage() --> nil

Executes the codeblock defined on the start of a page. Automatically


called by the TReport::Activate method.

EndPage Executes the codeblock defined on the end of a page. .


EndPage Executes the codeblock defined on the end of a page.
-------------------------------------------------------------------------------

TReport::EndPage() --> nil

Executes the codeblock defined on the end of a page. Automatically


called by the TReport::Activate method.

NeedNewPage Returns .t. if a new page is needed. -internal used- .


NeedNewPage Returns .t. if a new page is needed. -internal used-
-------------------------------------------------------------------------------

TReport::NeedNewPage() --> lYesNo

Returns .t. if a new page is needed. -internal used-

NewLine Start a new line, and executes the startline codeblock. .


NewLine Start a new line, and executes the startline codeblock.
-------------------------------------------------------------------------------

TReport::NewLine() --> nil

Start a new line, and executes the startline codeblock.

BackLine .
BackLine
-------------------------------------------------------------------------------

TReport::BackLine() --> nil

ColTitle Prints all report columns titles. .


ColTitle Prints all report columns titles.
-------------------------------------------------------------------------------

TReport::ColTitle() --> nil

Prints all report columns titles.

TotalLine Prints every report columns Separator lines. .


TotalLine Prints every report columns Separator lines.
-------------------------------------------------------------------------------

TReport::TotalLine( cChar ) --> nil

Prints every report columns separator lines.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


cChar is the character to use for printing those lines.

PageTotal Prints all report column page & grand totals. .


PageTotal Prints all report column page & grand totals.
-------------------------------------------------------------------------------

TReport::PageTotal() --> nil

Prints all report column page & grand totals.

Activate Starts executing the report. .


Activate Starts executing the report.
-------------------------------------------------------------------------------

TReport::Activate( For, bWhile, bInit, bEnd, bStartPage,;


bEndPage, bStartGroup, bEndGroup, ;
bStartLine, bEndLine ) --> nil

Starts executing the report.

Parameters: All the codeblocks involved in the activation and execution


process.

Play .
Play
-------------------------------------------------------------------------------

TReport:Play() --> nil

Margin Modify any of the top, left, bottom & right report margins. .
Margin Modify any of the top, left, bottom & right report margins.
-------------------------------------------------------------------------------

TReport::Margin( nValue, nType, nScale ) --> nil

Modify any of the top, left, bottom & right report margins.

nValue The value of the new margin to be used.

nType The type of margin to be changed:

LEFT 1
TOP 4
RIGHT 2
BOTTOM 5

nScale Inches or centimeters to be used:

INCHES 1
CENTIMETERS 2

Say Draws a text .


Say Draws a text
-------------------------------------------------------------------------------

TReport::Say( nCol, xText, nFont, nPad, nRow )

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


nCol

xText

nFont

nPad

nRow

SayBitmap Draws a bitmap .


SayBitmap Draws a bitmap
-------------------------------------------------------------------------------

TReport::SayBitmap( nRow, nCol, cBitmap, nWidth, nHeight, nScale )

nRow

nCol

cBitmap

nWidth

nHeight

nScale

Box Draws a box .


Box Draws a box
-------------------------------------------------------------------------------

TReport::Box( nRow, nCol, nBottom, nRight, nPen, nScale )

nRow

nCol

nBottom

nRight

nPen

nScale

Line Draws a line .


Line Draws a line
-------------------------------------------------------------------------------

TReport::Line( nTop, nLeft, nBottom, nRight, nPen, nScale )

nTop

nLeft

nBottom

nRight

nPen

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


nScale

Shadow Shadows an area .


Shadow Shadows an area
-------------------------------------------------------------------------------

TReport::Shadow() --> nil

KillShadow .
KillShadow
-------------------------------------------------------------------------------

TReport::KillShadow() --> nil

Grid Places a grid on the report .


Grid Places a grid on the report
-------------------------------------------------------------------------------

TReport::Grid() --> nil

Inc2Pix Turns inches into pixels .


Inc2Pix Turns inches into pixels
-------------------------------------------------------------------------------

TReport::Inc2Pix( nValue ) --> nil

-------------------------------------------------------------------------------
Class TRColumn
-------------------------------------------------------------------------------

DATA
oReport Its TReport object container.
aData An array with all data codeblocks.
aTitle An array with all titles codeblocks.
aPicture An array with all pictures.
bDataFont A codeblock that returns the font to use for the data.
bTitleFont A codeblock that returns the font to use for the title.
bTotalFont A codeblock that returns the font to use for the total.
bTotalExpr A codeblock to return when a total must be calculated.
cTotalPict A string holding the PICTURE to use for the data.
nWidth The width of the column in pixels.
nDataHeight The height of the column data.
nTitleHeight The height of the column title.
nTotal The accumulated total already calculated for the column.
nCol The column position if defined.
nSize The width in characters in pixels if defined by the user.
nPad The relative position inside the column: LEFT, CENTER, RIGHT
nPen The Report pen elements to use
lTotal If the column has total
lShadow If the column has to be filled with a shadow background
lGrid If the column has to be bordered with lines
-------------------------------------------------------------------------------

METHODS
New Method constructor: creates a new column.
Stabilize Stabilizes the column. It is called by the report stabilize.
SayTitle Prints its title.
SayData Prints its data.
SayTotal Prints its total.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


-------------------------------------------------------------------------------
Class TTreeItem Trees TreeItems in FiveWin.
--------------------------------------------------------------------------------

See Class TLinkList and xBase TREE ... ENDTREE command


for an explanation of Trees under FiveWin.

DATAs
--------------------------------------------------------------------------------
cDraw Contains the draw characters for this item.
cPrompt Contains the associated text label of the item.
oPrev Reference to previous TreeItem object.
oNext Reference to next TreeItem object.
oTree Reference to a contained tree object.
lOpened If the contained tree object is opened or not.
nLevel Ident level of the item.
hBmpOpen Handle of the bitmap for opened state.
hBmpClose Handle of the bitmap for closed state.

METHODs
--------------------------------------------------------------------------------
New Constructor from source code
End Ends control and make it disappear
Add Adds a new following item.
Close Closes the the treeitem.
ColSizes Returns an array with colsizes to use for painting the browse
row.
Delete Deletes treeitem.
Draw Draws the item.
GetLabel Retrieves the treeitem label.
GetNext Retrieves the next treeitem.
GetPrev Retrieves the previus treeitem.
GetText Retrieves the treeitem prompt.
Open Opens the optional tree contained by the TreeItem.
SetNext Set a new value for the next treeitem.
SetText Set a new prompt for the current treeitem.
Skip Goes to the next treeitem.
Toggle Change the treeitem status if it's open closes it, else opens
it.

-------------------------------------------------------------------------------
Class TRGroup FiveWin Report Engine Group objects
-------------------------------------------------------------------------------

DATAs
-------------------------------------------------------------------------------
oReport Its TReport object container.
aTotal An array of numeric totals, one for each report column.
bGroup A codeblock which holds the group expression.
bHeader A codeblock that returns the header of the group.
bFooter A codeblock that returns the footer of the group.
bHeadFont A TFont object to use to print the group header.
bFootFont A TFont object to use to print the group footer.
cValue It keeps the latest group evaluated expression.
nCounter
lEject If eject is to be performed on each group change.

METHODs
-------------------------------------------------------------------------------
New Method constructor: creates a new TRGroup object. .

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Reset Resets the accumulated total value of all aTotal to 0. .
Header Prints the header of the group. .
Footer Prints the footer of the group. .
Total Prints the totals of the group. .
HeaderHeight Returns the height of the group header. .
FooterHeight Returns the height of the group footer. .
Evaluate Calculates the group expression .
Check Checks if the group condition has changed .
-------------------------------------------------------------------------------
Class TRLine FiveWin Report Engine Line objects .
-------------------------------------------------------------------------------

DATAs
-------------------------------------------------------------------------------
oReport Its TReport object container.
aLine An array of codeblocks with all the line data elements.
aFont An array of codeblocks with all the fonts to be used. .
aRow Internally used during printing.
aWidth An array with each line element width.
aPad An array with each line element pad type: LEFT, CENTER, RIGHT
nCol Internally used to print the line.
nHeight The height of the line.
nWidth The largest width defined of its elements.

METHODs
-------------------------------------------------------------------------------
New Method constructor: creates a new TRLine object. .
Stabilize Stabilizes the line. Called by the report stabilize method. .
Say Prints the line. .

-------------------------------------------------------------------------------
Class TSay Inherits from TControl
--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
l3D If the say has to be painted with 3D effects
cPicture The PICTURE to use when showing the SAY
bGet A codeblock which returns the text to draw

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
ReDefine Constructor for resources
Default Default initialization process
cGenPrg Generates a string with the source code of the SAY
HandleEvent Specific SAY HandleEvent method
cToChar Generates a data template to build a Dialog
Init Generic initialization
Refresh Forces the SAY to be repainted
SetText Changes the text of the SAY

-------------------------------------------------------------------------------

Class TScrollBar Inherits from TControl


--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
lVertical If it is a vertical ScrollBar.
lReDraw If the scrollbar must update automatically its position
lIsChild If belongs to a Window with ScrollBars style
nMin, nMax The numeric range to be represented by the Scrollbar

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


nPgStep The increment of value when PgUp or PgDn on the ScrollBar
bGoUp A codeblock to eval when going up
bGoDown A codeblock to eval when going down
bGoTop A codeblock to eval when top is selected
bGoBottom A codeblock to eval when bottom is selected
bPageUp A codeblock to eval when PageUp is selected
bPageDown A codeblock to eval when PageDown is selected
bPos A codeblock to eval when the Thumb is moved to a new position
bTrack

METHODS
--------------------------------------------------------------------------------

New Constructor from source code.


ReDefine Constructor from resource.
WinNew Constructor for non-true scrollbar.
cToChar Generates a data template to build a Dialog.
GetPos Retrieves the current value represented by the Scrollbar.
GetRange Returns an array of two elements with the Min and the Max
values
GoBottom Evaluates the bGoBottom block and updates thumb position
GoDown Evaluates the bGoDown block and updates thumb position
GoTop Evaluates the bGoTop block and updates thumb position
GoUp Evaluates the bGoUp block and updates thumb position
HandleEvent Redefined events manager
Init Generic initialization
MouseMove Specific MouseMove behavior
PageDown Evaluates the bPageDown block and updates thumb posit
PageUp Evaluates the bPageUp block and updates thumb posit
SetPos Changes the position of the thumb
SetRange Changes the represented range of the ScrollBar
ThumbPos Changes the position of the Thumb
ThumbTrack

--------------------------------------------------------------------------------

Class TSocket InterNet TCP/IP sockets support


--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
nPort socket port number
cIPAddr socket IP address
nTimeOut connection timeout value
nBackLog listen backlog value
nSocket socket handle
hFile handle of a file transmited in chunks
bAccept codeblock to evaluate on accept event.
bRead codeblock to evaluate on read event.
bWrite codeblock to evaluate on write event.
bClose codeblock to evaluate on close event.
bConnect codeblock to evaluate on connect event.

METHODS
--------------------------------------------------------------------------------
New( nPort ) Constructor. nPort = port to use for the socket.
Accept( nSocket ) Constructor. Builds a new socket to accept a incomming
connection
End() Generic destructor.
HandleEvent() manages asyncronous connections events.
GetData() Retrieves incomming data.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


SendBin() sends binary data.
SendChunk() sends chunks of a file (::hFile ).
SendData() sends data.
Listen() Sets the socket in listening state.
Close() Closes the socket.
Connect( cIPAddr ) Connects to a specified IP address.
Refresh() Determines the status of the socket.
OnAccept() Accept incomming event method.
OnRead() Read incomming event method.
OnWrite() Write incomming event method.
OnClose() Close event action.
OnConnect() On connect event method.

--------------------------------------------------------------------------------

Class TStruct C language low level structs object oriented management


--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
cBuffer buffer to hold the struct containts
aMembers array with struct members description

METHODs
--------------------------------------------------------------------------------
New() CONSTRUCTOR
AddMember( cName, nType, nLen ) Adds a new struct member
SetMember( nMember, uData ) Changes a struct member value
GetMember( nMember ) Retrieves a struct member value
SizeOf() INLINE Len( ::cBuffer ) Retrieves the struct total length
OnError( cMsg, nError ) ERROR HANDLER

--------------------------------------------------------------------------------
Class TTabs FROM TControl
--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
aPrompts Label of tab.
aSizes Size of tab.
nOption Number of tab.
bAction CodeBlock.

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
ReDefine Constructor from resources
AddItem Add an item to the folder.
Default Default initialization
DelItem Delete an item from the folder.
Display Displays the control. Use :Refresh() to force repaint
GetHotPos Returns the tabs option that matches a specified HotKey char
Init Generic Control initialization method
LButtonDown Action to be performed when clicking the mouse
Paint Draws the control. Internally used by Display method
SetOption Select the active tab option.
SetTabs Set the array of tabs and option. Default "One", "Two" and
"Three".
SysCommand Behavior when pressing Alt+... combinations

--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Class TTime Time objects management
--------------------------------------------------------------------------------

DATAs
--------------------------------------------------------------------------------
nTime time value as a numeric long

METHODs
--------------------------------------------------------------------------------
New Constructor from source code
System Constructor from computer system time
AddHours Adds a specified number of hours.
AddMinutes Adds a specified number of Minutes.
AddSeconds Adds a specified number of Seconds.
cAdd Adds another time and returns the result as a string
cGetTime Retrieves current time as a string.
cSub Returns the difference, as a string, from another time
SysChange Change system time.

--------------------------------------------------------------------------------
Class TTimer
--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
bAction The action to be performed on each interval
lActive If the timer is currently active
nId The API identifier of the timer
nInterval The interval of each action in 1/1000 secs
hWndOwner The handle of the window container of the timer

METHODs
--------------------------------------------------------------------------------
New Constructor method
TTimer:New( nInterval, bAction, oWnd )

Activate Activates the timer


TTimer:Activate() --> nil

DeActivate Deactivates the timer


TTimer:DeActivate() --> nil

Release Destroys the timer


TTimer:Release() --> nil

--------------------------------------------------------------------------------
Class TTxtEdit Ascii files visual editing. Inherits from TControl
--------------------------------------------------------------------------------

DATAs
--------------------------------------------------------------------------------
aLines An array holding all the text lines
aDelLines An array to store the deleted lines
aRDelLines An array where to store the undo actions
nDelLines Max. number of deleted lines to store
nVisLines Number of lines that fit in screen
nLineTop First line visible on screen
lInsert Logical cursor insert mode
lChanged Text has changed
cFileName Name of the related physical filename
cOperators A string with all the operators (i.e.: "+-*/:.,;" )
cSeparators A string with all the separators (i.e.: " " + Chr( 9 ) )

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


nRow Caret physical pixel row position inside the control surface
nCol Caret physical pixel col position inside the control surface
nLineRow Caret logical row position inside the control surface
nLineCol Caret logical col position inside the control surface
cTokens1 A string with the first group of tokens delimited with spaces
cTokens2 A string with the second group of tokens delimited with spaces
cTokens3 A string with the third group of tokens delimited with spaces
cBegWith A string with the group of begin-with tokens delimited with
spaces
nClrTok1 The first group of tokens color
nClrTok2 The second group of tokens color
nClrTok3 The third group of tokens color
nClrBegin The begin-with group of tokens color
nClrNumber The numbers tokens color
nClrString The strings tokens color
nClrOperator The operators tokens color
nClrBBlock BackColor of a marked block
nClrFBlock ForeColor of a marked block
nBlkStay
nBlkPos
nBlkStart First logical line of the marked block
nBlkEnd Last logical line of the marked block
nTabLen Number of spaces to display for a TAB character
nLeftMargin Left margin
lVScroll Shows the vertical scrollbar
lBackUp Makes a backup BAK file when start saving the file to disk
lUndo Allows undo operations
nOldLine Last selected text line
lRegistered ClassData to store the WinApi registered state of the Class

METHODS
--------------------------------------------------------------------------------
New Constructor method
Change Always executed when there is a change in the text
DelBlock Deletes the current marked block
DelCurLine Deletes the current selected line
Delete Response to Del Key
DelLine Deletes any line
DrawLine Draws any line
DrawCurLine Draws the current selected line
Display Shows all the text lines
GoUp Try to go to the previous text line
GoDown Try to go to the next text line
InsLine Insert a text line
Load Loads the text file from disk
nGetTokenColor Retrieves the defined color for a specified token
nLine Index line inside aLines array
Paint Automatically called from inside Display method
SelFile Interactively select a new file to edit
GotFocus Action performed when getting the focus
LostFocus Action performed when losing the focus
KeyChar Action performed when generating a keystroke
KeyDown Action performed when pressing a key
LButtonDown Action performed when left clicking the mouse
GoPrevLine Go to the previous text line
GoNextLine Go to the next text line
GoPrevChar Go to the previous character
GoNextChar Go to the next character
GoBeginLine Go to the beginning of the text line
GoEndLine Go to the end of the text line
GoPrevWord Go to the previous word

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


GoNextWord Go to the next word
ToggleInsert Toggles the current insert mode
ReSize Action performed when resizing the control
SetFont Sets the font to use for displaying the text lines
SetText Sets the text to edit from a string
VScrAdjust Vertical ScrollBar Range Adjust
GoBottom Go to the last text line
GoTop Go to the first text line
GotoLine Interactively request the line to go to
GoLine Go to a certain text line
PageUp Go to the previous page of text lines
PageDown Go to the next page of text lines
DupLine Duplicates the current selected line
Copy Copies the current marked block into the Clipboard
Paste Copies the clipboard contents into the current caret position
Cut Deletes the current marked block and copies into the Clipboard
JoinLine Joins the current line with the next text line
SplitLine Breaks the current line into two from the current caret
position
Save Save the text to a disk file
AddUndo Adds a new action to the array of 'UnDoable' actions
Undo Undoes the last performed operation
Redo Redoes the last performed operation
MouseMove Action to perform when moving the mouse over the control
PaintBlkDown Extends downwards the marked block and paints it
PaintBlkUp Extends upwards the marked block and paints it

--------------------------------------------------------------------------------
Class TTxtFile Ascii files management as objects
--------------------------------------------------------------------------------

See Also Class TTxtEdit for editing text files.

DATAs
--------------------------------------------------------------------------------
cLine The latest ascii line read from the file
nTLines The number of lines contained inside the ascii file
nLine Current ascii line number
nMaxLineLength The maximum ascii line size permitted to be read. Default 1024
nOffset The binary position inside the ascii file

METHODs
--------------------------------------------------------------------------------
New Constructor method
Add Adds a new line to the ascii file
AppendLn Adds a new line to the ascii file
Advance Skips to the next ascii line
DelLine Deletes an ascii line
GetValue Retrieves an ascii INI file section and key value
GoTo Jumps to a specific ascii line number
GoTop Jumps to the beginning of the ascii file
GoBottom Jumps to the end of the ascii file
InsLine Insert an ascii line in the current line position
LastRec Returns number of ascii text lines
nRecno Returns the current ascii line number
ReadLine Returns the current ascii line text
ReadLn Returns the current ascii line text
RecCount Returns the number of ascii text lines
RecNo Returns the current ascii line number
RepLine Duplicates the current ascii text line
Rewind Skips to a previous line position

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


SetValue Changes an ascii INI file section and key value
Skip Skips a certain number of ascii text lines

--------------------------------------------------------------------------------

CLASS TVbControl FROM TControl


--------------------------------------------------------------------------------
CLASSDATA aEventNames // Just one array to all object instances
--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
hCtl The handle of the VBX control (internal API value)
aEvents An array with all the defined events and its
related actions.
METHODS
--------------------------------------------------------------------------------
New Creates a new VBX control from source code
ReDefine Redefine a VBX to be used from resources
Init Generic initialization of a VBX
GetPropName Retrieves the name of a VBX property by its order
aGetProps Returns an array with all the properties names
Default Default values for the initialization of the VBX
SetProp Changes a VBX property by its order
GetName Retrieves the class name of the VBX control (API value)
nGetProps Retrieves the number of properties of the VBX
nGetEvents Retrieves the number of events of the VBX
GetEvent Retrieves the name of a VBX event by its name
GetEnums Retrieves an array with a VBX enum all possible values
Get Retrieves the value of a property by its name
Set Changes a VBX property the value of a property by its name
GetProp Retrieves the value of a property by its order
GetPropType Retrieves the type of a VBX property
HandleEvent VBX specifically HandleEvent (inherits from TControl)
VbxEvent Internal VBX events management function support
MouseMove Virtual MouseMove method (to request default behavior)
VbxInherit Internal automatic inherit process for 5W VBX system

--------------------------------------------------------------------------------

Class TVideo Inherits from TMCI


--------------------------------------------------------------------------------

DATAs
--------------------------------------------------------------------------------
oMci A reference to a contained MCI Object
cAviFile The name of the associated AVI file.

METHODs
--------------------------------------------------------------------------------
New Constructor from source code
ReDefine Constructor from resources
Init Generic Control initialization method
Play Start playing the AVI file.

--------------------------------------------------------------------------------
Class TWBrowse Inherits from TControl
--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
aActions An array of codeblocks actions for clicking header .
lRegistered A CLASSDATA value. See TWindow:lRegistered.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


cAlias The workarea alias where the browse was created .
cField SELECT clause expression in SELECT ... FOR ... TO ... .
uValue1 FOR clause expression in SELECT ... FOR ... TO ... .
uValue2 TO clause expression in SELECT ... FOR ... TO ... .
bLine Retrieves an array of expressions for each column. .
bSkip Like Clipper TBrowse:skipBlock. We provide a default one .
bGoTop Like Clipper TBrowse:goTopBlock. We provide a default one .
bGoBottom Like Clipper TBrowse:goBottomBlock. We provide a default one.
bLogicLen CodeBlock that retrieves de length of the Data. We supply one
bChange CodeBlock to perform when moving from row to row .
bAdd The codeblock to execute for adding a new record .
nRowPos The row which has the focus. .
nColPos The left column visible on screen. .
nLen The number of elements. By default is Eval( ::bLogicLen ) .
nAt The array element currently selected when browsing arrays .
lHitTop Like Clipper TBrowse:hitTop. .
lHitBottom Like Clipper TBrowse:hitBottom. .
lCaptured If the mouse is being captured (resizing columns) .
lMChange If it is allowed to resize columns .
aHeaders Array of cText for the Header of each column. .
aColSizes Array of nSize for each column. .
nClrBackHead Header background color .
nClrForeHead Header foreground color .
nClrBackFocus Focused line background color .
nClrForeFocus Focused line foreground color .
aJustify An array of logical elements, one per column, for right justify

METHODS
--------------------------------------------------------------------------------
New Constructor from source code .
ReDefine Constructor from resources .
SetArray Automatically sets an array to be browsed .
SetTree Automatically sets a tree to be browsed .
lCloseArea Closes the associated area of the browse .
LDblClick Left double click events management .
Default Default initialization .
VertLine Vertical resizing of the columns .
BugUp Corrects the painting when very few records are browsed .
lEditCol Edits a cell of the browse .
GetDlgCode Returns the GetDlgCode associated .
GoUp Goes up one line .
GoDown Goes down one line .
GoLeft Goes left one column .
GoRight Goes right one column .
GoTop Goes to the first element browsed .
GoBottom Goes to the last element browsed .
HandleEvent Specific browses HandleEvent METHOD .
HScroll Horizontal scrollbars events manager .
Init Initialization process .
PageUp Goes up one page .
PageDown Goes down one page .
KeyDown Method to handle WM_KEYDOWN events. .
KeyChar Method to handle WM_CHAR events. .
LButtonDown Left mouse click events manager .
LButtonUp Left mouse releasing events manager .
MouseMove Mouse Movements events manager .
Paint Painting method .
VScroll Vertical scrollbar events manager .
Skip Moves the cursor up or down. .
DrawLine Redraws a specific row without input focus look .
DrawSelect Redraws cursor row with input focus look .

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


RecAdd Adds a new record evaluating the bRecAdd codeblock .
SetFilter Changes the currently values assigned for indexed filters .
GotFocus Got focus processes .
UpStable Forces to stabilize properly when a very records are browsed.
nRowCount Returns the number of visible rows on the browse .
GetColSizes Returns an array with all the sizes of the columns .
LostFocus Losing focus processes .
nAtCol Returns the column placed at a specific pixel position .
Report Automatically generates a Report from the browse .

--------------------------------------------------------------------------------
Class TWebServer InterNet WEB pages and Proxy server
--------------------------------------------------------------------------------

DATA
--------------------------------------------------------------------------------
nPort socket port number
cIPAddress socket IP address
nTimeOut connection timeout value
nBackLog listen backlog value
nSocket socket handle

METHODS
--------------------------------------------------------------------------------
New Constructor from source code.
ReDefine Constructor for resources.
cGetPRG Generates the source code of the button.
New( nPort ) Constructor. nPort specifies the port to use
Accept Constructor. Creates a clone from the listening host socket
End Closes the connection
GetText Retrives the data that arrives to the socket
SenData Sends data throught the socket
Listen Turns the socket into a listening host socket
--------------------------------------------------------------------------------
Class TWindow Main base Class
--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
hWnd window handle hWnd
nOldProc Old window procedure when SubClassing
bInit Code Block to execute on initialization
bMoved Code Block to execute after moving the window
bLClicked Code Block to execute when left clicking with the mouse
bKeyDown Code Block to execute when pressing a key
bPainted Code Block to execute when painting the Window
bRClicked Code Block to execute when right clicking with the mouse
bResized Code Block to execute after resizing a Window
bLDblClick Code Block to execute when left double clicking the mouse
bWhen Code Block for WHEN clause
bValid Code Block for VALID clause
bKeyChar Code Block to execute when pressing a no-control key
bMMoved Code Block to execute when moving the mouse
bGotFocus Code Block to execute when receiving the focus
bLostFocus Code Block to execute when losing the focus
cCaption The caption of the Window
cPS Paint structure meanwhile painting
nPaintCount N. of times painting procedure has been invoked
cMsg The text for the default message on the MsgBar
Cargo Standard Clipper general purpose user defined DATA
hDC window Device Context handle while painting
nId Numeric identifier of the Window

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


lActive If the window is active
lVisible If the window is visible
lFocused If the window has the focus
nStyle Numeric windows style value
nChrHeight Standard height for characters of the window
nChrWidth Standard width for characters of the window
nLastKey Last key pressed on the window
nTop window coordinates
nLeft window coordinates
nBottom window coordinates
nRight window coordinates
nClrPane Color of the background of the window
nClrText Color of the foreground of the window
nResult Numerical value after last activation
lValidating If the window is in a process of validating a control
nHelpId The help topic identifier for this window
hCtlFocus Handle of the child control which has the focus
aControls An array holding all the controls of the window
oBar Bar Object attached to the window
oBrush Brush Object attached to the window
oCursor Cursor Object attached to the window
oFont Font Object attached to the window
oIcon Icon Object attached to the window
oMenu Menu Object attached to the window
oSysMenu SysMenu Object attached to the window
oPopup Temporary popup menu acting over the window
oMsgBar MsgBar Object attached to the window
oWnd Window Object container of the window
oVScroll Vertical scrollbar Object attached to the window
oHScroll Horizontal scrollbar Object attached to the window

METHODS
--------------------------------------------------------------------------------
New Constructor of window class .
Activate Activates a Window .
AddControl Adds a new child control .
BeginPaint It is automatically called before painting .
Box Draws a Box on the Window
.
Capture Capture all the Mouse activity for the Window .
Center Centers the window on the screen .
Command Process a generic command .
Circle Draws a circle .
CoorsUpdate Updates the coordinates of the window .
Copy Places a copy of the window image at the clipboard .
Create Generic new Window Class creation .
CtlColor Set color of control. .
cTitle The caption of the Window .
DdeInitiate Initiate DDE session from the window .
DdeAck Acknowledge DDE. .
DdeExecute Execute DDE command .
DdeTerminate Terminate DDE session .
Destroy() Destroy a window .
Disable Disables the Window .
DrawItem Draw item .
DropFiles Handle files dropped on this window .
Enable Enable Window activity .
End End Activity .
EndPaint Automatically called when ending painting .
EraseBkGnd Erase background of window .
FloodFill Fill area from startpoint with color .

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


FocusNext Changes the child focus to the next or to the previous .
cGenPrg Generates the source code of the window .
nGetChrHeight Updates the nChrHeight DATA of the window .
GetCliRect Returns the client window area .
GetFont Get font from window .
GetRect Returns the whole area .
GetDC Returns the current device context. .
GetDlgCode Return the kind of Dialog information a window requests .
GetWidth Get width of string written with certain font .
GoNextCtrl Goto next control in window .
GoPrevCtrl Goto previous control in window .
GotFocus Called when window got focus .
GoTop Bring window to top .
HandleEvent Generic handle event management .
HardCopy() Makes a printout of the Window. .
Hide Hide window .
HScroll Horizontal scroll method dispatcher .
Iconize() Iconize window .
KeyDown Key holding down method dispatcher .
KeyChar Key pressed method dispatcher .
KillFocus Called when window loses focus .
LButtonDown Left Mouse button down dispatcher .
LDblClick Called when left double click occurs .
Line Draws a line .
Link Window to OOPS conversion initialization .
LostFocus Called when window loses focus .
lWhen Evaluate when condition .
Maximize Maximize window .
MenuSelect Called when menuitem is selected .
MeasureItem Measure size of control .
Minimize Minimizes the Window .
MouseMove Called when mouse moves over window .
Move Moves the Window .
NcActivate .
Normal Give window normal size .
Paint Generic painting method .
PaletteChanged .
PostMsg Post a Windows message .
Print Prints the Window at the Printer .
QueryDragIcon Icon for dragging .
QueryEndSession End of query .
QueryNewPalette .
RButtonDown Right mouse button down dispatcher .
ReleaseDC Release the previous device context requested .
Refresh Forces a Window to be repainted .
Register Register a new Window Class .
ReSize Changes the size of a Window .
Say Writes text on a Window .
SayRect Writes text with a box around .
SendMsg Send a Windows message .
SelColor Choose foreground or background color for window .
SetBrush Changes the brush of a Window .
SetCoors Changes the coordinates of the Window .
SetColor Set foreground/background color and brush .
SetFocus Gives the focus to a Window .
SelFont Select font for window .
SetFont Changes the font of a Window .
SetMenu Changes the Menu of a Window .
SetMsg Changes the message of the bottom of the Window .
SetPixel Draws a pixel on the Window .
SetText Changes the caption of the Window .

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Show Show window .
SysCommand System Menu commands dispatcher .
Timer Called when timer event occurs for window .
UnLink Disables Window-OOPS connection .
Update Update controls on window .
lValid Check valid condition .
VScroll generic vertical scroll dispatcher .
nVertRes() Vertical resolution of window in pixels .
nHorzRes Horizontal resolution of window in pixels .
AEvalWhen() Evaluate when clauses for controls when starting window .
VbxFireEvent A VBX event was triggered .

--------------------------------------------------------------------------------
Class TYacc FiveWin YACC Machine
--------------------------------------------------------------------------------
DATA
--------------------------------------------------------------------------------
oLex AS OBJECT TLex object
lDebug AS LOGICAL Debug mode
nErrors AS NUMERIC
nErrFlag AS NUMERIC
nToken AS NUMERIC Last token
nTheState AS NUMERIC Actual state
nState AS NUMERIC INIT 1 Index into aStates
nValue AS NUMERIC INIT 1 Index into aValues
aStates AS ARRAY INIT {}
aLen AS ARRAY N. of rules of each state
aValues AS ARRAY INIT {}
aDefRed AS ARRAY INIT {}
aShift AS ARRAY
aReduce AS ARRAY
aSIndex AS ARRAY Array of shift indexes
aRIndex AS ARRAY Array of reduce indexes
aGIndex AS ARRAY Array of goto indexes
aDGoto AS ARRAY
aTable AS ARRAY
aLHS AS ARRAY Left hand side
aCheck AS ARRAY
aRules AS ARRAY
uLValue Last left value
uValue Last right value
bShift AS BLOCK
bReduce AS BLOCK

METHODS
--------------------------------------------------------------------------------
New Constructor from source code
Parse Starts processing an input stream (file or string)
Shift Shifts to a new state
Reduce Reduces from a state and executes the production rule if
defined
Error Error manager.
ProdValue Returns the value of a production member.
Accept General acceptacion process when parsing is completed.

--------------------------------------------------------------------------------

OBJECTS engine .
--------------------------------------------------------------------------------

OBJECTS Syntax

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------

#include "Objects.ch"

CLASS <TMyClass> [ FROM <TParentClass> ]

[ EXPORT | PUBLIC ] \
[ PROTECTED | READONLY ] | Scope clauses
[ LOCAL | HIDDEN ] /

DATA <DataName> [ AS CHARACTER | NUMERIC | DATE | LOGICAL


CODEBLOCK | NIL ]
...

METHOD <MethodName>( [ <params,...> ] ) ;


[ CONSTRUCTOR | SETGET | VIRTUAL | BLOCK ]

METHOD <MethodName>( [ <params,...> ] ) ;


INLINE <uCode, ...>

MESSAGE <cMsgName> METHOD <MethodName>

ENDCLASS

<TMyClass> Is the name of the new Class we are going to create. It may
not exceed from ten characters.

<TParentClass> Is the name of the Class from which we want to inherit a


new Class.

<DataName> They are the name of the Data elements (instance variables)
we want to have for the Objects of this new Class.

<MethodName> Is the name of the Methods of the Objects.

<params,...> Is an optional list of elements to be passed as parameters


to the methods.

Clauses
--------------------------------------------------------------------------------

CONSTRUCTOR When we are going to initialize an Object and we want to


automatically return a reference to self.
It is a good practice to first specify the methods
that allows you to build an object (constructors).

SETGET They are for calculated Data. This means we will manipulate
this name of a method like a Data.

VIRTUAL Methods that do nothing. Very useful for inheritances and


when you are starting creating and testing a Class.

BLOCK Extremely fast and easy to code, use this clause when you
want to declare 'inline' methods just from the definition
of the Class. We use a lot of them in FiveWin Classes. You
have to specify as first parameter 'Self'.

All methods automatically require a first parameter


which it is the 'Self'. Objects.ch automatically
provides 'Self' in standard METHODs, but in BLOCK

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Methods you must specify it. So, BLOCK require to
specify 'Self' and the codeblock parameters:

METHOD <MethodName> BLOCK ;


{ | Self, <arg1>, <arg2>, ..., <argN> | ... }

The advantadge of BLOCK methods over standard


METHODs is that they don't require to write the
related code, as it is included in the same declaration.
So it reduces the number of required Clipper symbols,
but it has the disadvantadge that always a codeblock
must be evaluated. On a standard METHOD a codeblock
evaluation is not necessary, so we avoid one execution
step.

INLINE The same functionality than the BLOCK clause, but it is


much more easy to use as it is not necessary to build the
codeblock -it is automatically built- It is better xBase!
We plan in next versions of FiveWin to convert all our
BLOCK methods into INLINE clauses.

INLINE Methods get automatically converted into BLOCK


methods definition. It is just an easier and faster way
to code a BLOCK method. We recommend you to use INLINE
methods instead of BLOCK methods.

As INLINE methods get automatically preprocessed into


BLOCK methods, the 'self' is automatically provided so
it is not needed to specify it.

Methods codification
--------------------------------------------------------------------------------

METHOD <MethodName>( [<params,...>] ) CLASS <TMyClass>

-we have a local 'Self' ready to use here.

-use ::<Data> for accessing Self:<Data>.

return

Include only ONE class per .PRG.

--------------------------------------------------------------------------------

FiveWin Functions - Alphabetically ordered

--------------------------------------------------------------------------------

AddFontResource() Adds a new font to the Windows font table


--------------------------------------------------------------------------------

Syntax: AddFontResource( <cFontFile> | <hFontResource> ) -->


<nFontsAdded>

This function add a font resource to the Windows font table. Any
application can then use the font.

Parameters:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<cFontFile> The name of an external file where we have stored
some fonts we want to use in our application.

<hFontResource> The handle of a module (DLL) where we have stored


some fonts we want to use in our application.

Returns:

<nFontsAdded> The number of fonts the system successfully added.

Sample: AddFontResource( "MyApp.dll" )

Source code: SOURCE\\WINAPI\\FontCrea.c

--------------------------------------------------------------------------------
aGetWorkAreas() Returns an array with all available work areas
--------------------------------------------------------------------------------

Syntax: aGetWorkAreas() --> <aWorkAreas>

Parameters: None.

Returns:

<aWorkAreas> An array with the name of all workareas in use.

Sample: local aAreas := aGetWorkAreas()

Source code: SOURCE\\FUNCTION\\DbTools.prg

--------------------------------------------------------------------------------

AnsiToOem() Translates a Window string into the OEM MsDos


--------------------------------------------------------------------------------

Syntax: AnsiToOem( <cWindowText> ) --> <cOemText>

Parameters:

<cWindowText> The Window string to convert into OEM format.

Returns:

<cOemText> The equivalent OEM string.

Observations Normally all the data that you capture from MsDos
into a DBF is stored as OEM text. In this situation
you may call OemToAnsi() to properly review it from
inside Windows.

Text that is captured from Windows is in Ansi


format. To use it from MsDos later, store it as
the result of AnsiToOem().

Source code: SOURCE\\WINAPI\\OemAnsi.c

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
aOData() Returns an array with all an Object Class DATA names
--------------------------------------------------------------------------------

Syntax: aOData( <oObject> ) --> <aClassDataNames>

Parameters:

<oObject> This is an Object.

Returns:

<aData> This function returns an array with the Names


of all the Object Class Data.

Observations: None.

Sample: local aObjClsNames := aOData( oObject )

Source code: SOURCE\\FUNCTION\\aOData.prg

See also: aOData.eho:"source code"

--------------------------------------------------------------------------------
Arc() Draws an elliptical arc
--------------------------------------------------------------------------------

Syntax: Arc( <hDC>, <nLeftRect>, <nTopRect>,


<nRightRect>, <nBottomRect>,
<nXStartArc>, <nYStartArc>,
<nXEndArc>, <nYEndArc> ) -->
<lSuccess>

Parameters:

<hDC> Identifies the device context where the arc is drawn

<nLeftRect> The dimensions of the rect where the arc is placed


<nTopRect>
<nRightRect>
<nBottomRect>

<nXStartArc> The coordinates of starting point of the arc.


<nYStartArc>
<nXEndArc> The coordinates of ending point of the arc.
<nYEndArc>

Returns:

<lSuccess> A logical value indicating that the operation


was performed successfully.

Source code: SOURCE\\WINAPI\\Drawing.c

--------------------------------------------------------------------------------
ASend() Send an OOP message to an array of Objects
--------------------------------------------------------------------------------

Syntax: ASend( <aArray>, <cMsg>, <uParam1>, ..., <uParamN> )

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Parameters:

<aArray> An array of objects.

<cMsg> A literal describing the OOP message to send to the


object. It is the same as doing the following code,
but in a much more efficient way, and without having
to know in advance which OOP message will be sent to
the array of objects:

local n

for n = 1 to Len( <aArray> )


<aArray>[ n ]:<cMsg>( <uParam1>, ..., <uParamN> )
next

<uParam1> A list of optional parameters to be supplied as


<uParamN> parameters to the method.

Returns: nil

Source code: C language. Not provided.

See also: OSend()

--------------------------------------------------------------------------------
aTreeBmps() Returns an array with the default tree bitmaps
--------------------------------------------------------------------------------

Syntax: aTreeBmps() --> <aBmpHandles>

Parameters: None

Returns:

<aBmpHandles> An array with the handles of the bitmaps used


to display the FiveWin trees.

Observations Used internally by FiveWin trees.

Source code:

See also:

--------------------------------------------------------------------------------
BarAdjust() Adjust the bar to the new dimension of its container
--------------------------------------------------------------------------------

Syntax: BarAdjust( <hWnd>, <nMode>, <lMsgBar> ) --> nil

Parameters:

<hWnd> The Window handle of the Button Bar.

<nMode> The currently button Bar nMode Selected.

<lMsgBar> If the container window of the Button bar has

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


a message Bar.

Returns: Nil

Observations: Used internally by Fivewin. You don't need to use


it directly.

Source code: SOURCE\\FUNCTION\\Bartools.c

See also:

--------------------------------------------------------------------------------
BeginPaint() Prepares a window for start painting
--------------------------------------------------------------------------------

Syntax: BeginPaint( <hWnd>, @<cPS> ) --> <hDC>

Parameters:

<hWnd> Identifies the window to be repainted.

<cPS> A variable that will receive a


WinApi PAINTSTRUCT as a string. This variable
has to be supplied by reference.

Returns:

<hDC> The device context for the given window.

Comments: The BeginPaint function automatically sets the


clipping region of the device context to exclude
any area outside the update region. The update
region is set by the InvalidateRect or
InvalidateRgn function and by the system after
sizing, moving, creating, scrolling, or any other
operation that affects the client area. If the
update region is marked for erasing, BeginPaint sends
a WM_ERASEBKGND message to the window.

An application should not call BeginPaint except


in response to a WM_PAINT message. Each call
to the BeginPaint function must have a
corresponding call to the EndPaint function.

If the caret is in the area to be painted,


BeginPaint automatically hides the caret to
prevent it from being erased.

If the window's class has a background brush,


BeginPaint will use that brush to erase the
background of the update region before returning.

Sample: SOURCE\\CLASSES\\Window.prg

Source code: SOURCE\\WINAPI\\Paint.c

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
B2Bin() Converts a byte into a string 1 byte len
--------------------------------------------------------------------------------

Syntax: B2Bin( <nValue> ) --> <cValue>

Parameters:

< nValue > This is a number which is converted to a BYTE string

Returns:

<cValue> The equivalent <nValue> as a string.

Sample: local cVar := B2Bin( 1 )

Source code: SOURCE\\WINAPI\\b2bin.c

--------------------------------------------------------------------------------
Browse() Automatic full featured FiveWin browse
--------------------------------------------------------------------------------

Syntax: Browse( cTitle, cListName, bNew, bModify, bDelete,;


bSearch, bList ) --> nil

Parameters:

<cTitle> The principal title for the Fivewin browse.


<cListName> This is the name of the data to see in browse.
<bNnew> This CodeBlock is used to add a New Record.

<bModify> This CodeBlock is used to Modify the record.


<bDelete> This CodeBlock is used to delete the record.

<bSearch> This CodeBlock is used to search for data.


<bList> This CodeBlock is used to list to the printer.

Observations: This is a self contained Clipper-Fivewin traditional


dBase-III-Plus like Browse, very useful for prototyping
applications.

Sample:

static function Main()

local cTitle := "This is a FiveWin Browse Sample."


local cListName := "NAME, ADDRESS, TELEPHONE"
local bNew := { || MsgInfo( "Add a New Record" ) }
local bModify := { || MsgInfo( "Modify an existing record" ) }
local bDelete := { || MsgInfo( "Delete a record" ) }
local bSearch := { || MsgYesNo( "Do you want to search some thing? " )
}
local bList := { || MsgYesNo( "Do you want a report list?" ) }

USE NAME

Browse( cTitle, cListName, bNnew, bModify, bDelete, bSearch, bList )

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


return nil

Source code: "..\\source\\function\\browse.prg"

See also:

--------------------------------------------------------------------------------
BtnPaint() Paints the contents of a bitmapbutton
--------------------------------------------------------------------------------

Syntax: BtnPaint( hWnd, hBmpPal1, hBmpPal2, lPressed, lAdjust )


--> nil

Parameters:
<hWnd> The handle of the window which is painting
<hBmpPal1> Special FiveWin handle ( bitmap + palette together )
of the normal bitmap.
<hBmpPal2> Special FiveWin handle ( bitmap + palette together )
of the pressed bitmap.
<lPressed> If the button is being pressed.
<lAdjust> If the bitmap has to be adjusted on the surface.

Returns: Nothing.

Observations: This is a FiveWin function used internally to paint


the buttonbar buttons.

Source code: No provided.

--------------------------------------------------------------------------------
BuildCommDCB() Translates a device string into a control block
--------------------------------------------------------------------------------

Syntax: BuildCommDCB( <cInfoDef>, @<cDevBlock> ) --> lSuccess

The BuildCommDCB function translates a device-definition string into


appropriate serial Device Control Block (DCB) codes.

Parameters:

<cInfoDef> A string that specifies device-control information.


The string has the same form as the parameters used in
the MsDos mode command.

<cDevBlock> A string passed by reference that will receive the


translated string. Its structure defines the control
settings for the serial-communications device.

Returns: .t. if everything was ok.

Observations: This is a WinApi communication function.

Sample: See SAMPLES\\TestComm.prg

Source code: SOURCE\\WINAPI\\comm.c

See also:

--------------------------------------------------------------------------------
CallDll() Calls a function placed into a DLL

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------

Syntax: CallDll( <cFuntionDef>, <uParam1,...> ) --> <uResult>

Parameters:

<cFunctionDef> A special string which holds all the necessary


information to execute a certain action. This string
is automatically produced by the function
GetProcAddress().

<uParam1,...> Are the parameters supplied to the called function.


This depends on the DLL function we are going to call.

Returns: The returned value from the DLL function.

Observations: See INCLUDE\\DLL.CH for the xBase way of doing this


DLLs functions calls.

Sample: See SAMPLES\\DllCall.prg

Source code: SOURCE\\WINAPI\\CallDll.c

See also: GetProcAddress()

--------------------------------------------------------------------------------
CallWindowProc() Passes messages information to a specific procedure
--------------------------------------------------------------------------------

Syntax: CallWindowProc( <nWndProc>, <hWnd>, <nMsg>, <nWParam>,


<nLParam> ) --> <uReturn>

The CallWindowProc function passes message information to the specified


window procedure.

Parameters:

<nWndProc> Specifies the procedure-instance address of the previous


window procedure.

<hWnd> Identifies the window that will receive the message.

<nMsg> Specifies the message.

<nWParam> Specifies 16 bits of additional message-dependent


information.

<nLParam> Specifies 32 bits of additional message-dependent


information.

Returns: The return value specifies the result of the message


processing and depends on the message sent.

Observations: The CallWindowProc function is used for window


subclassing. Normally, all windows with the same class
share the same window procedure. A subclass is a window

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


or set of windows belonging to the same window class
whose messages are intercepted and processed by another
window procedure (or procedures) before being passed
to the window procedure of that class.

The SetWindowLong function creates the subclass by


changing the window procedure associated with a
particular window, causing Windows to call the new
window procedure instead of the previous one. Any
messages not processed by the new window procedure must
be passed to the previous window procedure by calling
CallWindowProc. This allows you to create a chain of
window procedures.

Source code: SOURCE\\WINAPI\\CallWnd.c

See also: SetWindowLong()

--------------------------------------------------------------------------------
cArgV() Retrieves a certain command line parameter
--------------------------------------------------------------------------------

Syntax: cArgV( <nOrder> ) --> <cCommandLineParam>

Retrieves a command line parameter supplied to


the application (like in C argv).

Parameters:

<nOrder> The parameter order supplied to the application.

Returns:

<cCommandLineParam> A string with the specified command line param.

Sample: See SAMPLES\\TestArgs.prg

Source code: SOURCE\\FUNCTION\\Arg.c

See also: nArgC()

--------------------------------------------------------------------------------
cCtrl2Chr() Generates a string with the control structure
--------------------------------------------------------------------------------

Syntax: cCtrl2Chr( <nTop>, <nLeft>, <nBottom>, <nRight>,


<nId>, <nStyle>, <cClassName>, <cCaption> )
--> <cControlString>

This function translates information from a windows


control into a special string to be used for created
memory windows resources templates.

Parameters:

<nTop>, <nLeft>, Control coordinates.


<nBottom>, <nRight>

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<nId> Control numeric ID identification.

<nStyle> Control numeric style description.

<cClassName> The control winapi class name.

<cCaption> The caption of the control.

Returns: A string with binary information that describes


those values.

Observations: It is used internally by FiveWin when creating


DialogBoxes in runtime.

Source code: SOURCE\\WINAPI\\Ctl2Chr.c

See also: See TControl:cToChar() METHOD.

--------------------------------------------------------------------------------
cGetExpression() General build expression DialogBox
--------------------------------------------------------------------------------

Syntax: cGetExpression( <cInitialExpression>, <cTitle> )


--> <cExpression>

Parameters:

<cInitialExpression> The default expression that appears when


invoking the cGetExpression() DialogBox.

<cTitle> The title for the DialogBox. By default it


shows "Expression builder".

Returns:

<cExpression> The expression built by the user.

Observations: This function is now only available from the


IDE. If you want to use it in your application
you have to copy the RC for the DialogBox from
IDE.DLL to your application.

Sample: ? cGetExpression( "Customer->Name",;


"Select a expression to search for" )

Source code: SOURCE\\FUNCTION\\MsgExpr.prg

See also: The Index builder in the IDE

--------------------------------------------------------------------------------
cGetFile() File selection standard DialogBox
--------------------------------------------------------------------------------

Syntax: cGetFile( <cFileMask>, <cTitle>,


[<nDefaultMask>],
[<cInitialDirecory>] ) --> <cFileName>

This function invokes the Windows default select

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


a file DialogBox.

Parameters:

<cFileMask> A string that contains a default filename, or


a list of possible file types to select:

? cGetFile( "Hello.prg", "Select a file" )

In this case "Hello.prg" is shown as the default


filename.

If you want to specify some different types of


files the following format must be used:

"DataBase | *.dbf |" + ;


"Index | *.cdx |" + ;
"Bitmap | *.bmp"

<cTitle> The title of the DialogBox. By default


"Select a file" is shown.

<nDefaultMask> An optional numeric value in case that


you want to start the DialogBox with a certain
file type selected (if you are using the multiple
file types format).

To request lately what was the file type selected,


you may use the function nGetFileFilter().

<cInitialDirectory> The initial directory where to start


looking for files. By default it uses ".\\"

Returns: A string with the name of the filename selected.

Sample: See IDE\\SOURCE for a lot of different samples.

Source code: SOURCE\\WINAPI\\GetFile.c

See also: nGetFileFilter()

--------------------------------------------------------------------------------
CloseZipFile() Closes the ZIP file
--------------------------------------------------------------------------------

Syntax CloseZipFile() --> nil

Parameters None

Returns Nothing.

Closes the ZIP file previously in use calling


GetFirstInZip() and GetNextInZip() functions.

Sample: SAMPLES\\TestZip.prg

Source code: SOURCE\\FUNCTION\\UnZip.c

--------------------------------------------------------------------------------
CurDrive() Retrieves the default drive selected letter

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------

Syntax CurDrive() --> <cCurDrive>

Parameters None

Returns

<cCurDrive> The letter of the currently selected


drive: "C", "D", "E", ...

Example

MsgInfo( CurDrive() )

--------------------------------------------------------------------------------
GetHelpFile() Retrieves the default help file selected
--------------------------------------------------------------------------------

Syntax

GetHelpFile() --> cHelpFile

Parameters

None

Returns

cHelpFile The name of the help file previously selected.

Description

We have implemented this function to easy the help functions


management, letting the user select a default HLP file which will
be accessed automatically, requesting different kind of services.
The function may be called at the beginning of the execution of our
application so it will remain active during our application execution.

Example

MsgInfo( GetHelpFile() ) // Shows cHelpFile

Source: HELP.C

--------------------------------------------------------------------------------
GetHelpTopic() Retrieves the default help Topic
--------------------------------------------------------------------------------

Syntax

GetHelpTopic( [ ncTopic ] )

Parameters

ncTopic Is an optional parameter and let us specify the topic


about we want help. It can be a number or a string.
If it is not specified, the default topic selected
with HelpSetTopic() will be shown.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


The topics identifiers are established by the help
file author.

Returns

Nothing

Description

We may select a default topic to be called every time we


request help.

Example

GetHelpTopic( "Use_of_help" )

Source: HELP.C

--------------------------------------------------------------------------------
C2Hex() Converts a byte into a hex string (2 chars) .
--------------------------------------------------------------------------------

Syntax: C2Hex( <cChar> ) --> <cHex>

Parameters:

<cChar> A one character string.

Returns:

<cHex> A two character hex string.

Sample: MsgInfo( C2Bin( "X" ) ) // returns a "58" hex

Source code: SOURCE\\FUNCTION\\B2Bin.c

See also: I2Hex()

--------------------------------------------------------------------------------
nFileCrc() Returns a CRC checksum for an entire file contents
--------------------------------------------------------------------------------

Syntax: nFileCrc( <cFileName> ) --> nCRCValue

Parameters:

<cFileName> The name of the file to calculate a checksum on its


containts.

Returns:

<nCRCValue> A numeric value with the checksum CRC.

Sample: MsgInfo( nFileCrc( "c:\command.com" )

Source code: Not provided.

See also: nStrCrc()

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
cFileDisk() Retrieves the drive from a filename with path
--------------------------------------------------------------------------------

Syntax: cFileDisk( <cFileName> ) --> <cDrive>

Parameters:

<cFileName> The filename whose drive to retrieve, if the


drive has been specified inside its filename.

Returns:

<cDrive> A two characters string with the format: A:, B:,


C:, etc...

Source code: SOURCE\\FUNCTION\\FileName.prg

--------------------------------------------------------------------------------
cFileExt() Retrieves the extension from a filename
--------------------------------------------------------------------------------

Syntax: cFileExt( <cFileName> ) --> <cExtName>

Parameters:

<cFileName> The filename whose extension to retrieve, if the


extension has been specified inside its filename.

Returns:

<cExtName> A three characters string with the extension


name.

Source code: SOURCE\\FUNCTION\\FileName.prg

--------------------------------------------------------------------------------
cFileMask() Retrieves the mask from a filename if specified
--------------------------------------------------------------------------------

Syntax: cFileMask( <cFileName> ) --> <cMask>

Parameters:

<cFileName> The filename whose mask to retrieve, if a


mask has been specified inside its filename. A mask
is a group of wildcards ( "*.*", "?...", etc...).

Returns:

<cMask> The mask if specified.

Source code: SOURCE\\FUNCTION\\FileName.prg

--------------------------------------------------------------------------------
cFileName() Retrieves the filename without its path
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Syntax: cFileName( <cFullFileName> ) --> <cFileName>

Parameters:

<cFullFileName> The full filename including path and optional


extension.

Returns:

<cFileName> Just the filename specified inside the full filename.

Source code: SOURCE\\FUNCTION\\FileName.prg

--------------------------------------------------------------------------------
cFileNoExt() Retrieves the filename without path and extension
--------------------------------------------------------------------------------

Syntax: cFileNoExt( <cFileName> ) --> <cFileName>

Parameters:

<cFileName> The full filename including path and optional


extension.

Returns:

<cFileName> Just the filename specified inside the full filename,


without path and extension.

Source code: SOURCE\\FUNCTION\\FileName.prg

--------------------------------------------------------------------------------
cFileNoPath() Retrieves the filename without path (as cFileName()) .
--------------------------------------------------------------------------------

Syntax: cFileNoPath( <cFullFileName> ) --> <cFileName>

Parameters:

<cFullFileName> The full filename including path and optional


extension.

Returns:

<cFileName> Just the filename specified inside the full filename.

Source code: SOURCE\\FUNCTION\\FileName.prg

--------------------------------------------------------------------------------
cFilePath() Retrieves the path from a filename with path
--------------------------------------------------------------------------------

Syntax: cFilePath( <cFileName> ) --> <cPath>

Parameters:

<cFileName> The full filename including path and optional


extension.

Returns:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<cPath> Just the path name specified inside the full filename.

Source code: SOURCE\\FUNCTION\\FileName.prg

--------------------------------------------------------------------------------
cFileSubDir() Retrieves the subdir name from a filename
--------------------------------------------------------------------------------

Syntax: cFileSubDir( <cFileName> ) --> <cDirName>

Parameters:

<cFileName> The full filename including path and optional


extension.

Returns:

<cDirName> Just the path name specified inside the full filename,
excluding the drive name.

Source code: SOURCE\\FUNCTION\\FileName.prg

--------------------------------------------------------------------------------
cNewFileName() Retrieves a new filename using a rootname
--------------------------------------------------------------------------------

Syntax: cNewFileName( <cRootName>, <cExt> ) --> <cNewFileName>

Parameters:

<cRootName> A root name to use to build a new filename that


does not exists.

<cExt> The extension to use to build the new filename.

Returns:

<cNewFileName> It is a new non-existing filename, with the format:


<cRootName>XXX.<cExt>

Source code: SOURCE\\FUNCTION\\FileName.prg

--------------------------------------------------------------------------------
cFileNoExt() Retrieves the filename without path and extension
--------------------------------------------------------------------------------

Syntax: cFileNoExt( <cFileName> ) --> <cFileName>

Parameters:

<cFileName> The full filename including path and optional


extension.

Returns:

<cFileName> Just the filename specified inside the full filename,


without path and extension.

Source code: SOURCE\\FUNCTION\\FileName.prg

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
cFileNoPath() Retrieves the filename without path (as cFileName()) .
--------------------------------------------------------------------------------

Syntax: cFileNoPath( <cFullFileName> ) --> <cFileName>

Parameters:

<cFullFileName> The full filename including path and optional


extension.

Returns:

<cFileName> Just the filename specified inside the full filename.

Source code: SOURCE\\FUNCTION\\FileName.prg

--------------------------------------------------------------------------------
cFilePath() Retrieves the path from a filename with path
--------------------------------------------------------------------------------

Syntax: cFilePath( <cFileName> ) --> <cPath>

Parameters:

<cFileName> The full filename including path and optional


extension.

Returns:

<cPath> Just the path name specified inside the full filename.

Source code: SOURCE\\FUNCTION\\FileName.prg

--------------------------------------------------------------------------------
cFileSubDir() Retrieves the subdir name from a filename
--------------------------------------------------------------------------------

Syntax: cFileSubDir( <cFileName> ) --> <cDirName>

Parameters:

<cFileName> The full filename including path and optional


extension.

Returns:

<cDirName> Just the path name specified inside the full filename,
excluding the drive name.

Source code: SOURCE\\FUNCTION\\FileName.prg

--------------------------------------------------------------------------------
cNewFileName() Retrieves a new filename using a rootname
--------------------------------------------------------------------------------

Syntax: cNewFileName( <cRootName>, <cExt> ) --> <cNewFileName>

Parameters:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<cRootName> A root name to use to build a new filename that
does not exists.

<cExt> The extension to use to build the new filename.

Returns:

<cNewFileName> It is a new non-existing filename, with the format:


<cRootName>XXX.<cExt>

Source code: SOURCE\\FUNCTION\\FileName.prg

--------------------------------------------------------------------------------
cTempFile() Retrieves a temporary new filename
--------------------------------------------------------------------------------

Syntax: cTempFile() --> <cNewFileName>

Parameters: None.

Returns:

<cNewFileName> It is a new non-existing filename, with the format:


XXXXXX.

Source code: SOURCE\\FUNCTION\\FileName.prg

--------------------------------------------------------------------------------
FSize() Retrieves the size of a filename without opening it
--------------------------------------------------------------------------------

Syntax: FSize( <cFileName> ) --> <nFileSize>

Parameters:

<cFileName> The name of the file whose size to retrieve.

Returns:

<nFileSize> A number specifying the size of the file.

Source code: SOURCE\\FUNCTION\\FileName.prg

--------------------------------------------------------------------------------
ChangeProc() Changes the procedure of a Window
--------------------------------------------------------------------------------

Syntax: ChangeProc( <hWnd> ) --> <nOldProc>

This function replaces the procedure that controls


the behavior of a function, for a FiveWin special one.

RestProc() replaces again this new procedure for


the old one.

Parameters:

<hWnd> The handle of the window to change its proc.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Returns:

<nOldProc> A number ( long pointer ) of the old procedure.

Observations: This function is used internally by FiveWin to


automatically subclass windows and controls and to
make them compatible with the OOPS architecture of
FiveWin.

Source code: SOURCE\\WINAPI\\ChangePr.c

--------------------------------------------------------------------------------
Chord() Draws a chord .
--------------------------------------------------------------------------------

Syntax: Chord( <hDC>, <nLeftRect>, <nTopRect>,


<nRightRect>, <nBottomRect>,
<nXStartLine>, <nYStartLine>,
<nXEndLine>, <nYEndLine> ) -->
<lSuccess>
Parameters:

<hDC> Identifies the device context where to paint

<nLeftRect> The rect of the bounding rectangle where to


<nTopRect> place the chord.
<nRightRect>
<nBottomRect>

<nXStartLine> The origin and end of the line that intersects


<nYStartLine> with the ellipse forming the chord.
<nXEndLine>
<nYEndLine>

Returns:

<lSuccess> A logical value indicating if the operation was


performed successfully.

Source code: SOURCE\\WINAPI\\Drawing.c

--------------------------------------------------------------------------------
ChooseColor() Color selection standard DialogBox
--------------------------------------------------------------------------------

Syntax: ChooseColor( <nRGBDefaultColor>, <nFlags> )


--> <nRGBColor>

This function calls the Windows standard color


selection DialogBox.

Parameters:

<nRGBDefaultColor> The color that will appear automatically when


the DialogBox starts.

<nFlags> An optional numeric value for some flags:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define CC_PREVENTFULLOPEN 4

Disables the possibility of defining user defined


colors. FiveWin by default allows user defined
colors.

Returns:

<nRGBColor> The RGB value of the color selected. If no


selection is done, nRGBDefaultColor is returned.

Sample: ? ChooseColor( CLR_CYAN )

Source code: SOURCE\\WINAPI\\ClrChoos.c

--------------------------------------------------------------------------------
ChooseFont() Font selection standard DialogBox
--------------------------------------------------------------------------------

Syntax: ChooseFont( <aPreviousFont>, @<nRGBColor> )


--> <aFont>

This function calls the Windows standard font


selection DialogBox.

This function is automatically called from


TFont():Choose() METHOD and automates the
process of providing parameters.

Also you may call TWindow():SelFont() METHOD for


a much easier way of managing this.

Parameters:

<aPreviousFont> An array with the default font description


to show as selected when invoking the DialogBox:

These are the elements of this array:

#define LF_HEIGHT 1
#define LF_WIDTH 2
#define LF_ESCAPEMENT 3
#define LF_ORIENTATION 4
#define LF_WEIGHT 5
#define LF_ITALIC 6
#define LF_UNDERLINE 7
#define LF_STRIKEOUT 8
#define LF_CHARSET 9
#define LF_OUTPRECISION 10
#define LF_CLIPPRECISION 11
#define LF_QUALITY 12
#define LF_PITCHANDFAMILY 13
#define LF_FACENAME 14

<nRGBColor> A numeric RGB color supplied by reference where


the DialogBox will place the user color selection.

Returns:

<aFont> An array that holds the new font definition,


with the same structure as <aDefaultFont>.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Sample: See IDE\\SOURCE for several samples used.

Source code: SOURCE\\WINAPI\\FontChoo.c

See also: TFont():Choose() and TWindow():SelFont()

--------------------------------------------------------------------------------
ClientToScreen() Converts client coordinates into screen coordinates
--------------------------------------------------------------------------------

Syntax: ClientToScreen( <hWnd>, <aPoint>) --> nil

This function converts the client coordinates of a


given point on the screen to screen coordinates.

Parameters:

<hWnd> The handle of the window whose client area is


used for the conversion.

<aPoint> An array of two elements that holds the


coordinates of the point. The two elements of this
array are transformed accordingly with the new
calculated values.

Returns: Nothing. The result is placed inside the same array.

Sample: local aPoint := { 100, 120 }

ClientToScreen( oWnd:hWnd, aPoint )

? aPoint[ 1 ]
? aPoint[ 2 ]

Source code: SOURCE\\WINAPI\\Clt2Scr.c

See also: ScreenToClient()

--------------------------------------------------------------------------------
CloseClipboard() Closes the clipboard
--------------------------------------------------------------------------------

Syntax: CloseClipboard() --> <lSuccess>

This function closes the ClipBoard.

Parameters: None.

Returns:

<lSuccess> A logical value that represents if the operation


was completed successfully.

Observations: A window must close the clipboard after using it in


order to let other windows use it.

Source code: SOURCE\\WINAPI\\ClpBrd.c

See also: OpenClipboard() SetClipboard() EmptyClipboard()


GetClpData()

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
CloseComm() Closes the communication device and frees memory
--------------------------------------------------------------------------------

Syntax: CloseComm( <nDeviceId> ) --> <lSuccess>

The CloseComm function closes the specified


communications device and frees any memory allocated
for the device's transmission and receiving queues.
All characters in the output queue are sent before
the communications device is closed.

Parameters:

<nDeviceId> Specifies the device to be closed. The OpenComm


function returns this value.

Returns:

<lSuccess> A logical value indicating if the operation was


successful.

Sample: See SAMPLES\\TestComm.prg

Source code: SOURCE\\WINAPI\\Comm.c

See also: OpenComm() WriteComm() ReadComm() BuildCommDcb()


SetCommStat() FlushComm() GetCommError()

--------------------------------------------------------------------------------
cNtxKey() Returns the index expression of a NTX index file
--------------------------------------------------------------------------------

Syntax: cNtxKey( <cNtxFileName> ) --> <cIndexKey>

This function opens a NTX file and retrieves the


ascii description of the index key used.

Parameters:

<cNtxFileName> The name of the NTX file.

Returns:

<cIndexKey> A string with the key description.

Source code: SOURCE\\FUNCTION\\NtxTools.c

--------------------------------------------------------------------------------
CreateDC() Creates a device context for the given device
--------------------------------------------------------------------------------

Syntax: CreateDC( <cDriver>, <cDevice>, <cOutPut>,


<cInitData> ) --> <hDC>

Parameters:

<cDriver> MsDos filename of the device driver (i.e.: "Epson" )

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<cDevice> Name of the specific device to be supported
( i.e. "Epson FX-80" )

<cOutPut> MsDos filename or device name of the physical


output medium (file or output port)

<cInitData> Additional information specific of that device.

Returns:

<hDC> The handle of the device context just created.

Observations: hDCs created with CreateDC() must be released with


DeleteDC(), and hDCs created with GetDC() must be
released with ReleaseDC().

Source code: SOURCE\\WINAPI\\DC.c

See also: DeleteDC()

--------------------------------------------------------------------------------
CreateDlg() Creates a modeless DialogBox from resources
--------------------------------------------------------------------------------

Syntax: CreateDlg( <hInstance>, <cTemplateName>,


<hWndOwner> ) --> <hDlg>

This function creates a Modeless DialogBox from


resources, giving the name of the resource.

All these functions are used automatically from


the FiveWin classes. Use the TDialog Class as it
is much more powerful and easy to use.

Parameters:

<hInstance> Identifies an instance of the module whose executable


file contains the dialog box template. FiveWin supplies
a GetResources() function that returns the Instance
of the EXE or the handle of the resources DLL in use.

<cTemplateName> The name given to the DialogBox template in the


resources.

<hWndOwner> The handle of the window which is the owner of the


DialogBox. By default it is GetActiveWindow().

Returns:

<hDlg> The handle ( like hWnd ) of the Dialog Box.

Source code: Not provided. See SOURCE\\WINAPI\\DlogBox.c

See also: CreateDlgIndirect() DialogBox() DialogBoxIndirect()

--------------------------------------------------------------------------------
CreateDlgIndirect() Creates a modeless DialogBox from memory resources
--------------------------------------------------------------------------------

Syntax: CreateDlgIndirect( <hInstance>, <cMemTemplate>,

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<hWndOwner> ) --> <hDlg>

This function creates a modeless dialog box from


a dialog box template in memory.

This function is used when a modeless dialog box is


created from source code.

Use FiveWin classes instead of managing these functions


directly. Classes give you much more power and they
are much easier to use.

Parameters:

<hInstance> Identifies an instance of the module that will


create the Dialog Box.

<cMemTemplate> A string that contains the binary description


of the Dialog Box template.

<hWndOwner> The handle of the window which is the owner of the


DialogBox. By default it is GetActiveWindow().

Returns:

<hDlg> The handle ( like hWnd ) of the Dialog Box.

Source code: Not provided. See SOURCE\\WINAPI\\DlogBox.c

See also: CreateDlg() DialogBox() DialogBoxIndirect()

--------------------------------------------------------------------------------
CreateFont() Creates a logical font with specific characteristics
--------------------------------------------------------------------------------

Syntax: CreateFont( <aFontDescription> ) --> <hFont>

This function creates a logical font that has the


specified characteristics in the array aFontDescription.

This function is used from the TFont Class. Use


Classes as they are much easier to use and more
powerful.

Parameters:

<aFontDescription> An array containing all the necessary information


for creating the font:

#define LF_HEIGHT 1
#define LF_WIDTH 2
#define LF_ESCAPEMENT 3
#define LF_ORIENTATION 4
#define LF_WEIGHT 5
#define LF_ITALIC 6
#define LF_UNDERLINE 7
#define LF_STRIKEOUT 8
#define LF_CHARSET 9
#define LF_OUTPRECISION 10
#define LF_CLIPPRECISION 11
#define LF_QUALITY 12

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define LF_PITCHANDFAMILY 13
#define LF_FACENAME 14

Returns:

<hFont> The handle of the new created font. 0 if it


as not possible to create it.

Source code: SOURCE\\WINAPI\\FontCrea.c

See also: ChooseFont()

--------------------------------------------------------------------------------
CreateHatch() Creates a brush with the specified hatched pattern
--------------------------------------------------------------------------------

Syntax: CreateHatch( <nStyle>, <nRGBColor> ) --> <hBrush>

This function creates a brush that has the specified


hatched pattern and color. The brush can be subsequently
be selected as the current brush for any device.

Parameters:

<nStyle> nStyle specifies the hatch style of the brush. This


parameter can be one of the following values:

Value Meaning

HS_BDIAGONAL 45-degree upward hatch (left to right)


HS_CROSS Horizontal and vertical crosshatch
HS_DIAGCROSS 45-degree crosshatch
HS_FDIAGONAL 45-degree downward hatch (left to right)
HS_HORIZONTAL Horizontal hatch
HS_VERTICAL Vertical hatch

<nRGBColor> specifies the foreground color of the brush (the color


of the hatches).

Returns:

<hBrush> The return value is the handle of the brush if the


function is successful. Otherwise, it is NULL.

Observations: When an application has finished using the brush


created by the CreateHatchBrush function, it should
select the brush out of the device context and then
delete it by using the DeleteObject function.

Source code: Not provided.

See also: CreatePatternBrush()

--------------------------------------------------------------------------------
CreatePattern() Creates a brush with the specified pattern bitmap
--------------------------------------------------------------------------------

Syntax: CreatePattern( <hBitmap> ) --> <hBrush>

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


This function creates a brush whose pattern is
specified by a bitmap. The brush can be subsequently
be selected for any device that support raster
operations.

Parameters:

<hBitmap> Identifies the bitmap.

Returns:

<hBrush> The handle of the brush. It returns 0 if it was


not possible to create it.

Source code: SOURCE\\WINAPI\\CreatePa.c

See also: CreateHatchBrush()

--------------------------------------------------------------------------------
CreatePen() Creates a pen with the specified style, width & color
--------------------------------------------------------------------------------

Syntax: CreatePen( <nStyle>, <nWidth>, <nRGBColor> )


--> <hPen>

This function creates a pen having the specified


style, width and color. The pen can be subsequently
be selected as the current pen for any device.

Parameters:

<nStyle> Specifies the pen style. This parameter can be one


of the following values:

PS_SOLID Creates a solid pen.


PS_DASH Creates a dashed pen. (Valid only when the
pen width is 1.)
PS_DOT Creates a dotted pen. (Valid only when the
pen width is 1.)
PS_DASHDOT Creates a pen with alternating dashes and
dots. (Valid only when the pen width is 1.)
PS_DASHDOTDOT Creates a pen with alternating dashes
and double dots. (Valid only when the pen
width is 1.)
PS_NULL Creates a null pen.
PS_INSIDEFRAME Creates a pen that draws a line inside
the frame of closed shapes produced by
graphics device interface (GDI) output
functions that specify a bounding rectangle
(for example, the Ellipse, Rectangle,
RoundRect, Pie, and Chord functions). When
this style is used with GDI output functions
that do not specify a bounding rectangle
(for example, the LineTo function), the
drawing area of the pen is not limited by a
frame.

<nWidth> Specifies the width, in logical units, of the pen. If


this value is zero, the width in device units is
always one pixel, regardless of the mapping mode.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<nRGBColor> Specifies the color of the pen.

Returns:

<hPen> The handle of the brush or 0 if it was not possible


to create it.

Sample: SAMPLES\\TestRpt5.prg

Source code: SOURCE\\WINAPI\\CreatePe.c

See also: See TPen Class and Pen xBase commands.

--------------------------------------------------------------------------------
CreateSolidBrush() Creates a brush that has a specified solid color
--------------------------------------------------------------------------------

Syntax: CreateSolidBrush( <nRGBColor> ) --> <hBrush>

This function creates a brush that has the specified


color in nRGBColor. The brush can be subsequently be
selected as the current brush for any device.

This functions are automatically called from FiveWin


TBrush class. Use the class as it is much more
easy to use.

Parameters:

<nRGBColor> Specifies a RGB color.

Returns:

<hBrush> The handle of the brush or 0 if it not was possible


to create it.

Source code: SOURCE\\WINAPI\\CreateSo.c

See also: Class TBrush and Brushes xBase commands.

--------------------------------------------------------------------------------
CreateWindow() Creates an overlapped, pop-up or child window
--------------------------------------------------------------------------------

Syntax: CreateWindow( <cClassName>, <cTitle>, <nStyle>,


<nLeft>, <nTop>, <nWidth>, <nHeight>,
<hWndOwner>, <hMenu>, <cExtraData> )
--> <hWnd>

This function creates a window. It is used from


inside FiveWin TWindow Class. Use Classes as they
much more powerful and easy to manage.

Parameters:

<cClassName> The name of the class of the window. This


class it is not related to an 5W oops class, but
to a windows api own identification.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<cTitle> The title or the caption of the window.

<nStyle> Specifies the style of the window being created.

<nLeft>, <nTop> The coordinates and dimensions of the window.


<nWidth>, <nHeight>

<hWndOwner> The handle of the window owner (if any) of the new
window.

<hMenu> The handle of its PullDown menu.

<cExtraData> Some extra data sometimes required.

Returns:

<hWnd> The handle of the just created window.

Sample: See SOURCE\\CLASSES\\Window.prg for a sample of


how FiveWin uses this function.

Source code: SOURCE\\WINAPI\\CreateWn.c

See also: TWindow Class and Window creation xBase commands

--------------------------------------------------------------------------------
CursorArrow() Select the Windows default arrow cursor
--------------------------------------------------------------------------------

Syntax: CursorArrow() --> nil

This function changes the mouse cursor to the


traditional arrow in window.

Parameters: None.

Returns: Nothing.

Sample: SAMPLES\\TestCurs.prg

Source code: SOURCE\\WINAPI\\Cursors.c

See also: CursorWait() CursorHand() CursorCatch() CursorWE()


CursorIbeam() CursorSize()

--------------------------------------------------------------------------------
CursorCatch() Selects the FiveWin hand catching cursor
--------------------------------------------------------------------------------

Syntax: CursorCatch() --> nil

This function changes the mouse cursor into a


hand in a catching position.

Parameters: None.

Returns: Nothing.

Observations: These functions let us change the mouse cursor just

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


temporarily while we are doing other tasks. As
soon as the API takes the control it will restore
the mouse cursor to the one associated to the window
which is below the cursor.

Sample: SAMPLES\\TestCurs.prg

Source code: SOURCE\\WINAPI\\Cursors.c

See also: CursorWait() CursorHand() CursorArrow() CursorWE()


CursorIbeam() CursorSize()

--------------------------------------------------------------------------------
CursorHand() Selects the FiveWin hand cursor
--------------------------------------------------------------------------------

Syntax: CursorHand() --> nil

This function changes the mouse cursor into a


hand in a pointing position.

Parameters: None.

Returns: Nothing.

Observations: These functions let us change the mouse cursor just


temporarily while we are doing other tasks. As
soon as the API takes control it will restore
the mouse cursor to the one associated with the window
which is below the cursor.

Sample: SAMPLES\\TestCurs.prg

Source code: SOURCE\\WINAPI\\Cursors.c

See also: CursorWait() CursorCatch() CursorArrow() CursorWE()


CursorIbeam() CursorSize()

--------------------------------------------------------------------------------
CursorIbeam() Selects the Windows default IBeam cursor
--------------------------------------------------------------------------------

Syntax: CursorIbeam() --> nil

This function changes the mouse cursor into a


hand in an 'ibeam' shape. (the one that we see
when the mouse goes over a GET).

Parameters: None.

Returns: Nothing.

Observations: These functions let us change the mouse cursor


temporarily while we are doing other tasks. As
soon as the API takes control it will restore
the mouse cursor to the one associated with the window
which is below the cursor.

Sample: SAMPLES\\TestCurs.prg

Source code: SOURCE\\WINAPI\\Cursors.c

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


See also: CursorWait() CursorCatch() CursorArrow() CursorWE()
CursorHand() CursorSize()

--------------------------------------------------------------------------------
CursorSize() Selects the Windows default Size cursor
--------------------------------------------------------------------------------

Syntax: CursorSize() --> nil

This function changes the mouse cursor into a


hand in a 'resize' shape. (the one that we see
when the mouse resizes a window).

Parameters: None.

Returns: Nothing.

Observations: These functions let us change the mouse cursor


temporarily while we are doing other tasks. As
soon as the API takes control it will restore
the mouse cursor to the one associated with the window
which is below the cursor.

Sample: SAMPLES\\TestCurs.prg

Source code: SOURCE\\WINAPI\\Cursors.c

See also: CursorWait() CursorCatch() CursorArrow() CursorWE()


CursorHand() CursorIbeam()

--------------------------------------------------------------------------------
CursorWait() Selects the Windows default wait cursor
--------------------------------------------------------------------------------

Syntax: CursorWait() --> nil

This function changes the mouse cursor into a


waiting sand-clock (the one that we see
when windows is processing).

Parameters: None.

Returns: Nothing.

Observations: These functions let us change the mouse cursor


temporarily while we are doing other tasks. As
soon as the API takes control it will restore
the mouse cursor to the one associated with the window
which is below the cursor.

Sample: SAMPLES\\TestCurs.prg

Source code: SOURCE\\WINAPI\\Cursors.c

See also: CursorSize() CursorCatch() CursorArrow() CursorWE()


CursorHand() CursorIbeam()

--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


CursorWE() Selects the Windows default WE cursor
--------------------------------------------------------------------------------

Syntax: CursorWE() --> nil

This function changes the mouse cursor into a


horizontal arrow (the one that we see
when windows is resizing horizontally).

Parameters: None.

Returns: Nothing.

Observations: These functions let us change the mouse cursor


temporarily while we are doing other tasks. As
soon as the API takes control it will restore
the mouse cursor to the one associated with the window
which is below the cursor.

Sample: SAMPLES\\TestCurs.prg

Source code: SOURCE\\WINAPI\\Cursors.c

See also: CursorSize() CursorCatch() CursorArrow() CursorWait()


CursorHand() CursorIbeam()

--------------------------------------------------------------------------------
cValToChar() Converts any value into a string
--------------------------------------------------------------------------------

Syntax: cValToChar( <uValue> ) --> <cValue>

This function converts a value of any type into


its equivalent character expression.

This function is coded in C language and it is


extremely fast.

Parameters:

<uValue> It may be any value except an array or an Object.

Returns:

<cValue> A string with the character expression of


<uValue>

Sample: ? cValToChar( 123 ) --> "123"

Source code: Not provided.

--------------------------------------------------------------------------------
DDEAck() DDE Acknowledge FiveWin management function
--------------------------------------------------------------------------------

Syntax: DDEAck( <hWndServer>, <nExtraData> ) --> nil

This is a FiveWin internal function for DDE support.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Use FiveWin DDE classes and xBase commands as they
are much easier to use and more powerful.

Parameters:

<hWndServer> The handle of the window which it is acting


as a server in a DDE conversation.

<nExtraData> Some extra data sometimes required.

Returns: Nothing.

Sample: SAMPLES\\TestDDE.prg DDEClien.prg DDEServe.prg

Source code: SOURCE\\CLASSES\\TDDE.prg

See also: DDeCommand() DdeGetCommand() DdeTerminate()

--------------------------------------------------------------------------------
DDECommand() DDE command FiveWin management function
--------------------------------------------------------------------------------

Syntax: DDECommand( <cDDECommand> ) --> <pGlobalMemory>

This is a FiveWin internal function for DDE support.

Use FiveWin DDE classes and xBase commands as they


are much easier to use and more powerful.

Parameters:

<cDDECommand> A character expression that holds the


DDE order we want to process.

Returns:

<pGlobalMemory> A numeric value which holds the pointer of


a global memory to be supplied to DDE services.

Sample: SAMPLES\\TestDDE.prg DDEClien.prg DDEServe.prg

Source code: SOURCE\\WINAPI\\DDE.c

See also: DDeCommand() DdeGetCommand() DdeTerminate()

--------------------------------------------------------------------------------
DDEGetCommand() DDE GetCommand FiveWin management function
--------------------------------------------------------------------------------

Syntax: DDEGetCommand( <pGlobalMemory> ) --> <cDDECommand>

This is a FiveWin internal function for DDE support.

Use FiveWin DDE classes and xBase commands as they


are much easier to use and more powerful.

Parameters:

<pGlobalMemory> A numeric value which holds the pointer of

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


a global memory to be supplied to DDE services.

Returns:

<cDDECommand> A character expression that holds the


DDE order we want to process.

Sample: SAMPLES\\TestDDE.prg DDEClien.prg DDEServe.prg

Source code: SOURCE\\WINAPI\\Ddexc.c

See also: DDeCommand() DdeGetCommand() DdeTerminate()

--------------------------------------------------------------------------------
DDETerminate() DDE Terminate FiveWin management function
--------------------------------------------------------------------------------

Syntax: DDETerminate( <hWndServer> ) --> nil

Called when a DDE conversation has finished.

This is a FiveWin internal function for DDE support.

Use FiveWin DDE classes and xBase commands as they


are much easier to use and more powerful.

Parameters:

<hWndServer> The handle of the window which it is acting


as a server in a DDE conversation.

Returns: nothing

Observations:

Sample: SAMPLES\\TestDDE.prg DDEClien.prg DDEServe.prg

Source code: SOURCE\\CLASSES\\TDDE.prg

See also: DDeCommand() DdeGetCommand() DdeTerminate()

--------------------------------------------------------------------------------
Decrypt() Decrypts a string with an optional key
--------------------------------------------------------------------------------

Syntax: Decrypt( <cEncryptedText> [, <cKey> ] )


--> <cDecryptedText>

Parameters:

<cEncryptedText> It is the text to decrypt.

<cKey> It is an optional text key to use it


to generate a personalized decrypted text.

Returns:

<cDecryptedText> The resulted decrypted text.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Source code: Not provided.

See also: Encrypt()

--------------------------------------------------------------------------------
DelDbfMdx() Resets the MDX file existence at a DBFMDX Dbf file
--------------------------------------------------------------------------------

Syntax: DelDbfMdx( <cDbfFileName> ) --> <lSuccess>

Parameters:

<cDbfFileName> The name of the DBF file to reset its MDX flag.

Returns:

<lSuccess> A logical value indicating if the operation


was successful.

Observations: This function has been created to be able to


reindex from scratch a MDX file (as a MDX index
would never be reindexed as it gets corrupted!).

The steps to follow are:

1. Close the DBF file.


2. Erase the MDX file.
3. Call DelDbfMdx( <cDbfFileName> )
4. Open the DBF file in anormal way.
5. Index it.

Source code: SOURCE\\FUNCTION\\NtxTools.c

See also: cNtxPos() cNtxKey()

--------------------------------------------------------------------------------
DeleteDC() Deletes the given device context
--------------------------------------------------------------------------------

Syntax: DeleteDC( <hDC> ) --> <lSuccess>

This function destroys the given device context.

Parameters:

<hDC> The handle of the device context

Returns:

<lSuccess> A logical value indicating if the operation


was successful.

Observations: This function must only be used to destroy device


contexts created with CreateDC() and never with
GetDC().

Source code: SOURCE\\WINAPI\\dc.c

See also: CreateDC() GetDC() ReleaseDC()

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
DeleteObject() Deletes an object from memory freeing all resources
--------------------------------------------------------------------------------

Syntax: DeleteObject( <hGDIObject> ) --> <lSuccess>

This function deletes a GDI object from memory,


freeing all system storage associated (objects
include pens, brushes, fonts, bitmaps, regions,
and palettes).

Parameters:

<hGDIObject> The handle of the GDI object, obtained with


its corresponding creating function.

Returns:

<lSuccess> A logical value indicating if the operation was


successful.

Observations: FiveWin internally implements a resources control


system in order to avoid and control the problems
related with system resources losing.

Source code: SOURCE\\WINAPI\\delobjec.c

See also: SelectObject()

--------------------------------------------------------------------------------
DestroyCursor() Destroys a cursor created with Create... or Load...
--------------------------------------------------------------------------------

Syntax: DestroyCursor( <hCursor> ) --> <lSuccess>

This function destroys a cursor that was previously


created by the CreateCursor() or LoadCursor() function
and frees any memory that the cursor occupied.

Parameters:

<hCursor> Identifies the cursor to be destroyed. The cursor


must not be in current use.

Returns:

<lSuccess> A logical value indicating if the operation was


successful.

Source code: SOURCE\\WINAPI\\Cursors.c

See also: CreateCursor() LoadCursor()

--------------------------------------------------------------------------------
DestroyWindow() Destroys the specified window
--------------------------------------------------------------------------------

Syntax: DestroyWindow( <hWnd> ) --> <lSuccess>

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


The DestroyWindow function destroys the specified
window. The function sends appropriate messages to the
window to deactivate it and remove the input focus. It
also destroys the window's menu, flushes the
application queue, destroys outstanding timers,
removes clipboard ownership, and breaks the
clipboard-viewer chain (if the window is at the top of
the viewer chain).

It sends WM_DESTROY and WM_NCDESTROY messages to the


window. If the given window is the parent of any
windows, DestroyWindow automatically destroys these
child windows when it destroys the parent window. The
function destroys child windows first, and then the
window itself.

The DestroyWindow function also destroys modeless


dialog boxes created by the CreateDialog function.

FiveWin manages all these functions through Classes.


Use FiveWin Classes as they are much easier to use and
more powerful.

Parameters:

<hWnd> The handle of the window to be destroyed.

Returns:

<lSuccess> A logical value indicating if the operation was


successful.

Source code: SOURCE\\WINAPI\\WndDestr.c

See also: CreateWindow()

--------------------------------------------------------------------------------
DialogBox() Creates a modal dialog box from resources
--------------------------------------------------------------------------------

Syntax: DialogBox( <hInstance>, <cTemplate>, <hWndOwner> )


--> nResult

This function creates and executes a Modal DialogBox


from a Dialog Box template resource.

Parameters:

<hInstance> Identifies an instance of the module whose executable


file contains the dialog box template. FiveWin supplies
a GetResources() function that returns the Instance
of the EXE or the handle of the resources DLL in use.

<cTemplateName> The name given to the DialogBox template in the


resources.

<hWndOwner> The handle of the window which is the owner of the


DialogBox. By default it is GetActiveWindow().

Returns:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<nResult> The parameter supplied to the function
EndDialog() used to terminate the execution of the
Dialog Box.

Observations: Use FiveWin Classes and xBase commands. They are


much more powerful and easy to manage.

Source code: Not provided. See SOURCE\\WINAPI\\Dlogbox.c

See also: EndDialog() CreateDlg() CreateDlgI()


DialogBoxIndirect()

--------------------------------------------------------------------------------
DialogBoxIndirect() Creates a modal dialog box from memory resources
--------------------------------------------------------------------------------

Syntax: DialogBoxIndirect( <hInstance>, <cMemTemplate>,


<hWndOwner> ) --> <nResult>

This function creates and executes a Modal DialogBox


from a Dialog Box template resource.

Parameters:

<hInstance> Identifies an instance of the module whose executable


file contains the dialog box template. FiveWin supplies
a GetResources() function that returns the Instance
of the EXE or the handle of the resources DLL in use.

<cMemTemplate> A string that contains the binary description


of the Dialog Box template.

<hWndOwner> The handle of the window which is the owner of the


DialogBox. By default it is GetActiveWindow().

Returns:

<nResult> The parameter supplied to the function


EndDialog() used to terminate the execution of the
Dialog Box.

Observations: Use FiveWin Classes and xBase commands. They are


much more powerful and easy to manage.

Source code: Not provided. See SOURCE\\WINAPI\\Dlogbox.c

See also: EndDialog() CreateDlg() CreateDlgI()


DialogBox()

--------------------------------------------------------------------------------
DibDraw() FiveWin DIB drawing function
--------------------------------------------------------------------------------

Syntax: DibDraw( hDC, hMemBitmap, hPalette, nRow, nCol,


nWidth, nHeight ) --> lSuccess

This function draws a DIB (device independent bitmap)


on the device context specified by hDC

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Parameters:

<hDC> The handle of the device context to use.

<hMemBitmap> The handle of the DIB.

<hPalette> The handle of the palette associated to the


DIB.

<nRow>, <nCol> The coordinates in pixels where start drawing.

<nWidth>, <nHeight> The dimensions for drawing the DIB.

Returns:

<lSuccess> A logical value indicating if the operation was


successful.

Observations: When we started building FiveWin we first started


working with bitmaps. Later we discovered that the
general recommendation was to work with DIBs. So
we developed all the necessary functions to work
with DIBs. As our own experience increased, we believe
that there is a better way (a mixture of both) that was
much faster and easier.

We did a lot of different tests, and our system


was by far the fastest. It was a reason based on
speed and ease of use, because we wanted FiveWin to
be extremely fast! <g>

This later system is the one we currently use in


FiveWin, though we do give support for both Bitmaps
and DIBs.

You don't have to worry at all, just use FiveWin


TBitmap Class and place yourself at the
xBase & OOP level to get the maximum productivity.

Concentrate on your application, don't lose yourself


in details!

Source code: SOURCE\\WINAPI\\Dib.c

See also: DibRead() DibPalette() DibWidth() DibHeight()


DibWrite()

--------------------------------------------------------------------------------
DibFromBitmap() Creates a DIB from a bitmap
--------------------------------------------------------------------------------

Syntax: DibFromBitmap( <hBitmap>, <hPalette> ) --> <hDIB>

This function creates a DIB from a Bitmap and its


associated palette.

Parameters:

<hBitmap> The handle of the bitmap to convert into a

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


DIB.

<hPalette> The handle of the palette associated to


the bitmap.

Returns:

<hDIB> The handle of the new DIB. (DIB = Device


independent bitmap).

Observations: We strongly recommend you to use TBitmap Class


for managing bitmaps. FiveWin process all that
you need automatically.

Source code: Not provided. See SOURCE\\WINAPI\\Dib.c

See also: DibRead() DibPalette() DibWidth() DibHeight()


DibWrite()

--------------------------------------------------------------------------------
DibHeight() Returns the height of a DIB
--------------------------------------------------------------------------------

Syntax: DibHeight( <hDib> ) --> <nHeight>

This function returns the height in pixels of a


DIB.

Parameters:

<hDIB> The handle of the new DIB. (DIB = Device


independent bitmap).

Returns:

<nHeight> The height of the DIB expressed in pixels.

Observations: We strongly recommend you to use TBitmap Class


for managing bitmaps. FiveWin process all that
you need automatically.

Source code: SOURCE\\WINAPI\\Dib.c

See also: DibRead() DibPalette() DibWidth() DibHeight()


DibWrite()

--------------------------------------------------------------------------------
DibPalette() Returns the palette handle of a DIB
--------------------------------------------------------------------------------

Syntax: DibPalette( <hDIB> ) --> <hPalette>

This function retrieves the handle of the palette


associated to the DIB.

Parameters:

<hDIB> The handle of the new DIB. (DIB = Device


independent bitmap).

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Returns:

<hPalette> The handle of the palette associated with


the bitmap.

Observations: We strongly recommend you to use TBitmap Class


for managing bitmaps. FiveWin process all that
you need automatically.

Source code: SOURCE\\WINAPI\\Dib.c

See also: DibRead() DibPalette() DibWidth() DibHeight()


DibWrite()

--------------------------------------------------------------------------------
DibRead() Reads a DIB from disk
--------------------------------------------------------------------------------

Syntax: DibRead( <cBitmapFile> ) --> <hDIB>

This function generates a DIB in memory reading


it from a file .BMP in disk.

Parameters:

<cBitmapFile> The filename of the BMP file in disk.

Returns:

<hDIB> The handle of the new DIB. (DIB = Device


independent bitmap).

Observations: We strongly recommend you to use TBitmap Class


for managing bitmaps. FiveWin process all that
you need automatically.

Source code: SOURCE\\WINAPI\\Dib.c

See also: DibRead() DibPalette() DibWidth() DibHeight()


DibWrite()

--------------------------------------------------------------------------------
DibWidth() Returns the width of a DIB
--------------------------------------------------------------------------------

Syntax: DibWidth( <hDib> ) --> <nWidth>

This function returns the width in pixels of a DIB.

Parameters:

<hDIB> The handle of the new DIB. (DIB = Device


independent bitmap).
Returns:

<nWidth> The width of the DIB expressed in pixels.

Observations: We strongly recommend you to use TBitmap Class

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


for managing bitmaps. FiveWin process all that
you need automatically.

Source code: SOURCE\\WINAPI\\Dib.c

See also: DibRead() DibPalette() DibWidth() DibHeight()


DibWrite()

--------------------------------------------------------------------------------
DibWrite() Saves a DIB to disk
--------------------------------------------------------------------------------

Syntax: DibWrite( <cBMPFileName>, <hDIB> ) --> <lSuccess>

This function generates a BMP file in disk from


a DIB in memory.

Parameters:

<cBMPFileName> The name of the BMP file to generate in disk.

<hDIB> The handle of the DIB in memory.

Observations: We strongly recommend you to use TBitmap Class


for managing bitmaps. FiveWin process all that
you need automatically.
Returns:

<lSuccess> A logical value indicating if the operation was


successful.

Source code: SOURCE\\WINAPI\\Dib.c

See also: DibRead() DibPalette() DibWidth() DibHeight()


DibWrite()

--------------------------------------------------------------------------------
DPToLP() Converts device coordinates into logical coordinates
--------------------------------------------------------------------------------

Syntax: DPToLP( <hDC>, <aPoint> ) --> <lSuccess>

This function converts device coordinates into


logical coordinates.

The result is stored again into the same aPoint


array.

Parameters:

<hDC> The handle of the device context.

<aPoint> An array of two values { x, y } representing


the coordinate.

Returns:

<lSuccess> If the operation was successful.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Source code: SOURCE\\WINAPI\\Point.c

See also: LPToDP()

--------------------------------------------------------------------------------
DrawBitmap() FiveWin drawing bitmaps 16 colors function
--------------------------------------------------------------------------------

Syntax: DrawBitmap( <hDC>, <hBitmap>, <nRow>, <nCol>,


<nWidth>, <nHeight>, <nRaster> )
--> nil

This function draws a bitmap (16 colors or 256


colors without palette control) onto the specified
device context.

Parameters:

<hDC> The handle of the device context.

<hBitmap> The handle of the bitmap.

<nRow>, <nCol> The coordinates where to draw.


<nWidth>, <nHeight> The dimensions to adjust the bitmap.

<nRaster> A raster operation style, as follows:

BLACKNESS Turns all output black.


DSTINVERT Inverts the destination bitmap.
MERGECOPY Combines the pattern and the source
bitmap by using the Boolean AND
operator.
MERGEPAINT Combines the inverted source bitmap
with the destination bitmap by using
the Boolean OR operator.
NOTSRCCOPY Copies the inverted source bitmap to
the destination.
NOTSRCERASE Inverts the result of combining the
destination and source bitmaps by
using the Boolean OR operator.
PATCOPY Copies the pattern to the destination
bitmap.
PATINVERT Combines the destination bitmap with
the pattern by using the Boolean XOR
operator.
PATPAINT Combines the inverted source bitmap
with the pattern by using the Boolean
OR operator. Combines the result of
this operation with the destination
bitmap by using the Boolean OR operator.
SRCAND Combines pixels of the destination and
source bitmaps by using the Boolean
AND operator.

SRCCOPY Copies the source bitmap to the


destination bitmap.
SRCERASE Inverts the destination bitmap and
combines the result with the source
bitmap by using the Boolean AND
operator.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


SRCINVERT Combines pixels of the destination and
source bitmaps by using the Boolean
XOR operator.
SRCPAINT Combines pixels of the destination and
source bitmaps by using the Boolean OR
operator.
WHITENESS Turns all output white.

Returns: Nothing

Observations: We strongly recommend use of the FiveWin TBitmap Class,


as it is much easier to use and more powerful.

Sample: SAMPLES\\Install.prg

Source code: SOURCE\\WINAPI\\BmpDraw.c

See also:

--------------------------------------------------------------------------------
DrawIcon() Draws an Icon
--------------------------------------------------------------------------------

Syntax: DrawIcon( <hDC>, <nRow>, <nCol>, <hIcon> ) -->


<lSuccess>

This function draws an icon at the specified device


context.

Parameters:

<hDC> The handle of the device context where to draw.

<nRow>, <nCol> The coordinates where to paint.

<hIcon> The handle of the icon.

Returns:

<lSuccess> A logical value that it is true if the operation


was successful.

Observations: The handle of the icon must be loaded with LoadIcon()

We strongly recommend use of FiveWin TIcon Class


as it is much more powerful and easy to use.

Source code: SOURCE\\WINAPI\\Icons.c

See also: LoadIcon() ExtractIcon() nIcons()

--------------------------------------------------------------------------------
DrawText() Draws formatted text into a given rectangle
--------------------------------------------------------------------------------

Syntax: DrawText( <hDC>, <cText>, <aRect>, <nStyle> )


--> <nTextHeight>

This function draws formatted text into the given

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


rectangle. It formats text by expanding tabs into
appropriate spaces, aligning text to the left, right,
or center of the rectangle, and breaking text into
lines that fit within the rectangle.

The DrawText function uses the device context's


selected font, text color, and background color to draw
the text. Unless the DT_NOCLIP format is specified,
DrawText clips the text so that the text does not
appear outside the given rectangle. All formatting is
assumed to have multiple lines unless the
DT_SINGLELINE format is specified.

Parameters:

<hDC> The handle of the device context where


to paint.

<cText> The string to draw.

<aRect> A Clipper array of four elements:

{ nTop, nLeft, nBottom, nRight }

<nStyle> The style to use for drawing the text:

DT_BOTTOM Specifies bottom-aligned text. This


value must be combined with DT_SINGLELINE.
DT_CALCRECT Determines the width and height of the
rectangle. If there are multiple lines of
text, DrawText will use the width of the
rectangle pointed by aRect and extend the
base of the rectangle to bound the last
line of text. If there is only one line of
text, DrawText will modify the right side
of the rectangle so that it bounds the
last character in the line. In either case,
DrawText returns the height of the
formatted text but does not draw the text.
DT_CENTER Centers text horizontally.
DT_EXPANDTABS Expands tab characters. The default
number of characters per tab is eight.

DT_EXTERNALLEADING Includes the font external leading


in line height. Normally, external leading
is not included in the height of a line of
text.
DT_LEFT Left-aligns text.
DT_NOCLIP Draws without clipping. DrawText is
somewhat faster when DT_NOCLIP is used.
DT_NOPREFIX Turns off processing of prefix characters.
Normally, DrawText interprets the mnemonic
& as a directive to underscore the
character that follows, and the mnemonic
&& as a directive to print a single &. By
specifying DT_NOPREFIX, this processing is
turned off.

DT_RIGHT Right-aligns text.


DT_SINGLELINE Specifies single line only. Carriage

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


returns and line-feeds do not break the
line.
DT_TABSTOP Sets tab stops. The high-order byte of
the fuFormat parameter is the number of
characters for each tab. The default number
of characters per tab is eight.
DT_TOP Specifies top-aligned text (single line
only).
DT_VCENTER Specifies vertically centered text (single
line only).
DT_WORDBREAK Specifies word breaking. Lines are
automatically broken between words if a
word would extend past the edge of the
rectangle specified by aRect parameter.
A carriage return/line-feed sequence will
also break the line.

Note that the DT_CALCRECT, DT_EXTERNALLEADING,


DT_INTERNAL, DT_NOCLIP, and DT_NOPREFIX
values cannot be used with the DT_TABSTOP
value.

#define DT_TOP 0 // 0x0000


#define DT_LEFT 0 // 0x0000
#define DT_CENTER 1 // 0x0001
#define DT_RIGHT 2 // 0x0002
#define DT_VCENTER 4 // 0x0004
#define DT_BOTTOM 8 // 0x0008
#define DT_WORDBREAK 16 // 0x0010
#define DT_SINGLELINE 32 // 0x0020
#define DT_EXPANDTABS 64 // 0x0040
#define DT_TABSTOP 128 // 0x0080
#define DT_NOCLIP 256 // 0x0100
#define DT_EXTERNALLEADING 512 // 0x0200
#define DT_CALCRECT 1024 // 0x0400
#define DT_NOPREFIX 2048 // 0x0800
#define DT_INTERNAL 4096 // 0x1000

Returns:

<nTextHeight> Specifies the height of the text if the function


is successful.

Source code: SOURCE\\WINAPI\\Text.c

See also: TextOut() ExtTextOut()

--------------------------------------------------------------------------------
Ellipse() Draws an ellipse
--------------------------------------------------------------------------------

Syntax: Ellipse( <hDC>, <nLeft>, <nTop>, <nRight>, <nBottom> )


--> <lSuccess>

This function draws an ellipse inside the specified


rectangle coordinates. It uses the currently selected
pen and brush in the device context of the paint area.

Parameters:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<hDC> The handle of the device context.

<nLeft>, <nTop> Are the coordinates of the bounding rectangle of the


<nRight>, <nBottom> ellipse.

Returns:

<lSuccess> A logical value true if the operation was successful.

Source code: SOURCE\\WINAPI\\Ellipse.c

See also: Chord() DrawFocusRect() Pie() Polygon() PolyPoligon()


Rectangle() RoundRect()

--------------------------------------------------------------------------------
EmptyClipboard() Empties the clipboard
--------------------------------------------------------------------------------

Syntax: EmptyClipboard() --> <lSuccess>

This function empties the clipboard and frees


data handles in the clipboard. It then assigns
ownership of the clipboard to the window that
currently has the clipboard open.

Parameters: None.

Returns:

<lSuccess> A logical value true if the operation was


successful.

Observations: The clipboard must be open when this function


is called.

Source code: SOURCE\\WINAPI\\ClpBrd.c

See also: OpenClipboard() SetClipboard() EmptyClipboard()


GetClpData()

--------------------------------------------------------------------------------
EnableWindow() Enables or disables mouse and keyboard activity
--------------------------------------------------------------------------------

Syntax: EnableWindow( <hWnd>, <lEnable> ) --> <lSuccess>

This function enables or disables mouse and


keyboard input to the given function or control.
When input is disabled, the window ignores input
such as mouse clicks and key presses. When input
is enabled, the window processes all input.

Parameters:

<hWnd> The handle of the window or control.


In FiveWin: oWnd:hWnd.

<lEnable> A logical value indicating if perform an enable or


disable operation.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Returns:

<lSuccess> A logical value true if the operation was


successful.

Source code:

See also: TWindow:Enable() TWindow:Disable() IsWindowEnabled()

--------------------------------------------------------------------------------
Encrypt() Encrypts a string with an optional key
--------------------------------------------------------------------------------

Syntax: Encrypt( <cText> [, <cKey> ] )


--> <cEncryptedText>

Parameters:

<cText> It is the text to encrypt.

<cKey> It is an optional text key to use it


to generate a personalized encrypted text.

Returns:

<cEncryptedText> The resulted encrypted text.

Source code: Not provided.

See also: Decrypt()

--------------------------------------------------------------------------------
EndDialog() Finish a modal DialogBox
--------------------------------------------------------------------------------

Syntax: EndDialog( <hWndDlg>, <nResult> ) --> nil

This function hides a modal DialogBox and causes


the DialogBox function to return.

Parameters:

<hWndDlg> The handle of the DialogBox to end.

<nResult> nResult is a numeric value that will be returned


by DialogBox() or DialogBoxIndirect() functions.

Returns: Nothing.

Source code: Not provided. See SOURCE\\WINAPI\\DlogBox.c

See also: DialogBox() DialogBoxIndirect()

--------------------------------------------------------------------------------
EndPage() Ends printing a page
--------------------------------------------------------------------------------

Syntax: EndPage( <hDC> ) --> <nReturnCode>

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


This function signals the device context that the
application has finished writing to a page. Normally
we use this function to start working on a new page.

Parameters:

<hDC> The handle of the device context.

Returns:

<nReturnCode> The result of the operation.

SP_ERROR General error.


SP_APPABORT Job was terminated because the
application's print-canceling function
returned zero.
SP_USERABORT User terminated the job by using
Windows Print Manager (PRINTMAN.EXE).
SP_OUTOFDISK Not enough disk space is currently
available for spooling, and no more
space will become available.
SP_OUTOFMEMORY Not enough memory is available for
spooling.

Source code: SOURCE\\WINAPI\\PrintDc.c

See also: StartPage()

--------------------------------------------------------------------------------
EndPaint() Ends painting a window
--------------------------------------------------------------------------------

Syntax: EndPaint( <hWnd>, <cPS> ) --> nil

This function marks the end of painting for the


given window. This function is required for
each BeginPaint() but only after painting is
complete.

Parameters:

<hWnd> The handle of the window that is being


currently painted.

<cPS> A string that hold relevant information


about the painting process. (it holds a
PAINTSTRUCT structure).

Returns: Nothing.

Source code: SOURCE\\WINAPI\\Paint.c

See also: BeginPaint()

--------------------------------------------------------------------------------
ExitWindowsExec() Exit Windows, runs a MsDos program, and restart windows
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Syntax: ExitWindowsExec( <cExeName>, <cParams> ) -->
<lSuccess>

Parameters:

<cExeName> Identifies the MsDos EXE to execute. For batch


files, it is the path of the command.com.

<cParams> Identifies the parameters to supply to the


MsDos app. For a batch file you have to
include '/c':

"/c batfile.bat"
Returns:

<lSuccess> A logical value indicating that the operation


was completed successfully.

Source code: SOURCE\\WINAPI\\WinExec.c

--------------------------------------------------------------------------------
ExtractIcon() Retrieves an icon handle from EXE, DLL or ICO
--------------------------------------------------------------------------------

Syntax: ExtractIcon( <cExeName>, <nIndex>)


--> <hIcon>

This function retrieves the handle of an icon from


a specified executable file, dynamic-link library
(DLL) or icon file.

Parameters:

<cExeName> The name of the EXE, DLL or ICO file.

<nIndex> Specifies the index of the icon to be retrieved,


from the total number of icons inside the module.
If 0 is specified the first icon is returned.
If -1 is specified the total number of icons is
returned.

Returns:

<hIcon> The handle of the icon. It is 0 if the


operation was not successful.

Sample: See IDE\\SOURCE\\Icons.prg

Source code: SOURCE\\WINAPI\\Icons.c

See also: LoadIcon() DrawIcon() nIcons()

--------------------------------------------------------------------------------
ExtTextOut() Writes a character string into a rectangular region
--------------------------------------------------------------------------------

Syntax: ExtTextOut( <hDC>, <nRow>, <nCol>, <aRect>, <cText> )


--> <lSucess>

This function writes a character string within a

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


rectangular region, using the currently selected
font.

Parameters:

<hDC> The handle of the device context.

<nRow>, <nCol> The coordinates where to paint inside the rect


specified in aRect.

<aRect> A 4 elements Clipper array, representing a rect:

nTop, nLeft, nBottom, nRight

<cText> The text to draw.

Returns:

<lSuccess> A logical value indicating if the operation was


successful.

Source code: SOURCE\\WINAPI\\Text.c

See also: TextOut() DrawText()

--------------------------------------------------------------------------------
FillRect() Fills a given rectangle with a specified brush
--------------------------------------------------------------------------------

Syntax: FillRect( <hDC>, <aRect>, <hBrush> ) --> nil

This function fills a rect with the specified brush.

Parameters:

<hDC> The handle of the device context.

<aRect> A 4 element Clipper array, representing a rect:

nTop, nLeft, nBottom, nRight

<hBrush> The handle of a brush.

Returns: Nothing.

Source code: SOURCE\\WINAPI\\Rects.c

See also: GetClientRect() GetWndRect() InvertRect()

--------------------------------------------------------------------------------
FloodFill() Fills an area of the screen
--------------------------------------------------------------------------------

Syntax: FloodFill( <hDC>, <nXStart>,


<nYStart>, <nRGBColor> ) -->
<lSuccess>
Parameters:

<hDC> Identifies the device context where to fill.

<nXStart> Identifies the coordinate where to start filling.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<nYStart>

<nRGBColor> The RGB color to use for filling.

Returns:

<lSuccess> A logical value indicating if the operation


was performed successfully.

Source code: SOURCE\\WINAPI\\Drawing.c

--------------------------------------------------------------------------------
FlushComm() Flushes all characters from transmision or receiving
--------------------------------------------------------------------------------

Syntax: FlushComm( <nIdComDev>, <nQueue> ) --> <nReturn>

This function flushes all characters from the


transmision or receiving queue of the specified
communications device.

Parameters:

<nIdComDev> Identifies the communication device to be flushed.


The OpenComm function returns this value.

<nQueue> Specifies the queue to be flushed. If this parameter


is zero, the transmision queue is flushed. If the
parameter is 1, the receiving queue is flushed.

Returns:

<nReturn> The return value is zero if the function is sucessfull.


It is less than zero if nIdComDev is not a valid
device or if nQueue is not a valid device. The
return value is positive if there is an error for the
specified device. For a list of the possible error
values, see the GetCommError function.

Sample: SAMPLES\\TestComm.prg

Source code: SOURCE\\WINAPI\\Comm.c

See also: GetCommError() OpenComm()

--------------------------------------------------------------------------------
FreeLibrary() Free a DLL library in use or decrements its counter use
--------------------------------------------------------------------------------

Syntax: FreeLibrary( <hInstance> ) --> nil

This function decreases by one the reference count


of the loaded library module. When the reference count
reaches zero, the memory occupied by the module is
freed.

Parameters:

<hInstance> The handle of the DLL. It is the value


returned by LoadLibrary().

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Returns: Nothing.

Source code: SOURCE\\WINAPI\\Dll.c

See also: LoadLibrary()

--------------------------------------------------------------------------------
FWBitmap() Creates the FiveWin own icon-alike bitmap
--------------------------------------------------------------------------------

Syntax: FWBitmap( <hDC> ) --> <hBitmap>

This an internal function of FiveWin that returns


a handle of a FiveWin logo built from memory. It
is used in the FiveWin error Dialog Box.

Parameters:

<hDC> The handle of the device context.

Returns:

<hBitmap> The handle of the just created bitmap.

Observations: This handle is automatically destroyed by FiveWin.

Source code: Not provided.

--------------------------------------------------------------------------------
FWBrushes() Creates any of the predefined FiveWin bitmaps
--------------------------------------------------------------------------------

Syntax: FWBrushes( <nBrushId> ) --> <hBitmap>

This is a FiveWin internal function that creates


a bitmap to build the FiveWin extended style brushes.

Parameters:

<nBrushId> A numeric identifier to select the predefined


type of brush.

Returns:

<hBitmap> The handle of the just created bitmap. FiveWin


uses it to build the brush. The destruction of this
bitmap is done automatically.

Source code: Not provided.

See also: FWBitmap()

--------------------------------------------------------------------------------
__GenGPF() Generates a GPF for testing purpouses
--------------------------------------------------------------------------------

Syntax: __GenGPF() --> nil

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Parameters: None

Returns: Nil

Comments: This function generates a GPF and breaks


the application. Don't use it! It is only provided
in order to try the new FiveWin user defined
GPFs controller.

Sample: SAMPLES\\TestTool.prg

Source code: SOURCE\\WINAPI\\ToolHelp.c

See also: InterruptRegister() InterruptUnRegister()

--------------------------------------------------------------------------------
GetActiveWindow() Retrieves the window handle of the active window
--------------------------------------------------------------------------------

Syntax: GetActiveWindow() --> <hWnd>

This function retrieves the window handle of the


active window.

Parameters: None

Returns:

<hWnd> The handle of the window, or null if there is


no any windows active at that moment.

Source code: SOURCE\\WINAPI\\ActWnd.c

--------------------------------------------------------------------------------
GetASyncKey() Determines whether a key is up or down
--------------------------------------------------------------------------------

Syntax: GetASyncKey( <nKey> ) --> <lDown>

This function returns if a key is down or up.

Parameters:

<nKey> The code of one of the 256 vkeys. See VKey.ch.

Returns:

<lDown> True if the key is pressed.

Source code: SOURCE\\WINAPI\\KeyBrd.c

See also: GetKeyState()

--------------------------------------------------------------------------------
GetCapture() Retrieves the window handle that has the mouse captured
--------------------------------------------------------------------------------

Syntax: GetCapture() --> <hWnd>

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


This function returns the handle of the window
that has captured the mouse.

Parameters: None.

Returns:

<hWnd> The handle of the window. In FiveWin: oWnd:hWnd.


It is 0 if no window has the mouse captured.

Source code: SOURCE\\WINAPI\\WMouse.c

See also: SetCapture() ReleaseCapture()

--------------------------------------------------------------------------------
GetCaretPos() Retrieves the current position of the caret
--------------------------------------------------------------------------------

Syntax: GetCaretPos() --> <aPoint>

This function returns the position of the caret.

Parameters: None.

Returns:

<aPoint> A Clipper array with two numeric values


representing a POINT structure:

{ nRow, nCol }

Source code: SOURCE\\WINAPI\\GetCaret.c

See also: CreateCaret() DestroyCaret() ShowCaret()

--------------------------------------------------------------------------------
GetClassName() Retrieves the class name of a window
--------------------------------------------------------------------------------

Syntax: GetClassName( <hWnd> ) --> <cClassName>

This function retrieves the class name of a window.

Parameters:

<hWnd> The handle of the window whose classname


( API classname not Clipper!) we want to know.

Returns:

<cClassName> The API classname registered for that kind


of windows.

Source code: SOURCE\\WINAPI\\WndUpdat.c

See also: CreateWindow()

--------------------------------------------------------------------------------
GetClientRect() Retrieves the client coordinates of a window
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Syntax: GetClientRect( <hWnd> ) --> <aRect>

This function retrieves the dimensions of the


window client area.

Parameters:

<hWnd> The handle of the window.

Returns:

<aRect> A Clipper array of 4 elements:

{ nTop, nLeft, nBottom, nRight }

Source code: SOURCE\\WINAPI\\Rects.c

See also: GetWndRect() FillRect() InvertRect() GetCoors()

--------------------------------------------------------------------------------
GetClpData() Retrieves the handle of the current clipboard data
--------------------------------------------------------------------------------

Syntax: GetClpData( <nFormat> ) --> <cData>

This function retrieves the containts of the


ClipBoard. FiveWin, right now, only supports
text manipulation through the Clipboard (though
it is not a FiveWin limitation, just because we
did not have the time yet! <g>)

Parameters:

<nFormat> The type of data to be retrieved:

CF_BITMAP The data is a bitmap.


CF_DIB The data is a memory object containing a
BITMAPINFO structure followed by the
bitmap data.
CF_DIF The data is in Data Interchange Format
(DIF).
CF_DSPBITMAP The data is a bitmap representation of a
private format. This data is displayed in
bitmap format in lieu of the privately
formatted data.
CF_DSPMETAFILEPICT The data is a metafile representation
of a private data format. This data is
displayed in metafile-picture format in
lieu of the privately formatted data.
CF_DSPTEXT The data is a textual representation of a
private data format. This data is displayed
in text format in lieu of the privately
formatted data.
CF_METAFILEPICT The data is a metafile (see the
description of the METAFILEPICT structure.

CF_OEMTEXT The data is an array of text characters


in the OEM character set. Each line ends
with a carriage returnlinefeed (CR-LF)
combination. A null character signals the
end of the data.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


CF_OWNERDISPLAY The data is in a private format that
the clipboard owner must display.
CF_PALETTE The data is a color palette.
CF_PENDATA The data is for the pen extensions to the
Windows operating system.
CF_RIFF The data is in Resource Interchange File
Format (RIFF).
CF_SYLK The data is in Symbolic Link (SYLK) format.
CF_TEXT The data is an array of text characters.
Each
line ends with a carriage returnlinefeed
(CR-LF) combination. A null character
signals the end of the data.
CF_TIFF The data is in Tag Image File Format (TIFF).

CF_WAVE The data describes a sound wave. This is a


subset of the CF_RIFF data format; it can
be used only for RIFF WAVE files.
Returns:

<cData> The text placed at the clipboard.


( it is pending to support the other formats,
or private new formats ).

Source code: SOURCE\\WINAPI\\ClpBrd.c

See also: OpenClipboard() SetClpData() CloseClipboard()

--------------------------------------------------------------------------------
GetCommError() Retrieves the most recent comm error value
--------------------------------------------------------------------------------

Syntax: GetCommError( <nIdComDev>, @<cComStat> ) --> <nRetCode>

This function retrieves the most recent error value


and current status for the specified device.

Parameters:

<nIdComDev> The communications device identifier created


with the OpenComm() function.

<cComStat> A string that will receive the information


for the comm status.

Returns:

<nRetCode> Indicates the last error value.

Sample: SAMPLES\\TestComm.prg

Source code: SOURCE\\WINAPI\\Comm.c

See also: OpenComm() BuildCommDev() CloseComm()

--------------------------------------------------------------------------------
GetCoors() Returns an array with four coordinates values
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Syntax: GetCoors( <hWnd> ) --> <aCoors>

This is a FiveWin function that retrieves the


absolute coordinates of a window or a control.

Parameters:

<hWnd> The handle of the window.

Returns:

<aCoors> A Clipper array of 4 elements:

{ nTop, nLeft, nBottom, nRight }

Sample: See IDE\\SOURCE for some working samples.

Source code: SOURCE\\WINAPI\\Rects.c

See also: GetClientRect() GetWndRect()

--------------------------------------------------------------------------------
GetDC() Retrieves the handle of a device context
--------------------------------------------------------------------------------

Syntax: GetDC( <hWnd> ) --> <hDC>

This function retrieves the handle of the device


context of the client area in the given window.

Parameters:

<hWnd> The handle of the window.

Returns:

<hDC> The handle of the device context.

Observations: You may think about a device context as a virtual


screen. Something similar when in MsDos we did
DispBegin() and DispEnd() with Clipper.

GetDC() it is like DispBegin(). Starts working


with a virtual screen. ReleaseDC() it is like
DispEnd(), and updates all painting to the
visible screen.

If you don't ReleaseDC() after you do a GetDC(),


you are unbalancing windows, and the system
finally crash!

Source code: SOURCE\\WINAPI\\DC.c

See also: ReleaseDC() CreateDC() DeleteDC()

--------------------------------------------------------------------------------
GetDesktopWindow() Retrieves the handle of the desktop window
--------------------------------------------------------------------------------

Syntax: GetDesktopWindow() --> <hWndDesktop>

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


This funtion retrieves the handle of the desktop
window.

Parameters: None

Returns:

<hWndDesktop> The handle of the desktiop window.

Observations: The desktop window it is also a window, created


by windows and you may manipulate it and control
it in some aspects.

Source code: SOURCE\\WINAPI\\Desktop.c

See also: SetDeskWallPaper()

--------------------------------------------------------------------------------
GetDeviceCaps() Retrieves device-specific information
--------------------------------------------------------------------------------

Syntax: GetDeviceCaps( <hDC>, <nCapability> ) --> <nValue>

This function retrieves the device-specific information


about a given device.

Parameters:

<hDC> The handle of the device context.

<nCapability> Specifies the type of information to be returned.

Returns:

<nValue> The requested value.

DT_PLOTTER Vector plotter


DT_RASDISPLAY Raster display
DT_RASPRINTER Raster printer
DT_RASCAMERA Raster camera
DT_CHARSTREAM Character stream
DT_METAFILE Metafile
DT_DISPFILE Display file

HORZSIZE Width of the physical display, in millimeters.


VERTSIZE Height of the physical display, in millimeters.
HORZRES Width of the display, in pixels.
VERTRES Height of the display, in raster lines.
LOGPIXELSX Number of pixels per logical inch along the display width.
LOGPIXELSY Number of pixels per logical inch along the display height.
BITSPIXEL Number of adjacent color bits for each pixel.
PLANES Number of color planes.
NUMBRUSHES Number of device-specific brushes.
NUMPENS Number of device-specific pens.
NUMMARKERS Number of device-specific markers.

NUMFONTS Number of device-specific fonts.


NUMCOLORS Number of entries in the device's color table.
ASPECTX Relative width of a device pixel used for line drawing.
ASPECTY Relative height of a device pixel used for line drawing.
ASPECTXY Diagonal width of a device pixel used for line drawing.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


PDEVICESIZE Size of the PDEVICE internal structure, in bytes.
CLIPCAPS Clipping capabilities the device supports. It can be one of
the following values:

Value Meaning

CP_NONE Output is not clipped.


CP_RECTANGLE Output is clipped to rectangles.
CP_REGION Output is clipped to regions.

SIZEPALETTE Number of entries in the system palette. This index is valid


only if the device driver sets the RC_PALETTE bit in the
RASTERCAPS index; it is available only if the driver is
written for Windows 3.0 or later.
NUMRESERVED Number of reserved entries in the system palette. This
index is valid only if the device driver sets the
RC_PALETTE bit in the RASTERCAPS index; it is available
only if the driver is written for Windows 3.0 or later.
COLORRES Color resolution of the device, in bits per pixel. This index
is
valid only if the device driver sets the RC_PALETTE bit in
the RASTERCAPS index; it is available only if the driver is
written for Windows 3.0 or later.
RASTERCAPS Raster capabilities the device supports. It can be a
combination of the following values:

Value Meaning

RC_BANDING Supports banding.


RC_BIGFONT Supports fonts larger than 64K.
RC_BITBLT Transfers bitmaps.
RC_BITMAP64 Supports bitmaps larger than 64K.
RC_DEVBITS Supports device bitmaps.
RC_DI_BITMAP Supports the SetDIBits and GetDIBits functions.
RC_DIBTODEV Supports the SetDIBitsToDevice function.
RC_FLOODFILL Performs flood fills.
RC_GDI20_OUTPUT Supports Windows version 2.0 features.
RC_GDI20_STATE Includes a state block in the device context.
RC_NONE Supports no raster operations.

RC_OP_DX_OUTPUT Supports dev opaque and DX array.


RC_PALETTE Specifies a palette-based device.
RC_SAVEBITMAP Saves bitmaps locally.
RC_SCALING Supports scaling.
RC_STRETCHBLT Supports the StretchBlt function.
RC_STRETCHDIB Supports the StretchDIBits function.

CURVECAPS Curve capabilities the device supports. It can be a


combination of the following values:

Value Meaning

CC_NONE Supports curves.


CC_CIRCLES Supports circles.
CC_PIE Supports pie wedges.
CC_CHORD Supports chords.
CC_ELLIPSES Supports ellipses.
CC_WIDE Supports wide borders.
CC_STYLED Supports styled borders.
CC_WIDESTYLED Supports wide, styled borders.
CC_INTERIORS Supports interiors.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


CC_ROUNDRECT Supports rectangles with rounded corners.

LINECAPS Line capabilities the device supports. It can be a


combination of the following values:

Value Meaning

LC_NONE Supports no lines.


LC_POLYLINE Supports polylines.
LC_MARKER Supports markers.
LC_POLYMARKER Supports polymarkers.
LC_WIDE Supports wide lines.
LC_STYLED Supports styled lines.
LC_WIDESTYLED Supports wide, styled lines.
LC_INTERIORS Supports interiors.

POLYGONALCAPS Polygonal capabilities the device supports. It can be a


combination of the following values:

Value Meaning

PC_NONE Supports no polygons.


PC_POLYGON Supports alternate fill polygons.
PC_RECTANGLE Supports rectangles.
PC_WINDPOLYGON Supports winding number fill polygons.
PC_SCANLINE Supports scan lines.
PC_WIDE Supports wide borders.
PC_STYLED Supports styled borders.
PC_WIDESTYLED Supports wide, styled borders.
PC_INTERIORS Supports interiors.

TEXTCAPS Text capabilities the device supports. It can be a


combination of the following values:

Value Meaning

TC_OP_CHARACTER Supports character output precision, which indicates the


device can place device fonts at any pixel location. This is
required for any device with device fonts.
TC_OP_STROKE Supports stroke output precision, which indicates the
device can omit any stroke ofa device font.
TC_CP_STROKE Supports stroke clip precision, which indicates the device can
clip device fonts to a pixel boundary.
TC_CR_90 Supports 90-degree character rotation, which indicates the
device can rotate characters only 90 degrees at a time.
TC_CR_ANY Supports character rotation at any degree, which indicates
the device can rotate device fonts through any angle.
TC_SF_X_YINDEP Supports scaling independent of x and y directions, which
indicates the device can scale device fonts separately in x
and y directions.

TC_SA_DOUBLE Supports doubled characters for scaling, which indicates the


device can double the size of device fonts.
TC_SA_INTEGER Supports integer multiples for scaling, which indicates the
device can scale the size of device fonts in any integer
multiple.
TC_SA_CONTIN Supports any multiples for exact scaling, which indicates
the device can scale device fonts by any amount but still
preserve the x and y ratios.
TC_EA_DOUBLE Supports double-weight characters, which indicates the
device can make device fonts bold. If this bit is not set for

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


printer drivers, graphics device interface (GDI) attempts to
create bold device fonts by printing them twice.
TC_IA_ABLE Supports italics, which indicates the device can make
device fonts italic. If this bit is not set, GDI assumes
italics are not available.

TC_UA_ABLE Supports underlining, which indicates the device can


underline device fonts. If this bit is not set, GDI creates
underlines for device fonts.
TC_SO_ABLE Supports strikeouts, which indicates the device can
strikeout device fonts. If this bit is not set, GDI creates
strikeouts for device fonts.
TC_RA_ABLE Supports raster fonts, which indicates that GDI should
enumerate any raster or TrueType fonts available for
this device in response to a call to the EnumFonts or
EnumFontFamilies function. If this bit is not set,
GDI-supplied raster or TrueType fonts are not enumerated when
these functions are called.
TC_VA_ABLE Supports vector fonts, which indicates that GDI should
enumerate any vector fonts available for this device in
response to a call to the EnumFonts or EnumFontFamilies
function. This is significant for vector devices only (that
is, for plotters). Display drivers (which must be able to
use raster fonts) and raster printer drivers always enumerate
vector fonts, because GDI rasterizes vector fonts before
sending them to the driver.

TC_RESERVED Reserved; must be zero.

/* TEXTCAPS */

#define TC_OP_CHARACTER 0x0001


#define TC_OP_STROKE 0x0002
#define TC_CP_STROKE 0x0004
#define TC_CR_90 0x0008
#define TC_CR_ANY 0x0010
#define TC_SF_X_YINDEP 0x0020
#define TC_SA_DOUBLE 0x0040
#define TC_SA_INTEGER 0x0080
#define TC_SA_CONTIN 0x0100
#define TC_EA_DOUBLE 0x0200
#define TC_IA_ABLE 0x0400
#define TC_UA_ABLE 0x0800
#define TC_SO_ABLE 0x1000
#define TC_RA_ABLE 0x2000
#define TC_VA_ABLE 0x4000
#define TC_RESERVED 0x8000

/* CLIPCAPS */
#define CP_NONE 0x0000
#define CP_RECTANGLE 0x0001
#define CP_REGION 0x0002

/* RASTERCAPS */
#define RC_NONE
#define RC_BITBLT 0x0001
#define RC_BANDING 0x0002
#define RC_SCALING 0x0004
#define RC_BITMAP64 0x0008
#define RC_GDI20_OUTPUT 0x0010
#define RC_GDI20_STATE 0x0020

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define RC_SAVEBITMAP 0x0040
#define RC_DI_BITMAP 0x0080
#define RC_PALETTE 0x0100
#define RC_DIBTODEV 0x0200
#define RC_BIGFONT 0x0400
#define RC_STRETCHBLT 0x0800
#define RC_FLOODFILL 0x1000
#define RC_STRETCHDIB 0x2000
#define RC_OP_DX_OUTPUT 0x4000
#define RC_DEVBITS 0x8000

Source code: SOURCE\\WINAPI\\Device.c

--------------------------------------------------------------------------------

GetDialogBaseUnits() Returns the DialogBox base units used to create it


--------------------------------------------------------------------------------

Syntax: GetDialogBaseUnits() --> <nBaseUnits>

This function returns the DialogBox base units


used by Windows when creating DialogBoxes. An
application should use these values to calculate
the average width of characters in the system font.

Parameters: None

Returns:

<nBaseUnits> A long value ( 4 bytes ) containing the width


and the height in pixels used by Windows in the
conversion of units for the DialogBoxes coordinates:
( in Windows, DialogBoxes use logical units )

nWidth = ( x * nLoWord( GetDialogBaseUnits() ) ) / 4


nHeight = ( y * nHiWord( GetDialogBaseUnits() ) ) / 8

x and y are the width and height in units of the


DialogBox.

FiveWin controls all these processes automatically


through the TDialog Class and DialogBoxes xBase
commands.

Source code: SOURCE\\WINAPI\\Dlg2Chr.c

--------------------------------------------------------------------------------

GetFirstInZip() Retrieves info for the first file in the ZIP file
--------------------------------------------------------------------------------

Syntax: GetFirstInZip( <cZipFileName> ) --> <aFileInfo>

Parameters:

<cZipFileName> The name of the ZIP file to retrieve info from


its first file.

Returns:

<aFileInfo> An array of 9 items containing the following

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


first file in ZIP information:

aFileInfo[ 1 ] // The returning code


// #define ZIP_OK 0
// #define ZIP_FILEERROR -1
// #define ZIP_INTERNALERROR -2
// #define ZIP_NOMOREITEMS 1

aFileInfo[ 2 ] // the filename


aFileInfo[ 3 ] // Date
aFileInfo[ 4 ] // Time
aFileInfo[ 5 ] // File size
aFileInfo[ 6 ] // Compressed size
aFileInfo[ 7 ] // offset insize the ZIP file
aFileInfo[ 8 ] // Pack Method
aFileInfo[ 9 ] // File attributes

Sample: SAMPLES\\TestZip.prg

Source code: SOURCE\\FUNCTION\\UnZip.c

--------------------------------------------------------------------------------
GetDlgItem() Retrieves the handle of a control
--------------------------------------------------------------------------------

Syntax: GetDlgItem( <hDlg>, <nCtlId> ) --> <hControl>

This function retrieves the handle of a control


from its DialogBox handle and its identifier.

Parameters:

<hDlg> The handle of the Dialogbox container of the control

<nCtlId> The control identifier

Returns:

<hControl> The window handle of the control

Observations: Controls are also windows

Source code:

See also: DialogBox() EndDialog() GetDlgCtrlId()

--------------------------------------------------------------------------------
GetFTime() Retrieves the time and date of a file
--------------------------------------------------------------------------------

Syntax: GetFDate( <hFile> ) --> <aDateTime>

Parameters:

<hFile> Identifies the handle of an opened file.


Use FOpen() to get this handle.

<cTime> Specifies a different time to be set to


the file. Use the format: "HH:MM:SS".

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<cdDate> Specifies a different date to be set to
the file. Use the format: "DD:MM:YYYY". You
can use both a date or a string type.

Returns:

<aDateTime> An array of two elements with the time and


date of the file. The time has the format "HH:MM:SS",
and the date is a Clipper date.

Source code: SOURCE\\FUNCTION\\Files.c

See also: SetFTime()

--------------------------------------------------------------------------------
GetFocus() Retrieves the handle of the window that has focus
--------------------------------------------------------------------------------

Syntax: GetFocus() --> <hWnd>

Parameters: None

Returns:

<hWnd> The handle of the window that has the focus.

Sample: local hWnd := GetFocus()

Source code: SOURCE\\WINAPI\\SetFocus.c

--------------------------------------------------------------------------------
GetFontInfo() Retrieves font height, width and bold
--------------------------------------------------------------------------------

Syntax: GetFontInfo( <hFont> ) --> <aFontInfo>

This is a FiveWin function to obtain some


specific font info used from some classes.

Parameters:

<hFont> The handle of the font.

Returns:

<aFontInfo> A Clipper array of three elements:

{ nHeight, nWidth, lBold }

Source code: SOURCE\\WINAPI\\FontCrea.c

See also: CreateFont() ChooseFont()

--------------------------------------------------------------------------------
GetFreeSpace() Scans the global heap for memory size available
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Syntax: GetFreeSpace() --> <nSize>

This function scans the global heap and returns


the number of bytes of memory currently available.

Parameters: None

Returns:

<nSize> The total amount of memory.

Observations: This size of memory not always is continuous.


GlobalCompact() returns the maximum continuous
size.

Source code: SOURCE\\WINAPI\\Mem.c

--------------------------------------------------------------------------------
GetInstance() Returns the application handle instance value
--------------------------------------------------------------------------------

Syntax: GetInstance() --> <hInstance>

This function returns the instance of our application.

Parameters: None.

Returns:

<hInstance> An application identifier that Windows


assigns when executing our application.

Source code: Not available.

--------------------------------------------------------------------------------
GetKeyStat() Retrieves the state of the specified virtual key
--------------------------------------------------------------------------------

Syntax: GetKeyStat( <nKey> ) --> <lPressed>

This function retrieves if a key is beeing


pressed.

Parameters:

<nKey> The code of the key that we want to


check (normal or virtual)

Returns:

<lPressed> If it is pressed or not

Source code: See SOURCE\\CLASSES\\TGet.prg

See also: GetAsynKey()

--------------------------------------------------------------------------------
GetLocal() Retrieves any local variable from the stack
--------------------------------------------------------------------------------

Syntax: GetLocal( <nStackLevel>, <nIndex> ) -->

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<uLocal>

Parameters:

<nStackLevel> The depth of the activation level to query.


(Similar to Clipper ProcName(...) parameters). A 0
value means the current one. 1 means the previous,
2 the previous of that one, etc... By default it is
0.

<nIndex> The order in which the local variables


were declared at that stack level function.

Returns:

<uLocal> The value of the local variable requested.

Source code: Not provided.

Sample: See SOURCE\\FUNCTION\\ErrorSysW.prg

See also: GetParam()

--------------------------------------------------------------------------------
GetMapMode() Retrieves the current mapping mode
--------------------------------------------------------------------------------

Syntax: GetMapMode( <hDC> ) --> <nMapMode>

The function retrieves the current mapping mode


for a given device context.

Parameters:

<hDC> The handle of the device context.

Returns:

<nMapMode> A numeric value of the followings:

MM_ANISOTROPIC Logical units are converted to


arbitrary units with arbitrarily
scaled axes.
Setting the mapping mode to
MM_ANISOTROPIC does not change the
current window or viewport settings.
To change the units, orientation, and
scaling, an application should use the
SetWindowExt and SetViewportExt
functions.
MM_HIENGLISH Each logical unit is converted to
0.001 inch. Positive x is to the
right; positive y is up.
MM_HIMETRIC Each logical unit is converted to 0.01
millimeter. Positive x is to the right;
positive y is up.
MM_ISOTROPIC Logical units are converted to
arbitrary units with equally scaled
axes; that is, one unit along the
x-axis is equal to one unit along the

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


y-axis. The SetWindowExt and
SetViewportExt
functions must be used to specify
the desired units and the orientation
of the axes. GDI makes adjustments as
necessary to ensure that the x and y
units remain the same size.

MM_LOENGLISH Each logical unit is converted to 0.01


inch. Positive x is to the right;
positive y is up.
MM_LOMETRIC Each logical unit is converted to 0.1
millimeter. Positive x is to the
right; positive y is up.
MM_TEXT Each logical unit is converted to one
device pixel. Positive x is to the
right; positive y is down.
MM_TWIPS Each logical unit is converted to 1/20
of a point. (Because a point is 1/72
inch, a twip is 1/1440 inch). Positive
x is to the right; positive y is up.

Source code: SOURCE\\WINAPI\\SetMapMo.c

See also: SetMapMode() SetWindowExt() SetWindowOrg()

--------------------------------------------------------------------------------
GetNextInZip() Retrieves info for the next file in the ZIP file
--------------------------------------------------------------------------------

Syntax: GetNextInZip() --> <aFileInfo>

Parameters: None

Returns:

<aFileInfo> An array of 9 items containing the following


next file in ZIP information. GetFirstInZip() must
be called prior to use GetNextInZip():

aFileInfo[ 1 ] // The returning code


// #define ZIP_OK 0
// #define ZIP_FILEERROR -1
// #define ZIP_INTERNALERROR -2
// #define ZIP_NOMOREITEMS 1

aFileInfo[ 2 ] // the filename


aFileInfo[ 3 ] // Date
aFileInfo[ 4 ] // Time
aFileInfo[ 5 ] // File size
aFileInfo[ 6 ] // Compressed size
aFileInfo[ 7 ] // offset insize the ZIP file
aFileInfo[ 8 ] // Pack Method
aFileInfo[ 9 ] // File attributes

Sample: SAMPLES\\TestZip.prg

Source code: SOURCE\\FUNCTION\\UnZip.c

--------------------------------------------------------------------------------
GetParam() Retrieves any parameter value from the stack

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------

Syntax: GetParam( <nStackLevel>, <nIndex> ) -->


<uParameter>

Parameters:

<nStackLevel> The depth of the activation level to query.


(Similar to Clipper ProcName(...) parameters). A 0
value means the current one. 1 means the previous,
2 the previous of that one, etc... By default it is
0.

<nIndex> The order in which the parameter values


were provided to that stack level function.

Returns:

<uParameter> The value of the parameter requested.

Source code: Not provided.

Sample: See SOURCE\\FUNCTION\\ErrorSysW.prg

See also: GetLocal()

--------------------------------------------------------------------------------
GetParent() Retrieves the window handle of a window parent
--------------------------------------------------------------------------------

Syntax: GetParent( <hWnd> ) --> <hWndParent>

This function returns the handle of the container


window (if any) of a given window.

Parameters:

<hWnd> The handle of the window.

Returns:

<hWndParent> The handle of the container window of


<hWnd>

Source code: SOURCE\\WINAPI\\GetParen.c

See also: SetParent()

--------------------------------------------------------------------------------
GetPixel() Retrieves the RGB color of a pixel
--------------------------------------------------------------------------------

Syntax: GetPixel( <hDC>, <nCol>, <nRow> ) --> <nRGBColor>

Parameters:

<hDC> The handle of the device context.

<nCol> The coordinates of the pixel whose color is to


<nRow> be retrieved.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Returns:

<nRGBColor> The RGB (numeric long) color of that pixel.

Source code: SOURCE\\WINAPI\\SetPixel.c

See also: SetPixel()

--------------------------------------------------------------------------------
GetPrintDC() DialogBox to retrieves the printer device context
--------------------------------------------------------------------------------

Syntax: GetPrintDC( <hWndOwner> ) --> <hDC>

This function retrieves the standard Windows


DialogBox to select printing conditions and
returns the associated device context created
for the printer.

Parameters:

<hWndOwner> The handle of the window that may contains


the DialogBox. By default it is GetActiveWindow().

Returns:

<hDC> The handle of the device context for the


printer.

Observations: FiveWin offers a powerfull TPrint Class and a Report


Engine that automatizes all printing processes making
them much easier to use.

Sample: See SAMPLES\\REPORT\\*.*

Source code: SOURCE\\WINAPI\\PrintDc.c

See also: PrinterSetup()

--------------------------------------------------------------------------------
GetPrinter() Retrieves the printer device context without DlgBox
--------------------------------------------------------------------------------

Syntax: GetPrinter() --> <hDC>

Parameters: None

Returns:

<hDC> The handle of the device context for the


system printer. This system printer is the printer
that is installed in Windows as the default priner.

Observations: This function is automatically called from the


TPrinter class to create a printer object without
prompting with the standard printing selection
DialogBox.

Source code: SOURCE\\WINAPI\\PrintDc.c

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


See also: Class TPrinter

--------------------------------------------------------------------------------
GetProcAddress() Retrieves the address of the given module function
--------------------------------------------------------------------------------

Syntax: GetProcAddress( <hInst>, <cProcName>, <lPascalType>,


<nReturnType>, [<nParam1Type>, ...<nParamNType>] )
--> <cProcData>

Parameters:

<hInst> Identifies the module that contains the function.


Normally The handle of a DLL, that previously
we have loaded with LoadLibrary().

<cProcName> The name of the function, or its order number


inside the DLL.

<lPascalType> True is the function to be used is PASCAL type.


Normally most of Windows API functions are PASCAL
type.

<nReturnType> A numeric value that indicates the type of value


returned by the function to be called.

The nReturnType possible values are inside FiveWin


DLL.ch:

#define VOID 0
#define BYTE 1
#define CHAR 2
#define WORD 3
#define _INT 4 // conflicts with Clipper
Int()
#define BOOL 5
#define HDC 6
#define LONG 7
#define STRING 8
#define LPSTR 9
#define PTR 10
#define _DOUBLE 11 // conflicts with BORDER
DOUBLE

<nParam1Type> Are the different types of parameters that will be


<nParamNType> supplied as parameters when calling to the DLL
function. They are numeric values as the above
<nReturnType> values.

Returns:

<cProcData> A string which contains a binary representation of


the DLL function to be called plus necessary information
about the type, parameters and return type.

The information here contained is vital to properly


build a C-language alike stack and its manipulation.

Observations: This function is automatically used from the FiveWin


DLL management xBase commands. We strongly recommend
to use the xBase commands to use this function, as

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


An easier way and avoid possible mistakes.

Sample: SAMPLES\\CallDll.prg

Source code: SOURCE\\WINAPI\\GetProcA.c

See also: INCLUDE\\DLL.CH

--------------------------------------------------------------------------------
GetProfInt() Retrieves the value of a integer Win.ini file entry
--------------------------------------------------------------------------------

Syntax: GetProfInt( <cSection>, <cEntry>, <nDefault> )


--> <nValue>

Parameters:

<cSection> Specifies the section containing the entry.

<cEntry> The entry whose value is to be retrieved.

<nDefault> Specifies the default numeric value to return if


the entry cannot be found.

Returns:

<nValue> The numeric value in the INI file that follows


the specified entry.

Observations: This function retrieves a value from the WIN.INI


file.

Sample: SAMPLES\\TestIni.prg

Source code: SOURCE\\WINAPI\\Profile.c

See also: GetProfStr(), GetPvpProfile(), GetPvpProfString()

--------------------------------------------------------------------------------
GetProfStr() Retrieves the value of a string Win.ini file entry
--------------------------------------------------------------------------------

Syntax: GetProfStr( <cSection>, <cEntry>, <cDefault> )


--> <cValue>

<cSection> Specifies the section containing the entry.

<cEntry> The entry whose value is to be retrieved.

<cDefault> Specifies the default string value to return if


the entry cannot be found.

Returns:

<cValue> The string value in the INI file that follows


the specified entry.

Observations: This function retrieves a value from the WIN.INI


file.

Sample: SAMPLES\\TestIni.prg

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Source code: SOURCE\\WINAPI\\Profile.c

See also: GetProfInt(), GetPvpProfile(), GetPvpProfString()

--------------------------------------------------------------------------------
GetProp() Retrieves a data handle from the Windows property list
--------------------------------------------------------------------------------

Syntax: GetProp( <hWnd>, <cPropIdentifier> ) --> <hData>

Parameters:

<hWnd> Identifies the window whose property list is to


be searched.

<cPropIdentifier> A string identifies the data to be retrieved.

Returns:

<hData> The data handle of the associated property


of the window.

Observations: FiveWin uses this API function for storing some


extra values related to the windows, dialogs and
controls.

Basicly these functions let you assciate extra


values to the windows, and later you can retrieve
them. You can use this way, or you can use the
:Cargo data of all windows.

Source code: SOURCE\\WINAPI\\Prop.c

See also: SetProp() RemoveProp() EnumProps()

--------------------------------------------------------------------------------
GetPvpProfile() Retrieves the value of a integer private INI file entry
--------------------------------------------------------------------------------

Syntax: GetPvpProfile( <cSection>, <cEntry>, <nDefault>,


<cIniFile> ) --> <nValue>

Parameters:

<cSection> Specifies the section containing the entry.

<cEntry> The entry whose value is to be retrieved.

<nDefault> Specifies the default numeric value to return if


the entry cannot be found.

<cIniFile> Is is the name of the private INI file to use.

Returns:

<nValue> The numeric value in the INI file that follows


the specified entry.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Observations: This function retrieves a value from a user defined
INI file.

Sample: SAMPLES\\TestIni.prg

Source code: SOURCE\\WINAPI\\Profile.c

See also: GetProfStr(), GetPvpProfile(), GetPvpProfString()

--------------------------------------------------------------------------------
GetPvpProfString() Retrieves the value of a string private INI file
--------------------------------------------------------------------------------

Syntax: GetPvpProfString( <cSection>, <cEntry>, <cDefault>,


<cIniFile> ) --> <cValue>

<cSection> Specifies the section containing the entry.

<cEntry> The entry whose value is to be retrieved.

<cDefault> Specifies the default string value to return if


the entry cannot be found.

<cIniFile> Is is the name of the private INI file to use.

Returns:

<cValue> The string value in the INI file that follows


the specified entry.

Observations: This function retrieves a value from a user defined


INI file.

Sample: SAMPLES\\TestIni.prg

Source code: SOURCE\\WINAPI\\Profile.c

See also: GetProfInt(), GetPvpProfile(), GetPvpProfString()

--------------------------------------------------------------------------------
GetStockObject() Retrieves the handle of a predefined stock pens
--------------------------------------------------------------------------------

Syntax: GetStockObject( <nObjectType> ) --> <hGDIObject>

Parameters:

<nObjectType> Specifies the type of stock object for which to


retrieve the handle. This parameter can be one
of the following values:

#define OEM_FIXED_FONT 10
#define ANSI_FIXED_FONT 11
#define ANSI_VAR_FONT 12
#define SYSTEM_FONT 13
#define DEVICE_DEFAULT_FONT 14
#define DEFAULT_PALETTE 15
#define SYSTEM_FIXED_FONT 16
#define WHITE_PEN 6
#define BLACK_PEN 7
#define NULL_PEN 8

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define WHITE_BRUSH 0
#define LTGRAY_BRUSH 1
#define GRAY_BRUSH 2
#define DKGRAY_BRUSH 3
#define BLACK_BRUSH 4
#define NULL_BRUSH 5
#define HOLLOW_BRUSH NULL_BRUSH

BLACK_BRUSH Black brush.


DKGRAY_BRUSH Dark-gray brush.
GRAY_BRUSH Gray brush.
HOLLOW_BRUSH Hollow brush.
LTGRAY_BRUSH Light-gray brush.
NULL_BRUSH Null brush.
WHITE_BRUSH White brush.
BLACK_PEN Black pen.
NULL_PEN Null pen.
WHITE_PEN White pen.
ANSI_FIXED_FONT Windows fixed-pitch system font.
ANSI_VAR_FONT Windows variable-pitch system font.
DEVICE_DEFAULT_FONT Device-dependent font.

OEM_FIXED_FONT OEM-dependent fixed font.


SYSTEM_FONT System font. By default, Windows uses
the system font to draw menus, dialog
box controls, and other text. In Windows
versions 3.0 and later, the system
font is a variable-pitch font width;
earlier versions of Windows use a
fixed-pitch system font.
SYSTEM_FIXED_FONT Fixed-pitch system font used in
Windows versions Earlier than 3.0.
This object is available for
compatibility with earlier versions of
Windows.
DEFAULT_PALETTE Default color palette. This palette
consists of the static colors in the
system palette.

Returns:

<hGDIObject> The return value is the handle of the specified


object if the function is successful. Otherwise,
it is NULL.

Source code: SOURCE\\WINAPI\\GetStkOb.c

See also: GetObject()

--------------------------------------------------------------------------------
GetSysDir() Retrieves the Windows system directory path
--------------------------------------------------------------------------------

Syntax: GetSysDir() --> <cWinSystemPath>

Parameters: None

Returns:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<cWinSystemPath> The path of the Windows system directory.

Source code: SOURCE\\WINAPI\\WinExec.c

See also: GetWinDir()

--------------------------------------------------------------------------------
GetTextHeight() Retrieves the height of a selected font
--------------------------------------------------------------------------------

Syntax: GetTextHeight( <hWnd> ) --> <nFontHeight>

Parameters:

<hWnd> Is is the handle of the window whose font height


is to be retrieved.

Returns:

<nFontHeight> The height of the currently selected font


for that window.

Source code: SOURCE\\WINAPI\\GetTextW.c

See also: GetTextWidth()

--------------------------------------------------------------------------------
GetTextWidth() Retrieves the width of a selected font
--------------------------------------------------------------------------------

Syntax: GetTextWidth( <hWnd> ) --> <nFontWidth>

Parameters:

<hWnd> Is is the handle of the window whose font height


is to be retrieved.

Returns:

<nFontWidth> The width of the currently selected font for


that window.

Source code: SOURCE\\WINAPI\\GetTextW.c

See also: GetTextHeight()

--------------------------------------------------------------------------------
GetVersion() Retrieves the Windows and MsDos versions numbers
--------------------------------------------------------------------------------

Syntax: GetVersion() --> <anVersions>

Parameters: None

Returns:

<anVersions> An array of numbers, with the Windows


and MsDos versions:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


{ nWindowsVersion, nWindowsSubVersion,
nMsDosVersion, nMsDosSubVersion }

Source code: SOURCE\\WINAPI\\WinExec.c

Sample: SOURCE\\FUNCTION\\ErrorSysW.prg

--------------------------------------------------------------------------------
GetWinDir() Retrieves the Windows directory path
--------------------------------------------------------------------------------

Syntax: GetWinDir() --> <cWinPath>

Parameters: None

Returns:

<cWinPath> The path of the Windows directory.

Source code: SOURCE\\WINAPI\\WinExec.c

See also: GetSysDir()

--------------------------------------------------------------------------------
GetWindow() Retrieves the handle of a window
--------------------------------------------------------------------------------

Syntax: GetWindow( <hWnd>, <nRelationShip> )


--> <hWndSearched>

Parameters:

<hWnd> Identifies the original window.

<nRelationShip> Specifies the relationship between the original


function and the returned window. This parameter
can be one of the following values:

GW_CHILD Identifies the window's first child


window.
GW_HWNDFIRST Returns the first sibling window for
a child window; otherwise, it
returns the first top-level window in
the list.
GW_HWNDLAST Returns the last sibling window for a
child window; otherwise, it
returns the last top-level window in
the list.
GW_HWNDNEXT Returns the sibling window that
follows the given window in the
window manager's list.
GW_HWNDPREV Returns the previous sibling window in
the window manager's list.
GW_OWNER Identifies the window's owner.

Returns:

<hWndSearched> The handle of the searched window. 0 if it


not successful.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Source code: SOURCE\\WINAPI\\GetWnd.c

See also: FindWindow()

--------------------------------------------------------------------------------
GetWindowText() Retrieves the window associated text
--------------------------------------------------------------------------------

Syntax: GetWindowText( <hWnd> ) --> <cText>

Parameters:

<hWnd> The handle whose associated text is to be


retrieved.

Returns:

<cText> The text associated with that window.

Observations: In a standard window you get the window caption.

Source code: SOURCE\\WINAPI\\GetText.c

See also: SetWindowText()

--------------------------------------------------------------------------------
GetWindowWord() Retrieves a word value at the specified offset
--------------------------------------------------------------------------------

Syntax: GetWindowWord( <hWnd>, <nIndex> ) --> <nValue>

Parameters:

<hWnd> The handle of the window whose Index associated


word ( two bytes ) value is to be retrieved.

<nIndex> Specifies the zero-based index order of the value


to be retrieved.

#define GWW_HINSTANCE (-6)


#define GWW_HWNDPARENT (-8)
#define GWW_ID (-12)

GWW_HINSTANCE Specifies the instance handle of the


module that owns the window.
GWW_HWNDPARENT Specifies the handle of the parent
window, if any. The SetParent function
changes the parent window of a child
window. An application should not call
the SetWindowWord function to change
the parent of a child window.
GWW_ID Specifies the identifier of the child
window.

Returns:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<nValue> The returned value specifies information about the
given value.

Source code: SOURCE\\WINAPI\\GetWnd.c

See also: SetWindowWord() GetWindowLong() SetWindowLong()

--------------------------------------------------------------------------------
GetWndApp() Returns the FiveWin main application window object
--------------------------------------------------------------------------------

Syntax: GetWndApp() --> <hWnd>

Parameters: None

Returns:

<hWnd> The handle of the window of the main


application window.

Source code: Not provided.

--------------------------------------------------------------------------------
GetWndFrame() Returns the FiveWin main frame application window
--------------------------------------------------------------------------------

Syntax: GetWndFrame() --> <oWndFrame>

Parameters: None

Returns:

<oWndFrame> Returns the Clipper object of the main MDI frame


window.

Source code: SOURCE\\CLASSES\\MdiFrame.prg

--------------------------------------------------------------------------------
GetWndRect() Retrieves the window all area coordinates
--------------------------------------------------------------------------------

Syntax: GetWndRect( <hWnd> ) --> <aRect>

Parameters:

<hWnd> The handle of the window whose rect area is


to be retrieved.

Returns:

<aRect> An array with the


{ nTop, nLeft, nBottom, nRight }

Source code: SOURCE\\WINAPI\\Rects.c

See also: GetClientRect() GetCoors()

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
GetWndTask() Retrieves the window associated task handle
--------------------------------------------------------------------------------

Syntax: GetWndTask( <hWnd> ) --> <hTask>

Parameters:

<hWnd> The handle of the window whose task is


to be retrieved.

Returns:

<hTask> The handle of the task in which that


particular window has been created.

Source code: SOURCE\\WINAPI\\GetWnd.c

See also: GetTasks()

--------------------------------------------------------------------------------
GlobalAddAtom() Adds a string to the Windows atom table system
--------------------------------------------------------------------------------

Syntax: GlobalAddAtom( <cString> ) --> <nAtom>

Parameters:

<cString> A string to be added to the system atom


table to return a unique value for it.

Returns:

<nAtom> A numeric value (nAtom) unique for that


string.

Observations: This function is case sensitive.

Sample: MsgInfo( GlobalAddAtom( "Hello" ) )

Source code: SOURCE\\WINAPI\\Atom.c

See also: GlobalGetAtomName() GlobalDeleteAtom()

--------------------------------------------------------------------------------
GlobalFree() Frees the given global memory object
--------------------------------------------------------------------------------

Syntax: GlobalFree( <hGlobalMem> ) --> <hGlobalMem>

Parameters:

<hGlobalMem> Identifies the global memory object to freed.

Returns:

<hGlobalMem> If the function is successful it returns 0, if not


it returns again the same <hGlobalMem> supplied.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Observations: This functions are only recommend for very advanced
windows API programmers.

Source code: SOURCE\\WINAPI\\Mem.c

See also: GlobalAlloc() GlobalLock() GlobalUnlock()

--------------------------------------------------------------------------------
HelpIndex() Shows the default help file index
--------------------------------------------------------------------------------

Syntax

HelpIndex()

Parameters

None

Returns

Nothing

Description

HelpIndex() Shows the main index of the default selected Help file.

Source: SOURCE\\WINAPI\\HELP.C

--------------------------------------------------------------------------------
HelpPopup() Shows the context popup help
--------------------------------------------------------------------------------

Syntax

HelpPopup()

Parameters

None

Returns

Nothing

Description

HelpPopup() Shows the help context popup of the selected help file.

Source: SOURCE\\WINAPI\\HELP.C

--------------------------------------------------------------------------------
HelpSearch() Search DialogBox in the default Help file
-------------------------------------------------------------------------------
-

Syntax

HelpSearch( [ cString ] )

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Parameters

cString Is an optional parameter to specify the string we want to


search.

Returns

Nothing

Description

HelpSearch() calls the WinHelp search Dialog. If we have specified


a string to search then, automatically, the result of the search
is shown, if not, we have to dynamically type the expression.

Example

HelpSearch( "Hello" )

Source: HELP.C

--------------------------------------------------------------------------------
HelpSetPos() Changes the position of the WinHelp Window
-------------------------------------------------------------------------------
-

Syntax

HelpSetPos( nRow, nColumn )

Parameters

nRow, nColumn are two numeric values which specify the


coordinates where WinHelp appears. Windows
assigns logical dimensions of 1024 x 1024
dots to screen surface.

Returns

Nothing.

Description

We can select the position where WinHelp will appears.

Example

HelpSetPos( 200, 200 )

Source: HELP.C

--------------------------------------------------------------------------------
HelpSetTopic() Selects a help default topic
-------------------------------------------------------------------------------
-

Syntax

HelpSetTopic( cTopic )

Parameters

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


cTopic is a string that let us specify the default topic
where automatically show help.

Returns

Nothing

Description

It lets us select a help default topic. We may change this topic


from inside different parts of our program.

Example

HelpSetTopic( "Use_of_help" )

Source: HELP.C

--------------------------------------------------------------------------------
HelpTopic() Reviews a Topic
--------------------------------------------------------------------------------

Syntax

HelpTopic( [ ncTopic ] )

Parameters

ncTopic is a numeric or string parameter that selects the Topic to


review. If we specify strings we have to use '_' instead
of spaces between words.

Returns

None.

Description

HelpSetTopic() y GetHelpTopic() complements this function.

Example

HelpTopic( "Use_of_help" )

Source: HELP.C

--------------------------------------------------------------------------------
I2Hex() Converts a word (2 bytes) into a hex string (4 chars)
--------------------------------------------------------------------------------

Syntax: I2Hex( <nWord> ) --> <cHex>

Parameters:

<nWord> A number in the range 0-65535.

Returns:

<cHex> A four characters hex string.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Sample: MsgInfo( I2Bin( 1234 ) ) // returns a "04D2" hex

Source code: SOURCE\\FUNCTION\\Or.c

See also: C2Hex() L2Hex()

--------------------------------------------------------------------------------
InportByte() Reads a byte from a hardware port
--------------------------------------------------------------------------------

Syntax: InportByte( <nPort> ) --> <nByte>

Parameters:

<nPort> The hardware port number (one word: two bytes)


to read a byte from.

Returns:

<nByte> A numeric value corresponding to the


read byte.

Comments: Use these functions only to access


hardware ports. Communication ports must be
accessed using special API comm functions.

Source code: SOURCE\\WINAPI\\InOut.c

--------------------------------------------------------------------------------
InportWord() Reads a word (2 bytes) from a hardware port
--------------------------------------------------------------------------------

Syntax: InportWord( <nPort> ) --> <nWord>

Parameters:

<nPort> The hardware port number (one word: two bytes)


to read a word from.

Returns:

<nWord> A numeric value corresponding to the


read word.

Comments: Use these functions only to access


hardware ports. Communication ports must be
accessed using special API comm functions.

Source code: SOURCE\\WINAPI\\InOut.c

--------------------------------------------------------------------------------
InterruptRegister() Installs a user defined GPFs controller
--------------------------------------------------------------------------------

Syntax: InterruptRegister( <bAction> ) --> <lSuccess>

Parameters:

<bAction> The codeblock to automatically evaluate


when an occasional GPF occurs.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Returns:

<lSuccess> A logical value indicating if the GPF controller


was properly installed.

Comments: Though FiveWin has been extensively tested


against GPFs, we wanted to offer control over
a possible GPF offering so an opportunity to take
control to close all files and generating an
error.log file with info to detect the cause.

Sample: SAMPLES\\TestTool.prg

Source code: SOURCE\\WINAPI\\ToolHelp.c

--------------------------------------------------------------------------------
InterruptUnRegister() Uninstalls a user defined GPFs controller
--------------------------------------------------------------------------------

Syntax: InterruptUnRegister() --> <lSuccess>

Parameters: None.

Returns:

<lSuccess> A logical value indicating if the GPF controller


was properly uninstalled.

Comments: Though FiveWin has been extensively tested


against GPFs, we wanted to offer control over
a possible GPF offering so an opportunity to take
control to close all files and generating an
error.log file with info to detect the cause.

Sample: SAMPLES\\TestTool.prg

Source code: SOURCE\\WINAPI\\ToolHelp.c

--------------------------------------------------------------------------------
InvalidateRect() Forces a rectangle to be repainted
--------------------------------------------------------------------------------

Syntax: InvalidateRect( <hWnd>, <lRepaint> ) --> nil

InvalidateRect( <hWnd>, <aRect>, <lRepaint> ) --> nil

This function supports two different formats as


above.

Parameters:

<hWnd> The handle of the window whose update region


get invalid and should be painted.

<aRect> Specifies the dimensions of the rectangle that


needs to be updated: { nTop, nLeft, nBottom, nRight }.
If not supplied means the whole window area.

<lRepaint> Specifies if the window must be painted.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Returns: Nil.

Observations: This function forces a window region or its whole


area to be repainted. Basically it generates a
WM_PAINT message.

Source code: SOURCE\\WINAPI\\InvalRec.c

--------------------------------------------------------------------------------
InvertRect() Inverts the colors of a window rectangle
--------------------------------------------------------------------------------

Syntax: InvertRect( <hDC>, <aRect> ) --> nil

Parameters:

<hDC> Identifies the window device context.

<aRect> Identifies the rectangle to be inverted:


{ nTop, nLeft, nBottom, nRight }

Returns: nil.

Observations: This function inverts the colors of a window


rectangle. Basically if performs an xOR operation
over the colors. Thus, inverting twice a region
will restore the original region colors.

Source code: SOURCE\\WINAPI\\Rects.c

See also: FillRect()

--------------------------------------------------------------------------------
IsCdRom() Checks if a drive is a CdRom
--------------------------------------------------------------------------------

Syntax: IsCdRom( [ <cDrive> ] ) --> <lSuccess>

Parameters:

<cDrive> The letter of the drive to check.


i.e.: "c". Lowercase and Uppercase is permitted.
By default, it uses "C".

Returns:

<lSuccess> A logical value indicating if the specified


drive is a CdRom drive.

Sample: MsgInfo( IsCdRom( "C" ) )

See SAMPLES\\TestDrvs.prg

Source code: SOURCE\\FUNCTION\\Drives.c

--------------------------------------------------------------------------------
IsDiskette() Checks if a drive is a floppy disk
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Syntax: IsDiskette( [ <cDrive> ] ) --> <lSuccess>

Parameters:

<cDrive> The letter of the drive to check.


i.e.: "c". Lowercase and Uppercase is permitted.
By default, it uses "A".

Returns:

<lSuccess> A logical value indicating if the specified


drive is a floppy drive.

Sample: MsgInfo( IsDiskette( "C" ) )

See SAMPLES\\TestDrvs.prg

Source code: SOURCE\\FUNCTION\\Drives.c

--------------------------------------------------------------------------------
IsIconic() Checks if a window is iconized
--------------------------------------------------------------------------------

Syntax: IsIconic( <hWnd> ) --> <lIconic>

Parameters:

<hWnd> The handle of the window to check if it


is iconized.

Returns:

<lIconic> A logical value indicating if the window is


iconized.

Source code: SOURCE\\WINAPI\\WndIs.c

--------------------------------------------------------------------------------
IsZip() Checks a valid ZIP file
--------------------------------------------------------------------------------

Syntax: IsZip( <cZipFileName> ) --> <lYesNo>

Parameters:

<cZipFileName> The name of the ZIP file to check.

Returns:

<lYesNo> A logical value indicating if the file is a


valid ZIP file.

Sample: SAMPLES\\TestZip.prg

Source code: SOURCE\\FUNCTION\\UnZip.c

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
IsZoomed() Checks if a window is maximized
--------------------------------------------------------------------------------

Syntax: IsZoomed( <hWnd> ) --> <lMaximized>

Parameters:

<hWnd> The handle of the window to check if it


is maximized.

Returns:

<lMaximized> A logical value indicating if the window is


maximized.

Source code: SOURCE\\WINAPI\\WndIs.c

--------------------------------------------------------------------------------
IsWindow() Checks if a window handle is valid
--------------------------------------------------------------------------------

Syntax: IsWindow( <hWnd> ) --> <lIsWindow>

Parameters:

<hWnd> The handle of the window to check if it


is a valid handle.

Returns:

<lIsWindow> A logical value indicating if the window handle


is valid.

Source code: SOURCE\\WINAPI\\WndIs.c

--------------------------------------------------------------------------------
IsWindowVisible() Checks if a window is visible
--------------------------------------------------------------------------------

Syntax: IsWindowVisible( <hWnd> ) --> <lVisible>

Parameters:

<hWnd> The handle of the window to check if it


is visible.

Returns:

<lVisible> A logical value indicating if the window is


visible.

Source code: SOURCE\\WINAPI\\WndIs.c

--------------------------------------------------------------------------------
KillTimer() Removes the specified timer
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Syntax: KillTimer( <hWnd>, <nIdTimer> ) --> <lSuccess>

Parameters:

<hWnd> The handle of the window associated with


the timer to be removed. This must be the same
value passed as the hWnd parameter of the SetTimer
function that created the timer.

<nIdTimer> Identifies the timer to be removed. It is the


value returned by SetTimer() function.

Returns:

<lSuccess> A logical value indicating the result of the


KillTimer() operation.

Sample: SAMPLES\\TestTime.prg

Source code: SOURCE\\WINAPI\\Timers.c

See also: Class TTimer

--------------------------------------------------------------------------------
L2Hex() Converts a long (4 bytes) into a hex string (8 chars)
--------------------------------------------------------------------------------

Syntax: L2Hex( <nLong> ) --> <cHex>

Parameters:

<nLong> A number in the range 0 - 2147483647 (+ or -)

Returns:

<cHex> A eight characters hex string.

Sample: MsgInfo( L2Bin( 123456789 ) )


// returns a "075BCD15" hex

Source code: SOURCE\\FUNCTION\\Or.c

See also: C2Hex() I2Hex()

--------------------------------------------------------------------------------
lAnd() Retrieves the logical AND of some numeric values
--------------------------------------------------------------------------------

Syntax: lAnd( <nValue1>, <nValue2> ) --> <lResult>

Parameters:

<nValue1> A numeric value to be bit-anded with


nValue2.

<nValue1> A numeric value to be bit-anded with


nValue1.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Returns:

<lResult> A logical value with the result of the bit-and


operation.

Observations: This function basically checks if a certain bit


flag is active in a numeric value.

Sample: SOURCE\\Classes\\TGet:Init() METHOD.

Source code: SOURCE\\FUNCTION\\Or.c

See also: nAnd() nOr() lOr()

--------------------------------------------------------------------------------
LbxGetItem() Retrieves an item of a listbox
--------------------------------------------------------------------------------

Syntax: LbxGetItem( <hWnd>, <nItem> ) --> <cText>

Parameters:

<hWnd> Identifies the handle of the listbox control


whose nItem text is to be retrieved.

<nItem> Identifies the 1 based index of the item whose


text is to be retrieved.

Returns:

<cText> The text associated with that ListBox item.

Observations: This function is used by FiveWin in the TListBox


class. Use the TListBox class methods instead
of manipulating directly these functions.

Source code: SOURCE\\WINAPI\\Lbx.c

See also: Class TListBox

--------------------------------------------------------------------------------
lChDir() Changes from one directory to another
--------------------------------------------------------------------------------

Syntax: lChDir( <cNewDir> ) --> <lSuccess>

Parameters:

<cNewDir> The path of the new dir to change to.

Returns:

<lSuccess> If that directory exists and lChDir() could


change into it.

Sample: lChDir( "c:\\" )

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Source code: SOURCE\\FUNCTION\\ChDir.c

See also: lMkDir() lRmDir()

--------------------------------------------------------------------------------
lIsDir() Checks the existence of a directory
--------------------------------------------------------------------------------

Syntax: lIsDir( <cDir> ) --> <lSuccess>

Parameters:

<cNewDir> The path of the directory to check


if exists.

Returns:

<lSuccess> If the directory <cDir> exist.

Sample: MsgInfo( lIsDir( "c:\\win" ) )

Source code: SOURCE\\FUNCTION\\FileName.prg

See also: lChDir() lRmDir() lMkDir() CurDrive()

--------------------------------------------------------------------------------
lMkDir() Creates a new directory
--------------------------------------------------------------------------------

Syntax: lMkDir( <cNewDir> ) --> <lSuccess>

Parameters:

<cNewDir> The path of the new dir to create.

Returns:

<lSuccess> If the directory was created successfully.

Sample: lMkDir( "c:\\Customer" )

Source code: SOURCE\\FUNCTION\\MkDir.c

See also: lChDir() lRmDir()

--------------------------------------------------------------------------------
LineTo() Draws a line from the current position up to another
--------------------------------------------------------------------------------

Syntax: LineTo( <hDC>, <nRow>, <nCol>, <hPen> ) --> <lSuccess>

Parameters:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<hDC> Identifies the device context where to paint the line.
In FiveWin: <oWnd>:GetDC() and later: <oWnd>:hDC.

<nRow>, <nCol> The coordinates of the line End-point.

Returns:

<lSuccess> If successfully completed.

Observations: This function draws a line from the current painting


position up to the end of the line. Use MoveTo()
to select the start painting position.

Sample: SAMPLES\\Lineas.prg SAMPLES\\TestGraf.prg

Source code: SOURCE\\WINAPI\\LineTo.c

See also: MoveTo() CreatePen()

--------------------------------------------------------------------------------
LoadBitmap() Load the specified resource bitmap
--------------------------------------------------------------------------------

Syntax: LoadBitmap( <hInst>, <cnBitmap> ) --> <hBitmap>

Parameters:

<hInst> Identifies the module that contains the bitmap


to be loaded.

<cnBitmap> The name or the numeric identifier of the


bitmap to load.

Returns:

<hBitmap> The handle of the bitmap loaded.

Observations: Don't use this function to load a bitmap from


disk. Use ReadBitmap() instead.

Sample: SAMPLES\\Install.prg SAMPLES\\TestRes.prg

Source code: SOURCE\\WINAPI\\LoadBmp.c

See also: ReadBitmap() DeleteObject()

--------------------------------------------------------------------------------
LoadCursor() Load the specified resource cursor
--------------------------------------------------------------------------------

Syntax: LoadCursor( <hInst>, <cnCursor> ) --> <hCursor>

Parameters:

<hInst> Identifies the module that contains the cursor


to be loaded.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<cnCursor> The name or the numeric identifier of
the cursor to be loaded.

Returns:

<hCursor> The handle of the loaded cursor. 0 if


not successful.

Source code: SOURCE\\WINAPI\\Cursors.c

See also: SetCursor() DestroyCursor() CursorWait() Cursor...

--------------------------------------------------------------------------------
LoadIcon() Load the specified resource icon
--------------------------------------------------------------------------------

Syntax: LoadIcon( <hInst>, <cnIcon> ) --> <hIcon>

Parameters:

<hInst> Identifies the handle of the module that


contains the icon to be loaded.

<cnIcon> The name or the numeric identifier of


the icon to be loaded.

Returns:

<hIcon> The handle of the loaded icon, or 0


if not successful.

Sample: SAMPLES\\Install.prg

Source code: SOURCE\\WINAPI\\Icons.c

See also: ExtractIcon() nIcons() DrawIcon()

--------------------------------------------------------------------------------
LoadLibrary() Load a Dynamic link library to use it
--------------------------------------------------------------------------------

Syntax: LoadLibrary( <cLibraryName> ) --> <hInstance>

Parameters:

<cLibraryName> The name of the DLL to load.

Returns:

<hInstance> The handle of the DLL just loaded.

Observations: Windows searches for the library in this order:

1 The current directory.

2 The Windows directory (the directory

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


containing WIN.COM); the GetWinDir()
function retrieves the path of this directory.

3 The Windows system directory (the directory


containing such system files as GDI.EXE);
the GetSysDir() function retrieves the path of
this directory.

4 The directory containing the executable file


for the current task; the GetModuleFileName
function retrieves the path of this directory.

5 The directories listed in the PATH environment


variable.

6 The list of directories mapped in a network.

The return value is the instance handle of the loaded library module if the
function is successful. Otherwise, it is an error value less than
HINSTANCE_ERROR.

Errors

If the function fails, it returns one of the following error values:

Value Meaning

0 System was out of memory, executable file was corrupt, or relocations


were invalid.
2 File was not found.
3 Path was not found.
5 Attempt was made to dynamically link to a task, or there was a sharing
or network-protection error.
6 Library required separate data segments for each task.
8 There was insufficient memory to start the application.
10 Windows version was incorrect.
11 Executable file was invalid. Either it was not a Windows application
or there was an error in the .EXE image.
12 Application was designed for a different operating system.
13 Application was designed for MS-DOS 4.0.
14 Type of executable file was unknown.
15 Attempt was made to load a real-mode application (developed for an
earlier version of Windows).
16 Attempt was made to load a second instance of an executable file
containing multiple data segments that were not marked read-only.
19 Attempt was made to load a compressed executable file. The file must
be decompressed before it can be loaded.
20 Dynamic-link library (DLL) file was invalid. One of the DLLs required
to run this application was corrupt.
21 Application requires 32-bit extensions.

Comments

If the module has been loaded, LoadLibrary increments (increases by one)


the module's reference count. If the module has not been loaded, the function
loads it from the specified file.

LoadLibrary increments the reference count for a library module each time
an application calls the function. When it has finished using the module, the
application should use the FreeLibrary function to decrement (decrease by one)
the reference count.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


An application can use the GetProcAddress function to access functions in a
library that was loaded using LoadLibrary.

Sample: SAMPLES\\AutoLay.prg DllCall.prg DllClear.prg

Source code: SOURCE\\WINAPI\\Dll.c

See also: FreeLibrary()

--------------------------------------------------------------------------------
LoadString() Load the specified resource string
--------------------------------------------------------------------------------

Syntax: LoadString( <hInst>, <nResId> ) --> <cString>

Parameters:

<hInst> The handle of the module that contains


the string to be loaded.

<nResId> The numeric identifier of the string


resource to be loaded.

Returns:

<cString> The string just loaded or "".

Source code: SOURCE\\WINAPI\\String.c

--------------------------------------------------------------------------------
LPToDP() Converts logical coordinates into device coordinates
--------------------------------------------------------------------------------

Syntax: LPToDP( <hDC>, <aPoint> ) --> <lSuccess>

Parameters:

<hDC> Identifies the device context.

<aPoint> Contains a { nRow, nCol } point description to


be mapped into device coordinates.

Returns:

<lSuccess> If the operation was completed successfully.

Observations: This function store the new values inside the


same aPoint supplied array.

Source code: SOURCE\\WINAPI\\Point.c

See also: DPToLP()

--------------------------------------------------------------------------------
lSaveObject() Saves an object/array to disk
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Syntax: lSaveObject( <oVar>, <cFile> [,<nOpenMode>] ) --> nil

Parameters:

<oVar> Is the Object or Array to save to disk

<cFile> Is the name of the file where the Array/Object will


be saved to.

<nOpenMode> Is the DOS File mode in which the file shall be opened.
The default value is FO_WRITE and FO_COMPAT

This Function lets you save any object or Array to


a File. Please note, that you can not save a codeblock
to disc; if an Array element contains such a
codeblock, it will be NIL after retrieval.

If you need to work with a codeblock in a class, then


hardcode the block as a setget method instead of
storing it in a instvar slot.

--------------------------------------------------------------------------------
lWRunning() Checks if the main FiveWin events-looping is working
--------------------------------------------------------------------------------

Syntax: lWRunning() --> <lRunning>

Parameters: None

Returns:

<lRunning> True if FiveWin main loop event-processing is


already working.

Observations: This function is used by FiveWin to check that


the app is already processing and dispatching
events.

Source code: Not supplied.

--------------------------------------------------------------------------------
LZCopyFile() Copy and expands a Windows compressed file
--------------------------------------------------------------------------------

Syntax: LZCopyFile( <cFileSource>, <cFileTarget> )


--> <lSuccess>

Parameters:

<cFileSource> The name of the source file name to copy


-and expand-.

<cFileTarget> Specifies the target file where to place the


result.

Returns:

<lSuccess> If the operation was completed successfully.

Observations: This function simplifies several API function,

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


using them automatically to perform the
desired operation.

Sample: SAMPLES\\Install.prg

Source code: SOURCE\\WINAPI\\LzExpand.c

--------------------------------------------------------------------------------
MapDialogRect() Converts dialogbox units into screen units (pixels)
--------------------------------------------------------------------------------

Syntax: MapDialogRect( <hDlg>, <aRect> ) --> nil

Parameters:

<hDlg> The handle of the window of the dialogbox.


<oDlg>:hWnd.

<aRect> An array holding the rect values:


{ nTop, nLeft, nBottom, nRight }

Returns: The pixel values are stored again inside the


aRect array.

Source code: SOURCE\\WINAPI\\Rects.c

--------------------------------------------------------------------------------
MakeIntResource() Converts an integer resource ID in a Windows format
--------------------------------------------------------------------------------

Syntax: MakeIntResource( <nValue> ) --> <nLValue>

Parameters:

<nValue> A numeric value to be transformed into


a long numeric value.

Returns:

<nLValue> The same numeric value but in long format.

Observations: <nValue> is normally a WORD ( two bytes ) value.


<nLValue> is a LONG ( four bytes ) value.

Source code: SOURCE\\FUNCTION\\MakeIntR.c

--------------------------------------------------------------------------------
MeasureItem() FiveWin function to dispatch WM_MEASUREITEM msgs
--------------------------------------------------------------------------------

Syntax: MeasureItem( <nPMeasureItemStruct>, <nHeight> )


--> <lSuccess>

Parameters:

<nPMeasureItemStruct> A pointer ( numeric value ) to a


MEASUREITEM WinApi struct.

<nHeight> The height to be assigned into that


MEASUREITEM struct.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Returns:

<lSuccess> If the operation has been performed


successfully.

Observations: This function is managed automatically by


FiveWin to determinate the dimensions of a
'ownerdraw' WinApi control.

Source code: SOURCE\\WINAPI\\MeasureI.c

See also: TWindow:MeasureItem()

--------------------------------------------------------------------------------
MemStat() Returns a Dialog with all memory values
--------------------------------------------------------------------------------

Syntax: MemStat() --> nil

Parameters: None

Returns: nil

Observations: This function checks all Clipper memory values.

Sample: SAMPLES\\Memory.prg

Source code: SOURCE\\FUNCTION\\MemStat.prg

See also: GlobalFreeSpace()

--------------------------------------------------------------------------------
MenuAddItem() Adds a menuitem to a menu. Internally used.
--------------------------------------------------------------------------------

Syntax: MenuAddItem( <cPrompt>, <cMsg>, <lChecked>,


<lActive>, <bAction>, <cBmpFile>,
<cResName>, <oMenu>, <bBlock>, <nVKState>,
<nVirtKey>, <lHelp> ) --> <oMenuItem>

Parameters:

<cPrompt> The caption of the menuitem

<cMsg> The messagebar message for that menuitem

<lChecked> If it is checked originally the menuitem

<lActive> If it is enabled originally the menuitem

<bAction> The action to be performed for that menuitem selection

<cBmpFile> The name of a BMP file to be used to draw the menuitem

<cResName> The name of a BMP resource to be used to draw the


menuitem

<oMenu> The oMenu container of this menuitem

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<bBlock> The action to be performed by this menuitem supplied
as a codeblock

<nVKState> The accelerator info for this menuitem

<nVirtKey> Extra accelerator info for this menuitem

<lHelp> If it is a right-position typical help menuitem

Returns: The menuitem object properly built and initialized

Observations: FiveWin manages this function automatically from


inside the xBase commands.

Sample: SAMPLES\\TestMenu.prg

Source code: SOURCE\\CLASSES\\PdMenu.prg

See also: Class TMenuItem Class TMenu

--------------------------------------------------------------------------------
MenuBegin() Begins a new menu definition. Internally used.
--------------------------------------------------------------------------------

Syntax: MenuBegin( <lPopup>, <lSystem>, <oWnd> ) --> <oMenu>

Parameters:

<lPopup> If it is going to be a popup menu

<lSystem> If it is going to be a system menu

<oWnd> The window container of this menu

Returns:

<oMenu> The menu object already built and initialized

Observations: This function is used automatically by FiveWin


from the xBase commands.

Sample: SAMPLES\\TestMenu.prg

Source code: SOURCE\\CLASSES\\PdMenu.prg

See also: Class TMenu Class TMenuItem

--------------------------------------------------------------------------------
MenuEnd() Ends a menu definition. Internally used.
--------------------------------------------------------------------------------

Syntax: MenuEnd() --> <oMenu>

Parameters: None

Returns:

<oMenu> The menu object already initialized and with all


its submenus built and initialized.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Observations: This function is used automatically by FiveWin
from the xBase commands.

Sample: SAMPLES\\TestMenu.prg

Source code: SOURCE\\CLASSES\\PdMenu.prg

See also: Class TMenu Class TMenuItem

--------------------------------------------------------------------------------
MessageBeep() Plays a system alert level waveform sound or a tone
--------------------------------------------------------------------------------

Syntax: MessageBeep( <nBeepType> ) --> nil

Parameters:

<nBeepType> The type of sound to produce:

-1 Produces a standard beep sound by


using the computer speaker.
MB_ICONASTERISK Plays the sound identified by the
SystemAsterisk entry in the [sounds]
section of WIN.INI.
MB_ICONEXCLAMATION Plays the sound identified by the
SystemExclamation entry in the
[sounds] section of WIN.INI.
MB_ICONHAND Plays the sound identified by the
SystemHand entry in the [sounds]
section of WIN.INI.
MB_ICONQUESTION Plays the sound identified by the
SystemQuestion entry in the [sounds]
section of WIN.INI.
MB_OK Plays the sound identified by the
SystemDefault entry in the [sounds]
section of WIN.INI.

Returns: nil

Source code: SOURCE\\WINAPI\\MsgBeep.c

--------------------------------------------------------------------------------
MessageBox() Creates, displays and operates a MessageBox window
--------------------------------------------------------------------------------

Syntax: MessageBox( <hWnd>, <cText>, <cTitle>, <nStyle> )


--> <nRetValue>

Parameters:

<hWnd> The handle of the container window of the


messagebox dialog to be created. If it is 0, it will
not have a container window.

<cText> The message to be displayed.

<cTitle> The dialogbox title to be displayed. Default value


is "Error".

<nStyle> Specifies the contents and behavior of the DialogBox.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


This parameter can be a combination of the following
values:

Value Meaning

MB_ABORTRETRYIGNORE The message box contains three


push buttons: Abort, Retry, and
Ignore.
MB_APPLMODAL The user must respond to the
message box before continuing
work in the window identified by
the hwndParent parameter. However,
the user can move to the windows
of other applications and work in
those windows. MB_APPLMODAL is the
default if neither MB_SYSTEMMODAL
nor MB_TASKMODAL is specified.
MB_DEFBUTTON1 The first button is the default.
Note that the first button is
always the default unless
MB_DEFBUTTON2 or MB_DEFBUTTON3 is
specified.
MB_DEFBUTTON2 The second button is the default.
MB_DEFBUTTON3 The third button is the default.
MB_ICONASTERISK Same as MB_ICONINFORMATION.
MB_ICONEXCLAMATION An exclamation-point icon appears
in the message box.
MB_ICONHAND Same as MB_ICONSTOP.
MB_ICONINFORMATION An icon consisting of a lowercase
letter "I" in a circle appears in
the message box.
MB_ICONQUESTION A question-mark icon appears in
the message box.
MB_ICONSTOP A stop-sign icon appears in the
message box.
MB_OK The message box contains one push
button: OK.
MB_OKCANCEL The message box contains two push
buttons: OK and Cancel.

MB_RETRYCANCEL The message box contains two push


buttons: Retry and Cancel.
MB_SYSTEMMODAL All applications are suspended
until the user responds to the
message box. Unless the application
specifies MB_ICONHAND, the message
box does not become modal until
after it is created; consequently,
the parent window and other windows
continue to receive messages
resulting from its activation.
System-modal message boxes are
used to notify the user of serious,
potentially damaging errors that
require immediate attention (for
example, running out of memory).
MB_TASKMODAL Same as MB_APPLMODAL except that
all the top-level windows
belonging to the current task
are disabled if the hwndParent
parameter is NULL. This flag

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


should be used when the calling
application or library does not
have a window handle available
but still needs to prevent input
to other windows in the current
application without suspending
other applications.

MB_YESNO The message box contains two push


buttons: Yes and No.
MB_YESNOCANCEL The message box contains three
push buttons: Yes, No, and Cancel.

#define MB_OK 0 // 0x0000


#define MB_OKCANCEL 1 // 0x0001
#define MB_ABORTRETRYIGNORE 2 // 0x0002
#define MB_YESNOCANCEL 3 // 0x0003
#define MB_YESNO 4 // 0x0004
#define MB_RETRYCANCEL 5 // 0x0005
#define MB_TYPEMASK 15 // 0x000F
#define MB_ICONHAND 16 // 0x0010
#define MB_ICONQUESTION 32 // 0x0020
#define MB_ICONEXCLAMATION 48 // 0x0030
#define MB_ICONASTERISK 54 // 0x0040
#define MB_ICONMASK 240 // 0x00F0
#define MB_ICONINFORMATION MB_ICONASTERISK
#define MB_ICONSTOP MB_ICONHAND
#define MB_DEFBUTTON1 0 // 0x0000
#define MB_DEFBUTTON2 256 // 0x0100
#define MB_DEFBUTTON3 512 // 0x0200
#define MB_DEFMASK 3840 // 0x0F00
#define MB_APPLMODAL 0 // 0x0000
#define MB_SYSTEMMODAL 4096 // 0x1000
#define MB_TASKMODAL 8192 // 0x2000
#define MB_NOFOCUS 32768 // 0x8000

Returns: The return value is 0 if there is no enough


memory to create the message box. Otherwise,
it is one of the following menu-item values
returned by the dialogbox:

Value Meaning

IDABORT Abort button was selected.


IDCANCEL Cancel button was selected.
IDIGNORE Ignore button was selected.
IDNO No button was selected.
IDOK OK button was selected.
IDRETRY Retry button was selected.
IDYES Yes button was selected.

#define IDOK 1
#define IDCANCEL 2
#define IDABORT 3
#define IDRETRY 4
#define IDIGNORE 5
#define IDYES 6
#define IDNO 7

If a message box has a Cancel button, the IDCANCEL

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


value will be returned if either the ESC key is
pressed or the Cancel button is selected. If the
message box has no Cancel button, pressing ESC has
no effect.

Observations: FiveWin supplies as built-in function the most


common used messagebox styles. See Msg...() functions.

Sample: SAMPLES\\TestMsg.prg

Source code: SOURCE\\WINAPI\\MsgBox.c

See also: MsgInfo() MsgAlert() MsgYesNo()


MsgStop()
MsgRetryCancel() MsgAbout() MsgBeep() MsgMeter()

--------------------------------------------------------------------------------
MeterPaint() Paints the FiveWin meter
--------------------------------------------------------------------------------

Syntax: MeterPaint( <hWnd>, <hDC>, <nActual>, <nTotal>,


<nPercentage>, <cText>, <lPercentage>,
<nClrPane>, <nClrText>, <nClrBar>,
<nClrBackText>, <hFont> ) --> 0

Parameters:

<hWnd> The handle of the control beeing painted

<hDC> The handle of the device context of that window

<nActual> The actual value represented by the meter

<nTotal> The total value represented by the meter

<nPercentage> The percentage value represented by the meter

<cText> A text to be displayed inside the meter

<lPercentage> If the percentage has to be displayed

<nClrPane> 4 different RGB colors to use to paint all


<nClrText> different components.
<nClrBar>
<nClrBackText>

<hFont> The handle of the font to be used to display


the cText

Returns: Always 0

Observations: This function is automatically used by FiveWin


from inside the Class TMeter. This function was
designed to speed up the paint process.

Sample: SAMPLES\\Install.prg

Source code: SOURCE\\FUNCTION\\MetPaint.c

See also: Class TMeter MsgMeter()

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
MoveTo() Changes the painting coordinates
--------------------------------------------------------------------------------

Syntax: MoveTo( <hDC>, <nCol>, <nRow> ) --> <nLOldPos>

Parameters:

<hDC> The handle of the device context where


where are going to paint.

<nCol>, <nRow> The coordinates where to start painting.

Returns:

<nLOldPos> A numeric LONG ( four bytes ) value that


stores the old position. The LOWORD( <nLOldValue> )
contains the old nCol and the HIWORD( <nLOldValue> )
contains the old nRow.

Observations: Some API GDI painting functions requires to


previously determinate the position where to start
painting. MoveTo() lets do that.

Sample: SAMPLES\\Lines.prg

Source code: SOURCE\\WINAPI\\MoveTo.c

See also: LineTo()

--------------------------------------------------------------------------------
MoveWindow() Changes the position /and dimensions of a window
--------------------------------------------------------------------------------

Syntax: MoveWindow( <hWnd>, <nLeft>, <nTop>, <nWidth>,


<nHeight>, <lRepaint> ) --> <lSuccess>

Parameters:

<hWnd> The handle of the window to move / and resize.

<nLeft>, <nTop> The new origin position coordinates

<nWidth>, <nHeight> The new dimensions (if specified)

<lRepaint> If the window has to be repainted after this


operation

Returns:

<lSuccess> If the operation was successfully completed.

Source code: SOURCE\\WINAPI\\WndMove.c

See also: TWindow:Move()

--------------------------------------------------------------------------------
MsgAbout() MessageBox about style
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Syntax: MsgAbout( <cMsg> [,<cTitle>] ) --> nil

Parameters:

<cMsg> The message to display on the about dialogbox.

<cTitle> The title of the dialogbox. By default is "About"

Returns: nil

Observations: This function automatically calls the undocumented


WinApi function ShellAbout(), which it is the one
used by Windows in all standard applications when
you select about.

The standard dialogbox shows an icon, by default


it is a windows logo. To provide your icon to
MsgAbout() you should define an icon with the
number 1 as identifier:

MyApp.rc

1 ICON "MyApp.ico"

and then:

rc -K MyApp.rc MyApp.exe

Sample: SAMPLES\\TestMsg.prg

Source code: SOURCE\\WINAPI\\MsgBox.c

See also: MsgInfo() MsgAlert() MsgStop() MsgBeep()


MsgYesNo() MsgRetryCancel() MsgMeter() MsgGet()

--------------------------------------------------------------------------------
MsgAlert() MessageBox alert style
--------------------------------------------------------------------------------

Syntax: MsgAlert( <cMsg> [,<cTitle>] ) --> nil

Parameters:

<cMsg> The message to display

<cTitle> The title of the dialogbox. By default "Alert"

Returns: nil

Observations: This function simplifies the management of the


standard WinApi function MessageBox() with the
proper style to show the standard Alert icon.

Sample: SAMPLES\\TestMsg.prg

Source code: SOURCE\\WINAPI\\MsgBox.c

See also: MsgInfo() MsgStop() MsgAbout() MsgYesNo()


MsgRetryCancel() MsgBeep() MsgMeter() MsgGet()

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
MsgBeep() MessageBeep beep tone
--------------------------------------------------------------------------------

Syntax: MsgBeep() --> nil

Parameters: None

Returns: nil

Observations: This function simplifies the use of the WinApi


function MessageBeep( 0 ), and follows the
FiveWin guides of Msg...() functions.

Sample: SAMPLES\\TestMsg.prg

Source code: SOURCE\\WINAPI\\MsgBeep.c

See also: MessageBeep() MsgAlert() MsgInfo() MsgStop()


MsgYesNo() MsgRetryCancel() MsgGet()

--------------------------------------------------------------------------------
MsgGet() General one-line input message
--------------------------------------------------------------------------------

Syntax: MsgGet( <cTitle>, <cText>, @<uVar> [,<cBmpFile>] )


--> <lOk>

Parameters:

<cTitle> The title of the DialogBox.

<cText> The text of the SAY besides the GET.

<uVar> Any variable value passed by reference.

<cBmpFile> The name of a BMP file to display besides


the GET.

Returns:

<lOk> A logical value indicating if the user selected


Ok (.t.) or Cancel (.f.).
The modified value is stored in the same <uVar>
provided by reference.

Observations: This is a very useful function to quickly display


a DialogBox with a GET to accept some user info
input.
Using MsgGet() you avoid designing a DialogBox,
defining it and activating it just for this same
purpose. MsgGet() speed up some basic user input.

Sample: SAMPLES\\TestMsg.prg

Source code: SOURCE\\FUNCTION\\MsgGet.prg

See also: MsgAlert() MsgInfo() MsgStop() MsgYesNo()


MsgBeep() MsgRetryCancel() MsgAbout() MsgBeep()

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
MsgInfo() MessageBox information style
--------------------------------------------------------------------------------

Syntax: MsgInfo( <cMsg> [,<cTitle>] ) --> nil

Parameters:

<cMsg> The message to display

<cTitle> The title of the dialogbox.


By default "Information"

Returns: nil

Observations: This function simplifies the management of the


standard WinApi function MessageBox() with the
proper style to show the standard Info icon.

Sample: SAMPLES\\TestMsg.prg

Source code: SOURCE\\WINAPI\\MsgBox.c

See also: MsgAlert() MsgStop() MsgAbout() MsgYesNo()


MsgRetryCancel() MsgBeep() MsgMeter() MsgGet()

--------------------------------------------------------------------------------
MsgLogo() Shows a floating logo, typically used at start
--------------------------------------------------------------------------------

Syntax: MsgLogo( <cLogoFile>, [<nSeconds>] ) --> nil

Parameters:

<cLogoFile> The name of a .BMP bitmap file or the name


of a bitmap stored in resources.

FiveWin will check for the existence of the <cLogoFile>


as a .BMP file, and if it does not exist then it will
look for it inside the resources.

<nSeconds> An optional numeric value, indicating how many


seconds the logo has to be shown. By default it waits
for four seconds.

Returns: nil

Observations: This function let you show an initial application


logo as many Microsoft and Borland products do.

Sample: IDE\\Ide.exe

Source code: SOURCE\\FUNCTION\\MsgLogo.prg

See also: Msg...() functions

--------------------------------------------------------------------------------
MsgMeter() General meter progress dialog
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Syntax: MsgMeter( <bAction> [,<cMsg>] [,<cTitle>] ) --> nil

Parameters:

<bAction> The codeblock to evaluate while the


meter evolves. It has to accept four values:

bAction = { | oMeter, oText, oDlg, lEnd | ;


YourAction( oMeter, oText, oDlg, @lEnd ) }

<oMeter> Is a reference to the oMeter (TMeter) object


that your user defined function
(YourAction()) will receive.

<oText> Is a reference to the oText (TSay) object


that your user defined function
(YourAction()) will receive.
You can <oText>:SetText(<cNewText>) to
change its contains while the
meter evolves.

<oDlg> Is a reference to the oDlg (TDialog)


that your user defined function
(YourAction()) will receive.

<lEnd> A logical value supplied by


reference. If you set it to .t., then
all the process will end.

<cMsg> The text of the SAY object placed at the


MsgMeter dialogBox. By default it is
"Processing..."

<cTitle> The title of the DialogBox. By default it


is "Please, wait"

Returns: nil

Observations: This function simplifies the process of


creating and displaying a DialogBox where a
progress meter is displayed.
This is very typically an operation to perform when
you are reindexing, or doing some operation that
requires some user waiting and processing
involved.
This function, though it may seem a little confusing
to use, will let you manage Meters very easily.

Sample: SAMPLES\\TestMMt.prg

Source code: SOURCE\\FUNCTION\\MsgMeter.prg

See also: MsgAlert() MsgStop() MsgAbout() MsgYesNo()


MsgRetryCancel() MsgBeep() MsgGet()

--------------------------------------------------------------------------------
MsgPaint() FiveWin MessageBar painting function
--------------------------------------------------------------------------------

Syntax: MsgPaint( <hWnd>, <cMsg>, <cMsgDef>, <lErase>,


<lCentered> ) --> nil

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Parameters:

<hWnd> The handle of the window of the MsgBar


control that is been painted

<cMsg> The message to display

<cMsgDef> The alternative default message to be displayed


if cMsg is not supplied

<lErase> If the whole MessageBar has to be repainted

<lCentered> If the message has to be painted centered

Returns: nil

Observations: This function is automatically used from the


class TMsgBar. INTERNAL !!!

Sample: Most of the FiveWin samples manages bottom


message bars.

Source code: SOURCE\\FUNCTION\\MsgTools.c

See also: Class TMsgBar

--------------------------------------------------------------------------------
MsgRun() Shows a DialogBox with a msg and executes an action
--------------------------------------------------------------------------------

Syntax: MsgRun( <cMsg> [,<cTitle>], [<bAction>] )


--> nil

Parameters:

<cMsg> The message to display

<cTitle> The title of the dialogbox.


By default "Please, wait..."

<bAction> The codeblock to execute. By default it


just waits 1 second and finish. MsgRun() will end
automatically the modal DialogBox once the codeblock
action is performed.

Returns: nil

Observations: This function simplifies the process of showing


a brief message to the user and issuing an action,
without having to design and manage a non-modal
DialogBox. This function uses a Modal DialogBox which
guaranties that the application execution will wait
until the codeblock action is performed.

Sample: SAMPLES\\TestMsg.prg

Source code: SOURCE\\FUNCTION\\MsgRun.prg

See also: All Msg...() functions. They greatly simplify

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


your work!

--------------------------------------------------------------------------------
MsgStop() MessageBox stop style
--------------------------------------------------------------------------------

Syntax: MsgStop( <cMsg> [,<cTitle>] ) --> nil

Parameters:

<cMsg> The message to display

<cTitle> The title of the dialogbox.


By default "Stop"

Returns: nil

Observations: This function simplifies the management of the


standard WinApi function MessageBox() with the
proper style to show the standard Stop icon.

Sample: SAMPLES\\TestMsg.prg

Source code: SOURCE\\WINAPI\\MsgBox.c

See also: MsgAlert() MsgInfo() MsgAbout() MsgYesNo()


MsgRetryCancel() MsgBeep() MsgMeter() MsgGet()

--------------------------------------------------------------------------------
MsgToolBar() General Tool-bar style Dialog
--------------------------------------------------------------------------------

Syntax: MsgToolBar( <oWndParent>, <cTitle>, <aActions>,


<aBmps1>, <aBmps2> ) --> nil

Parameters:

<oWndParent> The reference of the container window


object of the toolbar to be created.

<cTitle> The title of the dialogbox to create

<aActions> An array containing several actions in codeblocks,


one for each button on the ToolBar.

<aBmps1> An array with the names of the BMP files or


the BMP resources to use to display the up state
of each toolbar button.

<aBmps2> An array with the names of the BMP files or


the BMP resources to use to display the down state
of each toolbar button.

Returns: nil

Observations: This function lets simplifies the design and


activation of a floating toolbar.
Its main goal is to increase productivity with
a minimum effort.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Sample: IDE\\SOURCE\\Report.prg

Source code: SOURCE\\FUNCTION\\MsgTBar.prg

See also: MsgAlert() MsgInfo() MsgAbout() MsgYesNo()


MsgRetryCancel() MsgBeep() MsgMeter() MsgGet()

--------------------------------------------------------------------------------
MsgWait() Shows a DialogBox with a msg and waits some time
--------------------------------------------------------------------------------

Syntax: MsgWait( <cMsg> [,<cTitle>], [<nSeconds>] )


--> nil

Parameters:

<cMsg> The message to display

<cTitle> The title of the dialogbox.


By default "Please, wait..."

<nSeconds> The time in seconds to wait. By default


just waits 4 seconds. MsgWait() will automatically
end the DialogBox that appears.

Returns: nil

Observations: This function simplifies the process of showing


a brief message to the user and waiting a little.
This function uses a Modal DialogBox which guaranties
that the application execution will wait until the
DialogBox is removed.

Sample: SAMPLES\\TestMsg.prg

Source code: SOURCE\\FUNCTION\\MsgRun.prg

See also: All Msg...() functions. They greatly simplify


your work!

--------------------------------------------------------------------------------
MsgNoYes() MessageBox YesNo style with default No .
--------------------------------------------------------------------------------

Syntax: MsgNoYes( <cMsg>, <cTitle> ) --> <lYesNo>

Parameters:

<cMsg> The message to display

<cTitle> The title of the dialogbox.


By default "Please, select"

Returns:

<lYesNo> A logical value .t. if the user choosed "Yes".

Observations: This function simplifies the management of the


standard WinApi function MessageBox() with the
proper style to show the question icon and

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


the YesNo style.

Sample: SAMPLES\\TestMsg.prg

Source code: SOURCE\\WINAPI\\MsgBox.c

See also: MsgAlert() MsgInfo() MsgAbout() MsgStop()


MsgRetryCancel() MsgBeep() MsgMeter() MsgGet()

--------------------------------------------------------------------------------
MsgYesNo() MessageBox YesNo style
--------------------------------------------------------------------------------

Syntax: MsgYesNo( <cMsg>, <cTitle> ) --> <lYesNo>

Parameters:

<cMsg> The message to display

<cTitle> The title of the dialogbox.


By default "Please, select"

Returns:

<lYesNo> A logical value .t. if the user choosed "Yes".

Observations: This function simplifies the management of the


standard WinApi function MessageBox() with the
proper style to show the question icon and
the YesNo style.

Sample: SAMPLES\\TestMsg.prg

Source code: SOURCE\\WINAPI\\MsgBox.c

See also: MsgAlert() MsgInfo() MsgAbout() MsgStop()


MsgRetryCancel() MsgBeep() MsgMeter() MsgGet()

--------------------------------------------------------------------------------
nAnd() Generates a numeric AND value from some numbers
--------------------------------------------------------------------------------

Syntax: nAnd( <nValue1>, <nValue2> [,...<nValueN>] )


--> <nResult>

Parameters:

<nValue1> A numeric value to be bit-ANDed with other


numeric values.

<nValue2> More numeric values to be bit-ANDded.


<nValueN>

Returns:

<nResult> A numeric value as result of bit-ANDded


all the numeric values supplied as parameters.

Observations: Just a little remembering:

1 AND 1 = 1

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


1 AND 0 = 0
0 AND 1 = 0
0 AND 0 = 0

This is applicable to each bits in those


numeric values

Sample: MsgInfo( nAnd( 15, 2 ) ) // it will return 2

// 15 = '00001111'
// 2 = '00000010'
//================
// 2 = '00000010'

Source code: SOURCE\\FUNCTION\\Or.c

See also: nOr() lAnd()

--------------------------------------------------------------------------------
nArgC() Returns the number of the command line parameters
--------------------------------------------------------------------------------

Syntax: nArgC() --> <nInitParams>

Parameters: None

Returns:

<nInitParams> The number of parameters + 1 supplied to the


application, thus is like calling PCount() + 1 just
starting the app, though nArgC() may be called
from anywhere in the app.

Sample: SAMPLES\\TestArgs.prg

Source code: SOURCE\\FUNCTION\\Args.c

See also: cArgV() PCount() Param()

--------------------------------------------------------------------------------
nColorToN() Returns the numeric color equivalent of an xBase color
--------------------------------------------------------------------------------

Syntax: nColorToN( <cColor> ) --> <nColor>

Parameters:

<cColor> A color in an xBase string format

Returns:

<nColor> The numeric ( byte ) representation of


that xBase color

Observations: This <nColor> it is not the RGB representation.

Source code: SOURCE\\FUNCTION\\ColorToN.c

See also: nRGB() nGetForeRGB() nGetBackRGB()

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
nDlgBox() Automatic DialogBox testing function.
--------------------------------------------------------------------------------

Syntax: nDlgBox( <cDlgName> ) --> <nResult>

Parameters:

<cDlgName> The name of the resource of a dialogbox


to quickly execute and test.

Returns:

<nResult> The value supplied to EndDlg() to end the


dialog.

Observations: This function was developed with the intention


of quickly test dialog boxes, in a prototype
stage.

Sample: nDlgBox( "Customers" )

Source code: SOURCE\\WINAPI\\dlogbox.c

See also: Dialog xBase commands - Class TDialog

--------------------------------------------------------------------------------
nGetFileFilter() Returns the FileSelect DialogBox selected type
--------------------------------------------------------------------------------

Syntax: nGetFileFilter() --> <nType>

Parameters:

<nType> A numeric value indicating the type


of files that was selected from inside the
standard DialogBox WinApi cGetFile() function.

Returns:

<nType> A numeric value with the order of the


type of files selected from cGetFile()

Observations: This value only has meaning when several types


of files has been specified when calling cGetFile()

Sample: IDE\\Ide.prg

Source code: SOURCE\\WINAPI\\GetFile.c

See also: cGetFile()

--------------------------------------------------------------------------------
nGetBackRgb() Returns the numeric value of an xBase back color
--------------------------------------------------------------------------------

Syntax: nGetBackRgb( <cColor> ) --> <nBackRGB>

Parameters:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<cColor> An xBase string color representation.

Returns:

<nBackRGB> A numeric RGB value corresponding to


the background component of the <cColor>
color expression.

Source code: SOURCE\\FUNCTION\\ColorToN.c

See also: nGetForeRGB() nRGB() nColorToN()

--------------------------------------------------------------------------------
nGetForeRGB() Returns the numeric value of an xBase fore color
--------------------------------------------------------------------------------

Syntax: nGetForeRgb( <cColor> ) --> <nForeRGB>

Parameters:

<cColor> An xBase string color representation.

Returns:

<nForeRGB> A numeric RGB value corresponding to


the foreground component of the <cColor>
color expression.

Source code: SOURCE\\FUNCTION\\ColorToN.c

See also: nGetBackRGB() nRGB() nColorToN()

--------------------------------------------------------------------------------
nIcons() Returns the number of icons
--------------------------------------------------------------------------------

Syntax: nIcons( <cFileName> ) --> <nIcons>

Parameters:

<cFileName> The name of a file that may contains


some icons (EXE, DLL, ICO, etc...)

Returns:

<nIcons> The number of icons contained inside


that file

Observations: These icons may be extracted with ExtractIcon()

Sample: IDE\\SOURCE\\Icons.prg

Source code: SOURCE\\WINAPI\\Icons.c

See also: ExtractIcon() LoadIcon() DrawIcon()

--------------------------------------------------------------------------------
nOr() Generates a numeric OR value from some numbers
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Syntax: nOr( <nValue1>, <nValue2> [,...<nValueN>] )
--> <nResult>

Parameters:

<nValue1> A numeric value to be bit-ORed with other


numeric values.

<nValue2> More numeric values to be bit-ORed.


<nValueN>

Returns:

<nResult> A numeric value as result of bit-ORed


all the numeric values supplied as parameters.

Observations: Just a gentle reminder:

1 OR 1 = 1
1 OR 0 = 1
0 OR 1 = 1
0 OR 0 = 0

This is applicable to each bits in those


numeric values

Sample: MsgInfo( nOr( 15, 2 ) ) // it will return 15

// 15 = '00001111'
// 2 = '00000010'
//================
// 15 = '00001111'

Source code: SOURCE\\FUNCTION\\Or.c

See also: nAnd() lAnd()

--------------------------------------------------------------------------------
nRandom() Generates a random number
--------------------------------------------------------------------------------

Syntax: nRandom( [<nRange>] ) --> <nRandom>

Parameters:

<nRange> An optional numeric value to set the range from


where we want to generate a random number. By default
a 65535 numeric range is used.

Returns:

<nRandom> A random number in the range 0 - <nRange>.

Sample: MsgInfo( nRandom( 100 ) ) // returns any number


// in the range 0 - 100

Source code: SOURCE\\FUNCTION\\Random.prg

See also: Numeric manipulation functions

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
nRGB() Generates a RGB numeric value
--------------------------------------------------------------------------------

Syntax: nRGB( <nRed>, <nGreen>, <nBlue> ) --> <nRGB>

Parameters:

<nRed> The numeric value of the red component.

<nGreen> The numeric value of the green component.

<nBlue> The numeric value of the blue component.

Returns:

<nRGB> A numeric (RGB) value corresponding to


the red, green and blue values specified.

Observations: Though FiveWin supplies a preprocessor RGB()


function, also this function is supplied to
let use this function inside CodeBlocks, macros,
etc...

Source code: SOURCE\\WINAPI\\Rgb.c

See also: Colors.ch: RGB() nGetBackRGB() nGetForeRgb()

--------------------------------------------------------------------------------
nStrHash() Returns a unique hash value for a string
--------------------------------------------------------------------------------

Syntax: nStrHash( <cString>, <nHashRange> )


--> <nHashValue>

Parameters:

<cString> Is the string to calculate a numeric hash value.

<nHashRange> Is the numeric range for the hash value.

Returns:

<nHashValue> A numeric value corresponding to a unique hash


value for that specific string.

Observations: Hash techniques is a powerfull way to increase


speed doing a search. Given a string we calculate
its hash value, and using that hashvalue we know
exactly where a certain string will be located in
a given array.

Sample:

local aStrings := Array( 50 )

aStrings[ nStrHash( "Test", 50 ) ] = { "Test",;


"related value" }
...

MsgInfo( aStrings[ nStrHash( "Test", 50 ) ][ 2 ] )

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


// we don't need to search "Test", we simply
// locate it based on its hash value!
// We can do the same with other strings values

Source code: SOURCE\\FUNCTION\\Hash.c

--------------------------------------------------------------------------------
nWRow() Returns a certain row number of a window
--------------------------------------------------------------------------------

Syntax: nWRow( <hWnd>, <hDC>, <nGraphRow> [,<hFont>] )


--> <nTextRow>
Parameters:

<hWnd> The handle of the window

<hDC> The handle of its device context

<nGraphRow> A numeric value in pixels

<hFont> An optional handle of a font

Returns:

<nTextRow> A numeric value specifying the text


row corresponding to that graphical row

Sample: SOURCE\\CLASSES\\WBrowse METHOD LDblClick()

Source code: SOURCE\\WINAPI\\WndRows.c

See also: nWRows()

--------------------------------------------------------------------------------
NextDlgTabItem() Retrieves the handle of the next WS_TABSTOP control
--------------------------------------------------------------------------------

Syntax: NextDlgTabItem( <hWndDlg>, <hControl>, <lNext> )


--> <hNextControl>

Parameters:

<hWndDlg> The handle of the DialogBox where to get


the next control handle.

<hControl> The handle of a known control used as a


reference

<lNext> A logical value meaning if we want the next or the


previous

Returns:

<hNextControl> The handle of the searched control

Sample: SOURCE\\CLASSES\\Window METHOD GoNextCtrl()

Source code: SOURCE\\WINAPI\\GetDlgIt.c

See also: Class TWindow

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
nHiByte() Returns the High Byte of a word (two bytes)
--------------------------------------------------------------------------------

Syntax: nHiByte( <nWord> ) --> <nHiByte>

Parameters:

<nWord> A numeric (2 bytes) value

Returns:

<nHiByte> A numeric (1 byte) value

Observations: A word is made of:

WORD = LOW_BYTE + HIGH_BYTE

Source code: SOURCE\\FUNCTION\\HiLoWord.c

See also: nLoByte() nHiWord() nLoWord()

--------------------------------------------------------------------------------
nHiWord() Returns the HiWord of a long (four bytes)
--------------------------------------------------------------------------------

Syntax: nHiWord( <nLong> ) --> <nHiWord>

Parameters:

<nLong> A numeric (4 bytes) value

Returns:

<nHiWord> A numeric (2 byte) value

Observations: A long is made of:

LONG = LOW_WORD + HIGH_WORD

Source code: SOURCE\\FUNCTION\\HiLoWord.c

See also: nLoByte() nHiByte() nLoWord()

--------------------------------------------------------------------------------
nLoByte() Returns the Low byte of a word (two bytes)
--------------------------------------------------------------------------------

Syntax: nLoByte( <nWord> ) --> <nLoByte>

Parameters:

<nWord> A numeric (2 bytes) value

Returns:

<nLoByte> A numeric (1 byte) value

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Observations: A word is made of:

WORD = LOW_BYTE + HIGH_BYTE

Source code: SOURCE\\FUNCTION\\HiLoWord.c

See also: nLoByte() nHiByte() nLoWord()

--------------------------------------------------------------------------------
nLoWord() Returns the Low word of a long (four bytes)
--------------------------------------------------------------------------------

Syntax: nLoWord( <nLong> ) --> <nLoWord>

Parameters:

<nLong> A numeric (4 bytes) value

Returns:

<nLoWord> A numeric (2 byte) value

Observations: A long is made of:

LONG = LOW_WORD + HIGH_WORD

Source code: SOURCE\\FUNCTION\\HiLoWord.c

See also: nLoByte() nHiByte() nLoWord()

--------------------------------------------------------------------------------
nMakeLong() Generates a long (4bytes) from two words (2bytes)
--------------------------------------------------------------------------------

Syntax: nMakeLong( <nLoWord>, <nHiWord> ) --> <nLong>

Parameters:

<nLoWord> A numeric (word) value.

<nHiWord> A numeric (word) value.

Returns:

<nLong> The result numeric (long) value

Observations: A long is made of:

LONG = HIGH_WORD - LOW_WORD

Source code: SOURCE\\FUNCTION\\MakeLong.c

See also: nHiWord() nLoWord() nHiByte() nLoByte()

--------------------------------------------------------------------------------
nMsgBox() Generic MessageBox quick access
--------------------------------------------------------------------------------

Syntax: nMsgBox( <cMsg> [,<cTitle>] [,<nStyle>] ) --> <nResult>

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Parameters:

<cMsg> The message to display

<cTitle> The title to display. By default, "Alert"

<nStyle> The style of the MessageBox. See MessageBox()


for the possible values

Returns:

<nResult> The numeric result value. See MessageBox


for all the possible values

Observations: This function just simplifies the use of the


standard MessageBox function, though FiveWin
offers all the Msg...() functions that simplifies
much more its management.

Sample: SAMPLES\\TestMsg.prg

Source code: SOURCE\\WINAPI\\MsgBox.c

See also: MsgInfo() MsgAlert() MsgStop() MsgBeep()


MsgYesNo() MsgRetryCancel() MsgMeter() MsgGet()

--------------------------------------------------------------------------------
NtxPos() Retrieves the relative index position of a record
--------------------------------------------------------------------------------

Syntax: NtxPos( <nIndexOrd>, <nRecNo> )


--> <nRelativeRecNoPos>

Parameters:

<nIndexOrd> It is the index order. By default 0.

<nRecNo> It is the recno to get its relative NTX index


position.

Returns:

<nRelativeRecNoPos> It is a numeric value with the resulting relative


record position.

Source code: SOURCE\\Function\\NtxPos.c

Comments FiveWin provides this function to query a NTX


file for a record relative position. It is needed
for properly update a browse scrollbar after
performing a seek:

SEEK <Expression>

if Found()
<oBrowse>:oVScroll:SetPos( ;
NtxPos( IndexOrd(), RecNo() ) )
endif

See also: Class TScrollBar METHOD SetPos()

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
OClone() Retrieves a duplicated Clipper object
--------------------------------------------------------------------------------

Syntax: OClone( <oObject> ) --> <oClonedObject>

Parameters:

<oObject> The object that we want to duplicate

Returns:

<oClonedObject> The resulting duplicated object

Source code: Not supplied

See also: OSend() aOData()

--------------------------------------------------------------------------------
OemToAnsi() Translates a OEM MsDos string into a Windows string
--------------------------------------------------------------------------------

Syntax: OemToAnsi( <cOemText> ) --> <cWindowText>

Parameters:

<cOemText> A OEM MsDOs string to be converted into a


Windows string.

Returns:

<cWindowText> The result Windows string.

Obervations Normally all the data that you capture from MsDos
into a DBF is stored as OEM text. In this situation
you may call OemToAnsi() to properly review it from
inside Windows.

Text that is captured from Windows is in Ansi


format. To use it from MsDos later, store it as
the result of AnsiToOem().

Source code: SOURCE\\WINAPI\\OemAnsi.c

--------------------------------------------------------------------------------
OpenClipboard() Open the Windows clipboard to start using it
--------------------------------------------------------------------------------

Syntax: OpenClipboard( <hWnd> ) --> <lSuccess>

Parameters:

<hWnd> The handle of the window to be associated


with the open clipboard

Returns:

<lSuccess> .t. is was possible to open it, .f. if another


application was alread using it

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Observations: FiveWin automatically manages all these
functions from inside the TClipBoard class.

Sample: SAMPLES\\TestClip.prg

Source code: SOURCE\\WINAPI\\ClpBrd.c

See also: CloseClipboard() SetClpData()

--------------------------------------------------------------------------------
OpenComm() Open the communication port to start using it
--------------------------------------------------------------------------------

Syntax: OpenComm( <cCommName> [,<nSizeIn>] [,<nSizeOut>] )


--> <nIdComm>

Parameters:

<cCommName> The name of the comm device to open in


a format like "COM" + N or "LPT" + N

<nSizeIn> The size in bytes of the receiving queue.


This parameter is ignored for "LPT" devices.
By default FiveWin assigns 1024.

<nSizeOut> The size in bytes of the transmission queue.


This parameter is ignored for "LPT" devices.
By default FiveWin assigns 128.

Returns:

<nIdComm> A numeric identifier for that opened device.


0 if there was an error.

If the function fails, it may return one of the


following error values:

Value Meaning

IE_BADID The device identifier is invalid or


unsupported.
IE_BAUDRATE The device's baud rate is unsupported.
IE_BYTESIZE The specified byte size is invalid.
IE_DEFAULT The default parameters are in error.
IE_HARDWARE The hardware is not available (is
locked by another device).
IE_MEMORY The function cannot allocate the queues.
IE_NOPEN The device is not open.
IE_OPEN The device is already open.

If this function is called with both queue sizes set


to zero, the return value is IE_OPEN if the device is
already open or IE_MEMORY if the device is not open.

Windows allows COM ports 1 through 9 and LPT ports 1


through 3. If the device driver does not support
a communications port number, the OpenComm function
will fail.

The communications device is initialized to a default


configuration. The SetCommState function should be used

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


to initialize the device to alternate values.
The receiving and transmission queues are used by
interrupt-driven device drivers. LPT ports are not
interrupt driven--for these ports, the cbInQueue and
cbOutQueue parameters are ignored and the queue size
is set to zero.

Sample: SAMPLES\\TestComm.prg

Source code: SOURCE\\WINAPI\\Comm.c

See also: CloseComm() WriteComm() ReadComm() BuildCommDcb()


SetCommState() FlushComm() GetCommError()

--------------------------------------------------------------------------------
OutportByte() Sends a byte to a hardware port
--------------------------------------------------------------------------------

Syntax: OutportByte( <nPort>, <nByte> ) --> nil

Parameters:

<nPort> The hardware port number (one word: two bytes)


to read a byte from.

<nByte> A numeric value corresponding to the


read byte.

Returns: nil

Comments: Use these functions only to access


hardware ports. Communication ports must be
accessed using special API comm functions.

Source code: SOURCE\\WINAPI\\InOut.c

--------------------------------------------------------------------------------
OutportWord() Sends a word (2 bytes) to a hardware port
--------------------------------------------------------------------------------

Syntax: OutportWord( <nPort>, <nWord> ) --> nil

Parameters:

<nPort> The hardware port number (one word: two bytes)


to read a word from.

<nWord> A numeric value corresponding to the


read word.

Returns: nil.

Comments: Use these functions only to access


hardware ports. Communication ports must be
accessed using special API comm functions.

Source code: SOURCE\\WINAPI\\InOut.c

--------------------------------------------------------------------------------
OutputDebugString() Displays a debugging msg at Microsoft dbwin.exe
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Syntax: OutputDebugWindow( <cText> ) --> nil

Parameters:

<cText> A text to display of the Microsoft dbwin.exe


debugging monitor utility. Microsoft provides this
small dbwin.exe utility to help tracing several
Windows API operations.

Returns: nil.

Comments: Some Windows API can not be interrupted, this


is why dbwin.exe is extremelly usefull to trace
some sections of the activity of our application.

DbWin.exe must be loaded before we can use


OutputDebugInfo().

FiveWin also supplies this function from low level


C source code, so we can use it from our own C
routines.

Sample: // Load Microsoft DbWin.exe first!


OutputDebugInfo( "Hello world!" )

Source code: Not provided.

--------------------------------------------------------------------------------
OSend() Generic messages Object sending function
--------------------------------------------------------------------------------

Syntax: OSend( <oObject>, <cMsg> [,<uParam1>,...<uParamN>] )


--> <uReturnedValue>

Parameters:

<oObject> The object which we want to send it a


message

<cMsg> A string with the message name

<uParam1> They are optional parameters if needed


<uParamN>

Returns:

<uReturnedValue> The value returned cause that message,


if there is a returned value defined.

Observations: OSend( <oObj>, "XXX" ) is the same as:

<oObj>:XXX

DATA and METHODs messages in Clipper are


managed in the same way, except that to
retrieve a value you have to place an
underscore before the DATA message name:

MsgInfo( OSend( oWnd, "_hWnd" ) )

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Source code: Not supplied.

See also: ASend() aOData()

--------------------------------------------------------------------------------
Paint3D() Displays text with 3D look
--------------------------------------------------------------------------------

Syntax: Paint3D( <hWnd> ) --> nil

Parameters:

<hWnd> The handle of the control we want to look


3D.

Returns: nil

Observations: This is an old function we used to have 3D look


before using SET 3DLOOK ON (using Ctl3d.dll).
We have left it just a sample.

Source code: SOURCE\\WINAPI\\Paint3d.c

See also: SET 3DLOOK ON, TControl:Set3DLook()

--------------------------------------------------------------------------------
PalBmpDraw() Displays a FiveWin combined bitmap and palette handle
--------------------------------------------------------------------------------

Syntax: PalBmpDraw( <hDC>, <nCol>, <nRow>, <hPalBmp>,


<nWidth>, <nHeight>, <nRaster> ) --> nil

Parameters:

<hDC> Identifies the window device context.

<nCol> The coordinates where to display the bitmap.


<nRow> Expressed in pixels unless there is an alternative
SetMapMode() selected.

<hPalBmp> A numeric handle which holds a special


FiveWin format to store a bitmap handle and its
associated palette handle:

hPalette = nHiWord( <hPalBmp> )


hBitmap = nLoWord( <hPalBmp> )

This handle is automatically generated by the


FiveWin functions:

PalBmpRead( <hDC>, <cBmpFileName> ) --> <hPalBmp>

PalBmpLoad( <hDC>, <cBmpResName> ) --> <hPalBmp>

And destroyed calling:

PalBmpFree( <hPalBmp> )

These functions are automatically called from


TBitmap Class.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<nWidth> The target dimensions for the dipplayed bitmap.
<nHeight> By tdefault the own bitmap dimensions are used.

<nRaster> A numeric value that specifies the raster


operation to be performed. Raster operation codes
define how the graphics device interface (GDI)
combines colors in output operations that involve
a current brush, a possible source bitmap, and a
destination bitmap. This parameter can be one of
the following:

Code Description

BLACKNESS Turns all output black.


DSTINVERT Inverts the destination bitmap.
MERGECOPY Combines the pattern and the source
bitmap by using the Boolean AND
operator.
MERGEPAINT Combines the inverted source bitmap
with the destination bitmap by
using the Boolean OR operator.
NOTSRCCOPY Copies the inverted source bitmap
to the destination.
NOTSRCERASE Inverts the result of combining
the destination and source bitmaps
by using the Boolean OR operator.
PATCOPY Copies the pattern to the destination
bitmap.
PATINVERT Combines the destination bitmap
with the pattern by using the
Boolean XOR operator.
PATPAINT Combines the inverted source bitmap
with the pattern by using the Boolean
OR operator. Combines the result of
this operation with the destination
bitmap by using the Boolean OR
operator.
SRCAND Combines pixels of the destination
and source bitmaps by using the
Boolean AND operator.

SRCCOPY Copies the source bitmap to the


destination bitmap.
SRCERASE Inverts the destination bitmap and
combines the result with the source
bitmap by using the Boolean AND
operator.
SRCINVERT Combines pixels of the destination
and source bitmaps by using the
Boolean XOR operator.
SRCPAINT Combines pixels of the destination
and source bitmaps by using the
Boolean OR operator.
WHITENESS Turns all output white.

Values

#define SRCCOPY 13369376 // 0x00CC0020L


#define SRCPAINT 15597702 // 0x00EE0086L
#define SRCAND 8913094 // 0x008800C6L

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define SRCINVERT 6684742 // 0x00660046L
#define SRCERASE 4457256 // 0x00440328L
#define NOTSRCCOPY 3342344 // 0x00330008L
#define NOTSRCERASE 1114278 // 0x001100A6L
#define MERGECOPY 12583114 // 0x00C000CAL
#define MERGEPAINT 12255782 // 0x00BB0226L
#define PATCOPY 15728673 // 0x00F00021L
#define PATPAINT 16452105 // 0x00FB0A09L
#define PATINVERT 5898313 // 0x005A0049L
#define DSTINVERT 5570569 // 0x00550009L
#define BLACKNESS 66 // 0x00000042L
#define WHITENESS 16711778 // 0x00FF0062L

Returns: Nothing

Sample: See SAMPLES\\Install.prg

Source code: SOURCE\\FUNCTIONS\\FwBmp.c

--------------------------------------------------------------------------------
ParamCount() Returns the number of parameters of a process
--------------------------------------------------------------------------------

Syntax: ParamCount( nProcDeep ) --> nParams

Parameters:

<nProcDeep> Is the number of a certain stack process ( a


process that called the one which is executing ).

Returns:

<nParms> Is the number of parameters that process received.

Test( nOne, cTwo, dThree )

Suppouse Test is the 5 level called on the stack:

? ParamCount( 5 ) --> 3 (parameters suplied)

Sample: See SOURCE\\FUNCTION\\ErrSysW.prg.

Source code: Not available.

--------------------------------------------------------------------------------
PeekMessage() Extract a message from the message queue
--------------------------------------------------------------------------------

Syntax: PeekMessage( @<cMsg>, <hWnd>, <nFilterFirst>,


<nFilterLast>, <nRemove> ) --> <lSuccess>

Parameters:

<cMsg> A string supplied by reference, where FiveWin


will place a MSG struct in a string format.

<hWnd> Identifies a window whose messages are to be


examined

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<nFilterFirst> Specifies the first and last values in the range
<nFilterLast> of messages to be examined

<nRemove> Specifies how messages are handled

Returns:

<lSuccess> A logical value indicating if the operation


was successfully.

The result is stored by reference inside <cMsg>

Observations: This functions are automatically managed by


FiveWin. We just document them here with the
wish of a better understanding, but we stress
on the idea that you should let FiveWin manage
all these complexity.

Source code: SOURCE\\WINAPI\\PeekMsg.c

--------------------------------------------------------------------------------
Pie() Draws a graphic pie
--------------------------------------------------------------------------------

Syntax: Pie( <hDC>, <nLeftRect>, <nTopRect>, <nRightRect>,


<nBottomRect>, <nxStartArc>, <nyStartArc>,
<nxEndArc>, <nyEndArc> ) --> <lSuccess>

Parameters

<hDC> Handle of device context

<nLeftRect> x-coordinate upper-left corner bounding rectangle

<nTopRect> y-coordinate upper-left corner bounding rectangle

<nRightRect> x-coordinate lower-right corner bounding rectangle

<nBottomRect> y-coordinate lower-right corner bounding rectangle

<nxStartArc> x-coordinate arc starting point

<nyStartArc> y-coordinate arc starting point

<nxEndArc> x-coordinate arc ending point

<nyEndArc> y-coordinate arc ending point

The Pie function draws a pie-shaped wedge by drawing


an elliptical arc whose center and two endpoints are
joined by lines.

Returns

<lSuccess> A logical value indicating if the operation was


successfull.

Comments The center of the arc drawn by the Pie function is the

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


center of the bounding rectangle specified by the
nLeftRect, nTopRect, nRightRect, and nBottomRect
parameters. The starting and ending points of the arc
are specified by the nxStartArc, nyStartArc, nxEndArc,
and nyEndArc parameters. The function draws the arc by
using the selected pen, moving in a counterclockwise
direction. It then draws two additional lines from
each endpoint to the arc's center. Finally, it fills
the pie-shaped area by using the current brush.

If nxStartArc equals nxEndArc and nyStartArc equals


nyEndArc, the result is an ellipse with a single line
from the center of the ellipse to the point
(nxStartArc,nyStartArc) or (nxEndArc,nyEndArc).

The figure drawn by this function extends up to but


does not include the right and bottom coordinates.
This means that the height of the figure is
nBottomRect - nTopRect and the width of the figure
is nRightRect - nLeftRect.

Both the width and the height of a rectangle must be


greater than 2 units and less than 32,767 units.

Sample: SAMPLES\\TestPie.prg

--------------------------------------------------------------------------------
PolyPolygon() Draws several polygons
--------------------------------------------------------------------------------

Syntax: PolyPolygon( <hDC>, <aPolygon1>,


...<aPolygonN> ) --> <lSuccess>

Parameters:

<hDC> Identifies the device context where to paint.

<aPolygon1> An array where each element is also


... an array of two numeric values identifiying
a point. The first and initial points have to
be the same.
<aPolygonN>

aPolygon = { { nCol1, nRow1 }, { nCol2, nRow2 },


... { nColN, nRowN }, { nCol1, nRow1 } }

Returns:

<lSuccess> A logical value indicating that the operation


was performed successfully.

Source code: SOURCE\\WINAPI\\Drawing.c

--------------------------------------------------------------------------------
PostMessage() Places a message at the end of the queue
--------------------------------------------------------------------------------

Syntax: PostMessage( <hWnd>, <nMsg>, <nWParam>, <nLParam> )


--> <lSuccess>

Parameters:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<hWnd> Identifies the window to which the message
will be posted. If this parameter is
HWND_BROADCAST (-1), the message will be posted
to all top level windows, including disabled
or invisible unowned windows.

<nMsg> Specifies the message to be posted.

<nWParam> Specifies 16 bits of aditional information.

<nLParam> Specifies 32 bits of aditional information.

Returns:

<lSuccess> A logical value indicating if the operation


was successfull.

Sample: SOURCE\\CLASSES\\Window METHOD PostMsg

Source code: SOURCE\\WINAPI\\PostMsg.c

See also: SendMessage() PeekMessage()

--------------------------------------------------------------------------------
PostQuitMessage() Generic finishing application function
--------------------------------------------------------------------------------

Syntax: PostQuitMessage( <nExitCode> ) --> nil

Parameters:

<nExitCode> The return code

Returns: nil

Observations This function is automatically managed by FiveWin


classes. We recommend you using :End().

Source code: SOURCE\\WINAPI\\PostQuit.c

See also: TWindow:End()

--------------------------------------------------------------------------------
ReadBitmap() Reads a bitmap from disk
--------------------------------------------------------------------------------

Syntax: ReadBitmap( [<hDC>], <cBmpFile> ) --> <hBitmap>

Parameters:

<hDC> Is the handle of the device context to be used with


that bitmap. You should supply 0 is no hDC is available.

<cBmpFile> Is the name of the .BMP file in the disk.

Returns:

<hBitmap> Is a bitmap handle.

Observations: This function is very usefull to dynamically load

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


bitmaps from disk. It lets the user of our application
supply new BMPs with photos, drawings, etc...

Sample: SAMPLES\\FwBrow.prg

Source code: SOURCE\\WINAPI\\BmpRead.c

See also: LoadBitmap() PalBmpDraw()

--------------------------------------------------------------------------------
ReadComm() Read the contents of the communication port
--------------------------------------------------------------------------------

Syntax: ReadComm( <nIdComm>, @<cBuffer> ) --> <nBytesRead>

Parameters:

<nIdComm> A numeric identifier for that opened device.


0 if there was an error.

<cBuffer> A string variable supplied by reference


where ReadComm() will place the read bytes.

The length of the initial supplied value


specifies the wished number of bytes to be read.

You may use, i.e., Space( ... ) to initialize


this buffer.

Returns:

<nBytesRead> The number of bytes read. 0 if there was


an error. Use GetCommError() to determine the
cause of the error.

Sample: SAMPLES\\TestComm.prg

Source code: SOURCE\\WINAPI\\Comm.c

See also: OpenComm() WriteComm() CloseComm()

--------------------------------------------------------------------------------
Rectangle() Draws a graphic rectangle
--------------------------------------------------------------------------------

Syntax: Rectangle( <hDC>, <nTop>, <nLeft>, <nBottom>,


<nRight> [,<hPen>] ) --> <lSuccess>
Parameters:

<hDC> Identifies the device context where to paint

<nTop> the coordinates of the rectangle


<nLeft>
<nBottom>
<nRight>

Returns:

<lSuccess> If the operation was successfull.

Observations: The rectangle is drawn with the current pen

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


selected and it is filled with the current brush

Source code: SOURCE\\WINAPI\\Rectangl.c

See also: Pie() LineTo()

--------------------------------------------------------------------------------
RegisterClass() Register a new Windows class
--------------------------------------------------------------------------------

Syntax: RegisterClass( <cClassName>, <nStyle>, <nClsExtra>,


<nWndExtra>, <hCursor>, <hBrush>,
<cMenuName>, <nWndProc> ) --> <lSuccess>
Parameters:

<cClassName> Specifies the name of the new class

<nStyle> Specifies the class style. These styles can be


combined by using the bitwise OR operator. This can
be any combination of the following values:

Value Meaning

CS_BYTEALIGNCLIENT Aligns the client area of a window


on the byte boundary (in the
x-direction).
CS_BYTEALIGNWINDOW Aligns a window on the byte
boundary (in the x-direction).
This flag should be set by
applications that perform bitmap
operations in windows by using the
BitBlt function.
CS_CLASSDC Gives the window class its own
display context (shared by
instances).
CS_DBLCLKS Sends double-click messages to a
window.
CS_GLOBALCLASS Specifies that the window class is
an application global class. An
application global class is created
by an application or library and is
available to all applications. The
class is destroyed when the
application or library that created
the class exits; it is essential,
therefore, that all windows created
with the application global class
be closed before this occurs.

CS_HREDRAW Redraws the entire window if the


horizontal size changes.
CS_NOCLOSE Inhibits the close option on the
System menu.
CS_OWNDC Gives each window instance its own
display context. Note that
although the CS_OWNDC style is
convenient, it must be used with
discretion because each display
context occupies approximately 800
bytes of memory.
CS_PARENTDC Gives the display context of the

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


parent window to the window class.
CS_SAVEBITS Specifies that the system should
try to save the screen image
behind a window created from this
window class as a bitmap. Later,
when the window is removed, the
system uses the bitmap to quickly
restore the screen image.
This style is useful for small
windows that are displayed briefly
and then removed before much other
screen activity takes place (for
example, menus or dialog boxes).
This style increases the time
required to display the window
since the system must first
allocate memory to store the bitmap.

CS_VREDRAW Redraws the entire window if the


vertical size changes.

<nClsExtra> Specifies the number of bytes to allocate following


the window class structure. These bytes are
initialized to 0.

<nWndExtra> Specifies the number of bytes to allocate following


the window instance. Those bytes are initialized
to 0.

<hCursor> Identifies the class cursor.

<hBrush> Identifies the class background brush. By default


FiveWin assigns drak gray color brush.

<cMenuName> Identifies the name of a resource menu.

<nWndProc> A pointer to the window procedure. By


default FiveWin uses DefWindowProc().

Returns:

<lSuccess> If the class is registered successfully.

Observations: FiveWin manages all these functions automatically.


We just provide here its description with the
intention that you get a better understanding,
but we insist on the idea that you let FiveWin
manage all these.

Sample: SOURCE\\CLASSES\\Window METHOD Register()

Source code: SOURCE\\WINAPI\\RegClass.c

See also: Class TWindow METHOD Register

--------------------------------------------------------------------------------
ReleaseCapture() Let the other applications use the mouse
--------------------------------------------------------------------------------

Syntax: ReleaseCapture() --> nil

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Parameters: None

Returns: nil

Observations: This function releases the mouse capture and


restores normal input processing.

Sample: SAMPLES\\NewHelp.prg

Source code: SOURCE\\WINAPI\\WMouse.c

See also: SetCapture() GetCapture()

--------------------------------------------------------------------------------
ReleaseDC() Finish using a device context
--------------------------------------------------------------------------------

Syntax: ReleaseDC( <hWnd>, <hDC> ) --> <lSuccess>

Parameters:

<hWnd> Identifies the handle of the window whose DC is


to be released.

<hDC> Identifies the device context to be released.

Returns:

<lSuccess> A logical value indicating if the operation was


completed sucessfully.

Observations: An application must call ReleaseDC() for each


GetDC() function call.

FiveWin manages all these functions automatically


through the TWindow class.

Source code: SOURCE\\WINAPI\\Dc.c

See also: GetDC() BeginPaint() EndPaint()

--------------------------------------------------------------------------------
RemoveFont() Removes a font from the available fonts list
--------------------------------------------------------------------------------

Syntax: RemoveFont( <cFontName> ) --> <lSuccess>

Parameters:

<cFontName> Identifies the name of the font resource file or


the handle of a module loaded that supplied that font.

Returns:

<lSuccess> If the operation was sucessfull.

Observations: Any application that adds or removes fonts from the


Windows font table should send a WM_FONTCHANGE message
to all top-level windows in the system by using the

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


SendMessage function with the hwnd parameter set to
-1 (HWND_BROADCAST).

In some cases, the RemoveFont function may not remove


the font resource immediately. If there are outstanding
references to the resource, it remains loaded until
the last logical font using it has been removed
(deleted) by using the DeleteObject function.

Source code: SOURCE\\WINAPI\\FontCrea.c

See also: AddFontResource()

--------------------------------------------------------------------------------
RemoveProp() Removes a previous stored window prop
--------------------------------------------------------------------------------

Syntax: RemoveProp( <hWnd>, <cStringAtom> ) --> <lSuccess>

Parameters:

<hWnd> Identifies the window whose property list is to


be changed.

<cStringAtom> A string or an atom that specifies a string.

Returns:

<lSuccess> If the operation was sucessfull.

Sample: SOURCE\\CLASSES\\Window.prg METHOD Unlink

Source code: SOURCE\\WINAPI\\Prop.c

See also: SetProp() GetProp()

--------------------------------------------------------------------------------
Report() Generic FiveWin automatic-reporting function
--------------------------------------------------------------------------------

Syntax: Report( [<oBrowse>] ) --> nil

Parameters:

<oBrowse> An optional reference to a browse object


to be used to retrieve its associated cAlias
DATA contents.

Returns: nil

Observations: This function allows the quickly implementation


of reports in our browses placed in dialogboxes.

This function has been greatly enhanced in the


new METHOD TWBrowse:Report().

Sample: SAMPLES\\FwBrow.prg

Source code: SOURCE\\FUNCTION\\Browse.prg

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


See also: Class TWBrowse METHOD Report()

--------------------------------------------------------------------------------
RestProc() Restores a window procedure -internally used-
--------------------------------------------------------------------------------

Syntax: RestProc( <hWnd>, <nOldProc> ) --> nil

Parameters:

<hWnd> The handle of the window whose old


procedure is to be restored.

<nOldProc> A pointer of the windows old procedure.

Returns: nil

Observations: This function is automatically used by FiveWin


to un-subclass a subclassed window.

Let FiveWin manage all these automatically.

Sample: SOURCE\\CLASSES\\Window.prg METHOD UnLink()

Source code: SOURCE\\WINAPI\\ChangePr.c

See also: ChangeProc()

--------------------------------------------------------------------------------
Say3D() Displays a 3D look text
--------------------------------------------------------------------------------

Syntax: Say3D( <hWnd>, <hDC>, <cCaption>, <lRaised>,


<lCentered> ) --> nil

Parameters:

<hWnd> The handle of the window to paint.

<hDC> The handle of the device context where to


paint.

<cCaption> The text to draw.

<lRaised> If the text is going to show raised or inset.

<lCentered> If the text is going to be centered.

Returns: nil

Observations: We used this function previous to use standard


3D Ctl3d.dll Microsoft look.

Source code: SOURCE\\FUNCTION\\Say3D.c

See also: SET 3DLOOK

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
ScreenToClient() Converts screens coordinates in Client coordinates
--------------------------------------------------------------------------------

Syntax: ScreenToClient( <hWnd>, <aPoint> ) --> nil

This function converts the screen coordinates of a


given point on the screen to client coordinates.

Parameters:

<hWnd> Is the handle of the window whose client area is


used for the conversion.

<aPoint> An array of two elements that holds the


coordinates of the point. The two elements of this
array are transformed acordingly with the new
calculated values.

Returns: Nothing. The result is placed inside the same array.

Sample: local aPoint := { 100, 120 }

ScreenToClient( oWnd:hWnd, aPoint )

? aPoint[ 1 ]
? aPoint[ 2 ]

Source code: SOURCE\\WINAPI\\Clt2Scr.c

See also: ClientToScreen()

--------------------------------------------------------------------------------
ScrollWindow() Scroll a region of a window
--------------------------------------------------------------------------------

Syntax: ScrollWindow( <hWnd>, <nCol>, <nRow>, <aRect>,


<aClip> ) --> nil

Parameters:

<hWnd> Identifies the window to be scrolled.

<nCol> Specifies the amount in device units of horizontal


scrolling. This parameter must be a negative value
to scroll to the left.

<nRow> Specifies the amount in device units of vertical


scrolling. This parameter must be a negative value
to scroll up.

<aRect> Specifies the portion of client area to be scrolled:


{ nTop, nLeft, nBottom, nRight }

<aClip> Specifies the clipping rectangle to be scrolled:


{ nTop, nLeft, nBottom, nRight }

Returns: nil

Source code: SOURCE\\WINAPI\\Clt2Scr.c

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


See also: ClientToScreen()

--------------------------------------------------------------------------------
SelectObject() Select a GDI object to be used in a device context
--------------------------------------------------------------------------------

Syntax: SelectObject( <hDC>, <hGDIObject> )


--> <hPrevGDIObject>
Parameters:

<hDC> Identifies the device context

<hGDIObject> Identifies the handle of the GDI object to be selected

Returns:

<hPrevGDIObject> Returns the handle of the previous GDI object selected.

Observations: Many GDI objects, before to be used, have to be


selected using this function.

Sample: SAMPLES\\Lines.prg

Source code: SOURCE\\WINAPI\\SelObjec.c

See also: DeleteObject()

--------------------------------------------------------------------------------
SendMessage() Sends a Windows message to a window
--------------------------------------------------------------------------------

Syntax: SendMessage( <hWnd>, <nMsg>, <nWParam>, <nLParam> )


--> <nLResult>
Parameters:

<hWnd> Identifies the handle of the window to which the


message will be sent. If this parameter is
HWND_BROADCAST (-1) then it is sent to all windows.

<nMsg> Specifies the message to be sent

<nWParam> A numeric value specifying 16 bits of additional


message dependant information.

<nLParam> A numeric value specifying 32 bits of additional


message dependant information.

Returns:

<nLResult> The result of the message processing and depends


on the message sent.

Sample: SAMPLES\\EndApp.prg

Source code: SOURCE\\WINAPI\\SendMsg.c

See also: PostMessage() PeekMessage() CLASS TWindow:SendMsg()

--------------------------------------------------------------------------------
SetActiveWindow() Changes the current active window
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Syntax: SetActiveWindow( <hWnd> ) --> <hPrevWnd>

Parameters:

<hWnd> Identifies the top level window to be activated

Returns:

<hPrevWnd> The handle of the previous active window.

Source code: SOURCE\\WINAPI\\WndCente.c

See also: GetActiveWindow()

--------------------------------------------------------------------------------
SetBlackPen() Selects the black pen for painting
--------------------------------------------------------------------------------

Syntax: SetBlackPen( <hDC> ) --> <hPrevPen>

Parameters:

<hDC> Identifies the handle of the device context where


select a black pen.

Returns:

<hPrevPen> Identifies the handle of the previous selected pen.

Source code: SOURCE\\WINAPI\\GetStokB.c

See also: SetWhitePen() GetStockObject()

--------------------------------------------------------------------------------
SetClipboardData() Places some data at the clipboard
--------------------------------------------------------------------------------

Syntax: SetClipboardData( <nType>, <cText> ) --> <nHandle>

Parameters:

<nType> Specifies the format of the data.

CF_BITMAP The data is a bitmap.


CF_DIB The data is a memory object containing a
BITMAPINFO structure followed by the bitmap
data.
CF_DIF The data is in Data Interchange Format (DIF).
CF_DSPBITMAP The data is a bitmap representation of a
private format. This data is displayed in
bitmap format in lieu of the privately
formatted data.
CF_DSPMETAFILEPICT The data is a metafile representation
of a private data format. This data is
displayed in metafile-picture format in
lieu of the privately formatted data.
CF_DSPTEXT The data is a textual representation of a
private data format. This data is displayed
in text format in lieu of the privately

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


formatted data.
CF_METAFILEPICT The data is a metafile (see the
description of the METAFILEPICT structure.

CF_OEMTEXT The data is an array of text characters in


the OEM character set. Each line ends with
a carriage returnlinefeed (CR-LF)
combination.
A null character signals the end of the data.
CF_OWNERDISPLAY The data is in a private format that
the clipboard owner must display.
CF_PALETTE The data is a color palette.
CF_PENDATA The data is for the pen extensions to the
Windows operating system.
CF_RIFF The data is in Resource Interchange File
Format (RIFF).
CF_SYLK The data is in Symbolic Link (SYLK) format.
CF_TEXT The data is an array of text characters.
Each line ends with a carriage return
linefeed (CR-LF) combination. A null
character signals the end of the data.
CF_TIFF The data is in Tag Image File Format (TIFF).

CF_WAVE The data describes a sound wave. This is a


subset of the CF_RIFF data format; it can
be used only for RIFF WAVE files.

<cText> The text to be placed at the clipboard. Right now,


FiveWin only supports text manipulation.

Returns:

<nHandle> The handle of the data placed at the


clipboard if successfull or 0 if there is a
problem.

Sample: SAMPLES\\TestClip.prg

Source code: SOURCE\\WINAPI\\ClpBrd.c

See also: OpenClipboard() CloseClipboard() EmptyClipboard()

--------------------------------------------------------------------------------
SetIdleAction() Set/removes the FiveWin background process
--------------------------------------------------------------------------------

Syntax: SetIdleAction( [ bIdleAction ] ) --> nil

Parameters:

<bIdleAction> Is the codeblock to execute during idle periods.


If no codeblock is provided, SetIdleAction() resets
the current bIdleAction, so it stops the previous
defined idle codeblock.

Returns: nil

Observations: It is very important that you don't process large


routines here or you will freeze the whole system.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Processes may be really, really fast !!!

Don't confuse idle periods with timers. Idle periods


are those during there are no pending messages to
process. As soon as the application starts processing
messages, all idle actions get stopped.

Sample: See TestIdle.prg


.

Source code: Not available.

--------------------------------------------------------------------------------
SetWhitePen() Selects the white pen for painting
--------------------------------------------------------------------------------

Syntax: SetWhitePen( <hDC> ) --> <hPrevPen>

Parameters:

<hDC> Identifies the handle of the device context where


select a white pen.

Returns:

<hPrevPen> Identifies the handle of the previous selected pen.

Source code: SOURCE\\WINAPI\\GetStokB.c

See also: SetBlackPen() GetStockObject()

--------------------------------------------------------------------------------
SetCapture() Captures all the mouse activity for a window
--------------------------------------------------------------------------------

Syntax: SetCapture( <hWnd> ) --> <hWndPrev>

Parameters:

<hWnd> Identifies the handle of the window to


receive all mouse messages.

Returns:

<hWndPrev> The handle of the previous window that


was receiving all mouse messages, if defined.
It not, it returns 0.

Observations: When the window no longer requires all mouse


input, the application it should call ReleaseCapture().

Sample: SAMPLES\\NewHelp.prg

Source code: SOURCE\\WINAPI\\WMouse.c

See also: GetCapture() ReleaseCapture()

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
SetClassWord() Changes a window word value
--------------------------------------------------------------------------------

Syntax: SetClassWord( <hWnd>, <nIndex>, <nNewValue> )


--> <nOldValue>

Parameters:

<hWnd> The handle of the window

<nIndex> Specifies the zero-based byte offset of the word value


to change.

Valid values are in the range zero through the number


of bytes of class memory, minus two (for example, if
10 or more bytes of extra class memory were specified,
a value of 8 would be an index to the fifth integer),
or one of the following values:

Value Meaning

GCW_HBRBACKGROUND Sets a new handle of a background


brush.
GCW_HCURSOR Sets a new handle of a cursor.
GCW_HICON Sets a new handle of an icon.
GCW_STYLE Sets a new style bit for the
window class.

#define GCW_HBRBACKGROUND (-10)


#define GCW_HCURSOR (-12)
#define GCW_HICON (-14)
#define GCW_HMODULE (-16)
#define GCW_CBWNDEXTRA (-18)
#define GCW_CBCLSEXTRA (-20)
#define GCL_WNDPROC (-24)
#define GCW_STYLE (-26)

<nNewValue> Specifies the replacement value.

Returns:

<nOldValue> The return value is the previous value of the


specified word, if the function is successful.
Otherwise, it is zero.

Observations: The SetClassWord function sets a word value at the


specified offset into the extra class memory for the
window class to which the given window belongs. Extra
class memory is reserved by specifying a nonzero value
in the cbClsExtra member of the WNDCLASS
structure used with the RegisterClass function.

Source code: SOURCE\\WINAPI\\RegClass.c

See also: SetClassLong() SetWindowWord() SetWindowLong()

--------------------------------------------------------------------------------
SetClpData() Changes the contents of the clipboard
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Syntax: SetClpData( <nFormat>, <uData> ) --> <lSuccess>

Parameters:

<nFormat> Specifies the format of the data. It can be any one


of the system-defined formats or a format registered
by the RegisterClipboardFormat function.

CF_BITMAP The data is a bitmap.

CF_DIB The data is a memory object containing


a BITMAPINFO structure followed by the
bitmap data.

CF_DIF The data is in Data Interchange Format


(DIF).

CF_DSPBITMAP The data is a bitmap representation of


a private format. This data is displayed
in bitmap format in lieu of the privately
formatted data.

CF_DSPMETAFILEPICT The data is a metafile


representation of a private data format.
This data is displayed in
metafile-picture format in lieu of the
privately formatted data.

CF_DSPTEXT The data is a textual representation of


a private data format. This data is
displayed in text format in lieu of the
privately data.

CF_METAFILEPICT The data is a metafile (see the


description of the METAFILEPICT structure.

CF_OEMTEXT The data is an array of text characters


in the OEM character set. Each line ends
with a carriage returnlinefeed (CR-LF)
combination. A null character signals
the end of the data.

CF_OWNERDISPLAY The data is in a private format that


the clipboard owner must display.

CF_PALETTE The data is a color palette.

CF_PENDATA The data is for the pen extensions to


the Windows operating system.

CF_RIFF The data is in Resource Interchange File


Format (RIFF).

CF_SYLK The data is in Symbolic Link (SYLK)


format.

CF_TEXT The data is an array of text characters.


Each line ends with a carriage
returnlinefeed (CR-LF) combination. A
null character signals the end of the
data.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


CF_TIFF The data is in Tag Image File Format
(TIFF).

CF_WAVE The data describes a sound wave. This is


a subset of the CF_RIFF data format; it
can be used only for RIFF WAVE files.

Private data formats in the range CF_PRIVATEFIRST


through CF_PRIVATELAST are not automatically freed
when the data is removed from the clipboard. Data
handles associated with these formats should be freed
upon receiving a WM_DESTROYCLIPBOARD message.

Private data formats in the range CF_GDIOBJFIRST


through
CF_GDIOBJLAST will be automatically removed by a call
to the DeleteObject function when the data is removed
from the clipboard. If Windows Clipboard is running, it
will not update its window to show the data placed in
the clipboard by the SetClipboardData until after the
CloseClipboard function is called.

<uData> The handle of the data to place at the


Clipboard. Right now FiveWin only supports text,
due not to a FiveWin limitation since that all
formats have not yet been implemented.

Sample: SAMPLES\\TestClip.prg

Source code: SOURCE\\WINAPI\\ClpBrd.c

See also: OpenClipboard() CloseClipboard() GetClpData()

--------------------------------------------------------------------------------
SetCommState() Selects the state of the communication port
--------------------------------------------------------------------------------

Syntax: SetCommState( <cDCB> ) --> <lSuccess>

Parameters:

<cDCB> A string containing a DCB structure


values. The DCB structure is automatically build
by BuildCommDcb() function.

Returns:

<lSuccess> If the operation is performed successfully.

Sample: SAMPLES\\TestComm.prg

Source code: SOURCE\\WINAPI\\Comm.c

See also: OpenComm() CloseComm() ReadComm() WriteComm()


BuildCommDcb()

--------------------------------------------------------------------------------
SetCursor() Changes the Windows active cursor
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Syntax: SetCursor( <hCursor> ) --> <hOldCursor>

Parameters:

<hCursor> The handle of the new mouse cursor.

Returns:

<hOldCursor> The handle of the previous in use cursor.

Sample: SAMPLES\\TestCurs.prg

Source code: SOURCE\\WINAPI\\Cursors.c

See also: Cursor...() functions LoadCursor() DestroyCursor()

--------------------------------------------------------------------------------
SetDate() Changes the date of the system
--------------------------------------------------------------------------------

Syntax: SetDate( <nDay>, <nMonth>, <nYear> ) --> <lSuccess>

Parameters:

<nDay> The date day.

<nMonth> The date month.

<nYear> The date year.

Returns:

<lSuccess> A logical value meaning that the supplied


date is valid and could be settled as the new date.

Sample: SAMPLES\\TestDate.prg

Source code: SOURCE\\FUNCTION\\DateTime.c

See also: SysTime()

--------------------------------------------------------------------------------
SetDeskWallPaper() Changes the desktop bitmap
--------------------------------------------------------------------------------

Syntax: SetDeskWallPaper( <cBmpFile> ) --> <lSuccess>

Parameters:

<cBmpFile> The name of the BMP file to be shown as


the desktop bitmap.

Returns:

<lSuccess> If the operation was successful.

Observations: This is an undocumented WinApi function. Don't


expect that is available in next Windows versions.
Also, this function does not store the value

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


for the next Windows startup. You have to modify
WIN.INI file in order to asure that it will
be the desktop BMP next time.

Sample: SAMPLES\\FwBrow.prg

See SAMPLES\\Install.prg for a better way of


changing the whole desktop look.

Source code: SOURCE\\WINAPI\\Desktop.c

--------------------------------------------------------------------------------
SetFDate() Set a different time and date for a file
--------------------------------------------------------------------------------

Syntax: SetFDate( <hFile>, <cTime>, <cdDate> ) --> <hWndPrev>

Parameters:

<hFile> Identifies the handle of an opened file.


Use FOpen() to get this handle.

<cTime> Specifies a different time to be set to


the file. Use the format: "HH:MM:SS".

<cdDate> Specifies a different date to be set to


the file. Use the format: "DD:MM:YYYY". You
can use both a date or a string type.

Returns:

<lSuccess> If the operation was performed successfully.

Source code: SOURCE\\FUNCTION\\Files.c

See also: GetFTime()

--------------------------------------------------------------------------------
SetFocus() Selects a window as focused
--------------------------------------------------------------------------------

Syntax: SetFocus( <hWnd> ) --> <hWndPrev>

Parameters:

<hWnd> Identifies the window to receive the keyboard


input. If this parameter is 0, keystrokes are
ignored.

Returns:

<hWndPrev> Identifies the window that previously had


the focus.

Observations: This function sends a WM_KILLFOCUS to the


window that previously had the focus, and
a WM_SETFOCUS to the window that recieves
the focus.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Source code: SOURCE\\WINAPI\\SetFocus.c

See also: GetFocus()

--------------------------------------------------------------------------------
SetHandleCount() Changes the maximum number of available files
--------------------------------------------------------------------------------

Syntax: SetHandleCount( <nHandles> ) --> <nHandlesAvailables>

Parameters:

<nHandles> Specifies the number of a file handles the


application requires. This count can not be greater
than 255.

Returns:

<nHandlesAvailables> Is the number of handles availables to the


application.

Observations: By default, the number of available handles is


20.

Sample: SAMPLES\\AutoLay.prg

Source code: SOURCE\\WINAPI\\SetHandl.c

--------------------------------------------------------------------------------
SetHelpFile() Selects the default Help File
-------------------------------------------------------------------------------
-

Sintax

SetHelpFile( cHelpFile )

Parameters

cHelpFile is the name of the HLP file to be used by default


from our program.

Returns

Nothing

Description

SetHelpFile() Selects the default HLP file to be called when requesting


help. GetHelpFile() will return the Help file name we
select here.

Example

SetHelpFile( "FiveWin.hlp" )

Source: HELP.C

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
SetMapMode() Selects a drawing mode
--------------------------------------------------------------------------------

Syntax: SetMapMode( <hDC>, <nMode> ) --> <nOldMode>

Parameters:

<hDC> Identifies the device context.

<nMode> Specifies the new mapping mode.

This parameter can be any one of the following


values:

Value Meaning

MM_ANISOTROPIC Logical units are converted to


arbitrary units with arbitrarily scaled axes.
Setting the mapping mode to MM_ANISOTROPIC
does not change the current window or viewport
settings. To change the units, orientation,
and scaling, an application should use the
SetWindowExt and SetViewportExt functions.

MM_HIENGLISH Each logical unit is converted to 0.001


inch. Positive x is to the right; positive y is
up.

MM_HIMETRIC Each logical unit is converted to 0.01


millimeter. Positive x is to the right; positive
y is up.

MM_ISOTROPIC Logical units are converted to arbitrary


units with equally scaled axes; that is, one
unit along the x-axis is equal to one unit
along the y-axis. The SetWindowExt and
SetViewportExt functions must be used to
specify the desired units and the orientation
of the axes. GDI makes adjustments as
necessary to ensure that the x and y units
remain the same size.

MM_LOENGLISH Each logical unit is converted to 0.01


inch. Positive x is to the right; positive y is
up.

MM_LOMETRIC Each logical unit is converted to 0.1


millimeter. Positive x is to the right;
positive y is up.

MM_TEXT Each logical unit is converted to one device


pixel. Positive x is to the right; positive y
is down.

MM_TWIPS Each logical unit is converted to 1/20 of a


point. (Because a point is 1/72 inch, a twip
is 1/1440 inch). Positive x is to the
right; positive y is up.

Returns:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<nOldMode> The previous mapping mode if the function
is successful.

Observations: The MM_TEXT mode allows applications to work in device


pixels, where one unit is equal to one pixel. The
physical size of a pixel varies from device to device.

The MM_HIENGLISH, MM_HIMETRIC, MM_LOENGLISH,


MM_LOMETRIC, and MM_TWIPS modes are useful for
applications that must draw in physically meaningful
units (such as inches or millimeters).

The MM_ISOTROPIC mode ensures a 1:1 aspect ratio,


which is useful when it is important to preserve
the exact shape of an image.

The MM_ANISOTROPIC mode allows the x- and


y-coordinates to be adjusted independently.

Source code: SOURCE\\WINAPI\\SetMapMo.c

See also: GetMapMode() SetViewPortExt() SetWndExt()

--------------------------------------------------------------------------------
SetParent() Changes the parent of a window
--------------------------------------------------------------------------------

Syntax: SetParent( <hWndChild>, <hWndParent> )


--> <hWndOldParent>

Parameters:

<hWndChild> Identifies the child window.

<hWndParent> Identifies the new parent window.

Returns:

<hWndOldParent> The handle of the old parent window.

Observations: If the child window is visible it gets


properly painted.

Sample: SAMPLES\\TestFold.prg

Source code: SOURCE\\WINAPI\\Getparen.c

See also: GetParent() IsChild()

--------------------------------------------------------------------------------
SetPixel() Draws a pixel
--------------------------------------------------------------------------------

Syntax: SetPixel( <hDC>, <nCol>, <nRow>, <nRGBColor> )


--> <nRGBColor>

Parameters:

<hDC> The handle of the device context where


to paint.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<nCol>, <nRow> The coordinates of the point where to set the
pixel.

<nRGBColor> The color to use for that pixel.

Returns:

<nRGBColor> The color used if the operation was


successful. This color may vary from the
original supplied color.

Source code: SOURCE\\WINAPI\\SetPixel.c

See also: GetPixel()

--------------------------------------------------------------------------------
SetProp() Store a window property in the Windows prop list
--------------------------------------------------------------------------------

Syntax: SetProp( <hWnd>, <cProp>, <nData> ) --> <lSuccess>

Parameters:

<hWnd> The handle of the window whose property


list receives the new entry.

<cProp> Identifies the prop name.

<nData> Identifies the data to be copied to the property


list

Returns:

<lSuccess> If the operation was successfully.

Sample: SOURCE\\CLASSES\\Window.prg METHOD Link()

Source code: SOURCE\\WINAPI\\Prop.c

See also: GetProp() RemoveProp()

--------------------------------------------------------------------------------
SetTextAlign() Selects the kind of text aligment
--------------------------------------------------------------------------------

Syntax: SetTextAlign( <hDC>, <nAlignMode> ) --> <nOldAlign>

Parameters:

<hDC> Identifies the device context.

<nAlignMode> A numeric value specifying the align mode:

The flags specify the relationship between a point


and a rectangle that bounds the text. The point can be
either the current position or coordinates specified
by a text-output function (such as the ExtTextOut
function). The rectangle that bounds the text is

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


defined by the adjacent character cells in the text
string.

The <nAlignMode> parameter can be one or more flags


from the following three categories.

Choose only one flag from each category.


The first category affects text alignment in the
x-direction:

Value Meaning

TA_CENTER Aligns the point with the horizontal


center of the bounding rectangle.

TA_LEFT Aligns the point with the left side of


the bounding rectangle. This is the
default setting.

TA_RIGHT Aligns the point with the right side of


the bounding rectangle.

The second category affects text alignment in the


y-direction:

Value Meaning

TA_BASELINE Aligns the point with the base line of


the chosen font.

TA_BOTTOM Aligns the point with the bottom of the


bounding rectangle.

TA_TOP Aligns the point with the top of the


bounding rectangle. This is the default
setting.

The third category determines whether the current


position is updated when text is written:

Value Meaning

TA_NOUPDATECP Does not update the current position


after each call to a text-output function.
This is the default setting.

TA_UPDATECP Updates the current x-position after each


call to a text-output function. The new
position is at the right side of the
bounding rectangle for the text. When
this flag is set, the coordinates
specified in calls to the TextOut
function are ignored.
Returns:

<nOldAlign> The previous text-alignment settings, if


the function is successful.

Observations: This align flags are used by the TextOut() and


ExtTextOut() functions.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Source code: SOURCE\\WINAPI\\Text.c

See also: TextOut() ExtTextOut()

--------------------------------------------------------------------------------
SetTime() Changes the time of the system
--------------------------------------------------------------------------------

Syntax: SetTime( <nHour>, <nMinutes>, [<nSeconds>],


[<nMillSecs>] ) --> <lSuccess>

Parameters:

<nHour> The time hour.

<nMinutes> The time minutes. Zero By default.

<nSeconds> The time seconds. Zero by default.

<nMillSecs> The time milliseconds. Zero by default.

Returns:

<lSuccess> A logical value meaning that the supplied


time is valid and could be settled as the new time.

Sample: SAMPLES\\TestDate.prg

Source code: SOURCE\\FUNCTION\\DateTime.c

See also: SetDate()

--------------------------------------------------------------------------------
SetTimer() Installs a system timer
--------------------------------------------------------------------------------

Syntax: SetTimer( <hWnd>, <nIdTimer>, <nInterval> )


--> <nNewId>

Parameters:

<hWnd> Identifies the window to be associated with


the timer.

<nIdTimer> Specifies a non-zero timer identifier.

<nInterval> The time-out value in miliseconds.

Returns:

<nNewId> A specific identifier for this new timer.

Observations: FiveWin supplies a TTimer class that automatically


and easily manages timers.

Sample: SAMPLES\\TestTime.prg

Source code: SOURCE\\WINAPI\\Timers.c

See also: KillTimer() Class TTimer

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
SetViewPortExt() Selects the viewport of a given device context
--------------------------------------------------------------------------------

Syntax: SetViewPortExt( <hDC>, <nWidth>, <nHeight> )


--> <aPrevDimensions>

Parameters:

<hDC> Identifies the device context.

<nWidth>, <nHeight> Specifies the y-extent and x-extent, in device


units of the viewport.

Returns:

<aPrevDimensions> An array that holds the previous dimensions:


{ nWidth, nHeight }

Observations: When the following mapping modes are set, calls to


the SetWindowExt and SetViewportExt functions are
ignored:

MM_HIENGLISH
MM_HIMETRIC
MM_LOENGLISH
MM_LOMETRIC
MM_TEXT
MM_TWIPS

When the mapping mode is MM_ISOTROPIC, an application


must call the SetWindowExt function before calling
SetViewportExt.

The x- and y-extents of the viewport define how much


the graphics device interface (GDI) must stretch
or compress units in the logical coordinate system to
fit units in the device coordinate system. For
example, if the x-extent of the window is 2 and the
x-extent of the viewport is 4, GDI converts two
logical units (measured from the x-axis) into four
device units. Similarly, if the y-extent of the window
is 2 and the y-extent of the viewport is -1, GDI
converts two logical units (measured from the y-axis)
into one device unit.

The extents also define the relative orientation of


the x- and y-axes in both coordinate systems. If
the signs of matching window and viewport extents are
the same, the axes have the same orientation. If the
signs are different, the orientation is reversed. For
example, if the y-extent of the window is 2 and the
y-extent of the viewport is -1, GDI converts the
positive y-axis in the logical coordinate system to
the negative y-axis in the device coordinate system.
If the x-extents are 2 and 4, GDI converts the
positive x-axis in the logical coordinate system to
the positive x-axis in the device coordinate system.

Source code: SOURCE\\WINAPI\\Dc.c

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


See also: SetMapMode() SetWindowExt()

--------------------------------------------------------------------------------
SetWindowExt() Sets the X and Y extents of a device context
--------------------------------------------------------------------------------

Syntax: SetWindowExt( <hDC>, <nWidth>, <nHeight> )


--> <aPrevDimensions>

Parameters:

<hDC> Identifies the device context.

<nWidth>, <nHeight> Specifies the y-extent and x-extent, in logical


units, of the window.

Returns:

<aPrevDimensions> An array that holds the previous dimensions:


{ nWidth, nHeight }

Observations: See SetViewPortExt() explanations.

Source code: SOURCE\\WINAPI\\Dc.c

See also: SetMapMode() SetViewPortExt()

--------------------------------------------------------------------------------
SetWindowOrigin() Changes the window origin of the DC of a window
-------------------------------------------------------------------------------

Syntax: SetWindowOrigin( <hDC>, <nCol>, <nRow> )


--> <aPrevOrigin>

Parameters:

<hDC> Identifies the device context.

<nCol>, <nRow> Identifies the coordinates of the top-left


position of the window.

Returns:

<aPrevOrigin> An array with the previous origin values:


{ nCol, nRow }

Observations: The window origin is the origin of the logical


coordinate system for a window. By changing the
window origin, an application can change the way the
graphics device interface (GDI) converts logical
coordinates to device coordinates (the viewport). GDI
converts logical coordinates to the device
coordinates of the viewport in the same way as it
converts the origin.

To convert points to the right, an application can


specify a negative value for the nCol parameter.

Similarly, to convert points down (in the MM_TEXT


mapping mode), the nRow parameter can be negative.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Source code: SOURCE\\WINAPI\\WndCente.c

See also: GetWindowOrg()

--------------------------------------------------------------------------------
SetWindowPos() Changes the position of a Window
--------------------------------------------------------------------------------

Syntax: SetWindowPos( <hWnd>, <hWndAfter>, <nCol>, <nRow>,


<nWidth>, <nHeight>, <nFlags> )
--> <lSuccess>
Parameters:

<hWnd> Identifies the window to be positioned.

<hWndAfter> Identifies the window to precede the positioned


window in the Z-order. This parameter must be a
window handle or one of the following values:

Value Meaning

HWND_BOTTOM Places the window at the bottom of


the Z-order. If hwnd identifies a
topmost window, the window loses its
topmost status; the system places the
window at the bottom of all other
windows.

HWND_TOP Places the window at the top of the


Z-order.

HWND_TOPMOST Places the window above all non-topmost


windows. The window maintains its
topmost position even when it is
deactivated.

HWND_NOTOPMOST Repositions the window to the top of


all non-topmost windows (that is, behind
all topmost windows). This flag has no
effect if the window is already a
non-topmost window.

<nCol>, <nRow> The new window coordinates.

<nWidth>, <nHeight> The new dimensions of the window.

<nFlags> Specifies the window sizing and positioning options.


This parameter can be a combination of the following
values:

Value Meaning

SWP_DRAWFRAME Draws a frame (defined in the window's


class description) around the window.

SWP_HIDEWINDOW Hides the window.

SWP_NOACTIVATE Does not activate the window. If this


flag is not set, the window is
activated and moved to the top of
either the topmost or non-topmost

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


group (depending on the setting of the
hwndInsertAfter parameter).

SWP_NOMOVE Retains the current position (ignores


the x and y parameters).

SWP_NOSIZE Retains the current size (ignores the


cx and cy parameters).

SWP_NOREDRAW Does not redraw changes. If this flag


is set, no repainting of any kind
occurs. This applies to the client
area, the non-client area (including
the title and scroll bars), and any
part of the parent window uncovered
as a result of the moved window.
When this flag is set, the application
must explicitly invalidate or redraw
any parts of the window and parent
window that must be redrawn.

SWP_NOZORDER Retains the current ordering (ignores


the hwndInsertAfter parameter).

SWP_SHOWWINDOW Displays the window.

Returns:

<lSuccess> A logical value indicating if the


operation was performed successfully.

Observations: If the SWP_SHOWWINDOW or the SWP_HIDEWINDOW flags are


set, the window cannot be moved or sized.

All coordinates for child windows are client


coordinates (relative to the upper-left corner of the
parent window's client area).

A window can be made a topmost window either by


setting the hwndAfter parameter to HWND_TOPMOST
and ensuring that the SWP_NOZORDER flag is not set,
or by setting a window's Z-order so that it is above
any existing topmost windows. When a non-topmost
window is made topmost, its owned windows are also
made topmost. Its owners are not changed.

If neither SWP_NOACTIVATE nor SWP_NOZORDER is


specified (that is, when the application requests
that a window be simultaneously activated and placed
in the specified Z-order), the value specified in
hwndAfter is used only in the following circumstances:

Neither HWND_TOPMOST or HWND_NOTOPMOST is specified


in the hwndAfter parameter.

The window specified in the hwnd parameter is not the


active window.

An application cannot activate an inactive window


without also bringing it to the top of the Z-order.
Applications can change the Z-order of an activated

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


window without restrictions or activate a window and
then move it to the top of the topmost or non-topmost
windows. A topmost window is no longer topmost if it
is repositioned to the bottom (HWND_BOTTOM) of the
Z-order or after any non-topmost window. When a
topmost window is made non-topmost, all of its owners
and its owned windows are also made non-topmost windows.

A non-topmost window may own a topmost window, but not


vice versa. Any window (for example, a dialog box)
owned by a topmost window is itself made a topmost
window, to ensure that all owned windows stay above
their owner.

Sample: SAMPLES\\TestTop.prg

Source code: SOURCE\\WINAPI\\WndPos.c

See also: MoveWindow()

--------------------------------------------------------------------------------
SetWindowText() Changes the caption of a Window
--------------------------------------------------------------------------------

Syntax: SetWindowText( <hWnd>, <cText> ) --> nil

Parameters:

<hWnd> Identifies the window or the control whose


text is to be set.

<cText> The text to be set as new window text.

Returns: nil

Observations: This function causes a WM_SETTEXT message to be


sent to the given window or control.

If the window specified by the hwnd parameter is a


control, the text within the control is set. If the
specified window is a list-box control created with
WS_CAPTION style, however, SetWindowText will set
the caption for the control, not for the list-box
entries.

Sample: Class TWindow METHOD SetText()

Source code: SOURCE\\WINAPI\\SetText.c

See also: GetWindowText()

--------------------------------------------------------------------------------
ShellAbout() Displays the typical Windows about DialogBox
--------------------------------------------------------------------------------

Syntax: ShellAbout( <cMsg> [,<cTitle>] [,<hIcon>] ) --> nil

Parameters:

<cMsg> The description text for the about dialogbox.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<cTitle> The title of the about dialogbox. By default
it shows "About".

<hIcon> The handle of the icon to show. By default


it uses the first icon included inside the EXE as
resource. It shows the typical Windows icon if
no icon is found.

Returns: nil

Observations: This function is also included now inside FiveWin


as MsgAbout. We plan to remove this in next
versions and just keep MsgAbout for compatibility
with FiveOS2 and fiveDos.

It is very usefull as it also shows the amount


of memory and resources available.

Sample: SAMPLES\\Install.prg

Source code: SOURCE\\WINAPI\\About.c

See also: MsgAbout()

--------------------------------------------------------------------------------
ShowWindow() Make the window show on the screen
--------------------------------------------------------------------------------

Syntax: ShowWindow( <hWnd>, <nMode> ) --> <lSuccess>

Parameters:

<hWnd> Identifies the window.

<nMode> Specifies how the window is to be shown. This


parameter can be one of the following values:

Value Meaning

SW_HIDE Hides the window and passes activation to


another window.

SW_MINIMIZE Minimizes the specified window and


activates the top-level window in the
system's list.

SW_RESTORE Activates and displays a window. If the


window is minimized or maximized, Windows
restores it to its original size and
position (same as SW_SHOWNORMAL).

SW_SHOW Activates a window and displays it in its


current size and position.

SW_SHOWMAXIMIZED Activates a window and displays it


as a maximized window.

SW_SHOWMINIMIZED Activates a window and displays it


as an icon.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


SW_SHOWMINNOACTIVE Displays a window as an icon. The
window that is currently active remains
active.

SW_SHOWNA Displays a window in its current state. The


window that is currently active remains
active.

SW_SHOWNOACTIVATE Displays a window in its most


recent size and position. The window that is
currently active remains active.

SW_SHOWNORMAL Activates and displays a window. If the


window is minimized or maximized, Windows
restores it to its original size and
position (same as SW_RESTORE).

#define SW_HIDE 0
#define SW_SHOWNORMAL 1
#define SW_NORMAL 1
#define SW_SHOWMINIMIZED 2
#define SW_SHOWMAXIMIZED 3
#define SW_MAXIMIZE 3
#define SW_SHOWNOACTIVATE 4
#define SW_SHOW 5
#define SW_MINIMIZE 6
#define SW_SHOWMINNOACTIVE 7
#define SW_SHOWNA 8
#define SW_RESTORE 9

Returns:

<lSuccess> A logical value indicating if the operation


was performed successfully.

Sample: Class TWindow METHOD Show()

Source code: SOURCE\\WINAPI\\WndShow.c

See also: IsWindowVisible()

--------------------------------------------------------------------------------
SndPlaySound() Plays a WAV sound file from resources
--------------------------------------------------------------------------------

Syntax: SndPlayRes( <cSndName>, <nMode> )


--> <lSuccess>

Parameters:

<cSndName> Specifies the name of the sound stored at


resources to play. It may be a string or a numeric
identifier. To include a WAV file into an RC, you
must specify a new user defined resource type named
"WAVE":

MyApp.rc

OKSOUND WAVE "OkSound.wav"

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


NOSOUND WAVE "NoSound.wav"

or

110 WAVE "OkSound.wav"


120 WAVE "NoSound.wav"

<nMode> Specifies options for playing the sound using one or


more of the following flags:

SND_SYNC The sound is played synchronously and the


function does not return until the sound
ends.

SND_ASYNC The sound is played asynchronously and the


function returns immediately after beginning
the sound. To terminate an
asynchronously-played sound, call
sndPlaySound with cSndName set to 0.

SND_NODEFAULT If the sound can't be found, the


function returns silently without playing
the default sound.

SND_MEMORY The parameter specified by cSndName to an


in-memory image of a waveform sound.

SND_LOOP The sound will continue to play repeatedly


until sndPlaySound is called again with the
cSndName parameter set to 0. You must also
specify the SND_ASYNC flag to loop sounds.

SND_NOSTOP If a sound is currently playing, the


function will immediately return FALSE
without playing the requested sound.

#define SND_SYNC 0
#define SND_ASYNC 1
#define SND_NODEFAULT 2
#define SND_MEMORY 4
#define SND_LOOP 8
#define SND_NOSTOP 16

Returns:

<lSuccess> A logical value indicating if the operation


was performed successfully.

Sample: SAMPLES\\Lolo.prg

Source code: SOURCE\\WINAPI\\Sound.c

See also: SndPlaySound() MsgSound() MsgBeep() MessageBeep()

--------------------------------------------------------------------------------
SndPlaySound() Plays a WAV sound file
--------------------------------------------------------------------------------

Syntax: SndPlaySound( <cSndName>, <nMode> )


--> <lSuccess>

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Parameters:

<cSndName> Specifies the name of the sound to play. The function


searches the [sounds] section of WIN.INI for an entry
with this name and plays the associated waveform file.
If no entry by this name exists, then it assumes the
name is the name of a waveform file. If this
parameter is 0, any currently playing sound is
stopped.

<nMode> Specifies options for playing the sound using one or


more of the following flags:

SND_SYNC The sound is played synchronously and the


function does not return until the sound
ends.

SND_ASYNC The sound is played asynchronously and the


function returns immediately after beginning
the sound. To terminate an
asynchronously-played sound, call
sndPlaySound with cSndName set to 0.

SND_NODEFAULT If the sound can't be found, the


function returns silently without playing
the default sound.

SND_MEMORY The parameter specified by cSndName to an


in-memory image of a waveform sound.

SND_LOOP The sound will continue to play repeatedly


until sndPlaySound is called again with the
cSndName parameter set to 0. You must also
specify the SND_ASYNC flag to loop sounds.

SND_NOSTOP If a sound is currently playing, the


function will immediately return FALSE
without playing the requested sound.

#define SND_SYNC 0
#define SND_ASYNC 1
#define SND_NODEFAULT 2
#define SND_MEMORY 4
#define SND_LOOP 8
#define SND_NOSTOP 16

Returns:

<lSuccess> A logical value indicating if the operation


was performed successfully.

Sample: SAMPLES\\TestBmp2.prg

Source code: SOURCE\\WINAPI\\Sound.c

See also: MsgBeep() MessageBeep()

--------------------------------------------------------------------------------
StartDoc() Start generating a new printing document
--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Syntax: StartDoc( <hDC> ) --> <nRetCode>

Parameters:

<hDC> Identifies the device context for the print job.

Returns:

<nRetCode> The return value is positive if the function is


successful. Otherwise it is SP_ERROR.

#define SP_ERROR (-1)

Source code: SOURCE\\WINAPI\\PrintDC.c

See also: Class TPrinter

--------------------------------------------------------------------------------
StartPage() Start prinitng a new page
--------------------------------------------------------------------------------

Syntax: StartPage( <hDC> ) --> <nRetCode>

Parameters:

<hDC> Identifies the device context for the print job.

Returns:

<nRetCode> The return value is positive if the function is


successful.

Source code: SOURCE\\WINAPI\\PrintDC.c

See also: EndPage() StartDoc()

--------------------------------------------------------------------------------
nStrCrc() Returns a CRC checksum for a text
--------------------------------------------------------------------------------

Syntax: nStrCrc( <cText> ) --> nCRCValue

Parameters:

<cText> The text from where we want to generate a 32


bits CRC checksum value.

Returns:

<nCRCValue> A numeric value with the checksum CRC.

Sample: MsgInfo( nStrCrc( "Hello world!" )

Source code: Not provided.

See also: nFileCrc()

--------------------------------------------------------------------------------
StrToken() Returns a token from a string

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------

Syntax: StrToken( <cText>, <nOcurrence> [,<cSepChar>] )


--> <cToken>

Parameters:

<cText> The text from where we want to extract a


token.

<nOcurrence> The numeric ocurrence of the token inside


<cText>.

<cSepChar> The character that separates the tokens.


By default it is a space (" ").

Returns:

<cToken> The token we want to retrieve.

Sample: SAMPLES\\DbfBuild.prg

Source code: SOURCE\\FUNCTION\\StrToken.c

--------------------------------------------------------------------------------
SysRefresh() Lets Windows process all pending messages
--------------------------------------------------------------------------------

Syntax: SysRefresh() --> <lQuit>

Parameters: None.

Returns:

<lQuit> A logical value indicating if a WM_QUIT


message was issued, so the app should be
finished.

Observations: This FiveWin function is extremelly important and


has no counterpart in standard Windows API.

SysRefresh() processes all pending messages,


letting Windows keep controlling all its
pending activities.

We must use SysRefresh() from inside those


processes that may be time consuming.

The big benefit and advantadge of SysRefresh()


is that it lets us keep doing 'standard' linear
programming without having to send ourselves
messages to keep processing a long task.

Use it in loops, seeks, and any time consuming


processes to avoid Windows from losing
processing control.

Sample: SAMPLES\\TestMMT.prg

Source code: Not provided.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
SysTime() Changes the time of the system
--------------------------------------------------------------------------------

Syntax: SysTime( <nNewTime> ) --> nil

Parameters:

<nNewTime> The new time we want to set the system


time to. It has to be provided in a 'long'
( 4 bytes ) format.

Returns: nil

Source code: SOURCE\\FUNCTION\\SetDate.c

See also: SetDate()

--------------------------------------------------------------------------------
TextOut() Draws text to a specified location
--------------------------------------------------------------------------------

Syntax: TextOut( <hDC>, <nRow>, <nCol>, <cText> )


--> <lSuccess>

Parameters:

<hDC> Identifies the device context.

<nRow>, <nCol> The coordinates where to print.

<cText> The text to be drawn.

Returns:

<lSuccess> A logical value indicating that the operation


was completed successfully.

Sample: CLASS TPrinter METHOD Say

Source code: SOURCE\\WINAPI\\Text.c

See also: ExtTextOut() WSay()

--------------------------------------------------------------------------------
TimerCount() Returns the ellapsed time since the app started
--------------------------------------------------------------------------------

Syntax: TimerCount() --> <aTimerInfo>

Parameters: None

Returns:

<aTimerInfo> An array that contains two numeric


values: { nMsSinceStart, nMsThisVM }

nMsSinceStart: It is the milliseconds since


the app started.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


nMsThisVM: It is the milliseconds since the
Windows virtual machine started (virtual
machine refers to Windows internal info and
it is not at all something related to FiveWin).

Samples: SAMPLES\\TestTool.prg

Source code: SOURCE\\WINAPI\\ToolHelp.c

--------------------------------------------------------------------------------
TreeBegin() FiveWin trees function support
--------------------------------------------------------------------------------

Syntax: TreeBegin( <cBmpOpen>, <cBmpClose> )


--> <oTree>

Parameters:

<cBmpOpen> The name of the resourced bitmap to use


as the open tree bitmap.

<cBmpClose> The name of the resourced bitmap to use


as the close tree bitmap.

Returns:

<oTree> The just new created tree reference.

Observations: These functions are automatically managed by


FiveWin trees creation xBase commands.

Sample: IDE\\SOURCE\\Menu.prg

Source code: SOURCE\\CLASSES\\Trees.prg

See also: Class TTreeItem Class TLinkList

--------------------------------------------------------------------------------
_TreeItem() FiveWin trees function support
--------------------------------------------------------------------------------

Syntax: _TreeItem( <cPrompt>, <cResName1>, <cResName2>,


<cBmpOpen>, <cBmpClose>, <lOpened> )
--> <oTreeItem>
Parameters:

<cPrompt> The text of the treeitem element.

<cResName1> The name of the resource bitmap to use


for this specific treeitem, when it is opened.

<cResName2> The name of the resource bitmap to use


for this specific treeitem, when it is close.

<cBmpOpen> The name of the bitmap file to use


for this specific treeitem, when it is opened.

<cBmpClose> The name of the bitmap file to use


for this specific treeitem, when it is closed.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<lOpened> A logical value indicating if the treeitem
originally is opened.

Returns:

<oTreeItem> A reference to the just new created treeitem.

Observations: These functions are automatically managed by


FiveWin trees creation xBase commands.

Sample: IDE\\SOURCE\\Menu.prg

Source code: SOURCE\\CLASSES\\Trees.prg

See also: TreeBegin() TreeEnd()

--------------------------------------------------------------------------------
TreeEnd() FiveWin trees function support
-------------------------------------------------------------------------------

Syntax: TreeEnd() --> nil

Parameters: None

Returns: nil

Observations: These functions are automatically managed by


FiveWin trees creation xBase commands.

Sample: IDE\\SOURCE\\Menu.prg

Source code: SOURCE\\CLASSES\\Trees.prg

See also: TreeBegin() TreeEnd()

--------------------------------------------------------------------------------
uCharToVal() Converts any value into a character string
--------------------------------------------------------------------------------

Syntax: uCharToVal( <cExpression>, <uType> )


--> <uValue>

Parameters:

<cExpression> A string expression to be converted to a


specific type.

<uType> It is value, whose type determines the kind


of conversion we want to do.

Returns:

<uValue> The corresponding value obtained from


<cExpression> and <uType> specifications.

Source code: SOURCE\\FUNCTION\\WQOut.prg

See also: cValToChar()

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
uLoadStruct() Restore an array or an object from disk
--------------------------------------------------------------------------------

Syntax: uLoadStruct( <cObjFile> ) --> <oObject>

Parameters:

<cObjFile> The name of a file on disk which contains


an array or an object previously saved with
lSaveStruct().

Returns:

<oObject> A reference of the array or the object


just beeing created.

Observations: In order to let Clipper properly rebuild a


specific class object, an external reference
to that class must be specified.

// Place this at the beginning of your app


// change TWindow for the name of the class
// of that object

extern TWindow

Source code: Not provided.

See also: lSaveStruct()

--------------------------------------------------------------------------------
UnZipFile() UnZips a file from the ZIP file
--------------------------------------------------------------------------------

Syntax: UnZipFile( <cZipFileName>,;


<cFileName>,;
<nFileOffset>,;
<hWnd> ) --> <nRetCode>

Parameters:

<cZipFileName> The name of the ZIP file from where to extract


<cFileName>.

<cFileName> The name of the file to extract from the ZIP


file.

<nFileOffset> The offset inside the ZIP file where this


file to extract is located. It is the seventh
item of the array returned by GetFirstInZip() and
GetNextInZip() functions.

<hWnd> The handle of the window or Dialog where


Info-Unz.dll will report the unzip progress. This
window will automatically evaluate its DATA bUnZip
codeblock:

<oWnd>:bUnZip = { | nPercent | ... }

From that codeblock you may update a Meter control,

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


or any other used control.

Returns:

<nRetCode> The returned code from this operation:

#define ZIP_OK 0
#define ZIP_FILEERROR -1
#define ZIP_INTERNALERROR -2
#define ZIP_NOMOREITEMS 1

Sample: SAMPLES\\TestZip.prg

Source code: SOURCE\\FUNCTION\\UnZip.c

--------------------------------------------------------------------------------
UpdateWindow() Updates the client area of a window
--------------------------------------------------------------------------------

Syntax: UpdateWindow( <hWnd> ) --> nil

Parameters:

<hWnd> Identifies the window to be updated.

Returns: nil

Observations: This function sends a WM_PAINT to the


window forcing it to be repainted.

Sample: SOURCE\\CLASSES\\Window.prg

Source code: SOURCE\\WINAPI\\WndUpdat.c

See also: CLASS TWindo METHOD Refresh()

--------------------------------------------------------------------------------
uValBlank() Returns the correspondent blank value of any variable
--------------------------------------------------------------------------------

Syntax: uValBlank( <uValue> ) --> <uBlankValue>

Parameters:

<uValue> A variable whose value is to be blanked.

Returns:

<uBlankValue> The same value but blanked.

Source code: SOURCE\\FUNCTION\\ValBlank.prg

See also: cValToChar() uCharToVal()

--------------------------------------------------------------------------------
WaitRun() Executes another Windows application and waits
--------------------------------------------------------------------------------

Syntax: WaitRun( <nCmdLine>, <nCmdShow> )


--> <hInstance>

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Parameters:

<nCmdLine> A string that contains the command line


to execute. If it does not contains a path,
then Windows searches in this order:

1 The current directory.

2 The Windows directory (the directory


containing WIN.COM); the GetWinDir()
function retrieves the path of this directory.

3 The Windows system directory (the directory


containing such system files as GDI.EXE); the
GetSysDir() function retrieves the path of
this directory.

4 The directory containing the executable file


for the current task; the GetModuleFileName
function retrieves the path of this directory.

5 The directories listed in the PATH environment


variable.

6 The directories mapped in a network.

<nCmdShow> Specifies how the windows application has to be


shown. See ShowWindow() for a description of all
possible values.

Returns:

<hInstance> The return value identifies the instance of the


loaded module, if the function is successful.
Otherwise, the return value is an error value less
than 32:

0 System was out of memory, executable file was


corrupt, or relocations were invalid.

2 File was not found.

3 Path was not found.

5 Attempt was made to dynamically link to a


task, or there was a sharing or
network-protection error.

6 Library required separate data segments for


each task.

8 There was insufficient memory to start the


application.

10 Windows version was incorrect.

11 Executable file was invalid. Either it was


not a Windows application or there was an
error in the .EXE image.

12 Application was designed for a different

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


operating system.

13 Application was designed for MS-DOS 4.0.

14 Type of executable file was unknown.

15 Attempt was made to load a real-mode


application (developed for an earlier version
of Windows).

16 Attempt was made to load a second instance


of an executable file containing multiple
data segments that were not marked read-only.

19 Attempt was made to load a compressed


executable file. The file must be decompressed
before it can be loaded.

20 Dynamic-link library (DLL) file was invalid.


One of the DLLs required to run this
application was corrupt.

21 Application requires 32-bit extensions.

Observations: This function works exactly as WinExec() with


the difference that it waits for the new task issued
to finish.

Sample: SAMPLES\\FwBrow.prg

Source code: SOURCE\\WINAPI\\WinExec.c

See also: ShowWindow() WinExec()

--------------------------------------------------------------------------------
WBrwScroll() Scroll some text lines in a window
--------------------------------------------------------------------------------

Syntax: WBrwScroll( <hWnd>, <nRows>, <hFont> ) --> nil

Parameters:

<hWnd> The handle of the window to scroll some


text lines.

<nRows> The number of rows to scroll.

<hFont> The font to use to calculate the rows height.

Returns: nil

Observations: This function is used by FiveWin when


scrolling some rows in a TWBrowse control.

Sample: SOURCE\\CLASSES\\WBrowse.prg METHOD GoUp()

Source code: SOURCE\\WINAPI\\WndBrow.c

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


See also: WBrwLine()

--------------------------------------------------------------------------------
WindowFromPoint() Retrieves the window which is at certain position
--------------------------------------------------------------------------------

Syntax: WindowFromPoint( <nCol>, <nRow> ) --> <hWnd>

Parameters:

<nCol> The point coordinates


<nRow>

Returns:

<hWnd> The handle of the window where the point is.

Observations: The WindowFromPoint function does not retrieve


the handle of a hidden, disabled, or transparent
window, even if the point is within the window. An
application should use the ChildWindowFromPoint
function for a nonrestrictive search.

Sample: SAMPLES\\NewHelp.prg

Source code: SOURCE\\WINAPI\\WndPt.c

See also: ChildWindowFromPoint()

--------------------------------------------------------------------------------
WinExec() Executes another Windows application
--------------------------------------------------------------------------------

Syntax: WinExec( <nCmdLine>, <nCmdShow> )


--> <hInstance>

Parameters:

<nCmdLine> A string that contains the command line


to execute. If it does not contains a path,
then Windows searches in this order:

1 The current directory.

2 The Windows directory (the directory


containing WIN.COM); the GetWinDir()
function retrieves the path of this directory.

3 The Windows system directory (the directory


containing such system files as GDI.EXE); the
GetSysDir() function retrieves the path of
this directory.

4 The directory containing the executable file


for the current task; the GetModuleFileName
function retrieves the path of this directory.

5 The directories listed in the PATH environment


variable.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


6 The directories mapped in a network.

<nCmdShow> Specifies how the windows application has to be


shown. See ShowWindow() for a description of all
possible values.

Returns:

<hInstance> The return value identifies the instance of the


loaded module, if the function is successful.
Otherwise, the return value is an error value less
than 32:

0 System was out of memory, executable file was


corrupt, or relocations were invalid.

2 File was not found.

3 Path was not found.

5 Attempt was made to dynamically link to a


task, or there was a sharing or
network-protection error.

6 Library required separate data segments for


each task.

8 There was insufficient memory to start the


application.

10 Windows version was incorrect.

11 Executable file was invalid. Either it was


not a Windows application or there was an
error in the .EXE image.

12 Application was designed for a different


operating system.

13 Application was designed for MS-DOS 4.0.

14 Type of executable file was unknown.

15 Attempt was made to load a real-mode


application (developed for an earlier version
of Windows).

16 Attempt was made to load a second instance


of an executable file containing multiple
data segments that were not marked read-only.

19 Attempt was made to load a compressed


executable file. The file must be decompressed
before it can be loaded.

20 Dynamic-link library (DLL) file was invalid.


One of the DLLs required to run this
application was corrupt.

21 Application requires 32-bit extensions.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Observations: The LoadModule() function provides an alternative
method for running an application.

Sample: SAMPLES\\FwBrow.prg

Source code: SOURCE\\WINAPI\\WinExec.c

See also: ShowWindow() LoadModule()

--------------------------------------------------------------------------------
WinHelp() Activates Windows WinHelp program
--------------------------------------------------------------------------------

Sintax

WinHelp( cHelpFile, nHelpType, ncAditionalData ) --> lSuccess

Parameters

cHelpFile Name of the help file to use. Those files have


HLP extension and use a Windows own format.

nHelpType Selects the kind of service to execute. Windows


offers multiple services through this function
so it may be quite confusing to obtain all its
posibilities. This is the reason why we have
created Help...() functions, which are special
functions based on WinHelp().

ncAditionalData Certain parameters acording to the requested


WinHelp() service.

Descrption

Windows implements all its help system through WinHelp() function.


This function calls WINHELP.EXE which is who manipulate HLP files.

Code: SOURCE\\WINAPI\\Help.c

--------------------------------------------------------------------------------
WndBox() Draws a box around
--------------------------------------------------------------------------------

Syntax: WndBox( <hDC>, <nTop>, <nLeft>, <nBottom>,


<nRight> ) --> nil

Parameters:

<hDC> Identifies the handle of the device context.

<nTop>, The coordinates of the box to draw.


<nLeft>,
<nBottom>,
<nRight>

Returns: Nil

Sample: SAMPLES\\ToolTip.prg

Source code: SOURCE\\FUNCTION\\WndBoxes.c

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


See also: WndBoxIn() WndBoxRaised()

--------------------------------------------------------------------------------
WndBoxIn() Draws a inset 3D box
--------------------------------------------------------------------------------

Syntax: WndBoxIn( <hDC>, <nTop>, <nLeft>, <nBottom>,


<nRight> ) --> nil

Parameters:

<hDC> Identifies the handle of the device context.

<nTop>, The coordinates of the box to draw.


<nLeft>,
<nBottom>,
<nRight>

Returns: Nil

Sample: SAMPLES\\ToolTip.prg

Source code: SOURCE\\FUNCTION\\WndBoxes.c

See also: WndBoxIn() WndBoxRaised()

--------------------------------------------------------------------------------
WndBoxRaised() Draws a box raised
--------------------------------------------------------------------------------

Syntax: WndBoxRaised( <hDC>, <nTop>, <nLeft>, <nBottom>,


<nRight> ) --> nil

Parameters:

<hDC> Identifies the handle of the device context.

<nTop>, The coordinates of the box to draw.


<nLeft>,
<nBottom>,
<nRight>

Returns: Nil

Sample: SAMPLES\\ToolTip.prg

Source code: SOURCE\\FUNCTION\\WndBoxes.c

See also: WndBoxIn() WndBoxRaised()

--------------------------------------------------------------------------------
WndCenter() Centers a window on the screen
--------------------------------------------------------------------------------

Syntax: WndCenter( <hWnd> [,<hWndParent>] ) --> nil

Parameters:

<hWnd> Identifies the handle of the window to center

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


on screen.

<hWndParent> An optional handle of a window to use


as a reference to center the <hWnd> window.

Returns: nil

Sample: SOURCE\\CLASSES\\Window.prg METHOD Center()

Source code: SOURCE\\WINAPI\\WndCenter.c

See also: Class TWindow METHOD Center()

--------------------------------------------------------------------------------
WndCopy() Copy a window image to the clipboard
--------------------------------------------------------------------------------

Syntax: WndCopy( <hWnd> [,<lAll>] ) --> nil

Parameters:

<hWnd> Identifies the handle of the window whose


image is going to be placed at the clipboard.

<lAll> An optional logical value indicating if all


the window area is to be copied or just the
window client area. By default only the client
area gets copied.

Returns: nil

Source code: SOURCE\\WINAPI\\WndMove.c

See also: Class TClipBoard WndPrint()

--------------------------------------------------------------------------------
WndPrint() Prints the image of a window
--------------------------------------------------------------------------------

Syntax: WndPrint( <hWnd>, <hDCDestination>, <nRow>,


<nCol>, <nScale> ) --> nil

Parameters:

<hWnd> The handle of a window to make a printout.

<hDCDestination> Identifies the device context where the window


image is going to be copied.

<nRow>, <nCol> The coordinates were to place the image.

<nScale> An optional zoom factor. By default is 1.

Returns: nil

Sample: CLASS TWindow METHOD Print()

Source code: SOURCE\\WINAPI\\WndPrint.c

See also: CLASS TWindow

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
WndRaised() Makes the border of a window look raised
--------------------------------------------------------------------------------

Syntax: WndRaised( <hWnd>, <hDC> ) --> nil

Parameters:

<hWnd> Identifies the window to make it look raised.

<hDC> The device context of the window.

Returns: nil

Sample: CLASS TBar METHOD Paint()

Source code: SOURCE\\FUNCTION\\WndBoxes.c

See also: WndBox() WndBoxIn()

--------------------------------------------------------------------------------
WNetBrowse() Shows a DialogBox to browse resources in a Net
--------------------------------------------------------------------------------

Syntax: WNetBrowse( <hWnd>, <nType>, <cPath> )


--> <nRetCode>

Parameters:

<hWnd> The handle of the window to be the parent of


the dialogbox to display.

<nType> The type of resources to browse:

#define TYPE_DRIVE 1
#define TYPE_FILE 2
#define TYPE_PRINTER 3
#define TYPE_COMM 4

Returns:

<nRetCode>

Sample: SAMPLES\\TestNet.prg

Source code: SOURCE\\WINAPI\\Net.c

See also: WNetGetUser() WNetError() WNetGetErrorText()

--------------------------------------------------------------------------------
WNetError() Retrieves the latest Net error
--------------------------------------------------------------------------------

Syntax: WNetError() --> <nErrorCode>

Parameters: None.

Returns:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<nErrorCode> The last net error code ocurred

Sample: SAMPLES\\TestNet.prg

Source code: SOURCE\\WINAPI\\Net.c

See also: WNetGetUser() WNetError() WNetGetErrorText()

--------------------------------------------------------------------------------
WNetGetUser() Retrieves the actual local Net user
--------------------------------------------------------------------------------

Syntax: WNetGetUser() --> <cUserName>

Parameters: None

Returns:

<cUserName> The name of the current station user.

Sample: SAMPLES\\TestNet.prg

Source code: SOURCE\\WINAPI\\Net.c

See also: WNetGetUser() WNetError() WNetGetErrorText()

--------------------------------------------------------------------------------
WritePProString() Writes an entry in a private INI file
--------------------------------------------------------------------------------

Syntax: WritePProString( <cSection>, <cEntry>, <cString>,


<cFileName> ) --> <lSuccess>
Parameters:

<cSection> Specifies the section containing the entry.

<cEntry> The entry whose value is to written.

<cString> The text value to set into the INI.

<cFileName> The name of the private INI file.

Returns:

<lSuccess> A logical value indicating if the operation


was performed successfully.

Sample: SAMPLES\\TestIni.prg

Source code: SOURCE\\WINAPI\\Profile.c

See also: WriteProfString()

--------------------------------------------------------------------------------
WriteProfString() Writes an entry in WIN.INI public file
--------------------------------------------------------------------------------

Syntax: WriteProfString( <cSection>, <cEntry>,


<cString> ) --> <lSuccess>
Parameters:

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


<cSection> Specifies the section containing the entry.

<cEntry> The entry whose value is to written.

<cString> The text value to set into the INI.

Returns:

<lSuccess> A logical value indicating if the operation


was performed successfully.

Sample: SAMPLES\\TestIni.prg

Source code: SOURCE\\WINAPI\\Profile.c

See also: WriteProfString()

--------------------------------------------------------------------------------
WQOut() FiveWin QOut() replacement
--------------------------------------------------------------------------------

Syntax: WQOut( <aParams> ) --> nil

Parameters:

<aParams> An array containing all the values to


be displayed on the screen.

Returns: nil

Sample: SAMPLES\\TestBVbx.prg

Source code: SOURCE\\FUNCTION\\WQOut.prg

See also: Msg...() functions

--------------------------------------------------------------------------------
WriteComm() Writes to the communication port
--------------------------------------------------------------------------------

Syntax: WriteComm( <nIdCommDev>, <cData> ) --> <nBytes>

Parameters:

<nIdComDev> Identifies the communication device to be flushed.


The OpenComm function returns this value.

<cData> The data to send to the comm port.

Returns:

<nBytes> The number of bytes written to the port.

Sample: SAMPLES\\TestComm.prg

Source code: SOURCE\\WINAPI\\Comm.c

See also: OpenComm() WriteComm() ReadComm() BuildCommDcb()


SetCommStat() FlushComm() GetCommError()

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
WScroll() Scrolls some text rows of a window
--------------------------------------------------------------------------------

Syntax: WScroll( <hWnd>, <nRows>, <hFont> ) --> nil

Parameters:

<hWnd> Identifies the window whose area is to be scrolled.

<nRows> Specifies the number of text rows to scroll.

<hFont> The handle of the font to calculate


the text height.

Returns: nil

Sample: SOURCE\\CLASSES\\WBrowse.prg

Source code: SOURCE\\WINAPI\\WndScrol.c

See also: WBrwLine() WBrwRows()

--------------------------------------------------------------------------------
xPadL() Left fills a string up to a certain pixel dimension
--------------------------------------------------------------------------------

Syntax: xPadL( <cText>, <nPixels> [,<cChar>] )


--> <cNewText>

Parameters:

<cText> The text whose character length is to be


adjusted.

<nPixels> The total length in pixels.

<cChar> An optional character to use to fill


by the left side the <cText> string.
Returns:

<cNewText> A new string whose left side has been


added with extra <cChar> characters to reach
the <nPixels> size.

Sample: SOURCE\\CLASSES\\WBrowse.prg

Source code: SOURCE\\FUNCTION\\xPad.prg

See also: xPadC() xPadR()

--------------------------------------------------------------------------------
xPadC() Center fills a string up to a certain pixel
--------------------------------------------------------------------------------

Syntax: xPadC( <cText>, <nPixels> [,<cChar>] )


--> <cNewText>

Parameters:

<cText> The text whose character length is to be

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


adjusted.

<nPixels> The total length in pixels.

<cChar> An optional character to use to fill


by both sides the <cText> string.
Returns:

<cNewText> A new string whose extremes side has been


added with extra <cChar> characters to reach
the <nPixels> size.

Sample: SOURCE\\CLASSES\\WBrowse.prg

Source code: SOURCE\\FUNCTION\\xPad.prg

See also: xPadL() xPadR()

--------------------------------------------------------------------------------
xPadR() Right fills a string up to a certain pixel dimension
--------------------------------------------------------------------------------

Syntax: xPadR( <cText>, <nPixels> [,<cChar>] )


--> <cNewText>

Parameters:

<cText> The text whose character length is to be


adjusted.

<nPixels> The total length in pixels.

<cChar> An optional character to use to fill


by right side the <cText> string.
Returns:

<cNewText> A new string whose right side has been


added with extra <cChar> characters to reach
the <nPixels> size.

Sample: SOURCE\\CLASSES\\WBrowse.prg

Source code: SOURCE\\FUNCTION\\xPad.prg

See also: xPadC() xPadL()

--------------------------------------------------------------------------------
FiveWin Functions - classified by cathegory
--------------------------------------------------------------------------------
Clipboard
OpenClipboard() Open the Windows clipboard before use .
CloseClipboard() Closes the clipboard .
SetClpData() Places data at the clipboard .
GetClpData() Retrieves the handle of the current clipboard data .
EmptyClipboard() Empties the clipboard .

Color
ChooseColor() Color selection standard DialogBox .
nColorToN() Convert color string to DOS color number .
nRGB() Generates a RGB value .
nGetForeRGB() Returns the RGB Fore value of a color string .

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


nGetBackRGB() Returns the RGB Back value of a color string .
GetPixel() Returns the RGB color of a pixel .
SetTextColor() Set the specified text color .
SetBkColor() Set the specified background color .
SetBkMode() Set the specified background mode .
GetTextColor() Returns the current text color .
GetBkColor() Returns the current background color .
GetSysColor() Retrieves the system color element specified .

Communications
OpenComm() Open the communication port before use .
CloseComm() Closes the communication device and frees memory .
ReadComm() Read the contents of the communication port .
FlushComm() Flushes all characters from transmision or receiving .
GetCommError() Retrieves the most recent comm error value .
BuildCommDCB() Translates a device string into a control block .
WriteComm() Writes to the communication port .
EnableCommNotification() Enables the automatic notification of msgs .

Date / Time
SetDate() Changes the date of the system .
SetTime() Changes the time of the system .

Debugging facilities
LogFile() Saves information to a log file .
OutputDebugString() Displays a debugging msg at Microsoft dbwin.exe .
WinInspect() Sets a codeblock to eval on each Windows API msg .

DialogBoxes
CreateDlg() Creates a modeless DialogBox from resources .
CreateDlgIndirect() Creates a modeless DialogBox from memory resources .
DialogBox() Creates a modal dialog box from resources .
DialogBoxIndirect() Creates a modal dialog box from memory resources .
EndDialog() Closes a modal DialogBox and frees resources .
GetDialogBaseUnits() Returns the DialogBox base units used to create it .
GetDlgItem() Retrieves the handle of a control .
MapDialogRect() Converts dialogbox units into screen units (pixels) .
nDlgBox() Automatic DialogBox testing function. .

Directories maintenance
CurDrive() Returns the current selected drive as a letter A,B,C..
aDrives() Returns an array with all the valid drives ids .
IsCdRom() Checks if a drive is a CdRom .
IsDiskette() Checks if a drive is a floppy disk .
lChDir() Changes from one directory to another .
lIsDir() Checks the existence of a directory .
lMkDir() Creates a new directory .
lRmDir() Removes a directory .
GetWinDir() Retrieves the Windows directory path .
GetSysDir() Retrieves the Windows system directory path .

DLLs
LoadLibrary() Load a Dynamic link library to use it .
FreeLibrary() Free a DLL library in use or decrements its counter use
GetProcAddress() Retrieves the address of the given module function .
CallDll() Calls a function placed into a DLL .

Drawing
Arc() Draws an elliptical arc .
Chord() Draws a chord .
Ellipse() Draws an ellipse .

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


FloodFill() Fills an area of the screen .
LineTo() Draws a line from the current position up to another .
MoveTo() Changes the origin point to start drawing a line .
Pie() Draws a pie-shaped wedge drawing an elliptical arc .
PolyPolygon() Draws several polygons .
Rectangle() Draws a graphic rectangle .
Say3D() Draws a 3D look text .
WndBoxIn() Draws an inset 3D rectangle .
WndBoxRaised() Draws a raised 3D rectangle .
WndRaised() Makes a control look raised .

Executing other apps


WaitRun() Executes another windows application (waits) .
WinExec() Executes another windows application (no waits) .
ExitWindowsExec() Exit windows, exec a Dos app, returns Windows ( " ) .

Files management
cFileDisk() Retrieves the drive from a filename with path .
cFileExt() Retrieves the extension from a filename .
cFileMask() Retrieves the mask from a filename if specified .
cFileName() Retrieves the filename without its path .
cFileNoExt() Retrieves the filename without path and extension .
cFileNoPath() Retrieves the filename without path (as cFileName()) .
cFilePath() Retrieves the path from a filename with path .
cFileSubDir() Retrieves the subdir name from a filename .
cNewFileName() Retrieves a new filename using a rootname .
cTempFile() Retrieves a temporary new filename .
FSize() Retrieves the size of a filename without opening it .
LzCopyFile() Copies and expands a Windows compressed file .
GetFTime() Retrieves the time and date of a file .
SetFTime() Set a different time and date for a file .
SetHandleCount() Increases the max number of files to open .

Help Files Management


GetHelpFile() Retrieves the default help file selected .
GetHelpTopic() Retrieves the default help Topic .
HelpIndex() Shows the default help file index .
HelpPopup() Shows the context popup help .
HelpSearch() Search DialogBox in the default Help file .
HelpSetPos() Changes the position of the WinHelp Window .
HelpSetTopic() Selects a help defaut topic .
HelpTopic() Reviews a Topic .
SetHelpFile() Selects the default Help File .
WinHelp() Activates Windows WinHelp program .

Icons
nIcons() Returns the number of icons .
LoadIcon() Load the specified resource icon .
ExtractIcon() Retrieves an icon handle from EXE, DLL or ICO .
DrawIcon() Draws an Icon .

INI Files
GetProfInt() Retrieves the value of a integer Win.ini file entry .
GetProfStr() Retrieves the value of a string Win.ini file entry .
GetPvpProfile() Retrieves the value of a integer private INI file entry
GetPvpProfString() Retrieves the value of a string private INI file .
WriteProfS() Writes an entry in WIN.INI public file .
WritePProString() Writes an entry in a private INI file .

Keyboard
GetASyncKeyState() Returns whether a key is up or down .

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


GetKeyState() Retrieves the state of the specified virtual key .
GetKeyToggle() Returns the state of a toggled key .
KeyToggle() Toggles the specified key .

Memory/Variables use
MemMax() Returns the highest dynamic memory consumed .
MemUsed() Returns the actual dynamic memory consumed .
nStatics() Returns the total number of statics variables .
Static() Returns any static variable of the application .
GetLocal() Retrieves any local variable from the stack .
GetParam() Retrieves any parameter value from the stack .
nFreeStack() Returns the remaining Clipper stack available .

Mouse
SetCapture() Captures all the mouse activity for a window .
ReleaseCapture() Let the other applications use the mouse .
GetCapture() Retrieves the window handle that has the mouse captured

NTX/MDX files management


DelDbfMdx() Resets the MDX file existence at a DBFMDX Dbf file .
cNtxKey() Return the key description of a NTX index file .
NtxPos() Returns the relative position of a recno .

Numeric manipulation
B2Bin() Converts a byte into a string 1 byte len .
C2Hex() Converts a byte into a hex string (2 chars) .
D2Bin() Converts a float into a string 8 bytes len .
I2Hex() Converts a word (2 bytes) into a hex string (4 chars).
L2Hex() Converts a long (4 bytes) into a hex string (8 chars).
lAnd() Retrieves the logical AND of some numeric values .
nAnd() Generates a numeric AND value from some numbers .
nOr() Generates a numeric OR value from some numbers .
nHiByte() Returns the High Byte of a word (two bytes) .
nLoByte() Returns the Low byte of a word (two bytes) .
nHiWord() Returns the HiWord of a long (four bytes) .
nLoWord() Returns the Low word of a long (four bytes) .
nMakeLong() Generates a long (4bytes) from two words (2bytes) .
MakeIntResource() Converts an integer resource ID in a Windows format .
nStrHash() Returns a hasing algorithm on a string .
nRandom() Generates a random number .

OemAnsi
AnsiToOem() Windows string to OEM conversion .
IsAnsi() Is it an ansi string .
IsOem() Is it an oem string .
OemToAnsi() OEM string to Windows string .

OOPS
aOData() Returns an array with all an Object Class DATA names .
OClone() Retrieves a duplicated Clipper object .
OSend() Generic messages Object sending function .
ASend() Generic messages array of Objects sending function .
lSaveObject() Saves an object to disk .
uLoadObject() Restores an object from disk .
lSaveVar() Saves an array to disk .
uLoadVar() Restores an array from disk .

Security/Copy Protection
nStrCRC() Returns the checksum of a text .
nFileCRC() Returns the checksum of a file .
Encrypt() Encrypts a text with an optional key .

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


Decrypt() Decrypts a text with an optional key .
nSerialHD() Returns the hardDisk serial number .

Sound
MessageBeep() Plays a system alert level waveform sound or a tone .
MsgBeep() MessageBeep beep tone .
SndPlaySound() Plays a WAV sound file .
SndPlayRes() Plays a WAV sound file from resources .

Strings
cValToChar() Converts any value into a string .
OemToAnsi() Translates a OEM MsDos string into a Windows string .
AnsiToOem() Translates a Window string into the OEM MsDos .
xPadL() Left fills a string up to a certain pixel dimension .
xPadC() Center fills a string up to a certain pixel " .
xPadR() Right fills a string up to a certain pixel dimension .
B2Bin() Converts a byte into a string 1 byte len .
StrCapFirst() Uppercase first char and lowercase the rest .
StrChar() Extract a single char from a string .
StrToken() Extract a token from inside a string .

System
InportByte() Reads a byte from a hardware port .
InportWord() Reads a word from a hardware port .
nPeekByte() Reads a memory byte .
nPeekWord() Reads a memory word .
nPokeByte() Writes a memory byte .
nPokeWord() Writes a memory word .
OutportByte() Sends a byte to a hardware port .
OutportWord() Sends a word to a hardware port .
SysRefresh() Let Windows system process pending messsages .
GetTasks() Returns an array with all active tasks names .
IsWinNT() Checks for Windows NT .

Timers
SetTimer() Installs a system timer .
KillTimer() Removes the specified timer .

User Quick DialogBoxes


MsgAbout() MessageBox about style .
MsgAlert() MessageBox alert style .
MsgBeep() MessageBeep beep tone .
MsgGet() General one-line input message .
MsgInfo() MessageBox information style .
MsgLogo() Displays an initial floating bitmap .
MsgMeter() General meter progress dialog .
MsgStop() MessageBox stop style .
MsgRetryCancel() MessageBox RetryCancel style .
MsgRun() Shows a DialogBox with a msg and executes an action .
MsgToolBar() General Tool-bar style Dialog .
MsgWait() Shows a DialogBox with a msg and waits some time .
MsgNoYes() MessageBox YesNo style with default No .
MsgYesNo() MessageBox YesNo style .

ZIP files management (only UnZip capabilities)


IsZip() Checks a valid ZIP file .
GetFirstInZip() Retrieves info for the first file in the ZIP file .
GetNextInZip() Retrieves info for the next file in the ZIP file .
CloseZipFile() Closes the ZIP file .
UnZipFile() UnZips a file from the ZIP file .

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
FiveWin Header Files
--------------------------------------------------------------------------------
Colors.ch Color constants definitions
Constant.ch Text to Graphics constants definitions
DDE.ch Commands for Dynamic Data Exchange
Dialog.ch Dialog Boxes
DLL.ch Dynamic Linking Libraries calling at RunTime
FiveWin.ch FiveWin main header file
Folder.ch Folders and Tabs management
Font.ch Fonts management
Ini.ch INI Files
Mail.ch Windows MAPI email support
Menu.ch Managing Menus
Objects.ch Object Oriented Engine of FiveWin
ODBC.ch Open DataBase connectivity support
Print.ch Using the Printer
Report.ch Report engine
SQL.ch ODBC header
TcBrowse.ch Column based new Browse
Tree.ch Trees support
Video.ch Video media AVI Support
VKey.ch Windows keys values
WinApi.ch Windows API definitions
ClipApi.h Clipper internal management declarations
WinTen.h To avoid conflicts with Windows API Pascal names

--------------------------------------------------------------------------------
Colors.ch Color constants definitions
--------------------------------------------------------------------------------
// FiveWin Graphical Enviroments RGB colors management

#ifndef _COLORS_CH
#define _COLORS_CH

#translate RGB( <nRed>, <nGreen>, <nBlue> ) => ;


( <nRed> + ( <nGreen> * 256 ) + ( <nBlue> * 65536 ) )

//----------------------------------------------------------------------------//
// Low Intensity colors
//----------------------------------------------------------------------------//

#define CLR_BLACK 0 // RGB( 0, 0, 0 )


#define CLR_BLUE 8388608 // RGB( 0, 0, 128 )
#define CLR_GREEN 32768 // RGB( 0, 128, 0 )
#define CLR_CYAN 8421376 // RGB( 0, 128, 128 )
#define CLR_RED 128 // RGB( 128, 0, 0 )
#define CLR_MAGENTA 8388736 // RGB( 128, 0, 128 )
#define CLR_BROWN 32896 // RGB( 128, 128, 0 )
#define CLR_HGRAY 12632256 // RGB( 192, 192, 192 )
#define CLR_LIGHTGRAY CLR_HGRAY

//----------------------------------------------------------------------------//
// High Intensity Colors
//----------------------------------------------------------------------------//

#define CLR_GRAY 8421504 // RGB( 128, 128, 128 )


#define CLR_HBLUE 16711680 // RGB( 0, 0, 255 )
#define CLR_HGREEN 65280 // RGB( 0, 255, 0 )
#define CLR_HCYAN 16776960 // RGB( 0, 255, 255 )

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define CLR_HRED 255 // RGB( 255, 0, 0 )
#define CLR_HMAGENTA 16711935 // RGB( 255, 0, 255 )
#define CLR_YELLOW 65535 // RGB( 255, 255, 0 )
#define CLR_WHITE 16777215 // RGB( 255, 255, 255 )

#endif
--------------------------------------------------------------------------------
Constant.ch Text to Graphics constants definitions
--------------------------------------------------------------------------------
#ifndef _CONSTANT_CH
#define _CONSTANT_CH

//----------------------------------------------------------------------------//
// FiveWin MsDos-Text coordinates simulation values
//----------------------------------------------------------------------------//

// Group
#define GRP_CHARPIX_H 14 // height of a char in pixels
#define GRP_CHARPIX_W 7 // width of a char in pixels
// Bitmaps
#define BMP_CHARPIX_H 14
#define BMP_CHARPIX_W 8
// ComboBox
#define CMB_CHARPIX_H 14
#define CMB_CHARPIX_W 8
// Dialog
#define DLG_CHARPIX_H 15.1
#define DLG_CHARPIX_W 7.9
// Get
#define GET_CHARPIX_H 13
#define GET_CHARPIX_W 8
// Icon
#define ICO_CHARPIX_H 14
#define ICO_CHARPIX_W 8
// ListBox
#define LST_CHARPIX_H 14
#define LST_CHARPIX_W 8
// MdiChild
#define MDIC_CHARPIX_H 16
#define MDIC_CHARPIX_W 8
// MdiFrame
#define MDIF_CHARPIX_H 16
#define MDIF_CHARPIX_W 8
// Meter
#define MTR_CHARPIX_H 14
#define MTR_CHARPIX_W 8
// MGet
#define MGET_CHARPIX_H 13
#define MGET_CHARPIX_W 8
// Radio
#define RAD_CHARPIX_H 13
#define RAD_CHARPIX_W 7
// Say
#define SAY_CHARPIX_H 13
#define SAY_CHARPIX_W 8
// Scrollbar
#define SCRL_CHARPIX_H 14
#define SCRL_CHARPIX_W 8
// Video
#define VID_CHARPIX_H 14
#define VID_CHARPIX_W 8

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


// WBrowse
#define BRSE_CHARPIX_H 14
#define BRSE_CHARPIX_W 8
// Window
#define WIN_CHARPIX_H 16
#define WIN_CHARPIX_W 8

#endif

--------------------------------------------------------------------------------
DDE.ch Commands for Dynamic Data Exchange
--------------------------------------------------------------------------------
#ifndef _DDE_CH
#define _DDE_CH

#define WM_DDE_FIRST 992 // 0x03E0


#define WM_DDE_INITIATE (WM_DDE_FIRST)
#define WM_DDE_TERMINATE (WM_DDE_FIRST+1)
#define WM_DDE_ADVISE (WM_DDE_FIRST+2)
#define WM_DDE_UNADVISE (WM_DDE_FIRST+3)
#define WM_DDE_ACK (WM_DDE_FIRST+4)
#define WM_DDE_DATA (WM_DDE_FIRST+5)
#define WM_DDE_REQUEST (WM_DDE_FIRST+6)
#define WM_DDE_POKE (WM_DDE_FIRST+7)
#define WM_DDE_EXECUTE (WM_DDE_FIRST+8)
#define WM_DDE_LAST (WM_DDE_FIRST+8)

//----------------------------------------------------------------------------//

#xcommand DEFINE <dde:DDE,LINK> <oDde> ;


[ SERVICE <cService> ] ;
[ TOPIC <cTopic> ] ;
[ ITEM <cItem> ] ;
[ ACTION <uAction> ] ;
[ VALID <uEnd> ] ;
=> ;
<oDde> := TDde():New( <cService>, <cTopic>, <cItem>, [<{uAction}>],;
[<{uEnd}>] )

#xcommand ACTIVATE <dde:DDE,LINK> <oDde> => <oDde>:Activate()

//----------------------------------------------------------------------------//

#endif
--------------------------------------------------------------------------------
Dialog.ch Dialog Boxes
--------------------------------------------------------------------------------
#ifndef _DIALOG_CH
#define _DIALOG_CH

//----------------------------------------------------------------------------//
// Microsoft 3D Look

#xcommand SET <look_3d: 3DLOOK, LOOK3D, LOOK 3D, 3D LOOK> <on:ON,OFF,&> => ;
Set3DLook( Upper(<(on)>) == "ON" )

//----------------------------------------------------------------------------//
// Resources

#xcommand SET RESOURCES TO <cName1> [,<cName2>] ;


=> ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ SetResources( <cName2> ); ] SetResources( <cName1> )

#xcommand SET RESOURCES TO => FreeResources()

//----------------------------------------------------------------------------//

#xcommand SET HELPFILE TO <cFile> => SetHelpFile( <cFile> )


#xcommand SET HELP TOPIC TO <cTopic> => HelpSetTopic( <cTopic> )

//----------------------------------------------------------------------------//
// Loading strings/or other Types from Resources

#xcommand REDEFINE <uVar> ;


[ AS <type: CHARACTER, NUMERIC, LOGICAL, DATE> ] ;
[ <resource: RESOURCE, RESNAME, NAME> <nIdRes> ] ;
=> ;
<uVar> := LoadValue( <nIdRes>, [Upper(<(type)>)], <uVar> )

//----------------------------------------------------------------------------//

#xcommand DEFINE DIALOG <oDlg> ;


[ <resource: NAME, RESNAME, RESOURCE> <cResName> ] ;
[ TITLE <cTitle> ] ;
[ FROM <nTop>, <nLeft> TO <nBottom>, <nRight> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ <lib: LIBRARY, DLL> <hResources> ] ;
[ <vbx: VBX> ] ;
[ STYLE <nStyle> ] ;
[ <color: COLOR, COLORS> <nClrText> [,<nClrBack> ] ] ;
[ BRUSH <oBrush> ] ;
[ <of: WINDOW, DIALOG, OF> <oWnd> ] ;
[ <pixel: PIXEL> ] ;
[ ICON <oIco> ] ;
[ FONT <oFont> ] ;
[ <help: HELP, HELPID> <nHelpId> ] ;
=> ;
<oDlg> = TDialog():New( <nTop>, <nLeft>, <nBottom>, <nRight>,;
<cTitle>, <cResName>, <hResources>, <.vbx.>, <nStyle>,;
<nClrText>, <nClrBack>, <oBrush>, <oWnd>, <.pixel.>,;
<oIco>, <oFont>, <nHelpId>, <nWidth>, <nHeight> )

#xcommand ACTIVATE DIALOG <oDlg> ;


[ <center: CENTER, CENTERED> ] ;
[ <NonModal: NOWAIT, NOMODAL> ] ;
[ WHEN <uWhen> ] ;
[ VALID <uValid> ] ;
[ ON [ LEFT ] CLICK <uClick> ] ;
[ ON INIT <uInit> ] ;
[ ON MOVE <uMoved> ] ;
[ ON PAINT <uPaint> ] ;
[ ON RIGHT CLICK <uRClicked> ] ;
=> ;
<oDlg>:Activate( <oDlg>:bLClicked [ := {|nRow,nCol,nFlags|<uClick>}],
;
<oDlg>:bMoved [ := <{uMoved}> ], ;
<oDlg>:bPainted [ := {|hDC,cPS|<uPaint>}],;
<.center.>, [{|Self|<uValid>}],;
[ ! <.NonModal.> ], [{|Self|<uInit>}],;
<oDlg>:bRClicked [ :=
{|nRow,nCol,nFlags|<uRClicked>}],;
[{|Self|<uWhen>}] )

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


//----------------------------------------------------------------------------//

#endif
--------------------------------------------------------------------------------
DLL.ch Dynamic Linking Libraries calling at RunTime
--------------------------------------------------------------------------------
// Copyright FiveTech 1993-7

#ifndef _DLL_CH
#define _DLL_CH

#ifndef _C_TYPES
#define _C_TYPES
#define VOID 0
#define BYTE 1
#define CHAR 2
#define WORD 3
#define _INT 4 // conflicts with Clipper Int()
#define BOOL 5
#define HDC 6
#define LONG 7
#define STRING 8
#define LPSTR 9
#define PTR 10
#define _DOUBLE 11 // conflicts with BORDER DOUBLE
#define DWORD 12
#endif

#translate NOREF([@]<x>) => <x>

//----------------------------------------------------------------------------//

#xcommand DLL [<static:STATIC>] FUNCTION <FuncName>( [ <uParam1> AS <type1> ] ;


[, <uParamN> AS <typeN> ] )
;
AS <return> [<pascal:PASCAL>] LIB <*DllName*> ;
=> ;
[<static>] function <FuncName>( [NOREF(<uParam1>)] [,NOREF(<uParamN>)]
) ;;
local hDLL := If( ValType( <DllName> ) == "N", <DllName>,
LoadLibrary( <(DllName)> ) ) ;;
local uResult ;;
local cFarProc ;;
if hDLL > 32 ;;
cFarProc = GetProcAddress( hDLL, <(FuncName)>, [<.pascal.>],
<return> [,<type1>] [,<typeN>] ) ;;
uResult = CallDLL( cFarProc [,<uParam1>] [,<uParamN>] ) ;;
If( ValType( <DllName> ) == "N",, FreeLibrary( hDLL ) ) ;;
else ;;
MsgAlert( "Error code: " + LTrim( Str( hDLL ) ) + " loading " +
<DllName> ) ;;
end ;;
return uResult

//----------------------------------------------------------------------------//

#xcommand DLL32 [<static:STATIC>] FUNCTION <FuncName>( [ <uParam1> AS <type1> ]


;
[, <uParamN> AS <typeN> ]
) ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


AS <return> [<pascal:PASCAL>] [ FROM <SymName> ] LIB <*DllName*> ;
=> ;
[<static>] function <FuncName>( [NOREF(<uParam1>)] [,NOREF(<uParamN>)]
) ;;
local hDLL := If( ValType( <DllName> ) == "N", <DllName>,
LoadLib32( <(DllName)> ) ) ;;
local uResult ;;
local cFarProc ;;
if hDLL >= 0 .and. hDLL <= 32 ;;
MsgAlert( "Error code: " + LTrim( Str( hDLL ) ) + " loading " +
<DllName> ) ;;
else ;;
cFarProc = GetProc32( hDLL,;
If( [ Empty( <SymName> ) == ] .t., <(FuncName)>, <SymName> ),;
[<.pascal.>], <return> [,<type1>] [,<typeN>] ) ;;
uResult = CallDLL32( cFarProc [,<uParam1>] [,<uParamN>] ) ;;
If( ValType( <DllName> ) == "N",, FreeLib32( hDLL ) ) ;;
end ;;
return uResult

#endif

//----------------------------------------------------------------------------//
--------------------------------------------------------------------------------
FiveWin.ch FiveWin main header file
--------------------------------------------------------------------------------
FiveWin main Header File */
Running multiple instances of a FiveWin EXE */
ACCESSING / SETTING Variables */
Default parameters management */
DO ... UNTIL support */
Idle periods management */
DataBase Objects */
General release command */
Brushes */
Pens */
ButtonBar Commands */
Icons */
PUSHBUTTON */
CHECKBOX */
COMBOBOX */
LISTBOX */
LISTBOX - BROWSE */
RADIOBUTTONS */
BITMAP */
SAY */
GET */
SCROLLBAR */
BOX - GROUPS */
Meter */
MetaFile Controls */
Cursor Commands */
Window Commands */
MESSAGE BAR */
CLIPBOARD */
Timer */
Visual Basic VBX Controls Support */
Different used commands */
Commands & functions not supported */

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


--------------------------------------------------------------------------------
Folder.ch Folders and Tabs management
--------------------------------------------------------------------------------
#ifndef _FOLDER_CH
#define _FOLDER_CH

//----------------------------------------------------------------------------//

#xcommand @ <nRow>, <nCol> FOLDER [<oFolder>] ;


[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
[ <prm: PROMPT, PROMPTS, ITEMS> <cPrompt,...> ] ;
[ <dlg: DIALOG, DIALOGS, PAGE, PAGES> <cDlgName1> [,<cDlgNameN>] ]
;
[ <lPixel: PIXEL> ] ;
[ <lDesign: DESIGN> ] ;
[ <color: COLOR, COLORS> <nClrFore> [,<nClrBack>] ] ;
[ OPTION <nOption> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ MESSAGE <cMsg> ] ;
[ <lAdjust: ADJUST> ] ;
=> ;
[<oFolder> := ] TFolder():New( <nRow>, <nCol>,;
[\{<cPrompt>\}], \{<cDlgName1> [,<cDlgNameN>]\},;
<oWnd>, <nOption>, <nClrFore>, <nClrBack>, <.lPixel.>,;
<.lDesign.>, <nWidth>, <nHeight>, <cMsg>, <.lAdjust.> )

#xcommand REDEFINE FOLDER [<oFolder>] ;


[ ID <nId> ] ;
[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
[ <prm: PROMPT, PROMPTS, ITEMS> <cPrompt,...> ] ;
[ <dlg: DIALOG, DIALOGS, PAGE, PAGES> <cDlgName1> [,<cDlgNameN>] ]
;
[ <color: COLOR, COLORS> <nClrFore> [,<nClrBack>] ] ;
[ OPTION <nOption> ] ;
[ ON CHANGE <uChange> ] ;
[ <lAdjust: ADJUST> ] ;
=> ;
[<oFolder> := ] TFolder():ReDefine( <nId>, [\{<cPrompt>\}],;
\{ <cDlgName1> [,<cDlgNameN>] \}, <oWnd>,;
<nOption>, <nClrFore>, <nClrBack>,;
[{|nOption,nOldOption| <uChange>}], <.lAdjust.> )

//----------------------------------------------------------------------------//

#xcommand @ <nRow>, <nCol> TABS [<oTabs>] ;


[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
[ <prm: PROMPT, PROMPTS, ITEMS> <cPrompt,...> ] ;
[ <act: ACTION, EXECUTE, ON CHANGE> <uAction> ] ;
[ <lPixel: PIXEL> ] ;
[ <lDesign: DESIGN> ] ;
[ <color: COLOR, COLORS> <nClrFore> [,<nClrBack>] ] ;
[ OPTION <nOption> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ MESSAGE <cMsg> ] ;
=> ;
[<oTabs> := ] TTabs():New( <nRow>, <nCol>,;
[\{<cPrompt>\}], [{|nOption|<uAction>}],;
<oWnd>, <nOption>, <nClrFore>, <nClrBack>, <.lPixel.>,;
<.lDesign.>, <nWidth>, <nHeight>, <cMsg> )

#xcommand REDEFINE TABS [<oTabs>] ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ ID <nId> ] ;
[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
[ <prm: PROMPT, PROMPTS, ITEMS> <cPrompt,...> ] ;
[ <act: ACTION, EXECUTE> <uAction> ] ;
[ <color: COLOR, COLORS> <nClrFore> [,<nClrBack>] ] ;
[ OPTION <nOption> ] ;
=> ;
[<oTabs> := ] TTabs():ReDefine( <nId>, [\{<cPrompt>\}],;
[{|nOption|<uAction>}], <oWnd>, <nOption>, <nClrFore>, <nClrBack> )

//----------------------------------------------------------------------------//
// FiveWin Dialog TPages Class

#xcommand REDEFINE PAGES <oPag> ;


[ ID <nId> ] ;
[ OF <oWnd> ] ;
[ DIALOGS <DlgName,...> ] ;
[ OPTION <nOption> ] ;
=> ;
<oPag> := TPages():Redefine( <nId>, <oWnd>, [{<DlgName>}], <nOption> )

#endif

--------------------------------------------------------------------------------
Font.ch Fonts management
--------------------------------------------------------------------------------
#ifndef _FONT_CH
#define _FONT_CH

#define LF_HEIGHT 1
#define LF_WIDTH 2
#define LF_ESCAPEMENT 3
#define LF_ORIENTATION 4
#define LF_WEIGHT 5
#define LF_ITALIC 6
#define LF_UNDERLINE 7
#define LF_STRIKEOUT 8
#define LF_CHARSET 9
#define LF_OUTPRECISION 10
#define LF_CLIPPRECISION 11
#define LF_QUALITY 12
#define LF_PITCHANDFAMILY 13
#define LF_FACENAME 14

//----------------------------------------------------------------------------//

#xcommand DEFINE FONT <oFont> ;


[ NAME <cName> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ <from:FROM USER> ] ;
[ <bold: BOLD> ] ;
[ <italic: ITALIC> ] ;
[ <underline: UNDERLINE> ] ;
[ WEIGHT <nWeight> ] ;
[ OF <oDevice> ] ;
[ NESCAPEMENT <nEscapement> ] ;
=> ;
<oFont> := TFont():New( <cName>, <nWidth>, <nHeight>, <.from.>,;
[<.bold.>],<nEscapement>,,<nWeight>, [<.italic.>],;
[<.underline.>],,,,,, [<oDevice>] )

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#xcommand ACTIVATE FONT <oFont> => <oFont>:Activate()

#xcommand DEACTIVATE FONT <oFont> => <oFont>:DeActivate()

#xcommand SET FONT ;


[ OF <oWnd> ] ;
[ TO <oFont> ] ;
=> ;
<oWnd>:SetFont( <oFont> )

//----------------------------------------------------------------------------//

#endif

--------------------------------------------------------------------------------
Ini.ch INI Files
--------------------------------------------------------------------------------
#ifndef _INI_CH
#define _INI_CH

#xcommand INI <oIni> ;


[ <file: FILE, FILENAME, DISK> <cIniFile> ] ;
=> ;
<oIni> := TIni():New( <cIniFile> )

#xcommand GET <uVar> ;


[ SECTION <cSection> ] ;
[ ENTRY <cEntry> ] ;
[ DEFAULT <uDefault> ] ;
[ <of: OF, INI> <oIni> ] ;
=> ;
<uVar> := <oIni>:Get( <cSection>, <cEntry>, <uDefault>, <uVar> )

#xcommand SET [ SECTION <cSection> ] ;


[ ENTRY <cEntry> ] ;
[ TO <uVal> ] ;
[ <of: OF, INI> <oIni> ] ;
=> ;
<oIni>:Set( <cSection>, <cEntry>, <uVal> )

#xcommand ENDINI =>

#endif

--------------------------------------------------------------------------------
Mail.ch Windows MAPI email support
--------------------------------------------------------------------------------
// FiveWin - Windows MAPI - mail services - xBase Commands

#ifndef _MAIL_CH
#define _MAIL_CH

//----------------------------------------------------------------------------//

#xcommand DEFINE MAIL [<oMail>] ;


[ SUBJECT <cSubject> ] ;
[ TEXT <cText> ] ;
[ TYPE <cType> ] ;
[ DATE <dDate> ] ;
[ TIME <cTime> ] ;
[ CONVERSATION <cConversation> ] ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ <rec: RECEIPT> ] ;
[ <user: FROM USER> ] ;
[ FILES <cFileName1> ,<cDescript1> ;
[,<cFileNameN> ,<cDescriptN> ] ] ;
[ ORIGIN <cOrigin> [,<cOriginAddress>] ] ;
[ TO <cTarget1> [,<cTargetAddress1>] ;
[,<cTargetN> [,<cTargetAddressN>] ] ] ;
=> ;
[ <oMail> := ] TMail():New( <cSubject>, <cText>, <cType>,;
<dDate>, <cTime>, <cConversation>, <.rec.>, <.user.>,;
[ \{<cOrigin>, <cOriginAddress>\} ],;
\{ [ \{<cTarget1>,<cTargetAddress1>\} ] ;
[,\{<cTargetN>,<cTargetAddressN>\} ] \},;
\{ [ \{<cFileName1>,<cDescript1>\} ] \ } )

#xcommand ACTIVATE MAIL <oMail> => <oMail>:Activate()

#xcommand SEND MAIL <oMail> => <oMail>:Activate()

//----------------------------------------------------------------------------//

#endif

--------------------------------------------------------------------------------
Menu.ch Managing Menus
--------------------------------------------------------------------------------
#ifndef _MENU_CH
#define _MENU_CH

//----------------------------------------------------------------------------//
// Creating PullDown Menus from source code

#xcommand MENU [ <oMenu> ] ;


[ <popup: POPUP> ] ;
=> ;
[ <oMenu> := ] MenuBegin( <.popup.> )

#xcommand MENUITEM [ <oMenuItem> PROMPT ] [<cPrompt>] ;


[ MESSAGE <cMsg> ] ;
[ <checked: CHECK, CHECKED, MARK> ] ;
[ <enable: ENABLED, DISABLED> ] ;
[ <file: FILE, FILENAME, DISK> <cBmpFile> ] ;
[ <resource: RESOURCE, RESNAME, NAME> <cResName> ] ;
[ ACTION <uAction,...> ] ;
[ BLOCK <bAction> ] ;
[ <of: OF, MENU, SYSMENU> <oMenu> ] ;
[ ACCELERATOR <nState>, <nVirtKey> ] ;
[ <help: HELP> ] ;
[ <HelpId: HELP ID, HELPID> <nHelpId> ] ;
[ WHEN <uWhen> ] ;
[ <break: BREAK> ] ;
=> ;
[ <oMenuItem> := ] MenuAddItem( <cPrompt>, <cMsg>,;
<.checked.>, [ Upper(<(enable)>) == "ENABLED" ],;
[\{|oMenuItem|<uAction>\}],;
<cBmpFile>, <cResName>, <oMenu>, <bAction>, <nState>, <nVirtKey>,;
<.help.>, <nHelpId>, [<{uWhen}>], <.break.> )

// New MRU technology in FiveWin. See SAMPLES\TestMru.prg !!!

#xcommand MRU <oMru> ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ <Ini: INI, ININAME, FILENAME, NAME, DISK> <cIniFile> ] ;
[ SECTION <cSection> ] ;
[ <size: SIZE, ITEMS> <nItems> ] ;
[ MESSAGE <cMsg> ] ;
[ ACTION <uAction> ] ;
=> ;
<oMru> := TMru():New( <cIniFile>, <cSection>, <nItems>, <cMsg>,;
[{|cMruItem,oMenuItem|<uAction>}] )

#xcommand SEPARATOR [<oMenuItem>] => [<oMenuItem>:=] MenuAddItem()

#xcommand ENDMENU => MenuEnd()

//----------------------------------------------------------------------------//
// Creating PullDown Menus from resources

#xcommand DEFINE MENU <oMenu> ;


[ <res: RESOURCE, NAME, RESNAME> <cResName> ] ;
[ <popup: POPUP> ] ;
=> ;
<oMenu> := TMenu():ReDefine( <cResName>, <.popup.> )

#xcommand REDEFINE MENUITEM [ <oMenuItem> PROMPT ] [<cPrompt>] ;


[ ID <nId> <of: OF, MENU> <oMenu> ] ;
[ ACTION <uAction> ] ;
[ BLOCK <bAction> ] ;
[ MESSAGE <cMsg> ] ;
[ <checked: CHECK, CHECKED, MARK> ] ;
[ <enable: ENABLED, DISABLED> ] ;
[ <file: FILE, FILENAME, DISK> <cBmpFile> ] ;
[ <resource: RESOURCE, RESNAME, NAME> <cResName> ] ;
[ ACCELERATOR <nState>, <nVirtKey> ] ;
[ <HelpId: HELP ID, HELPID> <nHelpId> ] ;
[ WHEN <uWhen> ] ;
=> ;
[ <oMenuItem> := ] TMenuItem():ReDefine( <cPrompt>, <cMsg>,;
<.checked.>, [ Upper(<(enable)>) == "ENABLED" ], <{uAction}>,;
<cBmpFile>, <cResName>, <oMenu>, <bAction>, <nId>,;
<nState>, <nVirtKey>, <nHelpId>, [<{uWhen}>] )

//----------------------------------------------------------------------------//

#xcommand DEFINE MENU <oMenu> OF <oWnd> ;


=> ;
<oMenu> := TMenu():New( .f., <oWnd> )

#xcommand SET MENU OF <oWnd> TO <oMenu> => <oWnd>:SetMenu( <oMenu> )

//----------------------------------------------------------------------------//
// PopUps Management

#xcommand ACTIVATE <menu:POPUP,MENU> <oMenu> ;


[ AT <nRow>, <nCol> ] ;
[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
=> ;
<oMenu>:Activate( <nRow>, <nCol>, <oWnd> )

//----------------------------------------------------------------------------//
// Using Window System Menu

#xcommand REDEFINE SYSMENU [<oMenu>] ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
=> ;
[<oMenu> :=] MenuBegin( .f., .t., <oWnd> )

#xcommand ENDSYSMENU => MenuEnd()

//----------------------------------------------------------------------------//

#endif

--------------------------------------------------------------------------------
Objects.ch Object Oriented Engine of FiveWin
--------------------------------------------------------------------------------
/*
+---------------------------------------------------------------+
| Objects.ch |
| |
| Clipper 5.x header file for Objects.lib V 4.0 |
| Fecha: Junio 1995 |
| |
| (c) 1993-4-5 Francisco Pulp.n y Antonio Linares |
+---------------------------------------------------------------+

. Dios libre al Sr. Usuario de cambiar una sola linea de


este fichero sin haber hecho antes una copia de seguridad !

. Please, don't touch even a single line of the following <g> !


*/

#ifndef _OBJECTS_CH
#define _OBJECTS_CH

#define _FuncType_

#xcommand DEFAULT <Desc> [, <DescN> ] => ;


__DFT__( <Desc> ) [ ; __DFT__( <DescN> ) ]

#xtranslate __DFT__( <Var> := <Dft> ) => ;


if( <Var> == nil, <Var> := <Dft>, )

#xtranslate __DFT__( <Var> = <Dft> ) => ;


__DFT__( <Var> := <Dft> )

// Una preciosa idea de Carlos Ruiz


#xtranslate BYNAME <V> [, <VN> ] => ::<V> := <V> [; ::<VN> := <VN> ]
#xtranslate BYNAME <V> DEFAULT <Val> => ::<V> := BYDEFAULT <V>, <Val>
#xtranslate BYNAME <V> IFNONIL => ;
if <V> != NIL ;;
::<V> := <V> ;;
end
#xtranslate BYDEFAULT <V>, <Val> => if( <V> == NIL, <Val>, <V> )

// Class Declaration - Declaracion de clase


// =======================

// El "Ambito" (Scope) por defecto inicial es PUBLIC. Lo pone _ObjNewCls().

#xcommand CLASS <ClsNam> ;


[ <from: INHERIT FROM, INHERIT, FROM, OF> <SupCls> [, <MoreSuper> ]
] ;
=> ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


function _AsFunc_( <ClsNam> ) ;;
static nClassH ;;
if nClassH == nil ;;
nClassH = _ObjNewCls( _AsStr_( <ClsNam> ) [, _AsFunc_( <SupCls>
) ] [, \{|| _AsFunc_( <MoreSuper> ) \} ] ) ;
[ ; #define _sUPcLS_ _AsName_( <SupCls> ) ]

#xtranslate CREATE CLASS <*ClsHead*> => CLASS <ClsHead>

// Declaraciones de Variables de Instancia y de Clase.


// ===================================================

#xcommand _GEN_DATA_ <vt>, <Vrs,...> [ AS <Typ,...> ] ;


[ <scp: PUBLIC, EXPORT, READONLY, PROTECTED, LOCAL, HIDDEN> ] ;
[ <dft: DEFAULT, INIT> <uData> ] ;
[ USER DATA <uUserData> ] ;
=> ;
_ObjAddMet( nClassH, __SCOPE__ [ <scp> ], [ \{ _AsUppLst_( <Typ> ) \} ]
,;
<vt>, [ <uData> ], _AsStrLst_( <Vrs> ) ) ;
[ ; ObjSetUserData( nClassH, <uUserData>, _AsStrLst_( <Vrs> ) ) ]

#xcommand _GEN_DATA_ <vt>, <Vrs,...> [ AS <Typ,...> ] ;


[ <scp: PUBLIC, EXPORT, READONLY, PROTECTED, LOCAL, HIDDEN> ] ;
[ INSTANTIATE <uData,...> ] ;
[ USER DATA <uUserData> ] ;
=> ;
_ObjAddMet( nClassH, __SCOPE__ [ <scp> ], [ \{ _AsUppLst_( <Typ> ) \} ]
,;
<vt>, [ _ObjInsDat( \{|Self| <uData> \} )], _AsStrLst_(
<Vrs> ) ) ;
[ ; ObjSetUserData( nClassH, <uUserData>, _AsStrLst_( <Vrs> ) ) ]

// Declaraciones de Variables de Instancia

#xcommand VAR <*VLst*> => _GEN_DATA_ 1, <VLst>


#xcommand INSTVAR <*VLst*> => VAR <VLst>
#xcommand DATA <*VLst*> => VAR <VLst>

// Declaraciones de Variables de Clase.

#xcommand CLASSVAR <*VLst*> => _GEN_DATA_ 2, <VLst>


#xcommand CLASSDATA <*VLst*> => CLASSVAR <VLst>

// Declaraciones de Metodos.
// =========================

#xcommand __METHOD__ <Met> [, <MetN> ] [ <scp: PUBLIC, EXPORT, LOCAL, HIDDEN> ]


[ <ctor: CONSTRUCTOR> ] => ;
_ObjAddMet( nClassH, __SCOPE__ [ <scp> ], <.ctor.>, 0, ;
_MetTrans_( <Met> ) [, _MetTrans_( <MetN> ) ] )

#xcommand _GEN_METHOD_ <Met> [,<MetN> ] [<*x*>] => ;


__METHOD__ <Met> [,<MetN> ] [<x>]

#xcommand _GEN_METHOD_ <Met> VIRTUAL [<*x*>] => __METHOD__ <Met>:_VIRTUAL_ [<x>]

// Una GENIAL idea de Antonio Linares: La declaraci.n "SetGet"


#xcommand _GEN_METHOD_ <Met> SETGET [<*x*>] => __METHOD__ <Met>:_SETGET_ [<x>]

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#xcommand _GEN_METHOD_ <Met> METHOD <udf> [, <MetN> METHOD <udfN> ] [<*x*>] => ;
__METHOD__ <Met> = <udf> [ , <MetN> = <udfN> ] [<x>]

#xcommand _GEN_METHOD_ <Met> <code: EXTERN, CFUNC, CMETHOD> <udf> [<*x*>] => ;
EXTERNAL _AsName_( <udf> ) ;;
_ObjAddMet( nClassH, __SCOPE__, .f., 0, _AsStr_(<Met>), _AsStr_( <udf>
) )

#xcommand _GEN_METHOD_ <Met> <o: BLOCK, INLINE> <code,...> [ <scp: PUBLIC,


EXPORT, LOCAL, HIDDEN> ] => ;
_ObjAddMet( nClassH, __SCOPE__ [<scp>], .f., 3, _BlkTrans_( <Met> <o>
<code> ) )

#xcommand MESSAGE <*cMDesc*> => _GEN_METHOD_ <cMDesc>

#xcommand DELEGATE MESSAGE <cMsgs,...> TO <cVar> [ <scp: PUBLIC, EXPORT, LOCAL,


HIDDEN> ] => ;
_ObjAddMet( nClassH, __SCOPE__ [<scp>], _AsStr_( <cVar> ), 4, ;
_AsStrLst_( <cMsgs> ) )

// El servidor particular de errores de una clase.

// Funcion Clipper. recibe: ( cMethodName, nError ) y Objeto en SELF


// puede devolver cualquier cosa.
// para que se genere error debe llamar antes de salir a
// _ClsSetErr( oError ) y si no se debe generar error debe hacerlo as.
// _ClsSetErr( )

#xcommand ERROR HANDLER <cFunc> => ;


_ObjAddMet( nClassH, , .f., 5, \{|| _AsName_( <cFunc> )() \} )

// SOLO FUNCIONES PASCAL con 10 caracteres o menos, con el prototipo...


// BOOL pascal UserErrServer( CLSHANDLE Handle, PCLIPSYMBOL pMessage, WORD
wError );
#xcommand ERROR HANDLER <cFunc> <code: EXTERN, CFUNC, CMETHOD> => ;
EXTERNAL _AsName_( <cFunc> ) ;;
_ObjAddMet( nClassH, , .f., 5, _AsStr_( <cFunc> ) )

#xcommand _GEN_METHOD_ <cFunc> ERROR HANDLER [ <x> ] => ;


ERROR HANDLER <cFunc> [ <x> ]

#xcommand _GEN_METHOD_ <cMeth> OPERATOR <cOp> => ;


_ObjAddMet( nClassH, , .f., 6, <(cOp)>, \{|| _AsName_( <cMeth> )() \}
)

#xcommand _GEN_METHOD_ <cMeth> ALIAS OF <cMsg> => ;


_ObjAddMet( nClassH, _AsStr_( <cMeth> ), _AsStr_( <cMsg> ), 7 )

// PreAmbitos
#xcommand __ST__ <st: METHOD, MESSAGE, VAR, INSTVAR, DATA, CLASSVAR, CLASSDATA
> <*x*> ;
=> <st> <x>
#xcommand EXPORT <*x*> => __ST__ <x> PUBLIC
#xcommand HIDE <*x*> => __ST__ <x> HIDDEN
#xcommand PROTECT <*x*> => __ST__ <x> PROTECTED

// Declaraciones de Scoping por defecto.

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


// =======================================
#xcommand EXPORT: => _DftScope( 0 )
#xcommand PUBLIC: => EXPORT:
#xcommand PROTECTED: => _DftScope( 1 )
#xcommand READONLY: => PROTECTED:
#xcommand LOCAL: => _DftScope( 2 )
#xcommand HIDDEN: => LOCAL:

// Traductores de descripciones de m.todos.

#xtranslate _MetTrans_( <Met> ) => ;


_AsStr_( <Met> ), \{|| _AsName_( <Met> )() \}

#xtranslate _MetTrans_( <Met> = <udf> ) => ;


_AsStr_( <Met> ), \{|| _AsName_( <udf> )() \}

#xtranslate _MetTrans_( <Met>:_VIRTUAL_ ) => ;


_AsStr_( <Met> ), "_VIRTUAL_"

#xtranslate _MetTrans_( <Met>:_SETGET_ ) => ;


_AsStr_( <Met> ), \{|| _AsName_( <Met> )() \}, ;
"_" + _AsStr_( <Met> ), \{|| _AsName_( <Met> )() \}

#xtranslate _BlkTrans_( <Met> INLINE <code,...> ) => ;


#<Met>, \{ | Self | <code> \}

#xtranslate _BlkTrans_( <Met>( [<prm,...>] ) INLINE <code,...> ) => ;


#<Met>, \{ | Self [, <prm> ] | <code> \}

#xtranslate _BlkTrans_( <Met> BLOCK <code,...> ) => ;


_AsStr_( <Met> ), <code>

// Traductores Gen.ricos de <Func>[ ( [ <parms,..> ] ) ]

#xtranslate _AsFunc_( <itm> ) => <itm>()


#xtranslate _AsFunc_( <itm>( [<prm,...>] ) ) => <itm>( [<prm>] )

#xtranslate _AsName_( <itm> ) => <itm>


#xtranslate _AsName_( <itm>( [<prm,...>] ) ) => <itm>

#xtranslate _AsStr_( <itm> ) => <(itm)>


#xtranslate _AsStr_( <itm>( [<prm,...>] ) ) => #<itm>
#xtranslate _AsUpp_( <itm> ) => upper( _AsStr_( <itm> ) )

#xtranslate _AsStrLst_( <Typ> [, <TypN> ] ) => ;


_AsStr_( <Typ> ) [, _AsStr_( <TypN> ) ]
#xtranslate _AsUppLst_( <Typ> [, <TypN> ] ) => ;
_AsUpp_( <Typ> ) [, _AsUpp_( <TypN> ) ]

#xtranslate __SCOPE__ => NIL


#xtranslate __SCOPE__ <scp: PUBLIC, EXPORT> => 0
#xtranslate __SCOPE__ <scp: READONLY, PROTECTED> => 1
#xtranslate __SCOPE__ <scp: LOCAL, HIDDEN> => 2

#xtranslate :VIRTUAL => :_VIRTUAL_


#xtranslate :SETGET => :_SETGET_

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#xcommand ENDCLASS => ;
end ;;
return _ObjClsIns( nClassH ) ;;
#include "obendcls.ch"

#xcommand END CLASS => ENDCLASS

// Declaraciones para el c.digo ( funci.n . procedimiento ) de los m.todos.


// ==========================================================================

#xcommand _METHOD_ <Tp: FUNCTION, PROCEDURE> <Met> [ CLASS <ClassN> ] =>;


_FuncType_ <Tp> <Met> ;;
local Self := QSelf()

#translate METHOD <Tp: FUNCTION, PROCEDURE> <*Met*> => ;


_METHOD_ <Tp> <Met>

#translate METHOD <ClassN>::<*Met*> => ;


_METHOD_ FUNCTION <Met>

#translate METHOD <ClassN>.<*Met*> => ;


_METHOD_ FUNCTION <Met>

// Sixtaxis Parent / Super


// =======================

#xtranslate :Parent( <SupCls> ):<*M*> => :<SupCls>:<M>

#xtranslate :Parent:<*M*> => :_sUPcLS_:<M>

#xtranslate Super:<*M*> => Self:_sUPcLS_:<M>

#xtranslate :Super => :Parent

// Self
// ======
#xtranslate :: => Self:

#endif // _OBJECTS_CH

//---------------------------

// Redefine el comando METHOD para la declaraci.nes de m.todos


// en el bloque de clase.
// Fue redefinido por el .ltimo "endclass" para declarar c.digo de m.todos.

#xcommand METHOD <*MDesc*> => _GEN_METHOD_ <MDesc>

--------------------------------------------------------------------------------
ODBC.ch Open DataBase connectivity support
--------------------------------------------------------------------------------
#ifndef _ODBC_CH
#define _ODBC_CH

//----------------------------------------------------------------------------//

#xcommand DEFINE ODBC <oDbc> ;


[ NAME <cName> ] ;
[ USER <cPath> ] ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ PASSWORD <cPassword> ] ;
=> ;
<oDbc> := TOdbc():New( <cName>, <cPath>, <cPassword> )

#xcommand ODBC <oDbc> <sql: SQL, EXECUTE> <cCommand> ;


=> ;
<oDbc>:Execute( <cCommand> )

//----------------------------------------------------------------------------//

#endif

--------------------------------------------------------------------------------
Print.ch Using the Printer
--------------------------------------------------------------------------------
#ifndef _PRINT_CH
#define _PRINT_CH

//----------------------------------------------------------------------------//
// Printer

#xcommand PRINT [ <oPrint> ] ;


[ <name:TITLE,NAME,DOC> <cDocument> ] ;
[ <user: FROM USER> ] ;
[ <prvw: PREVIEW> ] ;
[ TO <xModel> ] ;
=> ;
[ <oPrint> := ] PrintBegin( [<cDocument>], <.user.>, <.prvw.>, <xModel> )

#xcommand PRINTER [ <oPrint> ] ;


[ <name:NAME,DOC> <cDocument> ] ;
[ <user: FROM USER> ] ;
[ <prvw: PREVIEW> ] ;
[ TO <xModel> ] ;
=> ;
[ <oPrint> := ] PrintBegin( [<cDocument>], <.user.>, <.prvw.>, <xModel> )

#xcommand PAGE => PageBegin()

#xcommand ENDPAGE => PageEnd()

#xcommand ENDPRINT => PrintEnd()


#xcommand ENDPRINTER => PrintEnd()

//----------------------------------------------------------------------------//

#endif

--------------------------------------------------------------------------------
Report.ch Report engine
--------------------------------------------------------------------------------
/*
+- Programa ---------------------------------------------------------------+
| Aplication: Header file for class TReport |
| File: REPORT.CH |
| Author: Ignacio Ortiz de Z..iga Echeverr.a |
| CIS: Ignacio Ortiz (100042,3051) |
| Date: 07/28/94 |
| Time: 20:20:07 |
| Copyright: 1994 by Ortiz de Zu.iga, S.L. |

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


+--------------------------------------------------------------------------+
*/

#define RPT_LEFT 1
#define RPT_RIGHT 2
#define RPT_CENTER 3
#define RPT_TOP 4
#define RPT_BOTTOM 5

#define RPT_INCHES 1
#define RPT_CMETERS 2

#define RPT_NOLINE 0
#define RPT_SINGLELINE 1
#define RPT_DOUBLELINE 2

#define CHAR_PATTERN "B"

#xcommand REPORT [ <oReport> ] ;


[ TITLE <bTitle, ...> [<TFmt:LEFT,CENTER,CENTERED,RIGHT>] ];
[ HEADER <bHead, ...> [<HFmt:LEFT,CENTER,CENTERED,RIGHT>] ];
[ FOOTER <bFoot, ...> [<FFmt:LEFT,CENTER,CENTERED,RIGHT>] ];
[ FONT <oFont, ...> ] ;
[ PEN <oPen, ...> ] ;
[ <lSum:SUMMARY> ] ;
[ <file: FILE, FILENAME, DISK> <cRptFile> ] ;
[ <resource: NAME, RESNAME, RESOURCE> <cResName> ] ;
[ <toPrint: TO PRINTER> ] ;
[ <toScreen: PREVIEW> ] ;
[ TO FILE <(toFile)> ] ;
[ TO DEVICE <oDevice> ] ;
[ CAPTION <cName> ] ;
=> ;
[ <oReport> := ] RptBegin({<{bTitle}>}, {<{bHead}>}, {<{bFoot}>},;
{<oFont>}, {<oPen>}, <.lSum.>, <cRptFile>, <cResName>,;
[<.toPrint.>], <.toScreen.>, <(toFile)>, <oDevice>, <cName>,;
[UPPER(<(TFmt)>)], [UPPER(<(HFmt)>)], [UPPER(<(FFmt)>)] )

#xcommand GROUP [ <oRptGrp> ] ;


[ ON <bGroup> ] ;
[ HEADER <bHead> ] ;
[ FOOTER <bFoot> ] ;
[ FONT <uFont> ] ;
[ <lEject:EJECT> ] ;
=> ;
[ <oRptGrp> := ] RptAddGroup( <{bGroup}>, <{bHead}>, ;
<{bFoot}>, <{uFont}>, <.lEject.> )

#xcommand COLUMN [ <oRptCol> ] ;


[ TITLE <bTitle, ...> ] ;
[ AT <nCol> ] ;
[ DATA <bData, ...> ] ;
[ SIZE <nSize> ] ;
[ PICTURE <cPicture, ...> ] ;
[ FONT <uFont> ] ;
[ <total: TOTAL> [ FOR <bTotalExpr> ] ] ;
[ <ColFmt:LEFT,CENTER,CENTERED,RIGHT> ] ;
[ <lShadow:SHADOW> ] ;
[ <lGrid:GRID> [ <nPen> ] ] ;
=> ;
[ <oRptCol> := ] RptAddColumn( {<{bTitle}>}, <nCol> ,;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


{<{bData}>}, <nSize>, {<cPicture>} ,;
<{uFont}>, <.total.>, <{bTotalExpr}> ,;
[UPPER(<(ColFmt)>)], <.lShadow.>, <.lGrid.>, <nPen> )

#xcommand END REPORT ;


=> ;
RptEnd()

#xcommand ENDREPORT ;
=> ;
END REPORT

#xcommand ACTIVATE REPORT <oReport> ;


[ FOR <for> ] ;
[ WHILE <while> ] ;
[ ON INIT <uInit> ] ;
[ ON END <uEnd> ] ;
[ ON POSTEND <uPostEnd> ] ;
[ ON STARTPAGE <uStartPage> ] ;
[ ON ENDPAGE <uEndPage> ] ;
[ ON POSTPAGE <uPostPage> ] ;
[ ON STARTGROUP <uStartGroup> ] ;
[ ON ENDGROUP <uEndGroup> ] ;
[ ON POSTGROUP <uPostGroup> ] ;
[ ON STARTLINE <uStartLine> ] ;
[ ON ENDLINE <uEndLine> ] ;
[ ON CHANGE <bChange> ] ;
=> ;
<oReport>:Activate(<{for}>, <{while}>, <{uInit}>, <{uEnd}>, ;
<{uStartPage}>, <{uEndPage}>, <{uStartGroup}>, <{uEndGroup}>,;
<{uStartLine}>, <{uEndLine}>, <{bChange}>,;
<{uPostEnd}>, <{uPostPage}>, <{uPostGroup}> )

// EOF

--------------------------------------------------------------------------------
SQL.ch ODBC header
--------------------------------------------------------------------------------
//algunos codigos de retorno
#define SQL_ERROR -1
#define SQL_INVALID_HANDLE -2
#define SQL_NEED_DATA 99
#define SQL_NO_DATA_FOUND 100
#define SQL_SUCCESS 0
#define SQL_SUCCESS_WITH_INFO 1
#define SQL_DROP 1

//tipos de campos
#define SQL_CHAR 1
#define SQL_NUMERIC 2
#define SQL_DECIMAL 3
#define SQL_INTEGER 4
#define SQL_SMALLINT 5
#define SQL_FLOAT 6
#define SQL_REAL 7
#define SQL_DOUBLE 8
#define SQL_DATE 9
#define SQL_TIME 10
#define SQL_TIMESTAMP 11
#define SQL_VARCHAR 12

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define SQL_LONGVARCHAR -1
#define SQL_BINARY -2
#define SQL_VARBINARY -3
#define SQL_LONGVARBINARY -4
#define SQL_BIGINT -5
#define SQL_TINYINT -6
#define SQL_BIT -7

//campos en el array de definicion de los campos de una consulta


#define SQLNAME 1
#define SQLCTYPE 2
#define SQLLEN 3
#define SQLDEC 4
#define SQLNULL 5
#define SQLNTYPE 6

/* Defines for SQLGetInfo */


#define SQL_INFO_FIRST 0
#define SQL_ACTIVE_CONNECTIONS 0
#define SQL_ACTIVE_STATEMENTS 1
#define SQL_DATA_SOURCE_NAME 2
#define SQL_DRIVER_HDBC 3
#define SQL_DRIVER_HENV 4
#define SQL_DRIVER_HSTMT 5
#define SQL_DRIVER_NAME 6
#define SQL_DRIVER_VER 7
#define SQL_FETCH_DIRECTION 8
#define SQL_ODBC_API_CONFORMANCE 9
#define SQL_ODBC_VER 10
#define SQL_ROW_UPDATES 11
#define SQL_ODBC_SAG_CLI_CONFORMANCE 12
#define SQL_SERVER_NAME 13
#define SQL_SEARCH_PATTERN_ESCAPE 14
#define SQL_ODBC_SQL_CONFORMANCE 15

#define SQL_DATABASE_NAME 16
#define SQL_DBMS_NAME 17
#define SQL_DBMS_VER 18

#define SQL_ACCESSIBLE_TABLES 19
#define SQL_ACCESSIBLE_PROCEDURES 20
#define SQL_PROCEDURES 21
#define SQL_CONCAT_NULL_BEHAVIOR 22
#define SQL_CURSOR_COMMIT_BEHAVIOR 23
#define SQL_CURSOR_ROLLBACK_BEHAVIOR 24
#define SQL_DATA_SOURCE_READ_ONLY 25
#define SQL_DEFAULT_TXN_ISOLATION 26
#define SQL_EXPRESSIONS_IN_ORDERBY 27
#define SQL_IDENTIFIER_CASE 28
#define SQL_IDENTIFIER_QUOTE_CHAR 29
#define SQL_MAX_COLUMN_NAME_LEN 30
#define SQL_MAX_CURSOR_NAME_LEN 31
#define SQL_MAX_OWNER_NAME_LEN 32
#define SQL_MAX_PROCEDURE_NAME_LEN 33
#define SQL_MAX_QUALIFIER_NAME_LEN 34
#define SQL_MAX_TABLE_NAME_LEN 35
#define SQL_MULT_RESULT_SETS 36
#define SQL_MULTIPLE_ACTIVE_TXN 37
#define SQL_OUTER_JOINS 38
#define SQL_OWNER_TERM 39
#define SQL_PROCEDURE_TERM 40

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define SQL_QUALIFIER_NAME_SEPARATOR 41
#define SQL_QUALIFIER_TERM 42
#define SQL_SCROLL_CONCURRENCY 43
#define SQL_SCROLL_OPTIONS 44
#define SQL_TABLE_TERM 45
#define SQL_TXN_CAPABLE 46
#define SQL_USER_NAME 47

#define SQL_CONVERT_FUNCTIONS 48
#define SQL_NUMERIC_FUNCTIONS 49
#define SQL_STRING_FUNCTIONS 50
#define SQL_SYSTEM_FUNCTIONS 51
#define SQL_TIMEDATE_FUNCTIONS 52

#define SQL_CONVERT_BIGINT 53
#define SQL_CONVERT_BINARY 54
#define SQL_CONVERT_BIT 55
#define SQL_CONVERT_CHAR 56
#define SQL_CONVERT_DATE 57
#define SQL_CONVERT_DECIMAL 58
#define SQL_CONVERT_DOUBLE 59
#define SQL_CONVERT_FLOAT 60
#define SQL_CONVERT_INTEGER 61
#define SQL_CONVERT_LONGVARCHAR 62
#define SQL_CONVERT_NUMERIC 63
#define SQL_CONVERT_REAL 64
#define SQL_CONVERT_SMALLINT 65
#define SQL_CONVERT_TIME 66
#define SQL_CONVERT_TIMESTAMP 67
#define SQL_CONVERT_TINYINT 68
#define SQL_CONVERT_VARBINARY 69
#define SQL_CONVERT_VARCHAR 70
#define SQL_CONVERT_LONGVARBINARY 71

#define SQL_TXN_ISOLATION_OPTION 72
#define SQL_ODBC_SQL_OPT_IEF 73

/* options for SQLSetConnectOption/SQLGetConnectOption */


#define SQL_ACCESS_MODE 101
#define SQL_AUTOCOMMIT 102
#define SQL_LOGIN_TIMEOUT 103
#define SQL_OPT_TRACE 104
#define SQL_OPT_TRACEFILE 105
#define SQL_TRANSLATE_DLL 106
#define SQL_TRANSLATE_OPTION 107
#define SQL_TXN_ISOLATION 108
#define SQL_CURRENT_QUALIFIER 109
#define SQL_ODBC_CURSORS 110
#define SQL_CONNECT_OPT_DRVR_START 1000

#define CONN_OPT_MIN SQL_ACCESS_MODE


#define CONN_OPT_MAX SQL_ODBC_CURSORS

/* options for SQLGetStmtOption/SQLSetStmtOption */


#define SQL_QUERY_TIMEOUT 0
#define SQL_MAX_ROWS 1
#define SQL_NOSCAN 2
#define SQL_MAX_LENGTH 3
#define SQL_ASYNC_ENABLE 4
#define SQL_BIND_TYPE 5

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define SQL_BIND_BY_COLUMN 0 /* Suboption for SQL_BIND_TYPE */

--------------------------------------------------------------------------------
TcBrowse.ch Column based new Browse
--------------------------------------------------------------------------------
** Last revision: May 29, 1995 at 10:03

/***************************************************************************

This project was started by an original idea of Salim Anter of Instabul

I have only added a little spit and polish. Harry Van Tassell

***************************************************************************/

/*
The include file for my Table [Traditional] Column Browse class

This project was started by an original idea of Salim Anter of Instabul

NOTE this is quite long and contains several different types of Columns
*/

#xcommand REDEFINE [ COLUMN ] BROWSE <oBrw> ;


[<Flds,...>] ;
[ ALIAS <cAlias> ] ;
[ ID <nId> ] ;
[ <dlg:OF,DIALOG> <oDlg> ] ;
[ <sizes:FIELDSIZES, SIZES, COLSIZES> <aColSizes,...> ] ;
[ <head:HEAD,HEADER,HEADERS> <aHeaders,...> ] ;
[ SELECT <cField> FOR <uValue1> [ TO <uValue2> ] ] ;
[ <change: ON CHANGE, ON CLICK> <uChange> ] ;
[ ON [ LEFT ] DBLCLICK <uLDblClick> ] ;
[ ON RIGHT CLICK <uRClick> ] ;
[ FONT <oFont> ] ;
[ CURSOR <oCursor> ] ;
[ <color: COLOR, COLORS> <nClrFore> [,<nClrBack>] ] ;
[ MESSAGE <cMsg> ] ;
[ <update: UPDATE> ] ;
[ WHEN <uWhen> ] ;
[ VALID <uValid> ] ;
=> ;
<oBrw> := TCBrowse():ReDefine( <nId>, ;
[\{|| \{ <Flds> \} \}], <oDlg>,;
[ \{<aHeaders>\}], [\{<aColSizes>\}],;
<(cField)>, <uValue1>, <uValue2>,;
[<{uChange}>],;
[\{|nRow,nCol,nFlags|<uLDblClick>\}],;
[\{|nRow,nCol,nFlags|<uRClick>\}],;
<oFont>, <oCursor>, <nClrFore>, <nClrBack>, <cMsg>,;
<.update.>, <(cAlias)>, <{uWhen}>, <{uValid}> )

//------------------------------------------------------------------------//

#xcommand @ <nRow>, <nCol> [ COLUMN ] BROWSE <oBrw> ;


[ [ FIELDS ] <Flds,...>] ;
[ ALIAS <cAlias> ] ;
[ <sizes:FIELDSIZES, SIZES, COLSIZES> <aColSizes,...> ] ;
[ <head:HEAD,HEADER,HEADERS> <aHeaders,...> ] ;
[ SIZE <nWidth>, <nHeigth> ] ;
[ <dlg:OF,DIALOG> <oDlg> ] ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ SELECT <cField> FOR <uValue1> [ TO <uValue2> ] ] ;
[ <change: ON CHANGE, ON CLICK> <uChange> ] ;
[ ON [ LEFT ] DBLCLICK <uLDblClick> ] ;
[ ON RIGHT CLICK <uRClick> ] ;
[ FONT <oFont> ] ;
[ CURSOR <oCursor> ] ;
[ <color: COLOR, COLORS> <nClrFore> [,<nClrBack>] ] ;
[ MESSAGE <cMsg> ] ;
[ <update: UPDATE> ] ;
[ <pixel: PIXEL> ] ;
[ WHEN <uWhen> ] ;
[ <design: DESIGN> ] ;
[ VALID <uValid> ] ;
=> ;
<oBrw> := TCBrowse():New( <nRow>, <nCol>, <nWidth>, <nHeigth>,;
[\{|| \{<Flds> \} \}], ;
[\{<aHeaders>\}], [\{<aColSizes>\}], ;
<oDlg>, <(cField)>, <uValue1>, <uValue2>,;
[<{uChange}>],;
[\{|nRow,nCol,nFlags|<uLDblClick>\}],;
[\{|nRow,nCol,nFlags|<uRClick>\}],;
<oFont>, <oCursor>, <nClrFore>, <nClrBack>, <cMsg>,;
<.update.>, <(cAlias)>, <.pixel.>, <{uWhen}>,;
<.design.>, <{uValid}> )

//------------------------------------------------------------------------//

// general data columns


#command DEFINE COLUMN <oCol> ;
[ <dat: DATA, SHOWBLOCK> <uData> ] ;
[ <tit: TITLE, HEADER> <cHead> [ <oem: OEM, ANSI, CONVERT>] ];
[ <clr: COLORS, COLOURS> <uClrFore> [,<uClrBack>] ] ;
[ ALIGN ] [ <align: LEFT, CENTERED, RIGHT> ] ;
[ <wid: WIDTH, SIZE> <nWidth> [ PIXELS ] ] ;
[ PICTURE <cPicture> ] ;
[ <bit: BITMAP> ] ;
[ <edit: EDITABLE> ] ;
[ MESSAGE <cMsg> ] ;
[ VALID <uValid> ] ;
[ ERROR [MSG] [MESSAGE] <cErr> ] ;
[ <lite: NOBAR, NOHILITE> ] ;
[ <idx: ORDER, INDEX, TAG> <cOrder> ] ;
=> ;
<oCol> := TCColumn():New( ;
If(<.oem.>, OemToAnsi(<cHead>), <cHead>), ;
[ If( ValType(<uData>)=="B", <uData>, <{uData}> ) ], <cPicture>, ;
[ If( ValType(<uClrFore>)=="B", <uClrFore>, <{uClrFore}> ) ], ;
[ If( ValType(<uClrBack>)=="B", <uClrBack>, <{uClrBack}> ) ], ;
If(!<.align.>,"LEFT", Upper(<(align)>)), <nWidth>, <.bit.>, ;
<.edit.>, <cMsg>, <{uValid}>, <cErr>, <.lite.>, <(cOrder)> )

//-------------------------------------------------------------------------//

// general data columns


#command ADD [ COLUMN ] TO [ BROWSE ] <oBrw> ;
[ <dat: DATA, SHOWBLOCK> <uData> ] ;
[ <tit: TITLE, HEADER> <cHead> [ <oem: OEM, ANSI, CONVERT>] ];
[ <clr: COLORS, COLOURS> <uClrFore> [,<uClrBack>] ] ;
[ ALIGN ] [ <align: LEFT, CENTERED, RIGHT> ] ;
[ <wid: WIDTH, SIZE> <nWidth> [ PIXELS ] ] ;
[ PICTURE <cPicture> ] ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ <bit: BITMAP> ] ;
[ <edit: EDITABLE> ] ;
[ MESSAGE <cMsg> ] ;
[ VALID <uValid> ] ;
[ ERROR [MSG] [MESSAGE] <cErr> ] ;
[ <lite: NOBAR, NOHILITE> ] ;
[ <idx: ORDER, INDEX, TAG> <cOrder> ] ;
=> ;
<oBrw>:AddColumn( TCColumn():New( ;
If(<.oem.>, OemToAnsi(<cHead>), <cHead>), ;
[ If( ValType(<uData>)=="B", <uData>, <{uData}> ) ], <cPicture>, ;
[ If( ValType(<uClrFore>)=="B", <uClrFore>, <{uClrFore}> ) ], ;
[ If( ValType(<uClrBack>)=="B", <uClrBack>, <{uClrBack}> ) ], ;
If(!<.align.>,"LEFT", Upper(<(align)>)), <nWidth>, <.bit.>, ;
<.edit.>, <cMsg>, <{uValid}>, <cErr>, <.lite.>, <(cOrder)> ) )

//------------------------------------------------------------------------//

// Array oBrw:aArray[oBrw:nAt, elm] columns


#command ADD [ COLUMN ] TO [ BROWSE ] <oBrw> [ DATA ] ARRAY ;
[ <el: ELM, ELEMENT> <elm> ] ;
[ <tit: TITLE, HEADER> <cHead> [ <oem: OEM, ANSI, CONVERT>] ];
[ <clr: COLORS, COLOURS> <uClrFore> [,<uClrBack>] ] ;
[ ALIGN ] [ <align: LEFT, CENTERED, RIGHT> ] ;
[ <wid: WIDTH, SIZE> <nWidth> [ PIXELS ] ] ;
[ PICTURE <cPicture> ] ;
[ <bit: BITMAP> ] ;
[ <edit: EDITABLE> ] ;
[ MESSAGE <cMsg> ] ;
[ VALID <uValid> ] ;
[ ERROR [MSG] [MESSAGE] <cErr> ] ;
[ <lite: NOBAR, NOHILITE> ] ;
=> ;
<oBrw>:AddColumn( TCColumn():New( ;
If(<.oem.>, OemToAnsi(<cHead>), <cHead>), ;
\{|x| If(Pcount()>0, <oBrw>:aArray\[<oBrw>:nAt, <elm>\] :=x, ;
<oBrw>:aArray\[<oBrw>:nAt, <elm>\])\}, <cPicture>, ;
[ If( ValType(<uClrFore>)=="B", <uClrFore>, <{uClrFore}> ) ], ;
[ If( ValType(<uClrBack>)=="B", <uClrBack>, <{uClrBack}> ) ], ;
If(!<.align.>,"LEFT", Upper(<(align)>)), <nWidth>, <.bit.>, ;
<.edit.>, <cMsg>, <{uValid}>, <cErr>, <.lite.> ) )

//------------------------------------------------------------------------//

// TDataBase Class oBrw:oDbf:FieldName


// TMultiDBF Class oBrw:oDbf:AliasName:FieldName

#command ADD [ COLUMN ] TO [BROWSE] <oBrw> [DATA] ;


<fi: oDBF, FIELD> [FIELD] <field> ;
[ ALIAS <alias> ] ;
[ <tit: TITLE, HEADER> <cHead> [ <oem: OEM, ANSI, CONVERT>] ];
[ <clr: COLORS, COLOURS> <uClrFore> [,<uClrBack>] ] ;
[ ALIGN ] [ <align: LEFT, CENTERED, RIGHT> ] ;
[ <wid: WIDTH, SIZE> <nWidth> [ PIXELS ] ] ;
[ PICTURE <cPicture> ] ;
[ <bit: BITMAP> ] ;
[ <edit: EDITABLE> ] ;
[ MESSAGE <cMsg> ] ;
[ VALID <uValid> ] ;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


[ ERROR [MSG] [MESSAGE] <cErr> ] ;
[ <lite: NOBAR, NOHILITE> ] ;
[ <idx: ORDER, INDEX, TAG> <cOrder> ] ;
=> ;
<oBrw>:AddColumn( TCColumn():New( ;
If(<.oem.>, OemToAnsi(<cHead>), <cHead>), ;
\{|x| If(Pcount()>0, <oBrw>:oDbf:[<alias>:]<field> :=x, ;
<oBrw>:oDbf:[<alias>:]<field>) \}, <cPicture>, ;
[ If( ValType(<uClrFore>)=="B", <uClrFore>, <{uClrFore}> ) ], ;
[ If( ValType(<uClrBack>)=="B", <uClrBack>, <{uClrBack}> ) ], ;
If(!<.align.>,"LEFT", Upper(<(align)>)), <nWidth>, <.bit.>, ;
<.edit.>, <cMsg>, <{uValid}>, <cErr>, <.lite.>, <(cOrder)> ) )

//------------------------------------------------------------------------//

#translate VALID <if: IF, CONDITION> <cond> => ;


VALID \{|o, x| x := o:varGet(), <cond> \}

//------------------------------------------------------------------------//

#define DT_LEFT 0
#define DT_CENTER 1
#define DT_RIGHT 2

//-------------------------------------------------------------------------//
//-------------------------------------------------------------------------//

--------------------------------------------------------------------------------
Tree.ch Trees support
--------------------------------------------------------------------------------
// Trees for FiveWin !!! Incredible powerfull !!!

#ifndef _TREE_CH
#define _TREE_CH

#xcommand TREE [<oTree>] ;


[ BITMAPS <cBmpOpen>, <cBmpClose> ] ;
=> ;
[<oTree>:=] TreeBegin( <cBmpOpen>, <cBmpClose> )

#xcommand TREEITEM [<oItem> PROMPT ] <cLabel> ;


[ RESOURCE <cResName1> [, <cResName2> ] ] ;
[ FILENAME <cBmpOpen> [, <cBmpClose> ] ] ;
[ <lOpened: OPENED, OPEN> ] ;
=> ;
[<oItem> :=] _TreeItem( <cLabel>, <cResName1>, <cResName2>,;
<cBmpOpen>, <cBmpClose>, <.lOpened.> )

#xcommand ENDTREE => TreeEnd()

#endif

--------------------------------------------------------------------------------
Video.ch Video media AVI Support
--------------------------------------------------------------------------------
#ifndef _VIDEO_CH
#define _VIDEO_CH

//----------------------------------------------------------------------------//

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#xcommand DEFINE VIDEO [<oVideo>] ;
[ <file: FILE, FILENAME, DISK> <cAviFile> ] ;
[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
=> ;
[ <oVideo> ] := TMci():New( "avivideo", <cAviFile>, <oWnd> )

#xcommand ACTIVATE VIDEO <oVideo> => <oVideo>:lOpen() ; <oVideo>:Play()

#xcommand PLAY VIDEO <oVideo> => <oVideo>:lOpen() ; <oVideo>:Play()

#xcommand @ <nRow>, <nCol> VIDEO [<oVideo>] ;


[ SIZE <nWidth>, <nHeight> ] ;
[ <file: FILE, FILENAME, DISK> <cFileName> ] ;
[ <of: OF, WINDOW, DIALOG > <oWnd> ] ;
[ <lNoBorder: NOBORDER> ] ;
=> ;
[ <oVideo> := ] TVideo():New( <nRow>, <nCol>, <nWidth>, <nHeight>,;
<cFileName>, <oWnd>, <.lNoBorder.> )

#xcommand REDEFINE VIDEO [<oVideo>] ;


[ ID <nId> ] ;
[ <of: OF, WINDOW, DIALOG > <oWnd> ] ;
[ WHEN <uWhen> ] ;
[ VALID <uValid> ] ;
[ <file: FILE, FILENAME, DISK> <cFileName> ] ;
=> ;
[ <oVideo> := ] TVideo():ReDefine( <nId>, <cFileName>, <oWnd>,;
<{uWhen}>, <{uValid}> )

//----------------------------------------------------------------------------//

#endif

--------------------------------------------------------------------------------
VKey.ch Windows keys values
--------------------------------------------------------------------------------
/* Virtual key codes */
/* C.digos de teclas Virtuales */

#define VK_LBUTTON 1 // 0x01


#define VK_RBUTTON 2 // 0x02
#define VK_CANCEL 3 // 0x03
#define VK_MBUTTON 4 // 0x04
#define VK_BACK 8 // 0x08
#define VK_TAB 9 // 0x09
#define VK_CLEAR 12 // 0x0C
#define VK_RETURN 13 // 0x0D
#define VK_SHIFT 16 // 0x10
#define VK_CONTROL 17 // 0x11
#define VK_MENU 18 // 0x12
#define VK_PAUSE 19 // 0x13
#define VK_CAPITAL 20 // 0x14
#define VK_ESCAPE 27 // 0x1B
#define VK_SPACE 32 // 0x20
#define VK_PRIOR 33 // 0x21
#define VK_NEXT 34 // 0x22
#define VK_END 35 // 0x23
#define VK_HOME 36 // 0x24
#define VK_LEFT 37 // 0x25
#define VK_UP 38 // 0x26

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define VK_RIGHT 39 // 0x27
#define VK_DOWN 40 // 0x28
#define VK_SELECT 41 // 0x29
#define VK_PRINT 42 // 0x2A
#define VK_EXECUTE 43 // 0x2B
#define VK_SNAPSHOT 44 // 0x2C
#define VK_INSERT 45 // 0x2D
#define VK_DELETE 46 // 0x2E
#define VK_HELP 47 // 0x2F
#define VK_NUMPAD0 96 // 0x60
#define VK_NUMPAD1 97 // 0x61
#define VK_NUMPAD2 98 // 0x62
#define VK_NUMPAD3 99 // 0x63
#define VK_NUMPAD4 100 // 0x64
#define VK_NUMPAD5 101 // 0x65
#define VK_NUMPAD6 102 // 0x66
#define VK_NUMPAD7 103 // 0x67
#define VK_NUMPAD8 104 // 0x68
#define VK_NUMPAD9 105 // 0x69
#define VK_MULTIPLY 106 // 0x6A
#define VK_ADD 107 // 0x6B
#define VK_SEPARATOR 108 // 0x6C
#define VK_SUBTRACT 109 // 0x6D
#define VK_DECIMAL 110 // 0x6E
#define VK_DIVIDE 111 // 0x6F
#define VK_F1 112 // 0x70
#define VK_F2 113 // 0x71
#define VK_F3 114 // 0x72
#define VK_F4 115 // 0x73
#define VK_F5 116 // 0x74
#define VK_F6 117 // 0x75
#define VK_F7 118 // 0x76
#define VK_F8 119 // 0x77
#define VK_F9 120 // 0x78
#define VK_F10 121 // 0x79
#define VK_F11 122 // 0x7A
#define VK_F12 123 // 0x7B
#define VK_F13 124 // 0x7C
#define VK_F14 125 // 0x7D
#define VK_F15 126 // 0x7E
#define VK_F16 127 // 0x7F
#define VK_F17 128 // 0x80
#define VK_F18 129 // 0x81
#define VK_F19 130 // 0x82
#define VK_F20 131 // 0x83
#define VK_F21 132 // 0x84
#define VK_F22 133 // 0x85
#define VK_F23 134 // 0x86
#define VK_F24 135 // 0x87
#define VK_NUMLOCK 144 // 0x90
#define VK_SCROLL 145 // 0x91

/* VK_A thru VK_Z are the same as their ASCII equivalents: 'A' thru 'Z' */
/* VK_A hasta VK_Z se corresponden con los valores ASCII : de 'A' a 'Z' */

/* VK_0 thru VK_9 are the same as their ASCII equivalents: '0' thru '9' */
/* VK_0 hasta VK_9 se corresponden con los valores ASCII : de '0' a '9' */

/* To accelerators functions */
/* Para las funciones de acceleradores */

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define ACC_NORMAL 1
#define ACC_SHIFT 4
#define ACC_CONTROL 8
#define ACC_ALT 16

--------------------------------------------------------------------------------
WinApi.ch Windows API definitions
--------------------------------------------------------------------------------
#ifndef _WINAPI_CH
#define _WINAPI_CH

#include "FwMsgs.h" // User defined FiveWin new Windows messages

//----------------------------------------------------------------------------//

#define IDOK 1
#define ID_OK 1
#define IDCANCEL 2

#define BN_CLICKED 0

#define CS_VREDRAW 1 // 0x0001


#define CS_HREDRAW 2 // 0x0002
#define CS_GLOBALCLASS 16384 // 0x4000

#define CS_OWNDC 32 // 0x0020


#define CS_CLASSDC 64 // 0x0040
#define CS_PARENTDC 128 // 0x0080

#define CS_BYTEALIGNCLIENT 4096 // 0x1000


#define CS_BYTEALIGNWINDOW 8192 // 0x2000

#define WS_OVERLAPPED 0 // 0x00000000L


#define WS_POPUP 2147483648 // 0x80000000L
#define WS_CHILD 1073741824 // 0x40000000L

#define WS_CLIPSIBLINGS 67108864 // 0x04000000L


#define WS_CLIPCHILDREN 33554432 // 0x02000000L

#define WS_VISIBLE 268435456 // 0x10000000L


#define WS_DISABLED 134217728 // 0x08000000L

#define WS_MINIMIZE 536870912 // 0x20000000L


#define WS_MAXIMIZE 16777216 // 0x01000000L

#define WS_CAPTION 12582912 // 0x00C00000L


#define WS_BORDER 8388608 // 0x00800000L
#define WS_DLGFRAME 4194304 // 0x00400000L
#define WS_VSCROLL 2097152 // 0x00200000L
#define WS_HSCROLL 1048576 // 0x00100000L
#define WS_SYSMENU 524288 // 0x00080000L
#define WS_THICKFRAME 262144 // 0x00040000L
#define WS_MINIMIZEBOX 131072 // 0x00020000L
#define WS_MAXIMIZEBOX 65536 // 0x00010000L

#define WS_GROUP 131072 // 0x00020000L


#define WS_TABSTOP 65536 // 0x00010000L

#define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED + WS_CAPTION + WS_SYSMENU +


WS_THICKFRAME + WS_MINIMIZEBOX + WS_MAXIMIZEBOX)
#define WS_POPUPWINDOW (WS_POPUP + WS_BORDER + WS_SYSMENU)

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define WS_CHILDWINDOW (WS_CHILD)

#define ES_LEFT 0
#define ES_RIGHT 2
#define ES_MULTILINE 4
#define ES_AUTOHSCROLL 128 // 0x0080
#define ES_WANTRETURN 4096 // 0x1000

#define WM_NULL 0 // 0x0000


#define WM_DESTROY 2 // 0x0002
#define WM_MOVE 3
#define WM_SIZE 5 // 0x0005
#define WM_SETFOCUS 7 // 0x0007
#define WM_KILLFOCUS 8 // 0x0008
#define WM_PAINT 15 // 0x000F
#define WM_CLOSE 16 // 0x0010
#define WM_QUERYENDSESSION 17 // 0x0011
#define WM_QUIT 18 // 0x0012
#define WM_SYSCOLORCHANGE 21 // 0x0015
#define WM_ENDSESSION 22 // 0x0016
#define WM_SYSTEMERROR 23 // 0x0017
#define WM_WININICHANGE 26 // 0x001A
#define WM_DEVMODECHANGE 27 // 0x001B
#define WM_FONTCHANGE 29 // 0x001D
#define WM_TIMECHANGE 30 // 0x001E
#define WM_SPOOLERSTATUS 42 // 0x002A
#define WM_COMPACTING 65 // 0x0041

#define WM_GETDLGCODE 135 // 0x0087


#define WM_CHAR 258 // 0x0102
#define WM_COMMAND 273 // 0x0111
#define WM_MOUSEMOVE 512 // 0x0200
#define WM_LBUTTONDOWN 513 // 0x0201
#define WM_LBUTTONUP 514 // 0x0202
#define WM_RBUTTONDOWN 516 // 0x0204
#define WM_RBUTTONUP 517 // 0x0205
#define WM_KEYDOWN 256 // 0x0100
#define WM_KEYUP 257 // 0x0101
#define WM_INITDIALOG 272 // 0x0110
#define WM_TIMER 275 // 0x0113
#define WM_HSCROLL 276 // 0x0115
#define WM_VSCROLL 277 // 0x0115

#define WM_QUERYNEWPALETTE 783 // 0x030F


#define WM_PALETTEISCHANGING 784 // 0x0310
#define WM_PALETTECHANGED 785 // 0x0311

#define WM_USER 1024 // 0x0400

#define DS_SYSMODAL 2
#define DS_MODALFRAME 128 // 0x80

// Dialogs

#define DLGC_WANTARROWS 1
#define DLGC_WANTTAB 2
#define DLGC_WANTALLKEYS 4
#define DLGC_WANTCHARS 128

// ListBox Styles

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define LBS_NOTIFY 1
#define LBS_SORT 2
#define LBS_OWNERDRAWFIXED 16 // 0x10
#define LBS_USETABSTOPS 128 // 0x80
#define LBS_NOINTEGRALHEIGHT 256 // 0x100
#define LBS_WANTKEYBOARDINPUT 1024 // 0x400
#define LBS_DISABLENOSCROLL 4096 // 0x1000
#define LBS_STANDARD 10485763 //0xA00003

// ComboBox Styles

#define CBS_SIMPLE 1 // 0x0001


#define CBS_DROPDOWN 2 // 0x0002
#define CBS_DROPDOWNLIST 3 // 0x0003
#define CBS_OWNERDRAWFIXED 16 // 0x0010
#define CBS_AUTOHSCROLL 64 // 0x0040
#define CBS_OEMCONVERT 128 // 0x0080
#define CBS_SORT 256 // 0x0100
#define CBS_DISABLENOSCROLL 2048 // 0x0800

// ScrollBar

#define SB_LINEUP 0
#define SB_LINELEFT 0
#define SB_LINEDOWN 1
#define SB_LINERIGHT 1
#define SB_PAGEUP 2
#define SB_PAGELEFT 2
#define SB_PAGEDOWN 3
#define SB_PAGERIGHT 3
#define SB_THUMBPOSITION 4
#define SB_THUMBTRACK 5
#define SB_TOP 6
#define SB_LEFT 6
#define SB_BOTTOM 7
#define SB_RIGHT 7
#define SB_ENDSCROLL 8

// Scroll Bar styles

#define SBS_HORZ 0
#define SBS_VERT 1

// CheckBox

#define BS_PUSHBUTTON 0
#define BS_DEFPUSHBUTTON 1
#define BS_CHECKBOX 2
#define BS_AUTOCHECKBOX 3 // 0x00000003
#define BS_GROUPBOX 7
#define BS_AUTORADIOBUTTON 9

/* Pen Styles */
#define PS_SOLID 0
#define PS_DASH 1
#define PS_DOT 2
#define PS_DASHDOT 3
#define PS_DASHDOTDOT 4
#define PS_NULL 5
#define PS_INSIDEFRAME 6

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define SS_BLACKRECT 4
#define SS_WHITERECT 6
#define SS_WHITEFRAME 9
#define SS_LEFT 0
#define SS_SIMPLE 11 // 0x0B

// VBX Support

#define DLGINIT 240

// ZIPs Support

#define FN_UNZIP 15000

#endif

--------------------------------------------------------------------------------
ClipApi.h Clipper internal management declarations
--------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
// Clipper API ver 1.0 Fco.Pulp.n, A.Linares //
////////////////////////////////////////////////////////////////////////////////

#ifndef _CLIPAPI_H
#define _CLIPAPI_H

// Some xBase for C language!


#define IF(x,y,z) ((x)?(y):(z))

#define MAX( a, b ) ( int ) (((int)(a) > (int)(b)) ? (a) : (b))


#define MIN( a, b ) ( int ) (((int)(a) < (int)(b)) ? (a) : (b))

// Types for wType in generic struct CLIPVAR


#define NIL 0x0000
#define NUMERIC 0x0002 // DWORD
#define NUM_FLOAT 0x0008
#define DATE 0x0020
#define LOGICAL 0x0080
#define CHARACTER 0x0400
#define MEMO 0x0C00
#define BLOCK 0x1000
#define ARRAY 0x8000
#define OBJECT ARRAY

#define BY_REF 0x2000 // Locals and Statics Ref's


#define BY_REF_MEM 0x4000 // MemVars Ref's

#define ANYREF 0x6000 // Mask Any referenced type.


#define ANYNUMBER 0x000A // Mask any Numerical type. 0x0002 & 0x0008
#define ALLTYPES 0xFFFF // Mask all types.

#ifndef __WINDOWS_H // 16 bits


#ifndef __FLAT__ // 32 bits

typedef unsigned char BYTE;


typedef unsigned int WORD;
typedef signed long LONG;
typedef unsigned long DWORD;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


typedef BYTE far * LPBYTE;
typedef char far * LPSTR;
typedef WORD * PWORD;
typedef WORD far * LPWORD;
typedef LONG * PLONG;
typedef LONG far * LPLONG;
typedef DWORD* PDWORD;
typedef DWORD far * LPDWORD;

typedef enum{ FALSE, TRUE } BOOL;

#endif
#endif

#ifdef __FLAT__
#define CLIPPER void // _System
#define PARAMS void * params
#define _parc( x ) PARC( x, params )
#else
#define CLIPPER void pascal
#define PARAMS void
#endif

typedef struct
{
WORD wType;
WORD w2;
WORD w3;
LPBYTE pPointer1;
LPBYTE pPointer2;
} CLIPVAR; // sizeof( CLIPVAR ) --> 14 bytes

// Una especie de herencia del struct CLIPVAR para types NUMERIC


// A kind of inheritance from CLIPVAR struct for NUMERIC types
typedef struct
{
WORD wType;
LONG lDummy1;
LONG lnNumber;
LONG lDummy2;
} CLV_LONG;

typedef struct
{
WORD wFloat[ 4 ];
} CLIP_FLOAT;

// Una especie de herencia del struct CLIPVAR para types NUM_FLOAT


// aun est. por desarrollar. Son las funciones _dv.....

// A kind of inheritance from CLIPVAR struct for NUM_FLOAT types


// still to be completed. They are the functions _dv......

typedef struct
{
WORD wType;
LONG lDummy1;
CLIP_FLOAT fFloat;
} CLV_FLOAT;

// Estructura CLV_WORD para NUMERIC (WORD) y para los LOGICAL (BOOL).

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


// CLV_WORD struct for NUMERIC (WORD) and for LOGICAL (BOOL).

typedef struct
{
WORD wType;
LONG lDummy;
WORD wWord; // for LOGICAL clipvars -> Casting to (BOOL)
WORD wDummy[ 3 ];
} CLV_WORD;

// Estructura VITEMCHAR para VITEM's CHAR.


// VITEMCHAR struct for VITEM's CHAR.

typedef struct
{
WORD wType;
WORD wLen;
WORD wDummy[ 5 ];
} CLV_CHAR;

typedef CLIPVAR near * PCLIPVAR;


typedef CLIPVAR far * LPCLIPVAR;

// When a parameter is passed by reference, Clipper provides a


// ClipVar that keeps a pointer to the original ClipVar.
// We call this a REF_CLIPVAR;

typedef struct
{
WORD wType;
WORD w2;
WORD w3;
PCLIPVAR pClipVar;
LPBYTE pVoid;
} REF_CLIPVAR;

typedef void ( pascal * PCLIPFUNC )( void );

typedef struct
{
BYTE cName[ 11 ];
BYTE cType;
LPBYTE pSymbol; // Is a LPCLIPSYMBOL. You must cast.
} CLIPNAME; // 16 bytes

typedef CLIPNAME * PCLIPNAME;


typedef CLIPNAME far * LPCLIPNAME;

typedef struct
{
BYTE Dummy[ 8 ];
PCLIPNAME pName;
PCLIPFUNC pFunc;
} CLIPSYMBOL; // 16 bytes

typedef CLIPSYMBOL * PCLIPSYMBOL;


typedef CLIPSYMBOL far * LPCLIPSYMBOL;

extern PCLIPSYMBOL _SymEval; // == _Get_Sym( "EVAL" )


// SymSys init

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


/////////////////////////////////////////////////////////
// EXTEND Module - Clipper Extend system functions //
/////////////////////////////////////////////////////////

extern WORD _parinfo( WORD );


extern WORD _parinfa( WORD, WORD );

#ifndef __FLAT__
extern LPSTR _parc( WORD wParam, ... );
#else
LPSTR PARC( WORD wParam, void * );
#endif

extern WORD _parclen( WORD wParam, ... );


extern LPSTR _pards( WORD, ...);
extern BOOL _parl( WORD wParam, ... );
extern int _parni( WORD wParam, ... );
extern LONG _parnl( WORD wParam, ... );
extern void _retc( char * );
extern void _retclen( char *, WORD wLen );
extern void _retd( char * );
extern void _retl( BOOL );
extern void _retni( WORD wNumber );
extern void _retnl( LONG lNumber );
extern void _ret( void );
extern void _reta( WORD wArrayLen ); // Creates and returns an Array
extern BOOL _storc( LPSTR, WORD wParam, ... );
extern BOOL _storclen( LPSTR, WORD wLen, WORD wParam, ... );
extern BOOL _storl( BOOL, WORD wParam, ... );
extern BOOL _storni( WORD wValue, WORD wParam, ... );
extern BOOL _stornl( LONG lValue, WORD wParam, ... );
extern BOOL _stords( LPSTR szYYYYMMDD, WORD wParam, ... );
extern void _xunlock( void );
extern LPBYTE _xgrab( WORD wSize );
extern void _xfree( LPBYTE );

#define ISCHAR( c ) ( ( _lbase + c + 1 )->wType & CHARACTER )


#define ISNUM( c ) ( ( _lbase + c + 1 )->wType & ANYNUMBER )
#define ISLOGICAL( c ) ( ( _lbase + c + 1 )->wType & LOGICAL )
#define ISARRAY( c ) ( ( _lbase + c + 1 )->wType & ARRAY )
#define ISDATE( c ) ( ( _lbase + c + 1 )->wType & DATE )
#define ISBLOCK( c ) ( ( _lbase + c + 1 )->wType & BLOCK )
#define ISBYREF( c ) ( ( _lbase + c + 1 )->wType & ANYREF )

// Retrieves any parameter checking type. Use ALLTYPES #define for no test.
extern PCLIPVAR _param( WORD wParam, WORD wType );

// Number of parameters
extern WORD _pcount;

#define PCOUNT() _parinfo(0)

typedef struct
{
BYTE Red, Green, Blue, Attr; // Four bytes
} RGB;

//////////////////////////////////////////////////////
// COLOR Module - Colors Control //
//////////////////////////////////////////////////////

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


// General Terminal
typedef struct
{ // R G B +*
RGB Fore; // FF FF FF 00
RGB Back; // FF FF FF 00
} CLIPCOLOR;

extern CLIPCOLOR * _colors; // _colors[ 5 ]


extern WORD _ColorCount; // Number of colors used .?
void _xSetColor( PCLIPVAR ); // String dBase Colors

//////////////////////////////////////////////////////////////////
// GT Module - General Terminal //
//////////////////////////////////////////////////////////////////

typedef struct
{
WORD wTop;
WORD wLeft;
WORD wHeight;
WORD wWidth; // so there is no conflict with Windows.h rect
} gtRECT; // as. no hay conflicto con el rect de windows.h

typedef gtRECT * LPgtRECT;

typedef struct
{
WORD wTop, wLeft, wHeight, wWidth;
BYTE RGBColor[ 8 ];
LONG lDummy1;
WORD wDummy2;
WORD wDummy3;
LPBYTE p34Bytes;
BYTE bDummy2[ 10 ];
} WINDOW;

typedef WINDOW * gtHWND;


typedef gtHWND * PgtHWND;

WORD _gtBox( WORD, WORD, WORD, WORD, LPSTR );


WORD _gtColorSelect( WORD wColor ); // __color() in 5.01
WORD _gtMaxRow( void );
WORD _gtMaxCol( void );
WORD _gtSetColor( CLIPCOLOR * pColors );
WORD _gtGetColor( CLIPCOLOR * pColors );
WORD _gtSetPos( WORD wRow, WORD wCol );
WORD _gtGetPos( WORD * pwRow, WORD * pwCol );
WORD _gtScroll( WORD, WORD, WORD, WORD, int );
WORD _gtWriteAt( WORD wRow, WORD wCol, LPSTR szText, WORD wLen );
WORD _gtWrite( LPSTR szText, WORD wLen );
WORD _gtWriteCon( LPSTR szText, WORD wLen );
WORD _gtSave( WORD wTop, WORD wLeft, WORD wBottom, WORD wRight, LPBYTE pBuffer
);
WORD _gtScrDim( LPWORD pwRows, LPWORD pwCols );
WORD _gtRest( WORD wTop, WORD wLeft, WORD wBottom, WORD wRight, LPBYTE pBuffer
);
WORD _gtRectSize( WORD wTop, WORD wLeft, WORD wBottom, WORD wRight, LPWORD
wResult );
WORD _gtRepChar( WORD wRow, WORD wCol, WORD wChar, WORD wTimes );

// Undocumented Windowing System !!!

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


void _gtWCreate( LPgtRECT rctCoors, PgtHWND hWnd );
void _gtWCurrent( gtHWND hWnd );
BOOL _gtWVis( gtHWND hWnd, WORD wStatus );
BOOL _gtWFlash( void );
void _gtWApp( PgtHWND hWndApp );
void _gtWPos( gtHWND hWnd, LPgtRECT rctCoors );

// Selects a color - Clipper calling conventions


extern void _color( void );

// extended GT - RUNsoft
void _gtShadow( WORD wTop, WORD wLeft, WORD wBottom, WORD wRight );
void _gtClrReverse( WORD wColor );
void _gtSayHot( WORD wRow, WORD wCol, LPSTR szText, WORD wClrNormal, WORD
wClrHot );
WORD _gtClrGet( WORD wColor );

//////////////////////////////////////////////////////////////////
// FILESYS Module - Low level Files Management
//////////////////////////////////////////////////////////////////

extern WORD _tcreat( LPSTR szFileName, WORD wMode );


extern BOOL _tclose( WORD wHandle );
extern WORD _topen( LPSTR szFileName, WORD wMode );
extern LONG _tlseek( WORD wHandle, LONG lRecNo, WORD wPosition );
extern WORD _tread( WORD wHandle, LPBYTE cBuffer, WORD wBytes );
extern WORD _twrite( WORD wHandle, LPBYTE cBuffer, WORD wBytes );

////////////////////////////////////////////////////////////////////////////
// STACK and OM Module - Clipper internal stack and ClipVars management //
////////////////////////////////////////////////////////////////////////////

// it stores the return value of a function // return ...


extern PCLIPVAR _eval;

// _lbase + 1 --> Self from within Methods ! Reach it with _par...( 0, ... ) !
// _lbase + 2 --> First parameter
// _lbase + 3 --> Second parameter
// ...
extern PCLIPVAR _lbase; // LOCAL BASE

// statics
extern PCLIPVAR _sbase; // STATIC BASE

// Clipper Stack tos = TO S tack


extern PCLIPVAR _tos;

// They automatically update _tos.


extern void _PutC( LPSTR szText );
extern void _PutCL( LPSTR szText, WORD wLen );
extern void _PutQ( WORD wNumber );
extern void _PutLN( LONG lNumber );
extern void _PutL( BOOL );

// Places any CLIPVAR at Clipper Stack. Pass ClipVars by value.


// Automatically updates _tos
extern void _xPushM( LPCLIPVAR );

// calling Clipper from C


extern void _PutSym( PCLIPSYMBOL );
// ( ++_tos )->wType = NIL; <-- We place nil at Self !!!

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


// we place other params with _Put...
extern void _xDo( WORD wParams );

// executing CodeBlocks

// _PutSym( _symEVAL );
extern void _xEval( WORD wNumberOfParameters );

// eval a codeblock with no params


extern void _cEval0( PCLIPVAR CodeBlock ); // evalua codeblock sin parametros.
extern void _cEval1( PCLIPVAR CodeBlock, PCLIPVAR Param1 ); // idem con un
par.metro.
// same but with one param

extern PCLIPVAR _GetGrip( PCLIPVAR ); // allocates new clipvar in high stack


pos.
extern void _DropGrip( PCLIPVAR ); // free it.

// Returns pointer to _lbase of calls stack, 0->this, 1->previous, ...


extern PCLIPVAR _ActInfo( WORD wIndex );

extern WORD _sptoq( PCLIPVAR ); // Returns the value of a number placed at


_tos
// By value or by ref as WORD
extern LONG _sptol( PCLIPVAR ); // IDEM as LONG

// Copy wBytes from Source to Destination


extern void _bcopy( LPBYTE pDest, LPBYTE pSource, WORD wBytes );

// Inicializes wLen Bytes with the value wValue


extern void _bset( LPBYTE pStart, WORD wValue, WORD wLen );

// Retrieves an element of an array


extern void _cAt( PCLIPVAR vArray, WORD wIndex, WORD wFlag, PCLIPVAR vDest );

// Changes an element of an array


extern void _cAtPut( PCLIPVAR vArray, WORD wIndex, PCLIPVAR vSource );

// Stores a String into an array element


extern void _cAtPutStr( PCLIPVAR vArray, WORD wIndex, LPSTR szString,
WORD wStrLen );

// Strings
// Creates a new String. Stores a CLIPVAR at _eval
extern void pascal _BYTESNEW( WORD wLenBytes );

// Locks a CLIPVAR String to access its bytes


// if need unlock returns TRUE
extern BOOL pascal _VSTRLOCK( PCLIPVAR vString );

// Gets the LPSTR of the String. It must be locked before with _VSTRLOCK
extern LPSTR pascal _VSTR( PCLIPVAR vString );

// UnLocks the String


extern void pascal _VSTRUNLOCK( PCLIPVAR vString );

#ifndef __FLAT__
#ifndef _BC5
WORD strlen( LPSTR szText );

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


void strcpy( LPBYTE lpTarget, LPBYTE lpSource );
BOOL strcmp( LPSTR szString1, LPSTR szString2 );
LPBYTE strcat( LPBYTE lpTarget, LPBYTE lpSource );
#endif
#endif

LPSTR _StrScan( LPSTR szSearchAt, LPSTR szSearchFor );

// Arrays
// Retrieves the Len of an array
extern WORD pascal _VARRAYLEN( PCLIPVAR vArray );

// Creates and returns an Array in _eval


extern void pascal _ARRAYNEW( WORD wLen );

// Add a new element to an array


// _tos + 1 --> array
// _tos + 2 --> element
// _tos must be incremented
extern void pascal __AADD( void );

// Resizes an Array
// Parameters must be placed usign _tos
// pcount must be updated
extern void pascal ASIZE( void );

// Retrieves the Symbol of a String


extern PCLIPSYMBOL _Get_Sym( LPSTR szName );
extern PCLIPSYMBOL _Chk_Sym( LPSTR szName );

////////////////////////////////////////////////////////
// SEND Module - OOPS Management !
////////////////////////////////////////////////////////

// Creates a new Class


LONG _mdCreate( WORD wMethods, PCLIPSYMBOL pClassName );

// Adds a new Method to a ClassH


extern _mdAdd( LONG lClassHandle, PCLIPSYMBOL pMethodName, PCLIPFUNC pMethod );

// Gets the function address of a method


// Message info must be placed at ( _lbase + 0 )->pMsg
// Self must be placed at _lbase + 1
extern PCLIPFUNC _isendp( void );

// Retrieves the ClassH of an Object


extern LONG _VDict( PCLIPVAR );

// Changes the ClassH of an Object or Array


extern void _VSetDict( PCLIPVAR, LONG lClassHandle );

void _xSend( WORD wNumberOfParameters ); // The missing xSend function

#define INSTVAR(Name,pCode) _mdAdd(ulHandle,_get_sym(Name),pCode);


_mdAdd(ulHandle,_get_sym("_"Name),pCode)
#define METHOD(Name,pCode) _mdAdd(ulHandle,_get_sym(Name),pCode)

/*********************************************************/
// executes a CodeBlock
// lbase + 1 --> CodeBlock
// lbase + 2 --> First parameter

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


// lbase + 3 --> ...
// _pcount --> Number of parameters
// extern void _ixblock( void ); // NO DEBE USARSE SIN guardar y preparar
// las variables de estado de plankton.

// IT MAY NOT BE USED without saving and


// preparing plakton state variables
// Memory Management
// Alloc wBytes (fixed .?)
extern LPBYTE _AllocF( WORD wBytes );

//////////////////////////////////////////////
// EVENT Module - Clipper internally is event-driven !!!
//////////////////////////////////////////////

typedef struct
{
WORD wDymmy;
WORD wMessage;
} EVENT;

typedef EVENT * PEVENT;

typedef WORD ( far * EVENTFUNCP ) ( PEVENT pEvent );

// Register a new Event Handler


extern WORD _evRegReceiverFunc( EVENTFUNCP pFunc, WORD wType );

extern void _evDeRegReceiver( WORD wHandlerOrder );

extern void _evSendId( WORD wMessage, WORD wHandlerOrder ); // 0xFFFF a Todos


extern WORD _evRegType( DWORD, DWORD, WORD );
extern void _evPostId( WORD evId, WORD wReceiverHandle );

extern void _Break_Cycle( void );

WORD _evModalRead( void );

WORD _gtModalRead( void );

extern void ( * _evKbdEntry )( PEVENT pEvent );

///////////////////////////////////////////////////////////
// BEEP Module - Terminal Driver Module
///////////////////////////////////////////////////////////

void _beep_( void );

///////////////////////////////////////////////////////////
// DYNC Module - Dynamic Linking Modules
///////////////////////////////////////////////////////////

typedef struct
{
WORD AX, BX, CX, DX;
} DLM_PARAMS;

typedef DLM_PARAMS * PDLM_PARAMS;

typedef WORD ( far * DLMSERVER )( PDLM_PARAMS pParams, WORD wService );


typedef DLMSERVER * PDLMSERVER;

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


void _DynLoadModule( PWORD pHandle, LPSTR szModule );
WORD _DynGetNamedAddr( WORD wHandle, LPSTR szEntryModule, PDLMSERVER pServer );
LONG _DynGetOrdAddr( WORD wHandle, WORD wService );

// ERROR
void _ierror( WORD wError ); // generates an internal error message and quit.

/** YO ESTAS cuatro no las pon.a **/


/** Not sure about these **/

void _CycleF( void );


WORD _osStackBase( void );
void _osAllocDefSeg( WORD*, WORD*,WORD* );
WORD _osAvail( void ); // N. de parrafos disponibles.

// TB Module
LPSTR _tbname( PCLIPVAR, WORD ); // Same as ProcName. 2. param no matter
// 1 param is _ActInfo( WORD )
// LAS "DATE"
// "DATE" ones
// gets the date at _tos, returns
extern void _year( void ); // recibe fecha en _tos, retorna
// (CLV_LONG) a.o en _tos
// (CLV_LONG) year at _tos
extern void _month( void ); // idem.
extern void _day( void ); // idem.

/*****

CLIPPER MiYear()
{
// copiamos el VITEM Fecha en la primera posici.n libre
// del STACK.

// we copy the date VITEM at the STACK first free position

_bcopy( ( FARP ) ( ++tos ),


( FARP ) _param( 1, DATE ),
sizeof( CLIPVAR ) );

_year();

// copiamos retorno en _eval y realineamos el STACK.


// we copy the return at _eval and realign the STACK

_bcopy( ( FARP ) _eval,


( FARP ) ( _tos-- ),
sizeof( CLIPVAR ) );

}
*****/

// TERM

void pascal QOUT( void );

#endif

// Nuevas para Windows


// New for Windows

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


WORD GetWndApp( void ); // Devuelve Handle Objeto ventana principal
// retrieves Main Object Window handle

--------------------------------------------------------------------------------
WinTen.h To avoid conflicts with Windows API Pascal names
--------------------------------------------------------------------------------
#ifndef _WINTEN_H
#define _WINTEN_H

#ifndef __FLAT__

// WinTen.h - Is to avoid conflicts between Clipper and Windows API


// functions with names of 10 characters or less.

// If you are going to develop some new C function to conect the API,
// check that it is here, if length 10 characters or less, and include
// it here if not

#define AbortDoc _AbortDoc


#define AddAtom _AddAtom
#define AnsiToOem _AnsiToOem
#define AnsiLower _AnsiLower
#define AnsiUpper _AnsiUpper
#define Arc _Arc
#define AppendMenu _AppendMenu
#define BeginPaint _BeginPaint
#define BitBlt _BitBlt
#define ChooseFont _ChooseFont
#define Chord _Chord
#define ClassFirst _ClassFirst
#define ClassNext _ClassNext
#define CloseComm _CloseComm
#define CreateDC _CreateDC
#define CreateFont _CreateFont
#define CreateIC _CreateIC
#define CreateIcon _CreateIcon
#define CreateMenu _CreateMenu
#define CreatePen _CreatePen
#define DdeConnect _DdeConnect
#define DdeGetData _DdeGetData
#define DeleteDC _DeleteDC
#define DeleteAtom _DeleteAtom
#define DeleteMenu _DeleteMenu
#define DialogBox _DialogBox
#define Dos3Call _Dos3Call
#define DPtoLP _DPtoLP
#define DragFinish _DragFinish
#define DrawIcon _DrawIcon
#define DrawText _DrawText
#define Ellipse _Ellipse
#define EndDialog _EndDialog
#define EndDoc _EndDoc
#define EndPage _EndPage
#define EndPaint _EndPaint
#define Escape _Escape
#define ExtTextOut _ExtTextOut
#define FillRect _FillRect
#define FindAtom _FindAtom
#define FindText _FindText
#define FindWindow _FindWindow

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define FloodFill _FloodFill
#define FlushComm _FlushComm
#define FrameRect _FrameRect
#define FrameRgn _FrameRgn
#define GetBkColor _GetBkColor
#define GetBkMode _GetBkMode
#define GetCapture _GetCapture
#define GetCursor _GetCursor
#define GetDC _GetDC
#define GetDCEx _GetDCEx
#define GetDCOrg _GetDCOrg
#define GetDIBits _GetDIBits
#define GetDlgItem _GetDlgItem
#define GetFocus _GetFocus
#define GetMapMode _GetMapMode
#define GetMenu _GetMenu
#define GetMessage _GetMessage
#define GetObject _GetObject
#define GetParent _GetParent
#define GetPixel _GetPixel
#define GetProp _GetProp
#define GetROP2 _GetROP2
#define GetSubMenu _GetSubMenu
#define GetVersion _GetVersion
#define GetWindow _GetWindow
#define GlobalFix _GlobalFix
#define GlobalFree _GlobalFree
#define GlobalLock _GlobalLock
#define GlobalNext _GlobalNext
#define GlobalSize _GlobalSize
#define HideCaret _HideCaret
#define hmemcpy _hmemcpy
#define InsertMenu _InsertMenu
#define InvertRect _InvertRect
#define InvertRgn _InvertRgn
#define IsChild _IsChild
#define IsIconic _IsIconic
#define IsMenu IsMenu_3_1 // _IsMenu
#define IsTask _IsTask
#define IsWindow _IsWindow
#define IsZoomed _IsZoomed
#define KillTimer _KillTimer
#define LineTo _LineTo
#define LoadBitmap _LoadBitmap
#define LoadCursor _LoadCursor
#define LoadIcon _LoadIcon
#define LoadMenu _LoadMenu
#define LoadModule _LoadModule
#define LoadString _LoadString
#define LocalAlloc _LocalAlloc
#define LocalFirst _LocalFirst
#define LocalInfo _LocalInfo
#define LocalInit _LocalInit
#define LocalNext _LocalNext
#define LPtoDP _LPtoDP
#define LZClose _LZClose
#define LZCopy _LZCopy
#define LZOpenFile _LZOpenFile
#define MAPILogoff _MAPILogoff
#define MAPILogon _MAPILogon
#define MemoryRead _MemoryRead

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define MessageBox _MessageBox
#define mmioClose _mmioClose
#define mmioOpen _mmioOpen
#define mmioRead _mmioRead
#define mmioSeek _mmioSeek
#define ModifyMenu _ModifyMenu
#define ModuleNext _ModuleNext
#define MoveTo _MoveTo
#define MoveWindow _MoveWindow
#define OemToAnsi _OemToAnsi
#define OpenComm _OpenComm
#define OpenIcon _OpenIcon
#define OpenFile _OpenFile
#define Pie _Pie
#define Polygon _Polygon
#define Polyline _Polyline
#define PrintDlg _PrintDlg
#define PtInRect _PtInRect
#define ReadComm _ReadComm
#define Rectangle _Rectangle
#define RegEnumKey _RegEnumKey
#define RegOpenKey _RegOpenKey
#define ReleaseDC _ReleaseDC
#define RemoveProp _RemoveProp
#define RemoveMenu _RemoveMenu
#define RestoreDC _RestoreDC
#define ResetDC _ResetDC
#define RoundRect _RoundRect
#define SaveDC _SaveDC
#define SetBkColor _SetBkColor
#define SetBkMode _SetBkMode
#define SetCapture _SetCapture
#define SetCursor _SetCursor
#define SetFocus _SetFocus
#define SetMapMode _SetMapMode
#define SetMenu _SetMenu
#define SetParent _SetParent
#define SetPixel _SetPixel
#define SetProp _SetProp
#define SetROP2 _SetROP2
#define SetTimer _SetTimer
#define ShellAbout _ShellAbout
#define ShowCaret _ShowCaret
#define ShowCursor _ShowCursor
#define ShowWindow _ShowWindow
#define SpoolFile _SpoolFile
#define StartDoc _StartDoc
#define StartPage _StartPage
#define StretchBlt _StretchBlt
#define TaskFirst _TaskFirst
#define TaskNext _TaskNext
#define TaskSwitch _TaskSwitch
#define TextOut _TextOut
#define TimerCount _TimerCount
#define UnionRect _UnionRect
#define WinExec _WinExec
#define WriteComm _WriteComm
#define WinHelp _WinHelp
#define Yield _Yield
#define wsprintf WSPRINTF

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


// Borland BIVBX10 Support

#define VBXMethod _VBXMethod


#define VBXInit _VBXInit
#define VBXTerm _VBXTerm
#define VBXSetProp _VBXSetProp
#define VBXGetProp _VBXGetProp
#define VBXLoadVBX _VBXLoadVBX
#define VBXSetMode _VBXSetMode
#define VBXHelp _VBXHelp
#define VBXCreate _VBXCreate
#define VBXGetHctl _VBXGetHctl
#define VBXGetHwnd _VBXGetHwnd

// ODBC Support

#define SQLGetData _SQLGetData


#define SQLExecute _SQLExecute
#define SQLError _SQLError
#define SQLBindCol _SQLBindCol
#define SQLPutData _SQLPutData
#define SQLFreeEnv _SQLFreeEnv
#define ConnectDlg _ConnectDlg
#define SQLCancel _SQLCancel
#define SQLGetInfo _SQLGetInfo
#define SQLPrepare _SQLPrepare
#define SQLConnect _SQLConnect
#define SQLTables _SQLTables
#define SQLFetch _SQLFetch
#define SQLColumns _SQLColumns
#define SQLSetPos _SQLSetPos

// ZIP management

#define IsZip _IsZip


#define UnzipFile _UnzipFile

// WinSock management

#define WSAStartup _WSAStartup


#define WSACleanup _WSACleanup
#define accept _accept
#define htons _htons
#define socket _socket
#define bind _bind
#define htonl _htonl
#define inet_addr _inet_addr
#define inet_ntoa _inet_ntoa
#define listen _listen
#define recv _recv
#define send _send
#define connect _connect
#define setsockopt _setsockopt
#define select _select

// OLE2 Management

#define OleDraw _OleDraw


#define OleRun _OleRun
#define OleCreate _OleCreate
#define DbgLogOpen _DbgLogOpen

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com


#define OleSave _OleSave
#define DispInvoke _DispInvoke

#endif
#endif

--------------------------------------------------------------------------------

PDF Creator - PDF4Free v2.0 http://www.pdf4free.com

You might also like