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

Manual Do FiveWin

  • Upload
    davirev

  • View
    990

  • Download
    7

Embed Size (px)

Citation preview

Page 1: Manual Do FiveWin

• FiveWin 1.9.2 - January 97 - Norton Guide

• Programming

1. FiveWin Programming Guide

• Reference

1. FiveWin Reference Guide

• About...1. Developers2. Tech Support3. Distribution4. Register Process5. WhatsNew

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

Page 2: Manual Do FiveWin

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

0. Organizing your working desktop0.1 Installing the software .0.2 Required tools .0.3 Dos coding and Windows testing .

1. The components of a Windows application1.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 Management2.1 What are resources ? .2.2 EXE resources vs. DLL resources .2.3 Multimedia applications .

3. DataBases Management3.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 Management4.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. Printing5.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. Debugging6.1 Using the FiveWin debugger .6.2 Debugging techniques .6.3 Low level debugging techniques .

7. Documenting7.1 Developing Windows Help files .7.2 Managing HLP files from your applications .

8. Windows advanced8.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

Page 3: Manual Do FiveWin

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

9. Object Oriented Programming in FiveWin9.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 applications10.1 Developing an installation program .

11. InterNet development11.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 bedivided 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 aseparate .DLL file or even inside the EXE file. Thosepieces, let's call them resources, can be managed and changedexternally from the program. This is probably the most importantreason for the birth of what is called "Visual Programming".

"Visual Programming" is mainly about resources. The programmer maydraw resources using the mouse and certain design programs. In thenext stage, those resources get related to some behaviors. From thatmoment you are building, and using, Objects!

FiveWin has been designed to obtain high performance from Windowsresources. FiveWin proposes a way of programming based on resourceusage. We are convinced that drawing screens and other resourcesis the easiest and quickest way to develop a program. Thanks to thistechnology you can easily build 'Data-driven' programs. This means thatyour user interface is based on external and modifiable data. You caneasily modify a screen and use it without having to recompile or relink.

The most important part of this process is to understand how to buildan Object from a resource, and how to define -redefine- itsbehaviors. 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 Objectwith 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

Page 4: Manual Do FiveWin

2. DEFINE <ObjectClass> <ObjectName>

This is the main way of building an Object in xBase. The Objectis 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 isgoing 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 alreadycreated in the resource, but you need a way to modify and defineits behaviors. This is why the REDEFINE command is going to bethe most important command to modify behaviors in xBase.

Once you have redefined its behaviors, the Object will be activatedusing 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 containscertain controls. To activate those controls it is not necessaryto use the command ACTIVATE ... for each of them. It is enough toACTIVATE the container Object.

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

1. You need a resource designer. We like to use Borland'sResource WorkShop. This designer comes with Borland's productsfor Windows, such as C++ and Turbo Pascal. You should contactBorland or a software distributor and get one! You'll thank us!

2. Using that designer you may start drawing the different screensof 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 storeyour screens in. (make a copy for every new project). You should tellthe resource editor to 'open' and use that DLL. Select open fileand 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 shouldspecify a unique identifier, a number, for each element of a screen.This number will be used by the REDEFINE command to tell FiveWin whichObject you are using.

Practice with your resource editor to understand it and to becomefamiliar with its usage.

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

#include 'FiveWin.ch'

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

Page 5: Manual Do FiveWin

SET RESOURCES TO <DLLFileName>

And when you are about to end the execution of your program, youshould 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 youhave to do is the following:

function TestDialogBox()

local oDlglocal 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 (CommandButtons). From the resource editor we have assigned a value of 110 to theGET 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 thiscommand. As an example, BUTTON has the clause ACTION to let usspecify what the Object will do when the button is pressed.

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

When you get used to this system you will understand that it is theeasiest 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 file2.- Inside an external DLL

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

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

Page 6: Manual Do FiveWin

1.- The biggest benefit of storing an .RC file (using Microsoftresource 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 alsothat under any source code or resources modification you willmake 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 allthose #define's and the resource editor let you use it when modifyingthe .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, automaticallywill call RC.EXE if detects a file with extension .RC with the samename 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 yourapplication if you take this route, because your EXE file alreadyknows how to locate the resources inside itself.

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

2.- The big benefit of storing resources inside a DLL is thatyou may really have Data Driven DialogBoxes, because if you modifythe DLL resources (using your resource editor) there will be noneed to recompile again your EXE! This may be a great advantagewhen developing very large applications.

We provide an empty DLL to be copied when you develop a new applicationas 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

Page 7: Manual Do FiveWin

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 youdecide to put your resources inside your app (using .RC and RC.EXE)there is no need to specify SET RESOURCES TO... as the .EXE alreadyhas all them inside.

The great disadvantage of this system is that you are not allowedto use labels if you use a DLL to store resources ! Neither Borlandresource editor nor Microsoft let you use a .CH or .H file whereyou 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 ofthem and decide by yourself which system suits better your needs.

2.3 Multimedia applications--------------------------------------------------------------------------------

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

FiveWin offers all the necessary extensions to develop sophisticatedmultimedia applications. Here we are going to see how to use sound, visionand how to manipulate any external device we may find useful. Also,we are going to explain some techniques that conveniently used will let usmake 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 personvoice, a song, noises, etc... We have the following functions to reproducethem:

* 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 andlater show them again at the screen or at the printer. You may store

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

Page 8: Manual Do FiveWin

your digital images at any other file format (using some convenientDLLs libraries) but later they will be turned into Bitmaps as Windowsis the only way that knows to manipulate them. We have the followingbitmaps 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 clickthem 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 objectsee TBitmap METHOD End() )(see Functions1 section DeleteObject() full explanation)

AVI Animated video files is the way Windows stored a sequence of bitmapsmixed with audio (recorded from a video camera, cartoons, etc...). FiveWinimplements the Class TVideo to easily reproduce them. (See Class TVideofull explanation).

Windows has a powerful subsystem named MCI (Media Control Interface) thatlets 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 isto check if it is MCI compatible. FiveWin implements the Class TMCI toeasily manage any kind of MCI compatible device (See Class TMCI fullexplanation).

To finally make your application look in a unique way (the final userwill not recognize that he is using a Windows application) there are someeasy techniques that could be used. You can easily avoid using a framein your main window, so there will not be a visible caption and typicalWindows small pushbuttons on the corners. Basically this can be donedoing:

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 avoidingdisplay the window frame and related buttons.

Multimedia applications open a wide range of possibilities where onlyyour imagination and your Windows expertise are the limits. Once you startpractising with these concepts you will easily recognize these elementson most existing Multimedia applications, and you will start incorporatingthem in your own FiveWin apps.

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

Page 9: Manual Do FiveWin

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

FiveWin imposes no restriction at all to your current DataBase designsand techniques acquired in MsDos. You may feel free to continueworking as you normally do with DataBases.

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

1.- By default any Windows task is given a maximum of 20 filesopened at the same time. In order to have the same conditions as wehave in MsDos you have to use the SetHandleCount() function thatFiveWin supplies:

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

If your application is going to manage 40 files at the same time, youwill have to do at the beginning of your application:

SetHandleCount( 40 )

Remember that DBFs that use memos also open an associated file DBT, andalso remember that normally when Windows is printing it opens sometemporary files (also FiveWin opens some more when doing PREVIEWs ofprinting works). If you get an error it may be that there are notenough 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 applicationsfor you will consume a lot of memory resources!

2.- If you are working with NonModal designs, the same DataBase mayget opened several times at the same time! By the same user! Clipperallows this but, in fact, your application is acting like an applicationfor 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 loadingWindows, this is a MUST! If you are using Windows 3.11 or Windows 95(pre-releases versions) this is no needed as these new versionsautomatically load SHARE.EXE when starting.

Converting an application for working in a NetWork is quite easy.Review this documentation for our recommendations and guidance forNetWork programming. Don't worry if you have never code a multi-userapplication. It is really easy!

3.- FiveWin offers you a powerful DataBase Class that in fact savesyou a lot of tedious work. Just give a little of your time to understandthe FiveWin DataBase Class and you will save a lot of your precioustime!

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 than5.2 d) you may have serious troubles working with some CA-ClipperRDDs. Some of them cause big problems in MsDos but in Windows theymay crash your system. DbfCdx is not working properly even in version

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

Page 10: Manual Do FiveWin

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 lotof 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 reducingthe size of your code when you have to manipulate a DBF. They simplify verymuch all the work required to work with DataBases and they are totallycompatible 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 theData, 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 thissentence you write:

local oDbf

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

DATABASE oDbf

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

The DataBase object will have as DATA the name of the fields of yourDBF. 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 LOCALvariables as buffers where they manipulate the DBF values, and laterthey save the contents to the real DBF. This is a must if you arecoding for NetWorking, as you can not manipulate the fields directlywhen you are sharing a DataBase (you have to lock, replace and thenunlock).

Another alternative used by Clipper programmers is to use an arrayas a buffer, where they load the initial DBF values, then they aremanipulated and later they are saved to disk. Normally those operationsare named Scatter() and Gather(). The disadvantage of using arraysis that you can not use your fields names directly, instead you haveto define labels (#defines) with the risk of altering those sequencesand generating errors.

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

Page 11: Manual Do FiveWin

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

In fact, the DataBase object keeps internally an array, in the sameway as you would use an array for a buffer, but with the benefit thatnow 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 youcan not use fields names with 10 characters, as in Clipper OOPSwhen you are assigning a DATA, Clipper internally places an underscoreat 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 thenyou 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 FiveWinDataBase object.

Enjoy DataBase objects, they are extremely powerful and saves youfrom a lot of work! And they are 100% compatible with your existingcode !!!

DataBases and Non-Modal programming--------------------------------------------------------------------------------

If you choose to develop your application using a Non-modal style you maybe 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 theclause 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 windowmay be opened several times! Or if a DialogBox is editing a certainDatabase, 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 windowopens several times (at the same time) the same DataBase it will bethe same situation as if different users were being opening severaltimes those Databases on a NetWork.

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

Page 12: Manual Do FiveWin

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 ondifferent alias, you HAVE to specify different ALIAS:

USE Customer ALIAS Cust1 NEWUSE 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 itemin this documentation we explain the foundation for doing NetWorkcoding 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 youspecify '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 NetWorkmay use it, or several non-modal MdiChild windows or Non-modal DialogBoxesmay access the DataBase info at the same time.

3. You can not manipulate the contents of a field directly. Beforereplacing the value of a field you have to lock the record. Basically thisis the typical procedure:

if MyAlias->( RLock() ) // Lock the recordMyAlias->Field := <NewValue> // Modify the contentsMyAlias->( DbUnLock() ) // UnLock the record

elseMsgAlert( "The DataBase is in use now! Try again!" )

endif

4. Some Database operations (as building an entire INDEX) mayrequire that you open a DataBase in EXCLUSIVE mode or that you lockthe entire Database, not just a record.

Use USE ... EXCLUSIVE to open a DataBase as exclusive or use thefunction FLock() to entirely lock a file.

5. Get yourself some book about NetWork coding for learningadvanced tips and tricks! You will become a NetWork programming masterpretty soon!

4.1 FiveWin own TWBrowse class--------------------------------------------------------------------------------

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

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

Page 13: Manual Do FiveWin

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

FiveWin TWBrowse does not work with column objects, instead of those, itholds an codeblock (DATA bLine) which returns an array. The contents ofthis array is used to display each visible column content. This makes animportant difference: Lets suppose we have a 10 columns browse, whichalso has 25 rows on the screen. If we were working with traditional browseto 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 littlethe way you are used to work with browsers. The main idea is that DATA bLineholds a codeblock that returns an array:

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

The second difference is that being in a graphical environment our userswanted to also show bitmaps (graphics) as browse elements. How could wedistinct from normal data and bitmaps handles ? The solution was that acharacter string holds normal data, and numeric values are consideredbitmap handles:

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

When FiveWin TWBrowse evaluates this codeblock, it detects there is a numericvalue as an element of that array, so that number is treated as a handleof a bitmap, and it is automatically painted on its column position. Asyou can use expressions to return that numeric value, you have an easyway 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 aMsDos Clipper TBrowse. We have just used 'Hungarian notation' (we specifythe type of a DATA -instvar- preceding the DATA name) to specify the typeof each TWBrowse object DATA:

FiveWin TWBrowse Clipper MsDos TBrowse================ ====================

DATAs bGoTop GoTopBlockbGoBottom GoBottomBlockbSkip SkipBlock

nTop (in pixels) nTopnLeft " nLeftnBottom " nBottomnRight " nRight

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

Page 14: Manual Do FiveWin

nRowPos RowPosnRowCount() (METHOD) RowCountnColPos ColPos(left visible column)IsColVisible() (METHOD)

lHitTop HitToplHitBottom HitBottom

nClrText, nClrPane ColorSpecnClrBackHead, nClrForeHeadnClrBackFocus, 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) HeadingbLine (All of them) BlockaSizes (All of them) Width

Beside these, FiveWin TWBrowse offers much more built-in functionalitythat 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

Page 15: Manual Do FiveWin

SetFilter() (Index based ) "filters

Report() (Automatic Reporting) "

SetArray() (Arrays editing) "SetTree() (Trees) "

Finally, FiveWin implements easy xBase commands to build a whole browsewith just one xBase command (there is no equivalent for this in MsDosClipper 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 explanationin this manual for a full description of the above xBase commands. Rememberthat FiveWin also provides a new powerful Class TCBrowse in case that youwant to work with column objects. TCBrowse is also a fast browse, thoughnot 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 onit).

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 howwe do it.

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

Page 16: Manual Do FiveWin

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

FiveWin Browses implement a powerful feature that allows us to retrievejust a part of a DataBase similar as a FILTER, but based on Indexes whichmakes it extremely fast and efficient (Clipper SET FILTER must notbe used with medium-big DataBases). Advanced Clipper RDDs likeComix or SixDriver implements some features that allow similarresults. Anyhow we decided to keep the SELECT clause for users ofstandard Clipper.

Lets see a sample of its use: Suppose you have a clients database indexedby surname. Lets suppose that you just want to review clients whosenames 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 (itis optional) we do a SEEK of the <uValue2> when going BOTTOM: (to findthe last element to be showed). If <uValue2> is not provided then weuse the following index value to stop the records showed.

From <uValue1> to <uValue2> (if defined) we check that <cField> isincluded in that range.

In order to make this powerful clause work properly some requirementsare necessary:

* The DataBase showed on the browse ( LISTBOX ... FIELDS ... ) must beindexed and the active Key must be the same as the <uValue1> we aregoing to seek. Please check carefully the types of the index expressionand 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>. Ifexist ( If Find() ) then proceed with the browse. There are manydifferent possible default behaviors when the <uValue1> is notfound, this is why we have decided that it is your responsibilityto decide what to do if <uValue1> is not found.

FiveWin also offers a :SetFilter() method to change dynamically thecurrent SELECTion, without having to create again the DialogBox (or thewindow):

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

Sample:

The browse gets defined with:

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

Page 17: Manual Do FiveWin

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 usingit properly. Please review your code and check that all the rulesthat we show here are being observed in your code.

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

4.4 Drawing bitmaps inside browses--------------------------------------------------------------------------------

FiveWin requires that all expressions to be shown on a browse to be ofcharacter type. The reason for this is that if you specify a number weunderstand it is a handle of a bitmap so there you want to show abitmap:

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 de14 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

Page 18: Manual Do FiveWin

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, 200OF 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"

SEPARATORMENUITEM "&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

Page 19: Manual Do FiveWin

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 oDlglocal oLbxlocal aHBitMaps:= { ReadBitmap( 0, "..\bitmaps\Level1.bmp" ), ; // BitMaps de

14 x 32ReadBitmap( 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() == 0APPEND BLANK

endifINDEX ON Clientes->Nombre TO CliNameSET INDEX TO CliNameGO 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

Page 20: Manual Do FiveWin

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

// Lets use different row colorsoLbx: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 previewSIZE 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 casecase nNivel == 1

nColor = CLR_HRED

case nNivel == 2nColor = CLR_HGREEN

case nNivel == 3nColor = CLR_HBLUE

endcase

return nColor

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

static function EditClient( oLbx, lAppend )

local oDlglocal lFiveProlocal lDialoglocal lObjectslocal nNivel

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

Page 21: Manual Do FiveWin

local cNamelocal cAddresslocal cPhonelocal nAgelocal lSave := .f.local nOldRec := RecNo()

DEFAULT lAppend := .f.

if lAppendGOTO BOTTOMSKIP

endif

lFivePro = "F" $ Clientes->ProductoslDialog = "D" $ Clientes->ProductoslObjects = "O" $ Clientes->ProductosnNivel = max( 1, Clientes->Nivel )cName = Clientes->NombrecAddress = Clientes->DireccioncPhone = Clientes->TelefononAge = 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 lAppendAPPEND BLANK

endif

Clientes->Nombre := cNameClientes->Direccion := cAddressClientes->Productos := If( lFivePro, "F", "" ) + ;

If( lDialog, "D", "" ) + ;

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

Page 22: Manual Do FiveWin

If( lObjects, "O", "" )

Clientes->Nivel := nNivelClientes->Telefono := cPhoneClientes->Edad := nAge

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

else

if Empty( cName ) .and. lSaveMsgAlert( "Please write a name" )

endif

GOTO nOldRec

endif

return nil

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

static function DelClient( oLbx )

if MsgYesNo( "Are you sure to delete this record ?" )DELETEPACKoLbx: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

elseoLbx:UpStable() // Corrects same page stabilizing BugoLbx:Refresh() // Repaint the ListBox

endifendif

return nil

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

function OpenDbf()

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

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

Page 23: Manual Do FiveWin

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, oBrwlocal 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 somethingoBrw: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

Page 24: Manual Do FiveWin

return nil

4.6 Browsing everything you want--------------------------------------------------------------------------------

The major advantage of FiveWin TWBrowse (strongly based on Clipper TBrowsemodel) is the capability of browsing anything you may need.

FiveWin TWBrowse is a generic browser machine capable of browsing informationof any type, though as DataBase browsing is usually more common, we haveadded certain built-in functionality to quickly build DataBases browsers.

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

DATAs bLine It will be used to display each browse line.It must return an array with all the columnselements to represent.

bSkip Used to skip certain amount of lines. Thiscodeblock is evaluated every time the currentselected line is going to change. bSkip receivesa numeric parameter indicating the desirednumber of lines to be skipped, and it has toconfirm that number returning it, or analternative number with the real number of linesto skip:

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

nWant represent the desired number of lines toskip. nDo will indicate the final number oflines to skip.

bGoTop These codeblocks are evaluated for navigatingbGoBottom through the represented data. Properly assigned

will let you browse anything.

bLogicLen You must assign here the logical total lengthof the browse, to properly set the browsescrollbar.

As an example, lets see how we can browse an array just manipulatingthese 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 somethingoBrw:bKeyChar = { | nKey | MsgInfo( nKey ) } // Controlling keystrokes

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

Page 25: Manual Do FiveWin

5. Printing

Basic concepts about printing in Windows--------------------------------------------------------------------------------

The major difference between managing the printer in MsDos and in Windowsis 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 weare going to manage text and drawings, that we may need to preview allthat on the screen, and the most important thing: that different printersmay have different resolutions, and we have to control all that.

FiveWin automatize all these processes giving you maximum power with minimumcomplexity. FiveWin categorizes all printing works in these differenttypes:

* Quick printing techniques!* Managing the printer object* The Report Engine

Quick printing techniques!--------------------------------------------------------------------------------

Besides the sophisticated FiveWin Report Engine, FiveWin offers youRAD (rapid application development) techniques to quickly prototypeyour 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 pagedreport automatically generated from the current workarea!

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

If you do <oBrw>:Report() where <oBrw> is a reference to yourbrowse, FiveWin will generate a full report with the same contentsof your browse. So, the easiest way to implement a report in yourbrowse is placing a bitmap button on your DialogBox with theaction <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 orcontrol!

Combining these techniques you can very quickly prototype yourfirst application printouts. Don't forget them!

Remember to use these techniques on the first stages of yourapplication.

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

Page 26: Manual Do FiveWin

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 momenton we may manipulate it directly, using all the DATA and METHODs offeredby 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 thespecific 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 verticaloPrn:nHorzRes() is the number of pixels in horizontal

Now, you divide those values by the number of rows and cols that youwant 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 resolutionof 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

Page 27: Manual Do FiveWin

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 excellentwork and contribution to the FiveWin Report engine,

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

( many thanks also to Roger Seiler for his great help on documenting theFiveWin 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 thecomplete 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

Page 28: Manual Do FiveWin

[ 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 thecolumns that the report will have indicating the data and thetitle 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 thecommand, 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 themin 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 arewritten on the left side.

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

Page 29: Manual Do FiveWin

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

MULTILINE TITLES, HEADERS AND FOOTERS:

If you want more than one line for a title just put a comma betweeneach 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 thetitle or between the title and the column titles. It is up to you toput the blank lines wherever you want them. For example, if you wantto put a blank line between the header and the title, just indicate asecond 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 canuse any expression that returns a character string, remember this isthe key to do almost anything you want. For example, if you want toput the date() on the report plus the current page number, justdo 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 almostanywhere: 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 itwhen 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 enginecreates all the pages until you push the button Preview, and thenyou will immediately see the first page created.

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

Page 30: Manual Do FiveWin

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

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

USING FONTS:

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

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

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

The size (width,height) specs. use different units of measure whenprinted versus displayed on screen. On screen, the units are pixels,but when printed, the units are font "points". Thus, for printedtext, we only use the second size specification (height) to give thepoint size, leaving the "width" as "0". The point size is given asa negative number, i.e. "10 point" is "-10". Remember that pointsize for proportionally spaced type is different than "pitch," whichis the term often used for non-proportionally spaced "typewriter" typelike Courier. Point size refers to letter height, whereas pitchrefers to the number of equal-spaced letters printed per inch. Regular"pica" sized typewriter type is 10 pitch - 10 letters per inch. Butrepresented in point size, this is 12 point -- very confusing becausethe smaller "elite" typewriter type is 12 pitch - 12 letters per inch,which is 9 point. (With "pitch," the bigger the number, the smallerthe font -- just the opposite of how "point" size works.) Now to addto the confusion, remember that in this Report Engine, we let FiveWinknow that we're working with point size instead of pixels by usingnegative numbers for points (and we must use points instead of pitchfor equal-spaced fonts like Courier). In this case, the "-" signisn't mathematical -- it doesn't mean (as math rules would suggest)that your point size gets smaller as the integer gets bigger. Justthe reverse. The bigger the integer, the bigger the point size. Ifyou're still confused, there's a fellow named Guttenberg on CIS whocan 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 ifyou do not specify a font for a specific column it will use thestandard 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

Page 31: Manual Do FiveWin

As you can see, you indicate the ordinal number in the list of fontsdefined 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 witha 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

Page 32: Manual Do FiveWin

------------------------------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 anumber. 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 isgoing to be printed, left, center or right. By default, everything isleft formated except numeric data which is right.

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

MULTILINE COLUMNS:

This is something you will really love: suppose you need to putanother 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 bestway is to use multi lines for columns. That means that one databaseregister can use more than one line on the report. So we can dosomething like this:

Name Salary=================== ===========Test->First Test->SalaryTest ->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 laterhow to change this behavior.

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

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

Page 33: Manual Do FiveWin

MAKING GROUPS:

To make a group means to have a subtotal on a particular kind ofdata. With the report form you can make two groups. With other reportgenerators you can make up to 9, but with FiveWin Report Engine youhave no limit.

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

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

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 theTOTAL clause for every State and will make a page eject when theState changes.

You can even specify a Header, a Footer and a font to use for thatgroup (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 clauseSUMMARY should only be used when there is at least one group defined.

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

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

CONTROLLING THE FLOW OF THE REPORT:

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

ACTIVATE REPORT oReport ;

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

Page 34: Manual Do FiveWin

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

Because the report engine can make a report even from an array, bydefault the WHILE condition is "!Eof()". So if you change the WHILEcondition, you must take care that if you are making a report from adatabase it is a good practice to include in the WHILE condition thetext ".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 youdo with other windows.

When you activate the report you can indicate functions that will becalled 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 thecolumn titles are printed.

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

The STARTPAGE is called on every start of a page. This is one of themost 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 isprinted (not very useful).

The STARTGROUP is called on every start of a group and before theheader 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 thefollowing line will fit in the current page, and if not, it will doan Eject and start a new page. Be carefull when using STARTLINE,because if you use Multiline columns there will be at least twoSTARTLINES for each record processed.

The ENDLINE is called on every end of line of the body report. WhenENDLINE is evaluated all the line has been printed and the currentreport 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

Page 35: Manual Do FiveWin

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 asound beep when the report is finished.

IMPORTANT: Be careful when using these clauses. Remember you areinside 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 printoTitle A TRLine object which contains the report titleoHeader A TRLine object which contains the report headeroFooter A TRLine object which contains the report footeroRptWnd The related report windowoBrush An optional brush to use at the report

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

Page 36: Manual Do FiveWin

aGroups An array with all the report TRGroups objects definedaColumns An array with all the report TRColumns objects definedaFont An array with all the report TFont objects definedaCols 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 reportbFor 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 reportbChange A codeblock which holds the ON CHANGE clausecRptFile -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.cPageTotalcGrandTotalnWidth 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.nLogPixXnLogPixYnFirstdrownLastdrownTitleHeightnCounterlSummary 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

Page 37: Manual Do FiveWin

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 createdlPreview If a report preview is requiredlBreaklSpanish If Spanish language is usedlShadow If a shadow is going to be displayedlGrid If a Grid is going to be displayedCargo 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-------------------------------------------------------------------------------

DATAoReport 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

Page 38: Manual Do FiveWin

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, RIGHTnPen The Report pen elements to uselTotal If the column has totallShadow If the column has to be filled with a shadow backgroundlGrid If the column has to be bordered with lines-------------------------------------------------------------------------------

METHODSNew 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.nCounterlEject 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

Page 39: Manual Do FiveWin

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, RIGHTnCol 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 specifyingthe 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 theuser the ability to preview and interactively select what to print or tocancel the printout work.

FiveWin uses standard Windows Metafiles files to store each of theprintout pages. In order to manage those metafiles, FiveWin looks forthe temporary directory on your system. Remember to set a TEMP directoryon 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 operationsare managed automatically by FiveWin.

8. Windows advanced8.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

Page 40: Manual Do FiveWin

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 RunTimeby its own name! See DllCall.prg example.

<FuncName> The name of the DLL function. Remember Clipper only uses10 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 4DOUBLE 8

<DllName> Name of the DLL.

We recommend to develop a C language based connection functions when youare going to develop an intensively work with some DLLs. See "usingWindows 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

Page 41: Manual Do FiveWin

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 symbolswith 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 alot of examples of doing this.

Warning: SndPlaySound() is already built inside FiveWin.lib. It has beenused 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

Page 42: Manual Do FiveWin

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

Page 43: Manual Do FiveWin

//----------------------------------------------------------------------------//// 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 10FreeLibrary( hDll )

nextendif

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 thatuses shared memory to exchange data between applications. Applications canuse DDE for one-time data transfers and for ongoing exchanges in which theapplications send updates to one another as new data becomes available.

Dynamic data exchange differs from the clipboard data-transfer mechanismthat is also part of the Windows operating system. One difference is thatthe clipboard is almost always used as a one-time response to a specificaction by the user--such as choosing the Paste command from a menu. AlthoughDDE may also be initiated by a user, it typically continues without theuser's further involvement.

FiveWin implements two Classes TDDEMLServer and TDDEMLClient to easilymanage 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

Page 44: Manual Do FiveWin

[ 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

Page 45: Manual Do FiveWin

bAction Action to be performedbEnd 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 codeActivate 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 sessionhConv A handle of the DDEML conversationcService The name of the servicehService The handle of the servicelConnecting If the server is in the process of connecting with a ClienthSz2 Some processes require to hold a hSZ2 handle stored hereaClients An array with all the attended ClientsbOnConnect The action to perform when connecting to a clientbOnRequest The action to perform on a client requestbOnDisconnect The action to perform when a client disconnectsbOnExecute The action to perform on a Client Execute command

METHODs--------------------------------------------------------------------------------New Constructor METHODConnect Automatically called when a Client wants to connectConnectConfirm Automatically called when a Client has finally connectedDisconnect Automatically called when a Client has disconnectedExecute Automatically called when a Client has sent a commandRequest Automatically called when a Client has done a requestReturn Use this method to return data to a Client Request

Class TDDEMLClient DDEML Client Object management--------------------------------------------------------------------------------

DATAs--------------------------------------------------------------------------------hInst A handle of the DDEML instance sessionhConv A handle of the DDEML conversationcService The name of the servicehService The handle of the servicecTopic The name of the topic to keep the conversation abouthTopic The handle of the topicnTimeOut The timeout to wait for an answer. Default 1000. Use -1 forASync.

METHODs--------------------------------------------------------------------------------New Constructor METHODConnect To connect to a ServerDisconnect To disconnect from the Server

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

Page 46: Manual Do FiveWin

End Disconnects from the Server. Same as aboveExecute 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 == niloServer = 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

Page 47: Manual Do FiveWin

//----------------------------------------------------------------------------//// 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!" )

elseMsgInfo( "Cannot connect to server" )

endif

endif

return nil

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

function RequestData()

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

Page 48: Manual Do FiveWin

local n

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

nextSysRefresh()

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 exchangingmail.

// 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

Page 49: Manual Do FiveWin

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

Page 50: Manual Do FiveWin

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 DataBasesfrom any Windows application. You may think about ODBC as we think aboutthe Clipper RDD system.

Clipper RDD system -replaceable Data drivers- is an open architectureto be used in Clipper applications. Just for Clipper.

Windows ODBC system -Open DataBase connectivity- is an open architectureto be used in ALL Windows applications.

As Clipper has an internal engine to support all RDD connections, likewiseODBC has a common engine (in ODBC.DLL) which lets all ODBC drivers connecteasily, using the same way.

ODBC is supported through a little DLL -about 40 Ks- that serves as aninterface 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 toworry about it as we know that it will always be used in the sameway. ODBC lets Windows applications use any kind of DataBases in thesame way!

FiveWin encapsulates this process and offers you a powerful xBaseand 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 ofFiveWin, managing ODBC will be as easy as:

USE "MyDataBase" VIA "ODBC"

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

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

Page 51: Manual Do FiveWin

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 workquite well, we believe from our experience and conversations with FiveWinusers that ODBC it is not at all as easy and fast as CA-Clipper standardDataBase management power (especially if you use the SixDriver or Comix!).

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

There are some circumstances where using ODBC may be extremely useful.We think FiveWin ODBC capabilities are really useful by offeringdownsizing to companies. Imagine a company which uses DataBases thatcan be accessed through ODBC. You can take your CA-Clipper andFiveWin and convert those DataBases into standard CA-Clipper DBFs andindexes (managed with your RDDs). This is a good opportunity for you togain 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 thesecircumstances remember not all ODBC drivers are as powerful asClipper, and you will discover, possibly a big surprise, that sometimesyour 'normal' Clipper processes can not be performed in ODBC!

We have not covered all the possibilities and situations in FiveWin ODBCthat you may face when trying to manage ODBC drivers. However we have offeredan open architecture which you may use and extend to suit your particularneeds.

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

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

SQL means Structured Query Language, and in some aspects it is verysimilar 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 levelSQL - Level 1SQL - Level 2

The core level is the most basic and standard system. All ODBC driversaccept most of SQL core level rules. Level1 and Level2 offer morepowerful capabilities. The first thing you need to identify when usingan ODBC driver is exactly at which level it operates. ODBC drivermanufacturers may provide an extensive documentation and samples.

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

Page 52: Manual Do FiveWin

Some drivers DON'T accept all ODBC capabilities. Carefully review yourODBC 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 avery easy way.

How do I use ODBC ?--------------------------------------------------------------------------------

First, the most important thing you have to do is to properly configureODBC used in Windows.

ODBC drivers and Windows MUST be properly configured at the USER levelto function correctly. You can not develop an ODBC application thatwill 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 toknow exactly, in advance, which DataBases are going to be used throughODBC, where they are and what drivers will they use.

There is a ODBC xBase driver, provided by Microsoft but it is notAT 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

Page 53: Manual Do FiveWin

<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, whichnormally includes the <cName>, <cPassword>, and otherextra required information.

<cCommand> A character string which holds the ODBC statement toexecute.

CLAUSES

FROM USER Means that we want to select interactively the DataBaseto 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, whichnormally includes the <cName>, <cPassword>, and otherextra required information.

<cCommand> A character string which holds the ODBC statement toexecute.

CLAUSES

FROM USER Means that we want to select interactively the DataBaseto use.

Class TDbOdbc ODBC DataBase management--------------------------------------------------------------------------------

FiveWin implements the Class TDbOdbc to simulate the xBase managementstyle on any ODBC used table.

DATAs

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

Page 54: Manual Do FiveWin

--------------------------------------------------------------------------------hStmt The handle of the SQL statement to process.oOdbc A reference to the related TOdbc session objectaFields Array containing all the DataBase fields descriptionnRetCode Returned code from the latest operationcLastComm The latest executed SQL command

METHODs--------------------------------------------------------------------------------New Constructor from source codeEnd Ends control and make it disappearCancel Cancels the current in process SQL statementExecute Execute an SQL statementGetCurName Gets the current assigned cursor nameGetOptionsInitFields Loads all DataBase fields descriptions into ::aFieldsLastCommand Last executed commandLastError Retrieves the last errorFieldGet Retrieves the contents of a fieldFieldGetBlob Retrieves the contents of a BLOB field into a disk fileFieldName Retrieves the name of a fieldFieldType Retrieves the type of a fieldFieldLen Retrieves the len of a fieldFieldDec Retrieves the number of decimals of a fieldParamDataPrepare Prepares a SQL command so next time won't be parsed againPutData Changes the current cursor pointed table valuesRowCount Retrieves the number of fields of the DataBaseSetCurName Sets a name for the cursor in useSetOptions Set several SQL optionsSetParam Sets a param description for next SQL statementSkip 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

Page 55: Manual Do FiveWin

return nil

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

function BuildMenu()

local oMenu

MENU oMenuMENUITEM "Use &ODBC" ACTION TestOdbc()

ENDMENU

return oMenu

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

function TestOdbc()

local oDbc, oDlglocal 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 therelated event codeblock you are looking for.

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

Page 56: Manual Do FiveWin

TWindow ClassbInit Code Block to execute on initializationbMoved Code Block to execute after moving the windowbLClicked Code Block to execute when left clicking the mousebKeyDown Code Block to execute when pressing a keybPainted Code Block to execute when painting the WindowbRClicked Code Block to execute when right clicking the mousebResized Code Block to execute after resizing a WindowbLDblClick Code Block to execute when left double clicking the mousebWhen Code Block for WHEN clausebValid Code Block for VALID clausebKeyChar Code Block to execute when pressing a no-control keybMMoved Code Block to execute when moving the mousebGotFocus Code Block to execute when receiving the focusbLostFocus Code Block to execute when losing the focus

TWBrowse ClassbSkip 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 ClassbInit 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 theDGroup of your application. A new ErrorSysW.prg uses thesefunctions to analize your DG memory and help you in properly finetune it.

Basically there are two main rules:

1. Reduce the amount of static variables used in your app. Thisis very easy just using a static array instead of severalvariables:

static onestatic twostatic three

change them into

static aVars := {,,}

where

#define ONE aVars[ 1 ]

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

Page 57: Manual Do FiveWin

#define TWO aVars[ 2 ]etc...

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

2. There is a powerfull utility named DGPIG (it can be foundon the CA-Clipper forum) produced by Michael Devore (CauseWay)that analizes LIBs and OBJs and reports about DG consume. ClipperOBJs consume 8 bytes which it is normal and can not be fixed. Butthe problem normally comes from C language modules. There are manyways why a C module can consume DG space. Normally for declaringa literal inside the C code or cause declaring a static array.This both problems can be fixed using the C clause 'far' thatforces 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 waystatic byte Buffer[200];

//right waystatic 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 youthis initial size), and the less Clipper static variables youmanage, 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 andMultiGets from source code ( @ ..., ... GET ... ), so we have been ableto successfully reduce the LNK (or DEF) file HeapSize value down to1024 bytes and the applications are working successfully. This was notpossible before as Gets and MultiGets used that area for internal working.Doing this HeapSize reduction you will get an extra 7,5 Ks for yourClipper stack!

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

Page 58: Manual Do FiveWin

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

If you have some experience with Object Oriented Programming (OOPS), or ifyou just are starting out, we are sure you will be delighted to know aboutthe OOPS structure that FiveWin implements.

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

1.- xBase Commands2.- Classes and Objects3.- Functions and Data Structures4.- The Windows API

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

xBase commands originally came from dBase, and they have been evolvingtowards 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 OOPSskills. FiveWin uses our library Objects to use the OOPS capabilityof CA-Clipper. You can contact us to get the latest commercial releaseof Objects, at a very low price, which includes all the documentation,examples and source code so you will be able to utilize the incredibleworld of OOPS technology.

Objects are also based on functions (methods) and data. This is the nextlevel of abstraction. You may realize as we progress through this documentthat 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 youmove down towards Windows API your power and possibilities are greater butobviously your productivity decreases. As application programers you shouldtry to be at a intermediate level: a balance between productivity andpower.

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

So in xBase the standard is established that for creating anObject we to use the command:

DEFINE <ObjectClass> <ObjectName> [ ADDITIONAL CLAUSES ]

Note that if we use that command for create any Object, in some waywe are using a generic building 'message'. This is why we recommendimplementing 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

Page 59: Manual Do FiveWin

an Object we use the command:

RELEASE <ObjectClass> <ObjectName>

These commands get processed in their correspondents messages sentto 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 allthe 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 tobuild new classes from the Classes that FiveWin offers you. Review theFiveWin Classes hierarchy and inspect the design and the code of itsclasses to understand how you should use the power of OOPS inheritance.

In FiveWin we have implemented for the first time a mixed system fordeveloping Object Oriented environments. The system we have developed letsyou 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 whywe 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 supposethat behavior will not be necessary again in the future, so there isno 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 thePAINT event. This system is based on CodeBlocks. It is logical becausethat behavior will not be reused in the future.

But, if we were building a system that it is going to be reused in thefuture, then it has all sense to build a new class: this is thetraditional OOPS way.

So, at FiveWin's TMsgBar Class, which is a class that will be usedfrequently in other programs, we inherit a new Class form TWindowand we redefine the method PAINT.

We are convinced that a good OOPS architecture should use this twobuilding models. As you get more OOPS experience you will understandour 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 discoveringnew possibilities.

Starting with OOPS--------------------------------------------------------------------------------

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

Page 60: Manual Do FiveWin

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 theworld around. Our brain has the automatic mechanisms to organize our worldinto Classes.

An Object is a collection of Data that has some typical behaviors whichdifferentiate 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 canbe DONE TO the chair:

The chair does: * Supports someone if he/she sits on it

Someone may destroy the chair --> Something is done to thechair.

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

Page 61: Manual Do FiveWin

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 createdand 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 issomething 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 isa concept that exists in everybodys mind. It is an abstraction of thematerial world!

In computing, a Class is a bunch of code, rules for creating andmanaging Objects.

In computing, an Object is a bunch of Data, real information beingmanaged according to its Class rules!

How do we create a Class with Clipper ?

CLASS TWindow

DATA nTop, nLeft, nBottom, nRight

METHOD New() CONSTRUCTORMETHOD Display()

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

Page 62: Manual Do FiveWin

ENDCLASS

That is the header declaration. We can see the Data that a WindowObject 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 itis 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 inClipper which has some specific Data!

That Data can have different values from one Object to another, but it willalways 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 followingthree rules:

* Encapsulation* Polimorphism* Inheritance

Using CA-Clipper with OBJECTS.LIB we get these three rules, so fromthat 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 differentmethods.

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

Page 63: Manual Do FiveWin

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 butwe 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 processedNon zero - Message already processed and

Windows API required value returned

Default Windows API behavior requiredreturn DefWindowProc( ... ) the Method just return nil

Object Oriented messages structure .--------------------------------------------------------------------------------

Microsoft Windows it is NOT a true Object Oriented environment. The mainreason for this is because it has been written using a non-true Object

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

Page 64: Manual Do FiveWin

Oriented language, C language. C was used instead of C++ because at thattime it was not available.

You may read in many places that Windows is Object Oriented. This is nottrue. In order to be Object Oriented is should offer the three main rulesof an Object Oriented environment: Encapsulation, Polymorphism andInheritance.

Windows should be Object Oriented and this would greatly help programmersto write Windows applications. This is why Borland, Microsoft, CA and othermanufacturers have developed C++ classes libraries to convert Windows intoa 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 findmany differences. These hierarchies are extremely large and most ofthe time all of their features are not required in standard Windowsbusiness applications.

Windows provides a very primitive way of simulating OOPS, it is called'SubClassing', not in the Object Oriented sense, but in a simple wayof changing a windows procedure by another.

In order to make Windows a OOPS environment, it is required that allcreated windows and controls are automatically 'SubClassed', that is,we change the standard Windows API behavior mechanisms for the OOPSmechanisms provided by an OOP language, like C++, Clipper 5 or any otherlanguage with real OOPS capabilities.

Microsoft MFC, Borland OWL, CA CommonView and Clipper-FiveWin have beenbuilt using the same construction rules. The same construction processesare in all those products. FiveWin offers the simplest and fastestClass hierarchy structure. We have developed it in that way to getthe best performance and size results. When you are in the OOPS arenayou run the risk of starting to create Classes without a strong reason andyou then run into the danger of huge performance decrease.

The process of converting Windows into a real OOPS environment has to betaken in two steps:

* Automatically SubClassing all windows and controls assoon as they are created. That allows us to change standardWindows behaviors.

* Designing a base general events processing mechanism toconvert Windows messages into OOPS-language messages inorder to take advantage of polymorphism and code reusability.

Thanks to OOPS inheritance it is possible to create a base TWindow Classwhich knows how to process most of all Windows API messages, and thenwe may inherit new Classes from it which redefine Methods and easily letus change the desired behaviors.

In FiveWin, the 'SubClassing' is done automatically through the TWindowMethods :Link() -to perform the SubClass process- and :UnLink() torestore the original procedures before the window gets destroyed. Thoseprocesses are quite sophisticated. Don't modify them.

FiveWin changes all the standard windows procedures to a single onewhich just gets the Clipper Object from the window handle and thenautomatically calls :HandleEvent() method. So :HandleEvent() receives all

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

Page 65: Manual Do FiveWin

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 realizeall 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 ishappening and about what every window has to do. That is why WindowsAPI requires the programmer to provide a window procedure for everywindow which will be called by Windows in order to give us the messages.

In all Windows applications there must be a typical defined windowfunction:

long WINAPI WndProc( HWND hWnd, WORD wMessage, WORD wParam, LONG lParam )

That is the function Windows API uses to sends messages to our definedwindow. Let's review those parameters:

* hWnd The Window API handle of our window. Windowsidentifies every window using a 'handle': a numericvalue Windows API internally generates. This valuemust NOT be manipulated, it is a 'read-only' value.

* wMessage A numeric value that identifies any of theWindows API different messages. All these differentmessages values are provided in a header fileprovided by Microsoft called Windows.h. FiveWin hasits own WinApi.ch which includes the most used messagesidentifiers values. If you need to know about them,please review Windows.h supplied by Microsoft orBorland or any other Windows tools manufacturer.

* wParam A numeric value, a 'WORD' is a number of twobytes so it is in the range 0-216 which is usedto provide the window function with some parametervalue. This parameter may be many different thingsaccording to the sent message.

* lParam A numeric value, a 'LONG' is a number of fourbytes so it is in the range 0-232 which is usedto provide the window function with some extra parametervalue. This parameter may be many different thingsaccording to the sent message.

The window function typically performs a C switch statement, a ClipperDO CASE... ENDCASE statement and performs different actions accordingto 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

Page 66: Manual Do FiveWin

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, thatis default behaviors to be performed in case we don't care aboutall sent messages. That is why all window functions have a default callat 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 valuesthe window function returns. Typically there are these possibilities:

* return 0 Means we have performed an actionand we don't want Windows to do anything.

* return non-zero In some cases Windows API requires somevalues.

* If we want We call DefWindowProc( ... ) and returnsstandard behavior its value to Windows API.

This process is the main conversation system between Windows API andour defined windows. In this process we have to connect to the ClipperObject Oriented kernel in order to convert it into an Object Orientedprocess.

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 youhave the real capability to create truly OOP based applications.

The main advantadge of coding using OOP is that our applications increase verymuch in modularity, so they are better structured and you will be able to codemuch 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 toeasily 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

Page 67: Manual Do FiveWin

local cLastName, cAddress, nAge

Now, you realize they all belong to a customer, so you create a newTCustomer 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 performedon 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 := 0static cTarget := "c:\FiveWin.18 "

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

function Main()

SET 3DLOOK ON

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

Page 68: Manual Do FiveWin

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 oDlglocal lLib := .t., lSamples := .t., lInclude := .t., lManual := .t.,;

lUtil := .t., lSource := .t., lGroup := .t.local nTotal := 2760000local 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

Page 69: Manual Do FiveWin

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:hWndlocal aRect := GetClientRect( hWnd )local oBrushlocal nTop := aRect[ 1 ]local nBottom := aRect[ 3 ]local nBlue := 200local nSteps := ( aRect[ 3 ] - aRect[ 1 ] ) / 3local 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

Page 70: Manual Do FiveWin

RELEASE BRUSH oBrush

aRect[ 1 ] += 3nBlue -= 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 lLibnPercent = 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 lManualLZCopyFile( "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

Page 71: Manual Do FiveWin

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, BuildExamples," + ;

cTarget + "\icons\Build.ico,0,2,1 )]" )

RELEASE DDE oDde

return nil

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

11. InterNet developmentIntraNet/InterNet applications development using Clipper & FiveWin--------------------------------------------------------------------------------

FiveWin powerfull Class TSocket implementation lets you build robust andpowerfull IntraNet/InterNet databased applications.

FiveWin Class TSocket offers an easy and object oriented WinSock.dll TCP/IPmanagement. Review SAMPLES\\TestSock.prg to see the foundation of a WEBself contained DataBased WEB pages server.

No extra software is required (as WebSite, Windows NT IIS, Personal WEBserver or similar), so FiveWin turns itself into one of the most powerfulltools to develop IntraNet/InterNet databased applications.

Class TSocket - InterNet TCP/IP object oriented implementationSAMPLES\\TestSock.prg - Self contained IntraNet/InterNet databased WEB server

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

Page 72: Manual Do FiveWin

API support--------------------------------------------------------------------------------WINAPI\WinSock.cWINAPI\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 sampleSAMPLES\\SockServ Sockets server client/server sampleSAMPLES\\FiveGen A databased-dictionary application with automatic WEBmgementSAMPLES\\GALLERY\ICopyFiles FTP sending and receiving files sample

--------------------------------------------------------------------------------Class TSocket InterNet TCP/IP sockets support--------------------------------------------------------------------------------

DATA--------------------------------------------------------------------------------nPort socket port numbercIPAddr socket IP addressnTimeOut connection timeout valuenBackLog listen backlog valuenSocket socket handlehFile handle of a file transmited in chunksbAccept 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 incommingconnectionEnd() 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

Page 73: Manual Do FiveWin

Class TWebServer InterNet WEB pages and Proxy server--------------------------------------------------------------------------------

DATA--------------------------------------------------------------------------------nPort socket port numbercIPAddress socket IP addressnTimeOut connection timeout valuenBackLog listen backlog valuenSocket 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 useAccept Constructor. Creates a clone from the listening host socketEnd Closes the connectionGetText Retrives the data that arrives to the socketSenData Sends data throught the socketListen Turns the socket into a listening host socket

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

Class TInternet Microsoft 32 bits WinINet.dll object oriented support--------------------------------------------------------------------------------

DATA--------------------------------------------------------------------------------hWinINet handle to opened WinINet.dllhSession handle of current sessionaFTPs Array of all TFTP objects in use

METHODS--------------------------------------------------------------------------------New ConstructorEnd Generic destructorFTP( cFTPSite ) Generates a new TFTP object and connects to it

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

Class TFTP Microsoft WinINet.dll FTP object oriented management--------------------------------------------------------------------------------

DATA--------------------------------------------------------------------------------oInternet TInternet container objectcSite URL addresshFTP handle of the FTP connectioncUserName user name to logincPassword password to login

METHODS--------------------------------------------------------------------------------New( cFTPSite, oInternet ) Constructor. cFTPSite = URL to connect to.

oInternet = previous created TInternet objectEnd() generic destructorDeleteFile( cFileName ) deletes a remote FTP fileDirectory( cMask ) as Clipper Directory() but on a FTP site!

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

Page 74: Manual Do FiveWin

--------------------------------------------------------------------------------Class TFTPFile Microsoft WinINet.dll FTP files object oriented management--------------------------------------------------------------------------------

DATA--------------------------------------------------------------------------------oFTP TFTP container objectcFileName name of the filehFile Internet handle of the filelBinary 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 destructorOpenRead() opens the file for readingOpenWrite() opens the file for writtingWrite( cData ) write data to the fileRead( nBytes ) read n bytes from the fileSeek( nBytes, nFrom ) skips + / - bytes file pointer

--------------------------------------------------------------------------------FiveWin Internet software layers--------------------------------------------------------------------------------

The following picture illustrates the FiveWin Internet foundation layers:

FiveWin ClassesTInternet, 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 Microsoftthat originally was developed by Berkeley University (the famous sockets!).FiveWin implements a direct connection to this DLL (WINAPI\WinSock.c), soyou may directly use all its functions.

On top this DLL Microsoft builds the 32 bits WinINet.dll, a high levelInternet layer wich is very usefull to manage FTP services. FiveWin ismanaging this 32 bits DLL thanks to our own 16-32 bits automatic thunksystem, used everytime you manage FiveWin DLL32 commands (DLL.CH). Infact all the WinINet.dll support has been built using FiveWin high levelDLL32 commands (SOURCE\WINAPI\WinINet.prg).

On top of the WinINet.dll layer, FiveWin implements three classes thatlet you easily manage WinINet.dll in an object oriented way: ClassTInternet, TFTP and TFTPFile. These classes simplify so much theWinINet.dll management. Class TFTPFile lets you use remote FTP filesas if they were files on your own computer ( FOpen(), FWrite(), etc...).There is a nice sample SAMPLES\GALLERY\ICOPYFIL that shows how to sendand receive FTP files directly from your FiveWin app without usingany Internet extra software.

On top of the WinSock.dll, FiveWin implements a powerfull object oriented

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

Page 75: Manual Do FiveWin

Class TSocket, which makes so easy to have full control of WinSock powersockets. With this Class you may solve whatever Internet need you may have.

Using Class TSocket we have implemented Class TWebServer, a completeWEB pages server totally built-in inside your FiveWin application. Yourapplications may transmit WEB pages that are visible all over Internet.

The real power of this design is based on the FiveWin dynamic HTML ownfoundation. 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 expressionswill be expanded in your HTML files. This means live access to yourdatabases and remote management of your application. Microsoft is tryingto implement now a solid dynamic HTML standard. You already have allthis power.

FiveWin Class TWebServer transparently manages HTTP cookies, queries,mimes extensions and so on. Finally, Class TWebServer recognizes Proxyrequires, so not only sends HTML files through the Internet but youmay use it to let all Intranet users access the Internet world throughit. Companies are very aware of Internet security risks so they don'twant to let all employees to directly access the Internet, this is whythey implement 'firewalls'. The 'firewall' concept requires a Proxy serverthat really access the Internet. FiveWin Class TWebServer offers afully configurable Proxy server, and all this built in in your ownFiveWin 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 dynamicHTML generation a mixure of JavaScript (or VBScript), standard HTMLand Clipper code is required.

JavaScript is a very easy to learn language. It behaves like a mixurebetween C and Clipper. Normally you may not need more than two daysto really master it. (I learned it myself on a weekend! <g>)

Get yourself familiar with HTML code. HTML is such an easy languagethat you will be surprised how fast you may get it. basically thereare two main operations you will be dealing with: GET and POST.

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

Page 76: Manual Do FiveWin

GET means the client is requiring some page. POST means the userfilled some controls info (GETs, radios, etc...) and he is sendingit to you. Have a look at SAMPLES\FIVEGEN to see how far we can gojust easily mixing these concepts.

FiveWin Class TWebServer automatically define some private variablesthat will be in scope for you to solve some information comming fromthe 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() functionto turns high character codes into lower ones. FiveWin implementsUnEscape() function to change back the effect of Escape().

* When a cookie has been defined on the client (see SAMPLES\FIVEGENto see how to manipulate cookies with JavaScript), FiveWin definesa 'Cookie' variable that holds the cookie value. A cookie is justa string variables that hold some client defines values.

* When the user has completed some controls requested info and hassubmited it to you, FiveWin declares a 'Query' variable that holdsthe original user query values.

You will become familiar to these concepts once you start managing themjust a little. You will be surprised how far you can get using yourloved Clipper and developing Internet applications using FiveWin.

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

Comandos

1. xBase Commands1.1 xBase commands alphabetically ordered .1.2 xBase common elements .1.3 FiveWin Header files .

2. Classes and Objects2.1 Classes alphabetically ordered .2.2 Classes hierarchy .2.3 Objects engine syntax .

3. Functions3.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

Page 77: Manual Do FiveWin

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

Page 78: Manual Do FiveWin

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 aDialogBox. To do it, just create the buttonbarfrom the ON INIT clause when activating theDialogBox.

At the ON INIT clause, a DialogBox behaves likea 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 forthe bar.

<oBtn> A reference to the BitmapButton Object.

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

Page 79: Manual Do FiveWin

<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 thehard 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 aResource 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 thecontainer Window of the Bar Object which containsthe BitmapButton.

<uWhen> An expression that indicates if the button ofthe 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 windowLEFT container. Right clicking on the buttonbar also popupsRIGHT 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 ofbutton.

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 (withouta buttonbar). The button will update its imageautomatically 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

Page 80: Manual Do FiveWin

[ 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 bitmapfrom a .RC, .RES or a .DLL file .

<cBmpFile> The name of the BMP file when loading a bitmap directlyfrom 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 theBitmap.

<uRClick> The action(s) to be performed when right clicking over theBitmap.

<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 beactive or not.

<uValid>

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

Page 81: Manual Do FiveWin

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 itsvisible area. This let the user review bitmaps larger thanthe control.

ADJUST Automatically adjusts the bitmap(s) to the size of thecontrol.

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

Page 82: Manual Do FiveWin

[ 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, TWbrowsewill manage it as the handle of a bitmap to bedisplayed.

<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 theListBox 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

Page 83: Manual Do FiveWin

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, BRICKSStandard 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

Page 84: Manual Do FiveWin

[ | 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 modecoordinates.

<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 isor 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

Page 85: Manual Do FiveWin

lose the focus.

CLAUSES

DEFAULT For default PushButtons: Automatically executes whenthe user press Enter, even from other controls.

Use this clause only when building the Button fromsource code. When using resources, this clause mustbe 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 modecoordinates.

<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

Page 86: Manual Do FiveWin

<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 theCheckBox 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

Page 87: Manual Do FiveWin

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 theDialogBox object. It is a 'reference' to theDialogBox object.

<cResName> The name of the DialogBox inside resource.The resource may be stored in a .RC file or ina .DLL file. Normally you use the 'Rename' option froma resource editor to give a name to the resourceelement.

<cTitle> The title of the DialogBox. You may also change thetitle of a resource DialogBox. This means that youmay use the same DialogBox for different purposes byjust changing its title.

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

Page 88: Manual Do FiveWin

<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 usefulwhen using several DLLs at the same time that holddifferent resources. By default this handle isthe application handle (when using .RC) or the handleof the DLL when using SET RESOURCES TO...

<nStyle> An optional DialogBox style. There are several samplesin the SAMPLES\ subdirectory showing you how tomanipulate this value. If you are using a DialogBoxfrom a resource then you have to select the style frominside the resource editor.

<nClrText>, The fore and back colors of the DialogBox.<nClrBack>

<oBrush> An optional brush to use to fill the surface of theDialogBox.

<oWnd> An optional container object of the DialogBox. Bydefault we use the window that is currently active.If you want to show DialogBoxes control messageson the bottom line of the screen you have to specifyits container.

<oIco> An optional ICON to show when the DialogBox has beenminimized.

<oFont> An optional Font to use for all the DialogBoxes.

<uWhen> WHEN clause that permits the DialogBox to startexecuting.

<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 mousebutton is clicked over the DialogBox surface.Three parameters: nRow, nCol, nFlags are automaticallysupplied:

nRow The row position (in pixels) where themouse was when it was clicked.

nCol The col position (in pixels) where themouse was when it was clicked.

nFlags A numeric flag which contains informationabout special keys being pressed at thesame 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

Page 89: Manual Do FiveWin

#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 iscreated but not shown on the screen. In this situationthe DialogBox behaves like a Window, and we may do allkind of operations as we do with a window, (like placinga ButtonBar on it!)

<uMoved> An optional action to be performed when the DialogBoxis moved.

<uPaint> An optional action to be performed when the DialogBoxhas just been painted.

<uRClicked> An optional action to be performed when the right mousebutton has been clicked on the DialogBox surface. Youcan use the same three parameters as in <uClick>.

CLAUSES

VBX You may specify this when using a VBX control in theDialogBox.

PIXEL When you want the DialogBox coordinates (creatingthe DialogBox from source code) to be in pixels.

CENTER If you want the DialogBox to appear centeredCENTERED on the screen.

NOWAIT If the DialogBox has to behave NonModal. NonModalNOMODAL means that other DialogBoxes may be working at the

same time! NonModal programming requires some specialcare:

* Take care of local variables: If you are using somelocals then remember you will go out of the scopeof the function where the DialogBox nonmodal hasbeen created and this may cause problems (only ifyou don't remember it). Clipper works perfectly inthese circumstances as it keeps 'live references'of the local variables inside the codeblocks. Butonly 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! becausea DBF may be opened several times. It is a goodidea to start learning NetWork programming

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

Page 90: Manual Do FiveWin

-it is really easy!-

* Normally we recommend that you not develop NonModalapplications for novice Windows-users. As soonas your clients get more and more used to Windows,NonModal programming is highly recommended. SeeMDI programming (in this documentation) fora very elegant and powerful NonModal programmingstyle.

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 RunTimeby its own name! See DllCall.prg example.

<FuncName> The name of the DLL function. Remember Clipper only uses10 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 4DOUBLE 8

<DllName> Name of the DLL.

We recommend to develop a C language based connection functions when youare going to develop an intensively work with some DLLs. See "usingWindows 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

Page 91: Manual Do FiveWin

CLIPPER SNDPLAYSOU() // ND(){

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

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

In this situation it is necessary to use a specific LIB so the linker willknow 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 symbolswith 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 alot of examples of doing this.

Warning: SndPlaySound() is already built inside FiveWin.lib. It has beenused 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

Page 92: Manual Do FiveWin

(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 tomanage.

<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 MsgBarif defined.

<nId> The numeric resource identifier of the control.

<uChange> An action to be performed when changing the folderselected page.

CLAUSES

PIXEL To use pixel coordinates instead of text coordinates.

DESIGN Allows the user to interactively move and resize thecontrol.

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

Page 93: Manual Do FiveWin

<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

Page 94: Manual Do FiveWin

[ 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

Page 95: Manual Do FiveWin

<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 memoMEMO 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 andright 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

Page 96: Manual Do FiveWin

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

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 textcoordinates.

<oIcon> Is a reference to the Icon Object.

<cResName> Is the name of the icon resource if we are loading the iconfrom a RC, RES or a DLL.

<cIcoFile> Is the name of a ICO file if we are loading the ICO directlyfrom disk.

<uClick> Is the action to be performed when the mouse clicks over theicon.

<oWnd> Is the container Object of the Icon.

<WhenFunc> An expression to evaluate in order to determine if thecontrol 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 iconfrom a RC, RES or a DLL.

<cIcoFile> Is the name of a ICO file if we are loading the ICO directlyfrom disk.

CLAUSES

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

Page 97: Manual Do FiveWin

UPDATE Indicates if this control has to be updated when doinga <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 typeof the variable. So it is important to properlyinitialize 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 codeGet 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

Page 98: Manual Do FiveWin

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 modecoordinates.

<oLbx> A reference to the ListBox object.

<cnVar> A Clipper variable, string or numeric, where FiveWin willautomatically 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 isselected.

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

Page 99: Manual Do FiveWin

<uLDblClick> A codeblock to evaluate when the user left double clicks themouse over the listbox.

<oWnd> A reference to the container object of the ListBox, normallya 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 containerif 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 aownerdraw 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 isdone in a very similar way toa normal Window. The differenceis just specify MDI.

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

Page 100: Manual Do FiveWin

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 whereWindows automatically reports which child Window isactivated.

Activation Commands are the same as with a normal Window.

To create a ChildWindow of the main MDI Window, we do it again in asimilar 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

Page 101: Manual Do FiveWin

[ 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 mouseis clicked over the Window.

<uRClick> An action to be performed when the right button of the mouseis 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 performedevery the Window is painted.

<uKeyDown> An action to be performed every a key is pressedbeing 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 scrollbaris upwards pressed.

<uDown> An action to be performed when the vertical scrollbaris downards pressed.

<uPgUp> An action to be performed when the vertical scrollbarhas been pagedown clicked.

<uPgDn> An action to be performed when the vertical scrollbarhas been pageup clicked.

<uLeft> An action to be performed when the horizontal scrollbarhas been leftwards clicked.

<uRight> An action to be performed when the horizontal scrollbarhas been righwards clicked.

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

Page 102: Manual Do FiveWin

<uPgLeft> An action to be performed when the horizontal scrollbarhas been pageleft clicked.

<uPgRight> An action to be performed when the horizontal scrollbarhas 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. Thesecharacteristics 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 theWS_BORDER style). This style cannot beused with the WS_DLGFRAME style.

WS_CHILD A child window. Cannot be used withthe WS_POPUP style.

WS_CHILDWINDOW Same as the WS_CHILD style.

WS_CLIPCHILDREN Excludes the area occupied by childwindows when drawing within the parentwindow. Used when creating the parentwindow.

WS_CLIPSIBLINGS Clips child windows relative to each other;that is, when a particular child windowreceives a paint message, theWS_CLIPSIBLINGS style clips all otheroverlapped child windows out of theregion of the child window to beupdated. (If WS_CLIPSIBLINGS is notspecified and child windows overlap, itis possible, when drawing within theclient area of a child window, to drawwithin the client area of a neighboringchild window.) For use with theWS_CHILD style only.

WS_DISABLED Window will be initially disabled.

WS_DLGFRAME Defines a window with a double borderbut no title.

WS_GROUP Specifies the first control of a group ofcontrols in which the user can move fromone control to the next by using the arrowkeys. All controls defined with theWS_GROUP style after the first controlbelong to the same group. The next control

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

Page 103: Manual Do FiveWin

with the WS_GROUP style ends the stylegroup 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 initiallyminimized. For use with theWS_OVERLAPPED style only.

WS_MINIMIZEBOX Creates a window that has a Minimize button.

WS_OVERLAPPED Defines an overlapped window. Anoverlapped window has a title and aborder.

WS_OVERLAPPEDWINDOW Creates an overlapped window having theWS_OVERLAPPED, WS_CAPTION, WS_SYSMENU,WS_THICKFRAME, WS_MINIMIZEBOX, andWS_MAXIMIZEBOX styles.

WS_POPUP Creates a pop-up window. Cannot be usedwith the WS_CHILD style.

WS_POPUPWINDOW Creates a pop-up window that has theWS_BORDER, WS_POPUP, and WS_SYSMENUstyles. The WS_CAPTION style must becombined with the WS_POPUPWINDOW styleto make the System menu visible.

WS_SYSMENU Creates a window that has a System-menubox in its title bar. Used only forwindows with title bars.

WS_TABSTOP Specifies one of any number of controlsthrough which the user can move byusing the TAB key. The TAB key movesthe user to the next control specifiedby the WS_TABSTOP style. Only dialogboxes use this style.

WS_THICKFRAME Creates a window with a thick framethat can be used to size the window.

WS_VISIBLE Creates a window that is initiallyvisible. This applies to overlapped,child, and pop-up windows. Foroverlapped windows, the y parameter isused as a ShowWindow functionparameter.

WS_VSCROLL Creates a window that has a verticalscroll bar.

Note: If this parameter is used it will override thevalues of the following parameters:

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

Page 104: Manual Do FiveWin

cBorderlCaptionlSysmenulminlMaxlVScrolllHScroll

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 thewindow, where the MDI environment will automaticallyplace 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 characterbased

You must specify the clause MDICHILD to have all the possibilities WindowsMDI offers.

MDI programming explanation

What is MDI ?

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

Page 105: Manual Do FiveWin

As soon as you start getting comfortable with Windows you will face oneof the more powerful features of it: Multiple Document Interface Windowing.

Most of the Windows commercial applications we use (the Windows ProgramManager is written using MDI) take advantage of the possibilities of MDI.

Basically MDI environment is a main Window which has several child Windowsinside which can be resized, tiled, cascaded, maximized, created and destroyedvery easily. In fact, a MDI environment is like a whole Window environmentall by itself.

These features, which may seem very common to you, won't work if youtry to get create them using standard Windows. Well, you could do it, but itwould 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 powerfulfeatures 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 areaof 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 clientit 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 Windowshas implemented.

Developing a MDI environment in C language is a very complicated task. Infact, it is one of the most difficult tasks for beginners. But you are luckybecause 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 Windowscreation commands. The only difference is that you must specify theMDI 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

Page 106: Manual Do FiveWin

To create a MDI Child Window you again use the standard Window creationcommands, but you must specify the clause MDICHILD.

All that you already know about FiveWin is still the same! You only haveto remember a few items:

A MDI Frame Window Object has 'DATA' named oWndClient, which is anotherWindows 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 onthe surface of the MDI frame Window, you really have to place it on theMDI 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 somevery 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 Windowsoffers to MDI programming.

Remember this:

TMdiFrame is the main Window. It has data named oWndClient which isa 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 useas you wish.

New MDI directions in FiveWin

In previous releases of FiveWin, we planned to develop some new Classesinheriting from TMdiChild to suit some of the 'normal' business applicationssituations 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 controlwhich automatically resizes to extend the whole visible area of theChild Window.

So, we are giving you a really powerful way of developing MDI environmentswhich is quick and clean:

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

Page 107: Manual Do FiveWin

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 standardsyntax:

DEFINE BUTTONBAR oBar OF <oWndChild> // The name of your MDI Child

Attach the buttons in a normal way. Every button will have the actionsyou define:

DEFINE BUTTON OF oBar ACTION ...

DEFINE BUTTON OF oBar ACTION ...

...

Using this approach easily enhances the functionality of the MDIChild Window without the need to develop a new Class -you are free todo 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 minuteswithout the need to create new Classes or learning very difficult MDIprogramming rules.

Let CA-Clipper and FiveWin do the hard work for you. This is the powerof 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

Page 108: Manual Do FiveWin

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

Page 109: Manual Do FiveWin

ENDSYSMENU

<oMenu> A reference to the Menu Object.

<oMenuItem> A reference to one of the menuitems of the menu. Eachmenuitem of a menu object is also an object. SEPARATORclause also may specify an optional menuitem variable tostore its related value.

<cMsg> The associated message of this control.

<cBmpFile> The name of a BMP file to be used as the label for amenuitem 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 checkif 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.CHECKEDMARK

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

Page 110: Manual Do FiveWin

HELP If the menuitem has to appear by the op right of thepulldown 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

Page 111: Manual Do FiveWin

CLAUSES

UPDATE If this control has to be updated everytime its containeris 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 todisplay 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

Page 112: Manual Do FiveWin

<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, whichnormally includes the <cName>, <cPassword>, and otherextra required information.

<cCommand> A character string which holds the ODBC statement toexecute.

CLAUSES

FROM USER Means that we want to select interactively the DataBaseto use.

Multiple DialogBox Pages xBase commands--------------------------------------------------------------------------------

Creating a folderfrom source code

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

Page 113: Manual Do FiveWin

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 DialogBoxesto manage. Important: These DialogBoxes must havethe style STYLE WS_CHILD | WS_VISIBLE at the RCor 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

Page 114: Manual Do FiveWin

...

ENDPAGEENDPRINT

<oPrint> A reference to the Printer Object.

<cDocument> The name of the document to be generated. It is the namethat 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 printoutwith different printers!) you need first to calculate theresolution of the printer, and then, divide those dimensionsby the number of rows and columns that you want:

See SAMPLES\TestPrn2.prg

<cText> The value to print. It may be of any type. FiveWinwill 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 thatfont independently from the printer used, you must specifythe OF ... clause when creating the font, and after theprinter object has been created:

local oPrn, oFont

PRINT oPrnDEFINE FONT oFont NAME "Arial" SIZE 0, -8 OF oPrnPAGE

...ENDPAGE

ENDPRINT

oFont:End()

Important: You have to :End() the font object once youhave finished and completed your printout work.

<nWidth> A specific printer units width to use whenprinting 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

Page 115: Manual Do FiveWin

FROM USER Lets the user interactively select the printer to use.If you don't specify this clause, FiveWin will use thedefault printer installed in your system.

PREVIEW Invokes the FiveWin preview system, which lets the userinteractively preview the printout before sending it tothe 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

Page 116: Manual Do FiveWin

[ ADJUST ] ;[ WHEN <WhenFunc> ] ;

<nRow>, <nCol> The coordinates of the Button. They mimic text modecoordinates.

<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 isor not enable.

<nId> The numeric resource identifier of the Control.

<ValidFunc> An expression to validate when the control is going tolose the focus.

CLAUSES

DEFAULT For default PushButtons: Automatically executes whenthe user press Enter, even from other controls.

Use this clause only when building the Button fromsource code. When using resources, this clause mustbe 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

Page 117: Manual Do FiveWin

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

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 simulatetext coordinates.

<oRadMenu> A reference to the RadMenu Object.

<nVar> The numeric variable which controls the RadioButtonMenu.

<cItems> A list of strings defining the prompts to be usedas radio elements.

<oWnd> A reference to the container Window of the RadioButton Menu.

<nHelpId> A list of numeric help identifier to associate toeach radio control.

<uChange> An action to be performed when a new radio isselected at the RadioButton Menu.

<cMsg> The associated message of this control

<WhenFunc> It is an expression to evaluate indicating if the control isor not enable.

<nWidth> The dimensions of the control.<nHeigth>

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

Page 118: Manual Do FiveWin

<ValidFunc> An expression to validate when the control is going tolose 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

Page 119: Manual Do FiveWin

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 theminside 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 TOresource

<cDllName> Is the name of a DLL where resources have beenplaced. It is possible to specify multiple DLLs for resources.

After opening several DLLs as resources it is necessaryto select the one we are going to use. To do so wemust 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 resourcedefinitions for your application. The SAMPLES\Build.bat we provideautomatically calls RC.EXE if a RC is defined with the same name asthe .prg you are building with build.bat. Applications requiringmultiple .prgs, must have their own .rmk file or batch file to buildthem. Use the above mentioned RC.EXE syntax to embed your resourcesinto 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

Page 120: Manual Do FiveWin

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 Textcoordinates.

<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 mustbe 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

Page 121: Manual Do FiveWin

<oSay> A reference to the Say Object.

<cText> The caption to assign to the Say Object. Specifying itchange 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

SHADEDSHADOW

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

Page 122: Manual Do FiveWin

[ 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 isselected on the Scrollbar. That is, when clickingbetween the thumb and the top arrow or when clickingbetween 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 onthe scrollbar. That is, when clicking on the top arrow orwhen pressing the key K_UP.

<uDownAction> An action to be performed when going down is selected onthe scrollbar. That is, when clicking on the bottom arrow orwhen pressing the key K_DOWN.

<uPgUpAction> An action to be performed when page up is selected onthe scrollbar. That is, when clicking between the thumb

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

Page 123: Manual Do FiveWin

and the top arrow.

<uPgDownAction> An action to be performed when page down is selected onthe scrollbar. That is, when clicking between the thumband the bottom arrow.

<uPos> An action to be performed when the thumb is moved by theuser and left on a different position. The new positionis 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 tolose the focus.

<cMsg> The associated message of this control

<WhenFunc> It is an expression to evaluate indicating if the control isor not enable.

CLAUSES

HORIZONTAL To use a horizontal or vertical scrollbar. Only usefulVERTICAL 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

Page 124: Manual Do FiveWin

(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 MsgBarif 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 thecontrol.

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 isreached.

<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

Page 125: Manual Do FiveWin

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 defaultif <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 defaultif <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

Page 126: Manual Do FiveWin

<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 isor not enable.

<ValidFunc> An expression to validate when the control is going tolose 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 backgroundof the Window. Use DEFINE BRUSH ... to create it. Thisparameter 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 insidea 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

Page 127: Manual Do FiveWin

<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 mouseis clicked over the Window.

<uRClick> An action to be performed when the right button of the mouseis 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 performedevery the Window is painted.

<uKeyDown> An action to be performed every a key is pressedbeing 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 definitionsConstant.ch Text to Graphics constants definitionsDDE.ch Commands for Dynamic Data ExchangeDialog.ch Dialog BoxesDLL.ch Dynamic Linking Libraries calling at RunTimeFiveWin.ch FiveWin main header fileFolder.ch Folders and Tabs managementFont.ch Fonts managementIni.ch INI FilesMail.ch Windows MAPI email supportMenu.ch Managing MenusObjects.ch Object Oriented Engine of FiveWinODBC.ch Open DataBase connectivity supportPrint.ch Using the PrinterReport.ch Report engineSQL.ch ODBC headerTcBrowse.ch Column based new BrowseTree.ch Trees supportVideo.ch Video media AVI SupportVKey.ch Windows keys valuesWinApi.ch Windows API definitionsClipApi.h Clipper internal management declarations

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

Page 128: Manual Do FiveWin

WinTen.h To avoid conflicts with Windows API Pascal namesxBase common elements--------------------------------------------------------------------------------

We have paid particular attention into the syntax of FiveWin such as usingthe same clause to do the same thing in similar circumstances. This meansthat as soon as you learn these few rules, you may control a lot ofdifferent FiveWin features.

We will keep extending this basic concept to manage all the different partsof the Windows API. Having just a unique xBase interface to manage theWindows API will let you concentrate in the goal of your application andnot in the details.

xBase clauses Description--------------------------------------------------------------------------------

DEFINE All the objects in FiveWin get created using thekey 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 thekey 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 extensivelyin 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

Page 129: Manual Do FiveWin

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 orcontainer of an Object, we use OF:

REDEFINE BUTTON ID ID_OK OF oDlg

The clause OF means: "belongs to", "it is containedin", "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 oDlgFor a font: DEFINE FONT oFont NAME "Arial" ;

SIZE 0, -20 OF oPrn

RESOURCE You may use any of these clauses to specifyRESNAME 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 createan Object from resources stored inside the sameEXE (rc resources) or stored inside a DLL.

FILENAME You may use any of these clauses to specifyFILE than an Object has to be loaded from a file in disk.DISK

DEFINE ... FILENAME <cFileName>

For example to use a button bitmap which pictureis 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

Page 130: Manual Do FiveWin

REDEFINE BITMAP oBmp ID ID_PHOTO OF oDlg ;FILENAME "Photo.bmp"

Remember: Always use FILENAME clause to usea 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

Page 131: Manual Do FiveWin

+--- 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 objectsnGroups Number of groupsnMode The position of the BtnBar on the windownBtnWidth The height and width of its buttons. By default is 28x28nBtnHeight 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 containerwindow.AdjMode Changes the BtnBar position to floating

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

Page 132: Manual Do FiveWin

Del Deletes a button from the bar.DelGroup Deletes a logical group from the bar.Display Displays the button barcGenPRG Returns a string with the source code of the button barFloat Turns the buttonbar into floating mode.FloatClick Processes MouseClicks on the float mode buttonbar.GetBtnTop Returns the appropriate nTop when adding a new buttonGetBtnLeft Returns the appropriate nLeft when adding a new buttonGoDown 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 windowMouseMove Activates the default message on window owner MsgBarPaint Displays the ButtonBar. Use :Refresh() instead this.RButtonDown Processes mouse right clicks on the buttonbar.RightMode Changes the BtnBar position to the Right the windowTopMode Changes the BtnBar position to the Top of the windowClick Mouse left button event handlerSaveIni Saves the bar to an INI fileSetMsg Set the text of the message bar of its container windowGetBtnCol 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 BitmapcBmpFile Name of the BMP file to displaycResName Name of the BMP resource to displaylStretch True if image has to be adjusted to all visible arealScroll True if image may be scrolled into its own visible areaaHotAreas An array with some hot-areas on the bitmapnVStep Units to scroll on vertical scrollnHStep Units to scroll on horizontal scrollnZoom Units to zoom the picture.

METHODS--------------------------------------------------------------------------------New Constructor from source codeDefine Constructor for resourcesReDefine Constructor for resourcesEnd Ends control and make it disappearCommand Processes WM_COMMAND WinApi messagesDefault Default initialization of the BitmapDestroy Destroy the bitmap object.Display Displays the bitmap. Use :Refresh() instead to force it.GotFocus Action to be performed when getting the focusHScroll Horizontal ScrollBar messages dispatcherInit Generic Control initialization methodInspect Interactive load of Bitmap.LButtonDown Action to be performed when clicking the mouse.Load Load the bitmap from resourcesLoadBmp Load bitmap from disk.nHeight Retrieves height of the image.

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

Page 133: Manual Do FiveWin

nWidth Retrieves width of the image.nXExtra Retrieves the size of image which it is not visiblenYExtra The same for the other axisPaint Draws the bitmapReload Load again a bitmapResize Changes the dimension of the bitmapScrollAdjust Updates the values on the scrollbarsScrollDown 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 paletteVScroll Vertical ScrollBar messages dispatcherZoom Zoom the picture.

Note: The ScrollXXX Methods assume that lScroll is TRUE AND thatthe BitMap is larger than the visible area

Class TBlock--------------------------------------------------------------------------------DATAcExpression A string with the block expressionbBlock the expression codeblock--------------------------------------------------------------------------------METHODSNew Creates a new codeblockEval / 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 surfacehBmpPal1 The main image of button.hBmpPal2 The image of button pressed for animated button.

METHODS--------------------------------------------------------------------------------New Constructor from source codeNewBar Constructor from source code for Button BarReDefine Creates a BtnBmp from resourcesClick Mouse left button event handlerFreeBitMaps Releases all the bitmaps associated with this controlcGenPRG Generates the source code of this controlHandleEvent Generic events handlerLButtonDown Behavior when pressing the mouseLButtonUp Behavior when releasing the mouse clickLoadBitmaps Load the bitmap/s from resourcesPaint Draws the ButtonMouseMove Behavior when moving the mouse over itRelease Destroy the Button imageSetFile Changes to a different BMP file

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

Page 134: Manual Do FiveWin

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 objectsaArray Holds the array, when browsing an arraylNoHScroll Don't display the vertical scrollbarlNoLiteBar Don't use a different color to hilite barlNoGrayBar Don't use a different color to lostfocus barlLogicDrop Use a combobox when editing a logical valuenAdjColumn Column index to expand to flush table windowlRepaint Bypass paint if falsenFreeze Freeze nFreeze left most columnsoDbf Holds DataBase object when usedoCtx Holds context object when usedlColDrag Allows column exchange by dragginglLineDrag Allows column width resize with the mousenDragCol Column being mouse dragged

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

Page 135: Manual Do FiveWin

lAutoCtx True when managing a context objecthBmpCursor Bitmap handle to display on first columnbSeekChange Expression to eval when record changescSeek Last expression to seek on incremental searchnColOrder Column which index is the active onenOClrForeHeadnOClrBackHeadcOrderType

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 .

TcColumnDATA--------------------------------------------------------------------------------cHeading Optional Header textbData Mandatory Code block to return column datacPicture Optional picture clausebClrFore Optional Foreground Color blockbClrBack Optional Background Color blocknAlign Optional Alignment DT_LEFT or so onnWidth Optional WidthlBitMap Optional Bitmap FlaglEdit True if editing is allowablelNoLite True to skip cell during SelectlLine()

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

Page 136: Manual Do FiveWin

cMsg Editing messagebValid Editing valid blockcError Bad valid error messagecOrder 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 applicationsto pass data handles to other applications. Clipboard functions carry outdata interchange between Windows applications.

DATAs--------------------------------------------------------------------------------nFormat Type of data placed in ClipboardoWnd Container object

METHODs--------------------------------------------------------------------------------New Constructor from source codeClear Open, clear Clipboard contents and close itClose Close the Clipboard to end using itEmpty Clear Clipboard contents if it's openEnd Open, clear Clipboard contents and close itGetData Get the content of ClipboardGetText Get the text placed in the ClipboardOpen Open the Clipboard to start using itSetData Set the content of ClipboardSetText 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

Page 137: Manual Do FiveWin

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 codeDestroy Destroy the object.Display Displays the control. Use :Refresh() to force repaintLDblClick Action to be performed on left double click. Invokes bInspectPaint Draws the control. This process occurs inside Display.

Class TComboBox Inherits from TControl--------------------------------------------------------------------------------

DATA--------------------------------------------------------------------------------aItems Array of Items of the ComboBoxnAt Index of the current select itemaBitmaps Array of Bitmaps of the ComboBox if ownerdraw style usedlOwnerDraw If it is an ownerdraw style ComboBoxnBmpHeight Height to use for painting the ownerdraw bitmapsnBmpWidth Width to use for painting the ownerdraw bitmapsbDrawItem CodeBlock to evaluate to select a ownerdraw bitmap to paintcError Error description when using a ComboBox for browse cell editingoGet Contained GET for DropDown ComboBoxes if STYLE CBS_DROPDOWNspecifiednStyle internally used when specifying a STYLE CBS_DROPDOWN ComboBox

METHODS--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor for resourcesAdd Add an item to the combobox items listcToChar Generates a data template to build a DialogBoxChange Changed event responseDefault Default initializationDefControl Register the control as a contained child of a container objectDel Deletes an itemDestroy Destroys the controlDrawItem OwnerDraw items paintingFillMeasure Calculates the dimension of an ownerdraw itemFind Checks if a specific string is contained at its items listFindString Returns the specific index position of an item in its listInit Generic initialization on DialogBoxesInsert Insert an itemLostFocus Action to be performed when loosing the focuslValid ComboBox validation when loosing the focusModify Modify the text of an itemMouseMove Action to be performed when moving the mouse over itOpen Opens the ComboBox related listRefresh Forces the control to be repaintedReset Empty all contents of the ComboBox and the array aItemsSelect To select a string in the list box of a combo box by indexSet To select a string in the list box of a combo box by textSetBitmaps To set the bitmaps to be used by the ownerdrawSetItems Changes the items shown in the comboboxShowTooltip Shows its tooltipVarGet Retrieves the associated Clipper variable value

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

Page 138: Manual Do FiveWin

Class TComm--------------------------------------------------------------------------------

Developed by a FiveWin user

DATA--------------------------------------------------------------------------------

nDevice, nInQueue, nOutQueue, nId, nStop, nBaud, nData, nErrcParity, cStyle, cCharaStatus

METHODS--------------------------------------------------------------------------------

New Constructor from source codeBreak 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 controlbChange Action to be performed when there is a major changecCaption Text caption of the ControllCaptured If the control has the mouse capturedlDrag If the control should be moved aroundlMouseDown Is the mouse button down on the controllUpdate If the control has to be updated when updating the DialognLastRow 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

Page 139: Manual Do FiveWin

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 createdcFile The name of the DBF file associatedcDriver The name of the driver associatedlShared If the workarea is sharedlReadOnly If the workarea is readonlybBoF 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 ConstructorSkip Skips like DbSkip()Activate Select its workarea as the one currently activeAddIndex Adds a new indexAppend Adds a new recordBlank Empties the editing bufferBof Checks if beginning of fileClose Closes the workareaCloseIndex Closes an indexCommit Flushes pending file buffersCreate Creates a new DataBaseCreateIndex Creates a new IndexClearRelation Clear active relationsDeActivate Closes the database. It acts like DbCloseArea()

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

Page 140: Manual Do FiveWin

DbCreate Creates the DBF file from its structure in a arrayDelete Mark a record for deletionDeleted Return the deleted status of the current recordDeleteIndex Remove a specified order from an order bagEof Determine when End of file is encounteredEval Evaluates a codeblock for records matching a scope/conditionFCount Return the number of fields in the current DBF fileFieldGet Retrieve the value of a field variableFieldPut Set the value of a field variableFound Determine if the previous search operation succeededGoTo Move to the record having the specified record numberGoTop Move to the first logical recordGoBottom Move to the last logical recordIndexKey Return the key expression of a specified indexIndexName Return the name of an order in the Order listIndexBagName Return the Order bag name of a specified OrderIndexOrder Return the position of an Order in the current Order ListLastRec Determine the number of records in the current DBF fileLoad Loads the record contents into the editing bufferLock Lock an open and shared database filePack Removes all record marked for deletionReCall Restore records marked for deletionRecCount Determine the number of records in the current DBF fileRecLock Lock the current recordRecNo Return the current record numberSave Saves the editing buffer contents into the DBF fileSetBuffer Activates/Deactivates the editing buffer .Seek Move to the record having the specified key valueSetOrder Set focus to an order in an Order listSetRelation Relate two work areasSkip Move relative to the current recordSkipper Try to skip a certain amount of recordsUnLock Release all locks for the current work areaUse Use a database file in a work areaUsed Determine whether a database file is in USEZap Remove all records from the current database file

Class TDbOdbc ODBC DataBase management--------------------------------------------------------------------------------

FiveWin implements the Class TDbOdbc to simulate the xBase managementstyle on any ODBC used table.

DATAs--------------------------------------------------------------------------------hStmt The handle of the SQL statement to process.oOdbc A reference to the related TOdbc session objectaFields Array containing all the DataBase fields descriptionnRetCode Returned code from the latest operationcLastComm The latest executed SQL command

METHODs--------------------------------------------------------------------------------New Constructor from source codeEnd Ends control and make it disappearCancel Cancels the current in process SQL statementExecute Execute an SQL statementGetCurName Gets the current assigned cursor nameGetOptionsInitFields Loads all DataBase fields descriptions into ::aFieldsLastCommand Last executed command

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

Page 141: Manual Do FiveWin

LastError Retrieves the last errorFieldGet Retrieves the contents of a fieldFieldGetBlob Retrieves the contents of a BLOB field into a disk fileFieldName Retrieves the name of a fieldFieldType Retrieves the type of a fieldFieldLen Retrieves the len of a fieldFieldDec Retrieves the number of decimals of a fieldParamDataPrepare Prepares a SQL command so next time won't be parsed againPutData Changes the current cursor pointed table valuesRowCount Retrieves the number of fields of the DataBaseSetCurName Sets a name for the cursor in useSetOptions Set several SQL optionsSetParam Sets a param description for next SQL statementSkip Skip to the next record

Class TDbm Class DataBase Manager--------------------------------------------------------------------------------

DATA--------------------------------------------------------------------------------aFields Array of fields objectsaIndexes Array of index objectsoDict related dictionary (Class TDict) object

METHODS--------------------------------------------------------------------------------New ConstructorRedefine Constructor from the dictionary (considered as a resource)AddField Adds a new field descriptionAddIndex Adds a new index descriptionReadFields Load the fields descriptions from the dictionary objectReadIndexes Load the indexes descriptions from the dictionary objectWriteFields Save the fields descriptions from the dictionary objectWriteIndexes Save the indexes descriptions from the dictionary objectCreate 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 performedbEnd 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 codeActivate 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

Page 142: Manual Do FiveWin

Class TDDEMLServer DDEML Server Object management--------------------------------------------------------------------------------

DATAs--------------------------------------------------------------------------------hInst A handle of the DDEML instance sessionhConv A handle of the DDEML conversationcService The name of the servicehService The handle of the servicelConnecting If the server is in the process of connecting with a ClienthSz2 Some processes require to hold a hSZ2 handle stored hereaClients An array with all the attended ClientsbOnConnect The action to perform when connecting to a clientbOnRequest The action to perform on a client requestbOnDisconnect The action to perform when a client disconnectsbOnExecute The action to perform on a Client Execute command

METHODs--------------------------------------------------------------------------------New Constructor METHODConnect Automatically called when a Client wants to connectConnectConfirm Automatically called when a Client has finally connectedDisconnect Automatically called when a Client has disconnectedExecute Automatically called when a Client has sent a commandRequest Automatically called when a Client has done a requestReturn Use this method to return data to a Client Request

Class TDDEMLClient DDEML Client Object management--------------------------------------------------------------------------------

DATAs--------------------------------------------------------------------------------hInst A handle of the DDEML instance sessionhConv A handle of the DDEML conversationcService The name of the servicehService The handle of the servicecTopic The name of the topic to keep the conversation abouthTopic The handle of the topicnTimeOut The timeout to wait for an answer. Default 1000. Use -1 forASync.

METHODs--------------------------------------------------------------------------------New Constructor METHODConnect To connect to a ServerDisconnect To disconnect from the ServerEnd Disconnects from the Server. Same as aboveExecute Sends a command to the Server.Request Request data from the Server.

Class TDialog Inherits from Class TWindow--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------cResName Resource Name of the DialoghResources Handle of the Resource where to find the DialoglCentered Logical value if centering the Dialog when paintinglModal Logical value if the Dialog Box is modal

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

Page 143: Manual Do FiveWin

lModify Logical value to allow using the Controls -notimplemented-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 codeCreate Build all dictionary related filesImport 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

Page 144: Manual Do FiveWin

Class TFile Low level files management as Objects--------------------------------------------------------------------------------

Class TFile is the base class for binary files manipulationFrom this class we inherit all file manager sub classes.

DATA--------------------------------------------------------------------------------cName File name.hFile Handle of the filenLen Length of the filenBufferLen Buffer length.nMode Opening Mode.

METHODS--------------------------------------------------------------------------------New Constructor from source codeCreate 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 asdefault.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 PromptsaDialogs Array of NonModal DialogBox objectsnOption Current selected pagenTabSize Size of the tabsoFont2 Bold Font typeaEnable Array of enabled pages

METHODS--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor from Resource

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

Page 145: Manual Do FiveWin

AddItem Adds an Item to the Folder.Default Default control initializationDelItem Deletes an Item from the Folder.Destroy Destroy the Folder object.Display Displays the control. Use :Refresh() to force repaintGetHotPos Returns the page index of a specified hotkeyGotFocus Event response code when receiving focusInit Generic Control initialization methodLButtonDown Action to be performed when clicking the mousePaint Draws the control. This process occurs internally from Display.Refresh Repaints the folder on the screenReSize Event response code when resizing the folderSetOption Changes the current active folder pageUpdate 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 fonthFontOld The handle of the font that was selected previouslylBold If it is boldlItalic If it is italiclUnderline If it is underlinelStrikeOut If it is strikeoutnHeight The height of the fontnWidth The width of the fontnEscapement The escapement of the fontnOrientation The orientation of the fontnWeight The weight of the fontnCharSet The charset of the fontnOutPrecision The outprecision of the fontnClipPrecision The clipprecision of the fontnQuality The quality of the fontnPitchFamily The pitch family of the font

METHODS--------------------------------------------------------------------------------New Constructor method. Builds a new fontChoose Builds a new font interactivelyEnd Finish the use of a font and release itActivate Set a font as defined for a specific device contextDeActivate Deselects the current font from the device context

Class TGet Inherits from TControl--------------------------------------------------------------------------------

DATAs--------------------------------------------------------------------------------oGet Standard MsDos Get related object to use its buffer contentsnClrFocusText Color for the get text when receiving focusnClrFocusPane Color for the get back when receiving focusnPos Position of the cursor (caret)

METHODs--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor for resourcesAssign Assigns the buffer value to the GET related variable

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

Page 146: Manual Do FiveWin

cGenPrg Generates the xBase source code of this controlCopy Copy the contents of the buffer in the ClipboardCreate Creates a GET control. Internally usedcText Get/Set the text of the TGet Object.cToChar Generates a data template to build a DialogCut Cut selected text and copies it at the clipboard.Default Default control initializationDispText Displays the buffer contentsEditUpdate Updates the variable and the displayGetDelSel Returns the text selected and deletedGetSel Retrieves the selected text from the TGet editing buffer.GetSelPos Returns the selected text positionsGotFocus Action to be performed when receiving the focusHandleEvent Generic events handlerInit Generic control initializationKeyChar Action to be performed when pressing a keyKeyDown 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 mouseLostFocus Action to be performed when losing the focuslValid Validates the getMouseMove Action to be performed when moving the mouse overMove Action to be performed when moving the mouse over the controlPaste Paste the Clipboard contents into the editing bufferRButtonDown Action to be performed when clicking the right button of mouse.Refresh Repaints the controlSave Updates the variable value from the bufferSelectAll 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

Page 147: Manual Do FiveWin

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 UniquelDdescending Ascending(default)/DescendingcComments Additional CommentscType

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 codeGet 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 analizerIt returns the different tokens found inside a file.

DATA--------------------------------------------------------------------------------aTokens Array of string tokens to identifyaIds Array of numeric identifiers for each found tokenlSkipBlank To automatic skip spaceslSkipCRLF To automatic skip carriage-return and line-feedcToken Last read token string valuecSeparators A string with all separators

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

Page 148: Manual Do FiveWin

cText To analyze text from memorynTxtPos Text index position when using cTextnTokNum Token identifier for numbers

METHODS--------------------------------------------------------------------------------New Constructor from source codelEoF 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 providesmanipulation for LIB files. See SAMPLES\TestLib.prg and TestLib2.prg

METHODS--------------------------------------------------------------------------------nSignature() Signature of a LIB filenPageSize() Number of pages inside LIBnDirPages() Number of pages of LIB diraModules() Array with all module names

Class TLibFile FROM TFile--------------------------------------------------------------------------------

Class TLibFile inherits from TFile and providesmanipulation for LIB files. See SAMPLES\TestLib.prg and TestLib2.prg

METHODS--------------------------------------------------------------------------------nSignature() Signature of a LIB filenPageSize() Number of pages inside LIBnDirPages() Number of pages of LIB diraModules() Array with all module names

Class TLinkList Managing Linked-Lists data structures--------------------------------------------------------------------------------

FiveWin implements a Class TLinkList to manage 'trees'. Trees are avisual representation of Linked-Lists data structures. Using a TWBrowseobject we can visually represent the Link-List structure as a treewhere each leave is a TTreeItem object.

Windows 95 implements its own 'Tree' control, but thanks to Class TLinkListand Class TTreeItem (and using a TWBrowse object) we may use trees underWindows 3.1 and NT 3.51.

See xBase TREE ... ENDTREE explanation to understand how to create atree object. Once the tree is created, you may visualize it using theTWBrowse Method SetTree( oTree ):

<oBrw>:SetTree( <oTree> )

DATAs--------------------------------------------------------------------------------

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

Page 149: Manual Do FiveWin

oFirst First item referenced by the LinkListoLast Last item referenced by the LinkList

METHODs--------------------------------------------------------------------------------Add Adds an item to the LinkListDraw Recalculates all drawing lines of the entire treeEnd Destroyes the LinkList objectGetLast Returns the last item of the LinkList (including subtrees)nCount Total Number of itemsOpenAll Open all subtreesEval Evals a codeblock for each TreeItem of the LinkList.

Class TListBox Inherits from TControl--------------------------------------------------------------------------------

DATA--------------------------------------------------------------------------------aItems Array of Items of the ListBoxaBitmaps Array of related bitmaps handles for ownerdraw ListBox.lOwnerDraw If it is a ownerdraw ListBox.nBmpHeigth Height of bitmaps if ListBox is OwnerDrawnBmpWidth Width of Bitmaps if Listbox is OwnerDrawcFileSpec FileSpec to display a fields directory items.bDrawItem Optional codeblock to select what bitmap to draw on a ownerdraw

METHODS--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor for resourcesAdd Add an Item to the list.aSelections Array with selected items on a MultiSelect ListBox.cGenPrn Generates the xBase source code of the controlChange Changed event handler.cToChar Generates a data template to build a DialogBoxDefault Default Listbox initializationDel 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 selectedGetSelCount Retrieves the number of selected items on a multiselect ListBoxGetSelItem Retrieves the current select item as textGoBottom Go to the last item in the listboxGoTop Go to the first item in the listboxInit Generic control initializationInsert Insert an Item.IsMultipleSel Check if the ListBox is multiple selection styleLen Retrieves the length of the list.LostFocus Behavior when losing the focusModify Modify the text of an Item.MouseMove Behavior when moving the mouse over the controlReset Empties the list.Select Select an item by its orderSet Select an item by its textSetBitmaps Sets the ownerdraw related bitmapsSetItems Changes the items of the listboxSetSel Selects a different item

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

Page 150: Manual Do FiveWin

SetSelItems Select a group of items on a multiselection ListBoxSwapDown Toggles an item with its following oneSwapUp Toggles an item with its preceding oneVScroll Vertical scroll events handler

Class TMail Windows MAPI management as objects--------------------------------------------------------------------------------

FiveWin - Windows MAIL services Object Oriented implementation

DATAs--------------------------------------------------------------------------------cSubject Mail subject descriptioncNoteText Text of the mailcMsgTypecConversationIDdDate Date of the mailcTime Time of the maillReceipt Has received the maillFromUser Interactively select the mail subject, target, etcaOrigin An array with all origin sendersaRecipients An array with all recipients receiversaFiles An array with all related files to send attached

METHODs--------------------------------------------------------------------------------New Constructor from source codeActivate Start the mail.End End the mail.

Class TMci Media Control Interface object oriented management--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------nError Last MCI errornId MCI device identifiercType Type of DevicecFileName Name of the file associated with the MCIoWnd Reference of the container window of the MCI Object

METHODS--------------------------------------------------------------------------------New Constructor from source codelOpen 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 structureoControl TControl object that is showed in child window

METHODS--------------------------------------------------------------------------------

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

Page 151: Manual Do FiveWin

New Generic constructor methodMaximize 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 focusNext Selects the next MdiChildPrev Selects the prev MdiChildReSize Behavior when resizing the MdiChildKeyDown Behavior when pressing a keySetControl Selects which control of the MdiChild has to be resizedautomatically

Class TMDIClient Inherits from Class TWindow--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------aWnd Array of TMDIChild objects

METHODS--------------------------------------------------------------------------------New Generic constructor methodTile Tile Child windowsCascade Cascade child windowsArrangeIcons 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 currentlyactive 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 ::aWndChildActivate Activate a different TMDICchild window.ChildMaximize Maximize a TMDICchild window.ChildRestore Restore a TMDICchild window.ChildClose Close a MdiChild windowChildNext Selects the next MdiChildResize Resizes the MdiClientlCloseAll Closes all the MdiChild ChildrenIconizeAll Iconizes all the Mdichild windowsKeyDown Behavior when pressing a keyMouseMove 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 methodTile Tile Child windowsCascade Cascade child windowsCloseAll Close all the MdiChild windowsIconizeAll Iconizes all the MdiChild windowsArrangeIcons 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

Page 152: Manual Do FiveWin

NextWindow Activate the child window immediately behind thecurrently active child window and place the currentlyactive child window behind all other child windows.

Resize Behavior when resizing the MdiFrameCommand Controls the WM_COMMAND messagesEnd Ends the window execution if VALID is .t.GotFocus Behavior when getting the focusSelect Select a MdiChild windowChildNew Creates an New TMDIChild.Release Destroy a TMDIFrame window and all his child objects

--------------------------------------------------------------------------------Class TMenu--------------------------------------------------------------------------------

DATA--------------------------------------------------------------------------------hMenu The Windows handle of the MenuaItems An array of MenuItemsoWnd A reference to the container Window of the MenulSysMenu If it is a System menulPopup If it is a popup menunHelpId The help topic identifier of this MenucVarName A variable name to identifier this object (visual editor)

METHODS--------------------------------------------------------------------------------New Creating a new MenuRedefine Creates a menu from resourceNewSys Redefining a SysMenuActivate PopMenu activating methodAdd Adding a new menuitem to the MenuAddEdit Adds standard editing menu optionsAddHelp Adds standard help menu optionsAddMdi Adds standard MDI menu optionsCommand Processes the user selection commandDelItems Invoked when destroying the menu. Destroys each menuitemDestroy Destroys the menuDisable Disables the entire menuEnd Ends the menuGetMenuItem Retrieves a reference to a MenuItem Object given its IdGetPopup Retrieves a reference to a contained Popup given its positionHelpTopic Invoked when pressing enter over this menuHilite Hilites a specific menuitemInit Called everytime the menu is going to be shownInsert Inserts a new menuitem at a specified positionLastItem A reference to last processed MenuItem ObjectLoad Changes some menu properties based on a binary infoRefresh Repaints the menuRelease Destroy the Menu ObjectReset Reset to the original System Menu of a WindowSave Generates a binary representation of the menuUnHilite DeHelites a specific menuitem

--------------------------------------------------------------------------------Class TMenuItem--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------cPrompt The label of the MenuItem

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

Page 153: Manual Do FiveWin

cMsg The text to be shown on the MsgBar of the main WindownId A numeric identifier for this menuitemnHelpId A numeric help topic identifier used to select invoked helpbAction The action to be performed when selecting the MenuItembWhen A codeblock to be avaluated to enable/disable the menuitemlChecked Logical value if the menuitem is checkedlActive Logical value if the menuitem is enabledlHelp If this is a menuitem help type (right placed)oMenu A reference of its container Menu objecthBitmap A handle to a Bitmap if defined

METHODS--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor from resourceDestroy 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 ObjectInspector).Event Retrieve the event from the event array.Load Set the properties of the menuitem based on a supplied binaryinformation.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

Page 154: Manual Do FiveWin

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. Eachmenuitem of a menu object is also an object. SEPARATORclause also may specify an optional menuitem variable tostore its related value.

<cMsg> The associated message of this control.

<cBmpFile> The name of a BMP file to be used as the label for amenuitem 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

Page 155: Manual Do FiveWin

<uWhen> An expression to be bloquified and evaluated to checkif 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.CHECKEDMARK

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 thepulldown 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 DimensionsnHeight DimensionsnXorig Origin in X axis.nYorig Origin in Y axis.lZoom if Zoom is enabled.lShadow If Shadow

METHODs--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor from resourceDisplay Displays the control. Use :Refresh() to force repaintEnd Ends control and make it disappearHide Hides the control.Paint Draws the control. This process occurs inside Display.SetCoorsSetFile Name of the metafile.SetOrg Set the X and Y origin.

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

Page 156: Manual Do FiveWin

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 MeternClrBar RGB color to use for the filled background of the meternClrBText RGB color to use for the filled text of the metercText The text to show on the meterlPercentage 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

Page 157: Manual Do FiveWin

<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 containeris 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 editingnPos The cursor position inside the control

METHODS--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor for resourcesAdjClient Adjust its dimensions to its container objectCopy Copy the selected text into the clipboardCreate Specific interface to WinApi CreateWindowcToChar Generates a data template to build a DialogCut Deletes the selected text and copies it into ClipboardDefault Default object initializationDelLine Deletes the specified line number. Default current oneFind Standard search text DialogBoxGetLine Retrieves the specified line number. Default current oneGetLineCount Retrieves the number of text linesGetCol Retrieves the current cursor colGetRow Retrieves the current cursor rowGotFocus Action to perform when getting the focusInit Generic initializationLostFocus Action to perform when losing the focusMouseMove Action to perform when moving the mouse over itRefresh Updates the text shown and forces repaintingSave Save the text into the associated variable

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

Page 158: Manual Do FiveWin

VScroll Vertical scrollbar events dispatcherKeyChar Process the keyboard inputSetPos Changes the cursor positionPaint Draws the textcText 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

Page 159: Manual Do FiveWin

[,<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

Page 160: Manual Do FiveWin

MULTILINE To use a multiple lines GET control to allow memoMEMO 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 andright 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 manageMRU lists on your menus !!! See SAMPLES\TestMru.prg for a test!

DATA--------------------------------------------------------------------------------aItems Array of MenuItemsnMaxItems Max Number of Items in the list.cIniFile Name of the associated ini file.cSection Section in the ini filecMsg Message for all MRU MenuItemsoMenu oMenu container of the MRU listoSeparator A reference of the SEPARATOR menuitem created above the MrunMenuPos oMenu container position of the MRU listbAction 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 showlCentered If the message should look centered at screenlInset If the message bar should look insetlActive Activate the MsgbarlDate If the message bar should look DatelClock If the message bar should look ClocklKbd If the message bar should look Keyboard status

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

Page 161: Manual Do FiveWin

oDate Related MsgItem object if DATE clause usedoTime Related MsgItem object if TIME clause usedoKbd Related MsgItem object if KEYBOARD clause usedoFontClock Font object for the Clock MsgItemoFontDate Font object for the Date MsgItemoFontKeyb Font object for the Keyboard MsgItemaItemnClrFore Foreground color as a RGB numbernClrBack Background color as a Rgb NumbernSizeItem

METHODs--------------------------------------------------------------------------------New Constructor from source codeAddItem Adds n Item to the MsgBar.Adjust Adjust the MsgBar dimensions to its container windowClockOff Turn off the clock.ClockOn Turn on the clock.DateOff Turn off the date.DateOn Turn on the date.Default Default initializationDelItem 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 mousePaint Draws the control. This process occurs inside Display.Refresh Repaints the controlSetMsg Set the text of the MsgBarShowMsgBar

--------------------------------------------------------------------------------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 codeClick Action to be performed when clicking the mouse.Refresh Repaints the itemSetFont 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

Page 162: Manual Do FiveWin

Class TObjFile inherits from TFile and providesmanipulation for OBJ files. See SAMPLES\TestObj.prg

OBJ files generated by any compiler are a database of variable lengthrecords. TObjFile Class lets you read and write OBJ files, thusgiving 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 OBJExtDef Writes a External definition record inside the OBJGrpDef Writes a Group definition record inside the OBJLeData Writes a Data block record inside the OBJLNames Writes the list of the local names of the OBJModEnd Writes the end of file record of the OBJPubDef Writes a Public definition record inside the OBJSegDef Writes a segment definition record inside the OBJSkipRec Go to next record inside the OBJTHeadr 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 pathcUser 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 statementMETHOD Execute( cCommand )

End Ends using the ODBC objectMETHOD End()

LastError Returns the last ODBC error descriptionMETHOD LastError()

--------------------------------------------------------------------------------Class TPages Multiple DialogBox Pages management--------------------------------------------------------------------------------

DATAs--------------------------------------------------------------------------------

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

Page 163: Manual Do FiveWin

nOption Current selected pageaDialogs Array of NonModal DialogBox objects

METHODs--------------------------------------------------------------------------------New Method Constructor from source codeRedefine Method Constructor from resourcesInit Generic control initializationDefault Control default initialization. Called from InitDestroy Generic destructor methodSetOption Sets a different selected pageGoPrev Selects the previous page to the current one selectedGoNext 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 pennStyle 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

Page 164: Manual Do FiveWin

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 (forexample, the Ellipse, Rectangle, RoundRect, Pie, and Chordfunctions). When this style is used with GDI outputfunctions that do not specify a bounding rectangle (forexample, the LineTo function), the drawing area of the penis 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 PennColor Specifies the color of the Pen as an RGB value

METHODs--------------------------------------------------------------------------------New Constructor MethodNew 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 (forexample, the Ellipse, Rectangle, RoundRect, Pie, and Chordfunctions). When this style is used with GDI outputfunctions that do not specify a bounding rectangle (forexample, the LineTo function), the drawing area of the penis not limited by a frame.

Values

#define PS_SOLID 0

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

Page 165: Manual Do FiveWin

#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 beused.

<oDevice> An optional device object to use its width as the widthunit reference.

Release Destroy MethodEnd Destroy Method. Use this method to destroy a Pen.

--------------------------------------------------------------------------------Class TPrinter--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------hDC Handle of the Device Context of the PrinterhDCOut Handle of the current metafile in use if file output specifiedaMeta Arrays of metafiles names generated in diskcDevice The name of the output devicecDocument The name of the spooler documentcDriver The name of the printer driver in usecModel Alternative printer to usecPort The name of the port usedcDir The path for the metafiles storage. By default TEMPnPage The page currently printednXOffset Coordinates of the virtual page originnYOffset Coordinates of the virtual page originlMeta If the output has to go to metafiles in disklModified If the printer device handle should be initialized againlStarted If the printing already startedoFont 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

Page 166: Manual Do FiveWin

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 printerResetDC 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 selectedoRadMenu Its related container TRadMenu ObjectnPos Relative position within respect to the other Menu Radiosbuttons

METHODS--------------------------------------------------------------------------------New Constructor from source code.ReDefine Constructor from resource.Click Mouse left button event handler.cToChar Generates a data template to build a DialogDefault Default control initialization.Init Generic control initialization.KeyDown Action to be performed when pressing a key.lIsChecked Retrieves its current logical valueMouseMove Behavior when moving the mouse over it.Refresh Repaints the controlSetCheck Changes its select/deselected state.

--------------------------------------------------------------------------------Class TRadMenu Manages a group of TRadio controls--------------------------------------------------------------------------------

DATA--------------------------------------------------------------------------------

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

Page 167: Manual Do FiveWin

aItems An array with all the Radio control itemsbSetGet A codeblock to control the related numeric variablebChange Action to perform when changing the radio selectedcMsg MsgBar text for its container windowlUpdate If the radio menu has to be updated from a TDialog:Update()

METHODS--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor from resourcesnOption SETGET Method which simulates the nOption DATARefresh Forces the whole control to be repaintedSet3DLook Activates the 3D look if its container is a windowEnd End all the radio elementsDisable Disables all the radio elementsEnable Enables all the radio elementsSetOption Changes the current selected radio optionSelect Select a different radio elementGoPrev Skips to previous radio elementGoNext Skips to next radio element

--------------------------------------------------------------------------------Class TRColumn-------------------------------------------------------------------------------

DATAoReport 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, RIGHTnPen The Report pen elements to uselTotal If the column has totallShadow If the column has to be filled with a shadow backgroundlGrid If the column has to be bordered with lines-------------------------------------------------------------------------------

METHODSNew 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

Page 168: Manual Do FiveWin

nLeft "nBottom "nRight "

METHODS--------------------------------------------------------------------------------

New Constructor for the rect--------------------------------------------------------------------------------Class TReport-------------------------------------------------------------------------------

DATAs-------------------------------------------------------------------------------oDevice The target device where to printoTitle A TRLine object which contains the report titleoHeader A TRLine object which contains the report headeroFooter A TRLine object which contains the report footeroRptWnd The related report windowoBrush An optional brush to use at the reportaGroups An array with all the report TRGroups objects definedaColumns An array with all the report TRColumns objects definedaFont An array with all the report TFont objects definedaCols 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 reportbFor 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 reportbChange A codeblock which holds the ON CHANGE clausecRptFile -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.cPageTotalcGrandTotalnWidth 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

Page 169: Manual Do FiveWin

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.nLogPixXnLogPixYnFirstdrownLastdrownTitleHeightnCounterlSummary 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 createdlPreview If a report preview is requiredlBreaklSpanish If Spanish language is usedlShadow If a shadow is going to be displayedlGrid If a Grid is going to be displayedCargo 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

Page 170: Manual Do FiveWin

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 xBasecommands.

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 columnposition.

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 calledwhen activating ( TReport::Activate() ) the report.

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

Page 171: Manual Do FiveWin

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 statemust be finish using ::End(). A report object will finish whenreceiving 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. Automaticallycalled 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

Page 172: Manual Do FiveWin

Executes the codeblock defined on the end of a group. Automaticallycalled 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. Automaticallycalled 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. Automaticallycalled 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

Page 173: Manual Do FiveWin

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 executionprocess.

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 1TOP 4RIGHT 2BOTTOM 5

nScale Inches or centimeters to be used:

INCHES 1CENTIMETERS 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

Page 174: Manual Do FiveWin

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

Page 175: Manual Do FiveWin

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-------------------------------------------------------------------------------

DATAoReport 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, RIGHTnPen The Report pen elements to uselTotal If the column has totallShadow If the column has to be filled with a shadow backgroundlGrid If the column has to be bordered with lines-------------------------------------------------------------------------------

METHODSNew 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

Page 176: Manual Do FiveWin

-------------------------------------------------------------------------------Class TTreeItem Trees TreeItems in FiveWin.--------------------------------------------------------------------------------

See Class TLinkList and xBase TREE ... ENDTREE commandfor 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 codeEnd Ends control and make it disappearAdd Adds a new following item.Close Closes the the treeitem.ColSizes Returns an array with colsizes to use for painting the browserow.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 opensit.

-------------------------------------------------------------------------------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.nCounterlEject 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

Page 177: Manual Do FiveWin

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, RIGHTnCol 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 effectscPicture The PICTURE to use when showing the SAYbGet A codeblock which returns the text to draw

METHODS--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor for resourcesDefault Default initialization processcGenPrg Generates a string with the source code of the SAYHandleEvent Specific SAY HandleEvent methodcToChar Generates a data template to build a DialogInit Generic initializationRefresh Forces the SAY to be repaintedSetText 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 positionlIsChild If belongs to a Window with ScrollBars stylenMin, nMax The numeric range to be represented by the Scrollbar

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

Page 178: Manual Do FiveWin

nPgStep The increment of value when PgUp or PgDn on the ScrollBarbGoUp A codeblock to eval when going upbGoDown A codeblock to eval when going downbGoTop A codeblock to eval when top is selectedbGoBottom A codeblock to eval when bottom is selectedbPageUp A codeblock to eval when PageUp is selectedbPageDown A codeblock to eval when PageDown is selectedbPos A codeblock to eval when the Thumb is moved to a new positionbTrack

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

valuesGoBottom Evaluates the bGoBottom block and updates thumb positionGoDown Evaluates the bGoDown block and updates thumb positionGoTop Evaluates the bGoTop block and updates thumb positionGoUp Evaluates the bGoUp block and updates thumb positionHandleEvent Redefined events managerInit Generic initializationMouseMove Specific MouseMove behaviorPageDown Evaluates the bPageDown block and updates thumb positPageUp Evaluates the bPageUp block and updates thumb positSetPos Changes the position of the thumbSetRange Changes the represented range of the ScrollBarThumbPos Changes the position of the ThumbThumbTrack

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

Class TSocket InterNet TCP/IP sockets support--------------------------------------------------------------------------------

DATA--------------------------------------------------------------------------------nPort socket port numbercIPAddr socket IP addressnTimeOut connection timeout valuenBackLog listen backlog valuenSocket socket handlehFile handle of a file transmited in chunksbAccept 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 incommingconnectionEnd() Generic destructor.HandleEvent() manages asyncronous connections events.GetData() Retrieves incomming data.

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

Page 179: Manual Do FiveWin

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 containtsaMembers array with struct members description

METHODs--------------------------------------------------------------------------------New() CONSTRUCTORAddMember( cName, nType, nLen ) Adds a new struct memberSetMember( nMember, uData ) Changes a struct member valueGetMember( nMember ) Retrieves a struct member valueSizeOf() INLINE Len( ::cBuffer ) Retrieves the struct total lengthOnError( 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 codeReDefine Constructor from resourcesAddItem Add an item to the folder.Default Default initializationDelItem Delete an item from the folder.Display Displays the control. Use :Refresh() to force repaintGetHotPos Returns the tabs option that matches a specified HotKey charInit Generic Control initialization methodLButtonDown Action to be performed when clicking the mousePaint Draws the control. Internally used by Display methodSetOption 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

Page 180: Manual Do FiveWin

Class TTime Time objects management--------------------------------------------------------------------------------

DATAs--------------------------------------------------------------------------------nTime time value as a numeric long

METHODs--------------------------------------------------------------------------------New Constructor from source codeSystem Constructor from computer system timeAddHours 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 stringcGetTime Retrieves current time as a string.cSub Returns the difference, as a string, from another timeSysChange Change system time.

--------------------------------------------------------------------------------Class TTimer--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------bAction The action to be performed on each intervallActive If the timer is currently activenId The API identifier of the timernInterval The interval of each action in 1/1000 secshWndOwner The handle of the window container of the timer

METHODs--------------------------------------------------------------------------------New Constructor method

TTimer:New( nInterval, bAction, oWnd )

Activate Activates the timerTTimer:Activate() --> nil

DeActivate Deactivates the timerTTimer:DeActivate() --> nil

Release Destroys the timerTTimer:Release() --> nil

--------------------------------------------------------------------------------Class TTxtEdit Ascii files visual editing. Inherits from TControl--------------------------------------------------------------------------------

DATAs--------------------------------------------------------------------------------aLines An array holding all the text linesaDelLines An array to store the deleted linesaRDelLines An array where to store the undo actionsnDelLines Max. number of deleted lines to storenVisLines Number of lines that fit in screennLineTop First line visible on screenlInsert Logical cursor insert modelChanged Text has changedcFileName Name of the related physical filenamecOperators 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

Page 181: Manual Do FiveWin

nRow Caret physical pixel row position inside the control surfacenCol Caret physical pixel col position inside the control surfacenLineRow Caret logical row position inside the control surfacenLineCol Caret logical col position inside the control surfacecTokens1 A string with the first group of tokens delimited with spacescTokens2 A string with the second group of tokens delimited with spacescTokens3 A string with the third group of tokens delimited with spacescBegWith A string with the group of begin-with tokens delimited withspacesnClrTok1 The first group of tokens colornClrTok2 The second group of tokens colornClrTok3 The third group of tokens colornClrBegin The begin-with group of tokens colornClrNumber The numbers tokens colornClrString The strings tokens colornClrOperator The operators tokens colornClrBBlock BackColor of a marked blocknClrFBlock ForeColor of a marked blocknBlkStaynBlkPosnBlkStart First logical line of the marked blocknBlkEnd Last logical line of the marked blocknTabLen Number of spaces to display for a TAB characternLeftMargin Left marginlVScroll Shows the vertical scrollbarlBackUp Makes a backup BAK file when start saving the file to disklUndo Allows undo operationsnOldLine Last selected text linelRegistered ClassData to store the WinApi registered state of the Class

METHODS--------------------------------------------------------------------------------New Constructor methodChange Always executed when there is a change in the textDelBlock Deletes the current marked blockDelCurLine Deletes the current selected lineDelete Response to Del KeyDelLine Deletes any lineDrawLine Draws any lineDrawCurLine Draws the current selected lineDisplay Shows all the text linesGoUp Try to go to the previous text lineGoDown Try to go to the next text lineInsLine Insert a text lineLoad Loads the text file from disknGetTokenColor Retrieves the defined color for a specified tokennLine Index line inside aLines arrayPaint Automatically called from inside Display methodSelFile Interactively select a new file to editGotFocus Action performed when getting the focusLostFocus Action performed when losing the focusKeyChar Action performed when generating a keystrokeKeyDown Action performed when pressing a keyLButtonDown Action performed when left clicking the mouseGoPrevLine Go to the previous text lineGoNextLine Go to the next text lineGoPrevChar Go to the previous characterGoNextChar Go to the next characterGoBeginLine Go to the beginning of the text lineGoEndLine Go to the end of the text lineGoPrevWord Go to the previous word

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

Page 182: Manual Do FiveWin

GoNextWord Go to the next wordToggleInsert Toggles the current insert modeReSize Action performed when resizing the controlSetFont Sets the font to use for displaying the text linesSetText Sets the text to edit from a stringVScrAdjust Vertical ScrollBar Range AdjustGoBottom Go to the last text lineGoTop Go to the first text lineGotoLine Interactively request the line to go toGoLine Go to a certain text linePageUp Go to the previous page of text linesPageDown Go to the next page of text linesDupLine Duplicates the current selected lineCopy Copies the current marked block into the ClipboardPaste Copies the clipboard contents into the current caret positionCut Deletes the current marked block and copies into the ClipboardJoinLine Joins the current line with the next text lineSplitLine Breaks the current line into two from the current caretpositionSave Save the text to a disk fileAddUndo Adds a new action to the array of 'UnDoable' actionsUndo Undoes the last performed operationRedo Redoes the last performed operationMouseMove Action to perform when moving the mouse over the controlPaintBlkDown Extends downwards the marked block and paints itPaintBlkUp 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 filenTLines The number of lines contained inside the ascii filenLine Current ascii line numbernMaxLineLength The maximum ascii line size permitted to be read. Default 1024nOffset The binary position inside the ascii file

METHODs--------------------------------------------------------------------------------New Constructor methodAdd Adds a new line to the ascii fileAppendLn Adds a new line to the ascii fileAdvance Skips to the next ascii lineDelLine Deletes an ascii lineGetValue Retrieves an ascii INI file section and key valueGoTo Jumps to a specific ascii line numberGoTop Jumps to the beginning of the ascii fileGoBottom Jumps to the end of the ascii fileInsLine Insert an ascii line in the current line positionLastRec Returns number of ascii text linesnRecno Returns the current ascii line numberReadLine Returns the current ascii line textReadLn Returns the current ascii line textRecCount Returns the number of ascii text linesRecNo Returns the current ascii line numberRepLine Duplicates the current ascii text lineRewind Skips to a previous line position

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

Page 183: Manual Do FiveWin

SetValue Changes an ascii INI file section and key valueSkip 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 codeReDefine Redefine a VBX to be used from resourcesInit Generic initialization of a VBXGetPropName Retrieves the name of a VBX property by its orderaGetProps Returns an array with all the properties namesDefault Default values for the initialization of the VBXSetProp Changes a VBX property by its orderGetName Retrieves the class name of the VBX control (API value)nGetProps Retrieves the number of properties of the VBXnGetEvents Retrieves the number of events of the VBXGetEvent Retrieves the name of a VBX event by its nameGetEnums Retrieves an array with a VBX enum all possible valuesGet Retrieves the value of a property by its nameSet Changes a VBX property the value of a property by its nameGetProp Retrieves the value of a property by its orderGetPropType Retrieves the type of a VBX propertyHandleEvent VBX specifically HandleEvent (inherits from TControl)VbxEvent Internal VBX events management function supportMouseMove 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 ObjectcAviFile The name of the associated AVI file.

METHODs--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor from resourcesInit Generic Control initialization methodPlay 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

Page 184: Manual Do FiveWin

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 onebChange 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

Page 185: Manual Do FiveWin

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 numbercIPAddress socket IP addressnTimeOut connection timeout valuenBackLog listen backlog valuenSocket 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 useAccept Constructor. Creates a clone from the listening host socketEnd Closes the connectionGetText Retrives the data that arrives to the socketSenData Sends data throught the socketListen Turns the socket into a listening host socket--------------------------------------------------------------------------------Class TWindow Main base Class--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------hWnd window handle hWndnOldProc Old window procedure when SubClassingbInit Code Block to execute on initializationbMoved Code Block to execute after moving the windowbLClicked Code Block to execute when left clicking with the mousebKeyDown Code Block to execute when pressing a keybPainted Code Block to execute when painting the WindowbRClicked Code Block to execute when right clicking with the mousebResized Code Block to execute after resizing a WindowbLDblClick Code Block to execute when left double clicking the mousebWhen Code Block for WHEN clausebValid Code Block for VALID clausebKeyChar Code Block to execute when pressing a no-control keybMMoved Code Block to execute when moving the mousebGotFocus Code Block to execute when receiving the focusbLostFocus Code Block to execute when losing the focuscCaption The caption of the WindowcPS Paint structure meanwhile paintingnPaintCount N. of times painting procedure has been invokedcMsg The text for the default message on the MsgBarCargo Standard Clipper general purpose user defined DATAhDC window Device Context handle while paintingnId Numeric identifier of the Window

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

Page 186: Manual Do FiveWin

lActive If the window is activelVisible If the window is visiblelFocused If the window has the focusnStyle Numeric windows style valuenChrHeight Standard height for characters of the windownChrWidth Standard width for characters of the windownLastKey Last key pressed on the windownTop window coordinatesnLeft window coordinatesnBottom window coordinatesnRight window coordinatesnClrPane Color of the background of the windownClrText Color of the foreground of the windownResult Numerical value after last activationlValidating If the window is in a process of validating a controlnHelpId The help topic identifier for this windowhCtlFocus Handle of the child control which has the focusaControls An array holding all the controls of the windowoBar Bar Object attached to the windowoBrush Brush Object attached to the windowoCursor Cursor Object attached to the windowoFont Font Object attached to the windowoIcon Icon Object attached to the windowoMenu Menu Object attached to the windowoSysMenu SysMenu Object attached to the windowoPopup Temporary popup menu acting over the windowoMsgBar MsgBar Object attached to the windowoWnd Window Object container of the windowoVScroll Vertical scrollbar Object attached to the windowoHScroll 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

Page 187: Manual Do FiveWin

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

Page 188: Manual Do FiveWin

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 objectlDebug AS LOGICAL Debug modenErrors AS NUMERICnErrFlag AS NUMERICnToken AS NUMERIC Last tokennTheState AS NUMERIC Actual statenState AS NUMERIC INIT 1 Index into aStatesnValue AS NUMERIC INIT 1 Index into aValuesaStates AS ARRAY INIT {}aLen AS ARRAY N. of rules of each stateaValues AS ARRAY INIT {}aDefRed AS ARRAY INIT {}aShift AS ARRAYaReduce AS ARRAYaSIndex AS ARRAY Array of shift indexesaRIndex AS ARRAY Array of reduce indexesaGIndex AS ARRAY Array of goto indexesaDGoto AS ARRAYaTable AS ARRAYaLHS AS ARRAY Left hand sideaCheck AS ARRAYaRules AS ARRAYuLValue Last left valueuValue Last right valuebShift AS BLOCKbReduce AS BLOCK

METHODS--------------------------------------------------------------------------------New Constructor from source codeParse Starts processing an input stream (file or string)Shift Shifts to a new stateReduce Reduces from a state and executes the production rule ifdefinedError 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

Page 189: Manual Do FiveWin

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

#include "Objects.ch"

CLASS <TMyClass> [ FROM <TParentClass> ]

[ EXPORT | PUBLIC ] \[ PROTECTED | READONLY ] | Scope clauses[ LOCAL | HIDDEN ] /

DATA <DataName> [ AS CHARACTER | NUMERIC | DATE | LOGICALCODEBLOCK | 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 maynot exceed from ten characters.

<TParentClass> Is the name of the Class from which we want to inherit anew 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 parametersto the methods.

Clauses--------------------------------------------------------------------------------

CONSTRUCTOR When we are going to initialize an Object and we want toautomatically return a reference to self.It is a good practice to first specify the methodsthat allows you to build an object (constructors).

SETGET They are for calculated Data. This means we will manipulatethis name of a method like a Data.

VIRTUAL Methods that do nothing. Very useful for inheritances andwhen you are starting creating and testing a Class.

BLOCK Extremely fast and easy to code, use this clause when youwant to declare 'inline' methods just from the definitionof the Class. We use a lot of them in FiveWin Classes. Youhave to specify as first parameter 'Self'.

All methods automatically require a first parameterwhich it is the 'Self'. Objects.ch automaticallyprovides 'Self' in standard METHODs, but in BLOCK

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

Page 190: Manual Do FiveWin

Methods you must specify it. So, BLOCK require tospecify 'Self' and the codeblock parameters:

METHOD <MethodName> BLOCK ;{ | Self, <arg1>, <arg2>, ..., <argN> | ... }

The advantadge of BLOCK methods over standardMETHODs is that they don't require to write therelated 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 codeblockmust be evaluated. On a standard METHOD a codeblockevaluation is not necessary, so we avoid one executionstep.

INLINE The same functionality than the BLOCK clause, but it ismuch more easy to use as it is not necessary to build thecodeblock -it is automatically built- It is better xBase!We plan in next versions of FiveWin to convert all ourBLOCK methods into INLINE clauses.

INLINE Methods get automatically converted into BLOCKmethods definition. It is just an easier and faster wayto code a BLOCK method. We recommend you to use INLINEmethods instead of BLOCK methods.

As INLINE methods get automatically preprocessed intoBLOCK methods, the 'self' is automatically provided soit 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. Anyapplication can then use the font.

Parameters:

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

Page 191: Manual Do FiveWin

<cFontFile> The name of an external file where we have storedsome fonts we want to use in our application.

<hFontResource> The handle of a module (DLL) where we have storedsome 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 MsDosinto a DBF is stored as OEM text. In this situationyou may call OemToAnsi() to properly review it frominside Windows.

Text that is captured from Windows is in Ansiformat. To use it from MsDos later, store it asthe result of AnsiToOem().

Source code: SOURCE\\WINAPI\\OemAnsi.c

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

Page 192: Manual Do FiveWin

--------------------------------------------------------------------------------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 Namesof 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 operationwas 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

Page 193: Manual Do FiveWin

Parameters:

<aArray> An array of objects.

<cMsg> A literal describing the OOP message to send to theobject. It is the same as doing the following code,but in a much more efficient way, and without havingto know in advance which OOP message will be sent tothe 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 usedto 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

Page 194: Manual Do FiveWin

a message Bar.

Returns: Nil

Observations: Used internally by Fivewin. You don't need to useit 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 aWinApi PAINTSTRUCT as a string. This variablehas to be supplied by reference.

Returns:

<hDC> The device context for the given window.

Comments: The BeginPaint function automatically sets theclipping region of the device context to excludeany area outside the update region. The updateregion is set by the InvalidateRect orInvalidateRgn function and by the system aftersizing, moving, creating, scrolling, or any otheroperation that affects the client area. If theupdate region is marked for erasing, BeginPaint sendsa WM_ERASEBKGND message to the window.

An application should not call BeginPaint exceptin response to a WM_PAINT message. Each callto the BeginPaint function must have acorresponding call to the EndPaint function.

If the caret is in the area to be painted,BeginPaint automatically hides the caret toprevent it from being erased.

If the window's class has a background brush,BeginPaint will use that brush to erase thebackground 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

Page 195: Manual Do FiveWin

--------------------------------------------------------------------------------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 traditionaldBase-III-Plus like Browse, very useful for prototypingapplications.

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

Page 196: Manual Do FiveWin

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 paintthe 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 intoappropriate 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 inthe MsDos mode command.

<cDevBlock> A string passed by reference that will receive thetranslated string. Its structure defines the controlsettings 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

Page 197: Manual Do FiveWin

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

Syntax: CallDll( <cFuntionDef>, <uParam1,...> ) --> <uResult>

Parameters:

<cFunctionDef> A special string which holds all the necessaryinformation to execute a certain action. This stringis automatically produced by the functionGetProcAddress().

<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 thisDLLs 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 specifiedwindow procedure.

Parameters:

<nWndProc> Specifies the procedure-instance address of the previouswindow procedure.

<hWnd> Identifies the window that will receive the message.

<nMsg> Specifies the message.

<nWParam> Specifies 16 bits of additional message-dependentinformation.

<nLParam> Specifies 32 bits of additional message-dependentinformation.

Returns: The return value specifies the result of the messageprocessing and depends on the message sent.

Observations: The CallWindowProc function is used for windowsubclassing. Normally, all windows with the same classshare the same window procedure. A subclass is a window

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

Page 198: Manual Do FiveWin

or set of windows belonging to the same window classwhose messages are intercepted and processed by anotherwindow procedure (or procedures) before being passedto the window procedure of that class.

The SetWindowLong function creates the subclass bychanging the window procedure associated with aparticular window, causing Windows to call the newwindow procedure instead of the previous one. Anymessages not processed by the new window procedure mustbe passed to the previous window procedure by callingCallWindowProc. This allows you to create a chain ofwindow 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 tothe 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 windowscontrol into a special string to be used for createdmemory windows resources templates.

Parameters:

<nTop>, <nLeft>, Control coordinates.<nBottom>, <nRight>

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

Page 199: Manual Do FiveWin

<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 describesthose values.

Observations: It is used internally by FiveWin when creatingDialogBoxes 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 wheninvoking the cGetExpression() DialogBox.

<cTitle> The title for the DialogBox. By default itshows "Expression builder".

Returns:

<cExpression> The expression built by the user.

Observations: This function is now only available from theIDE. If you want to use it in your applicationyou have to copy the RC for the DialogBox fromIDE.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

Page 200: Manual Do FiveWin

a file DialogBox.

Parameters:

<cFileMask> A string that contains a default filename, ora list of possible file types to select:

? cGetFile( "Hello.prg", "Select a file" )

In this case "Hello.prg" is shown as the defaultfilename.

If you want to specify some different types offiles 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 thatyou want to start the DialogBox with a certainfile type selected (if you are using the multiplefile types format).

To request lately what was the file type selected,you may use the function nGetFileFilter().

<cInitialDirectory> The initial directory where to startlooking 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 callingGetFirstInZip() 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

Page 201: Manual Do FiveWin

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

Syntax CurDrive() --> <cCurDrive>

Parameters None

Returns

<cCurDrive> The letter of the currently selecteddrive: "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 functionsmanagement, letting the user select a default HLP file which willbe accessed automatically, requesting different kind of services.The function may be called at the beginning of the execution of ourapplication 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 topicabout we want help. It can be a number or a string.If it is not specified, the default topic selectedwith HelpSetTopic() will be shown.

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

Page 202: Manual Do FiveWin

The topics identifiers are established by the helpfile author.

Returns

Nothing

Description

We may select a default topic to be called every time werequest 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 itscontaints.

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

Page 203: Manual Do FiveWin

--------------------------------------------------------------------------------cFileDisk() Retrieves the drive from a filename with path--------------------------------------------------------------------------------

Syntax: cFileDisk( <cFileName> ) --> <cDrive>

Parameters:

<cFileName> The filename whose drive to retrieve, if thedrive 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 theextension has been specified inside its filename.

Returns:

<cExtName> A three characters string with the extensionname.

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 amask has been specified inside its filename. A maskis 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

Page 204: Manual Do FiveWin

Syntax: cFileName( <cFullFileName> ) --> <cFileName>

Parameters:

<cFullFileName> The full filename including path and optionalextension.

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 optionalextension.

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 optionalextension.

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 optionalextension.

Returns:

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

Page 205: Manual Do FiveWin

<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 optionalextension.

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 thatdoes 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 optionalextension.

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

Page 206: Manual Do FiveWin

--------------------------------------------------------------------------------cFileNoPath() Retrieves the filename without path (as cFileName()) .--------------------------------------------------------------------------------

Syntax: cFileNoPath( <cFullFileName> ) --> <cFileName>

Parameters:

<cFullFileName> The full filename including path and optionalextension.

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 optionalextension.

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 optionalextension.

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

Page 207: Manual Do FiveWin

<cRootName> A root name to use to build a new filename thatdoes 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 controlsthe behavior of a function, for a FiveWin special one.

RestProc() replaces again this new procedure forthe old one.

Parameters:

<hWnd> The handle of the window to change its proc.

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

Page 208: Manual Do FiveWin

Returns:

<nOldProc> A number ( long pointer ) of the old procedure.

Observations: This function is used internally by FiveWin toautomatically subclass windows and controls and tomake them compatible with the OOPS architecture ofFiveWin.

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 wasperformed successfully.

Source code: SOURCE\\WINAPI\\Drawing.c

--------------------------------------------------------------------------------ChooseColor() Color selection standard DialogBox--------------------------------------------------------------------------------

Syntax: ChooseColor( <nRGBDefaultColor>, <nFlags> )--> <nRGBColor>

This function calls the Windows standard colorselection DialogBox.

Parameters:

<nRGBDefaultColor> The color that will appear automatically whenthe DialogBox starts.

<nFlags> An optional numeric value for some flags:

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

Page 209: Manual Do FiveWin

#define CC_PREVENTFULLOPEN 4

Disables the possibility of defining user definedcolors. FiveWin by default allows user definedcolors.

Returns:

<nRGBColor> The RGB value of the color selected. If noselection 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 fontselection DialogBox.

This function is automatically called fromTFont():Choose() METHOD and automates theprocess of providing parameters.

Also you may call TWindow():SelFont() METHOD fora much easier way of managing this.

Parameters:

<aPreviousFont> An array with the default font descriptionto 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 wherethe 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

Page 210: Manual Do FiveWin

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 agiven point on the screen to screen coordinates.

Parameters:

<hWnd> The handle of the window whose client area isused for the conversion.

<aPoint> An array of two elements that holds thecoordinates of the point. The two elements of thisarray are transformed accordingly with the newcalculated 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 operationwas completed successfully.

Observations: A window must close the clipboard after using it inorder 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

Page 211: Manual Do FiveWin

--------------------------------------------------------------------------------CloseComm() Closes the communication device and frees memory--------------------------------------------------------------------------------

Syntax: CloseComm( <nDeviceId> ) --> <lSuccess>

The CloseComm function closes the specifiedcommunications device and frees any memory allocatedfor the device's transmission and receiving queues.All characters in the output queue are sent beforethe communications device is closed.

Parameters:

<nDeviceId> Specifies the device to be closed. The OpenCommfunction returns this value.

Returns:

<lSuccess> A logical value indicating if the operation wassuccessful.

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 theascii 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

Page 212: Manual Do FiveWin

<cDevice> Name of the specific device to be supported( i.e. "Epson FX-80" )

<cOutPut> MsDos filename or device name of the physicaloutput 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 withDeleteDC(), and hDCs created with GetDC() must bereleased 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 fromresources, giving the name of the resource.

All these functions are used automatically fromthe FiveWin classes. Use the TDialog Class as itis much more powerful and easy to use.

Parameters:

<hInstance> Identifies an instance of the module whose executablefile contains the dialog box template. FiveWin suppliesa GetResources() function that returns the Instanceof the EXE or the handle of the resources DLL in use.

<cTemplateName> The name given to the DialogBox template in theresources.

<hWndOwner> The handle of the window which is the owner of theDialogBox. 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

Page 213: Manual Do FiveWin

<hWndOwner> ) --> <hDlg>

This function creates a modeless dialog box froma dialog box template in memory.

This function is used when a modeless dialog box iscreated from source code.

Use FiveWin classes instead of managing these functionsdirectly. Classes give you much more power and theyare much easier to use.

Parameters:

<hInstance> Identifies an instance of the module that willcreate the Dialog Box.

<cMemTemplate> A string that contains the binary descriptionof the Dialog Box template.

<hWndOwner> The handle of the window which is the owner of theDialogBox. 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 thespecified characteristics in the array aFontDescription.

This function is used from the TFont Class. UseClasses as they are much easier to use and more

powerful.

Parameters:

<aFontDescription> An array containing all the necessary informationfor 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

Page 214: Manual Do FiveWin

#define LF_PITCHANDFAMILY 13#define LF_FACENAME 14

Returns:

<hFont> The handle of the new created font. 0 if itas 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 specifiedhatched pattern and color. The brush can be subsequentlybe selected as the current brush for any device.

Parameters:

<nStyle> nStyle specifies the hatch style of the brush. Thisparameter can be one of the following values:

Value Meaning

HS_BDIAGONAL 45-degree upward hatch (left to right)HS_CROSS Horizontal and vertical crosshatchHS_DIAGCROSS 45-degree crosshatchHS_FDIAGONAL 45-degree downward hatch (left to right)HS_HORIZONTAL Horizontal hatchHS_VERTICAL Vertical hatch

<nRGBColor> specifies the foreground color of the brush (the colorof the hatches).

Returns:

<hBrush> The return value is the handle of the brush if thefunction is successful. Otherwise, it is NULL.

Observations: When an application has finished using the brushcreated by the CreateHatchBrush function, it shouldselect the brush out of the device context and thendelete 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

Page 215: Manual Do FiveWin

This function creates a brush whose pattern isspecified by a bitmap. The brush can be subsequentlybe selected for any device that support rasteroperations.

Parameters:

<hBitmap> Identifies the bitmap.

Returns:

<hBrush> The handle of the brush. It returns 0 if it wasnot 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 specifiedstyle, width and color. The pen can be subsequentlybe selected as the current pen for any device.

Parameters:

<nStyle> Specifies the pen style. This parameter can be oneof 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 penwidth is 1.)

PS_NULL Creates a null pen.PS_INSIDEFRAME Creates a pen that draws a line inside

the frame of closed shapes produced bygraphics device interface (GDI) outputfunctions that specify a bounding rectangle(for example, the Ellipse, Rectangle,RoundRect, Pie, and Chord functions). Whenthis style is used with GDI output functionsthat do not specify a bounding rectangle(for example, the LineTo function), thedrawing area of the pen is not limited by aframe.

<nWidth> Specifies the width, in logical units, of the pen. Ifthis value is zero, the width in device units isalways one pixel, regardless of the mapping mode.

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

Page 216: Manual Do FiveWin

<nRGBColor> Specifies the color of the pen.

Returns:

<hPen> The handle of the brush or 0 if it was not possibleto 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 specifiedcolor in nRGBColor. The brush can be subsequently beselected as the current brush for any device.

This functions are automatically called from FiveWinTBrush class. Use the class as it is much moreeasy to use.

Parameters:

<nRGBColor> Specifies a RGB color.

Returns:

<hBrush> The handle of the brush or 0 if it not was possibleto 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 frominside FiveWin TWindow Class. Use Classes as theymuch more powerful and easy to manage.

Parameters:

<cClassName> The name of the class of the window. Thisclass it is not related to an 5W oops class, butto a windows api own identification.

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

Page 217: Manual Do FiveWin

<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 newwindow.

<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 ofhow 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 thetraditional 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 ahand 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

Page 218: Manual Do FiveWin

temporarily while we are doing other tasks. Assoon as the API takes the control it will restorethe mouse cursor to the one associated to the windowwhich 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 ahand in a pointing position.

Parameters: None.

Returns: Nothing.

Observations: These functions let us change the mouse cursor justtemporarily while we are doing other tasks. Assoon as the API takes control it will restorethe mouse cursor to the one associated with the windowwhich 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 ahand in an 'ibeam' shape. (the one that we seewhen the mouse goes over a GET).

Parameters: None.

Returns: Nothing.

Observations: These functions let us change the mouse cursortemporarily while we are doing other tasks. Assoon as the API takes control it will restorethe mouse cursor to the one associated with the windowwhich is below the cursor.

Sample: SAMPLES\\TestCurs.prg

Source code: SOURCE\\WINAPI\\Cursors.c

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

Page 219: Manual Do FiveWin

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 ahand in a 'resize' shape. (the one that we seewhen the mouse resizes a window).

Parameters: None.

Returns: Nothing.

Observations: These functions let us change the mouse cursortemporarily while we are doing other tasks. Assoon as the API takes control it will restorethe mouse cursor to the one associated with the windowwhich 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 awaiting sand-clock (the one that we seewhen windows is processing).

Parameters: None.

Returns: Nothing.

Observations: These functions let us change the mouse cursortemporarily while we are doing other tasks. Assoon as the API takes control it will restorethe mouse cursor to the one associated with the windowwhich 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

Page 220: Manual Do FiveWin

CursorWE() Selects the Windows default WE cursor--------------------------------------------------------------------------------

Syntax: CursorWE() --> nil

This function changes the mouse cursor into ahorizontal arrow (the one that we seewhen windows is resizing horizontally).

Parameters: None.

Returns: Nothing.

Observations: These functions let us change the mouse cursortemporarily while we are doing other tasks. Assoon as the API takes control it will restorethe mouse cursor to the one associated with the windowwhich 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 intoits equivalent character expression.

This function is coded in C language and it isextremely 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

Page 221: Manual Do FiveWin

Use FiveWin DDE classes and xBase commands as theyare much easier to use and more powerful.

Parameters:

<hWndServer> The handle of the window which it is actingas 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 theyare much easier to use and more powerful.

Parameters:

<cDDECommand> A character expression that holds theDDE order we want to process.

Returns:

<pGlobalMemory> A numeric value which holds the pointer ofa 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 theyare 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

Page 222: Manual Do FiveWin

a global memory to be supplied to DDE services.

Returns:

<cDDECommand> A character expression that holds theDDE 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 theyare much easier to use and more powerful.

Parameters:

<hWndServer> The handle of the window which it is actingas 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 itto generate a personalized decrypted text.

Returns:

<cDecryptedText> The resulted decrypted text.

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

Page 223: Manual Do FiveWin

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 operationwas successful.

Observations: This function has been created to be able toreindex from scratch a MDX file (as a MDX indexwould 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 operationwas successful.

Observations: This function must only be used to destroy devicecontexts created with CreateDC() and never withGetDC().

Source code: SOURCE\\WINAPI\\dc.c

See also: CreateDC() GetDC() ReleaseDC()

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

Page 224: Manual Do FiveWin

--------------------------------------------------------------------------------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 (objectsinclude pens, brushes, fonts, bitmaps, regions,and palettes).

Parameters:

<hGDIObject> The handle of the GDI object, obtained withits corresponding creating function.

Returns:

<lSuccess> A logical value indicating if the operation wassuccessful.

Observations: FiveWin internally implements a resources controlsystem in order to avoid and control the problemsrelated 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 previouslycreated by the CreateCursor() or LoadCursor() functionand frees any memory that the cursor occupied.

Parameters:

<hCursor> Identifies the cursor to be destroyed. The cursormust not be in current use.

Returns:

<lSuccess> A logical value indicating if the operation wassuccessful.

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

Page 225: Manual Do FiveWin

The DestroyWindow function destroys the specifiedwindow. The function sends appropriate messages to thewindow to deactivate it and remove the input focus. Italso destroys the window's menu, flushes theapplication queue, destroys outstanding timers,removes clipboard ownership, and breaks theclipboard-viewer chain (if the window is at the top ofthe viewer chain).

It sends WM_DESTROY and WM_NCDESTROY messages to thewindow. If the given window is the parent of anywindows, DestroyWindow automatically destroys thesechild windows when it destroys the parent window. Thefunction destroys child windows first, and then thewindow itself.

The DestroyWindow function also destroys modelessdialog boxes created by the CreateDialog function.

FiveWin manages all these functions through Classes.Use FiveWin Classes as they are much easier to use andmore powerful.

Parameters:

<hWnd> The handle of the window to be destroyed.

Returns:

<lSuccess> A logical value indicating if the operation wassuccessful.

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 DialogBoxfrom a Dialog Box template resource.

Parameters:

<hInstance> Identifies an instance of the module whose executablefile contains the dialog box template. FiveWin suppliesa GetResources() function that returns the Instanceof the EXE or the handle of the resources DLL in use.

<cTemplateName> The name given to the DialogBox template in theresources.

<hWndOwner> The handle of the window which is the owner of theDialogBox. By default it is GetActiveWindow().

Returns:

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

Page 226: Manual Do FiveWin

<nResult> The parameter supplied to the functionEndDialog() used to terminate the execution of theDialog Box.

Observations: Use FiveWin Classes and xBase commands. They aremuch 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 DialogBoxfrom a Dialog Box template resource.

Parameters:

<hInstance> Identifies an instance of the module whose executablefile contains the dialog box template. FiveWin suppliesa GetResources() function that returns the Instanceof the EXE or the handle of the resources DLL in use.

<cMemTemplate> A string that contains the binary descriptionof the Dialog Box template.

<hWndOwner> The handle of the window which is the owner of theDialogBox. By default it is GetActiveWindow().

Returns:

<nResult> The parameter supplied to the functionEndDialog() used to terminate the execution of theDialog Box.

Observations: Use FiveWin Classes and xBase commands. They aremuch 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

Page 227: Manual Do FiveWin

Parameters:

<hDC> The handle of the device context to use.

<hMemBitmap> The handle of the DIB.

<hPalette> The handle of the palette associated to theDIB.

<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 wassuccessful.

Observations: When we started building FiveWin we first startedworking with bitmaps. Later we discovered that thegeneral recommendation was to work with DIBs. Sowe developed all the necessary functions to workwith DIBs. As our own experience increased, we believethat there is a better way (a mixture of both) that wasmuch faster and easier.

We did a lot of different tests, and our systemwas by far the fastest. It was a reason based onspeed and ease of use, because we wanted FiveWin tobe extremely fast! <g>

This later system is the one we currently use inFiveWin, though we do give support for both Bitmapsand DIBs.

You don't have to worry at all, just use FiveWinTBitmap Class and place yourself at thexBase & OOP level to get the maximum productivity.

Concentrate on your application, don't lose yourselfin 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 itsassociated palette.

Parameters:

<hBitmap> The handle of the bitmap to convert into a

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

Page 228: Manual Do FiveWin

DIB.

<hPalette> The handle of the palette associated tothe bitmap.

Returns:

<hDIB> The handle of the new DIB. (DIB = Deviceindependent bitmap).

Observations: We strongly recommend you to use TBitmap Classfor managing bitmaps. FiveWin process all thatyou 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 aDIB.

Parameters:

<hDIB> The handle of the new DIB. (DIB = Deviceindependent bitmap).

Returns:

<nHeight> The height of the DIB expressed in pixels.

Observations: We strongly recommend you to use TBitmap Classfor managing bitmaps. FiveWin process all thatyou 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 paletteassociated to the DIB.

Parameters:

<hDIB> The handle of the new DIB. (DIB = Deviceindependent bitmap).

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

Page 229: Manual Do FiveWin

Returns:

<hPalette> The handle of the palette associated withthe bitmap.

Observations: We strongly recommend you to use TBitmap Classfor managing bitmaps. FiveWin process all thatyou 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 readingit 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 = Deviceindependent bitmap).

Observations: We strongly recommend you to use TBitmap Classfor managing bitmaps. FiveWin process all thatyou 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 = Deviceindependent 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

Page 230: Manual Do FiveWin

for managing bitmaps. FiveWin process all thatyou 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 froma 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 Classfor managing bitmaps. FiveWin process all thatyou need automatically.

Returns:

<lSuccess> A logical value indicating if the operation wassuccessful.

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 intological coordinates.

The result is stored again into the same aPointarray.

Parameters:

<hDC> The handle of the device context.

<aPoint> An array of two values { x, y } representingthe coordinate.

Returns:

<lSuccess> If the operation was successful.

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

Page 231: Manual Do FiveWin

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 256colors without palette control) onto the specifieddevice 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 ANDoperator.

MERGEPAINT Combines the inverted source bitmapwith the destination bitmap by usingthe Boolean OR operator.

NOTSRCCOPY Copies the inverted source bitmap tothe destination.

NOTSRCERASE Inverts the result of combining thedestination and source bitmaps byusing the Boolean OR operator.

PATCOPY Copies the pattern to the destinationbitmap.

PATINVERT Combines the destination bitmap withthe pattern by using the Boolean XORoperator.

PATPAINT Combines the inverted source bitmapwith the pattern by using the BooleanOR operator. Combines the result ofthis operation with the destinationbitmap by using the Boolean OR operator.

SRCAND Combines pixels of the destination andsource bitmaps by using the BooleanAND operator.

SRCCOPY Copies the source bitmap to thedestination bitmap.

SRCERASE Inverts the destination bitmap andcombines the result with the sourcebitmap by using the Boolean ANDoperator.

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

Page 232: Manual Do FiveWin

SRCINVERT Combines pixels of the destination andsource bitmaps by using the BooleanXOR operator.

SRCPAINT Combines pixels of the destination andsource bitmaps by using the Boolean ORoperator.

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 devicecontext.

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 operationwas successful.

Observations: The handle of the icon must be loaded with LoadIcon()

We strongly recommend use of FiveWin TIcon Classas 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

Page 233: Manual Do FiveWin

rectangle. It formats text by expanding tabs intoappropriate spaces, aligning text to the left, right,or center of the rectangle, and breaking text intolines that fit within the rectangle.

The DrawText function uses the device context'sselected font, text color, and background color to drawthe text. Unless the DT_NOCLIP format is specified,DrawText clips the text so that the text does notappear outside the given rectangle. All formatting isassumed to have multiple lines unless theDT_SINGLELINE format is specified.

Parameters:

<hDC> The handle of the device context whereto 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. Thisvalue must be combined with DT_SINGLELINE.

DT_CALCRECT Determines the width and height of therectangle. If there are multiple lines oftext, DrawText will use the width of therectangle pointed by aRect and extend thebase of the rectangle to bound the lastline of text. If there is only one line oftext, DrawText will modify the right sideof the rectangle so that it bounds thelast character in the line. In either case,DrawText returns the height of theformatted 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 leadingin line height. Normally, external leadingis not included in the height of a line oftext.

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 thecharacter that follows, and the mnemonic&& as a directive to print a single &. Byspecifying DT_NOPREFIX, this processing isturned off.

DT_RIGHT Right-aligns text.DT_SINGLELINE Specifies single line only. Carriage

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

Page 234: Manual Do FiveWin

returns and line-feeds do not break theline.

DT_TABSTOP Sets tab stops. The high-order byte ofthe fuFormat parameter is the number ofcharacters for each tab. The default numberof characters per tab is eight.

DT_TOP Specifies top-aligned text (single lineonly).

DT_VCENTER Specifies vertically centered text (singleline only).

DT_WORDBREAK Specifies word breaking. Lines areautomatically broken between words if aword would extend past the edge of therectangle specified by aRect parameter.A carriage return/line-feed sequence willalso break the line.

Note that the DT_CALCRECT, DT_EXTERNALLEADING,DT_INTERNAL, DT_NOCLIP, and DT_NOPREFIXvalues cannot be used with the DT_TABSTOPvalue.

#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 functionis 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 specifiedrectangle coordinates. It uses the currently selectedpen and brush in the device context of the paint area.

Parameters:

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

Page 235: Manual Do FiveWin

<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 freesdata handles in the clipboard. It then assignsownership of the clipboard to the window thatcurrently has the clipboard open.

Parameters: None.

Returns:

<lSuccess> A logical value true if the operation wassuccessful.

Observations: The clipboard must be open when this functionis 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 andkeyboard input to the given function or control.When input is disabled, the window ignores inputsuch as mouse clicks and key presses. When inputis 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 ordisable operation.

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

Page 236: Manual Do FiveWin

Returns:

<lSuccess> A logical value true if the operation wassuccessful.

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 itto 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 causesthe DialogBox function to return.

Parameters:

<hWndDlg> The handle of the DialogBox to end.

<nResult> nResult is a numeric value that will be returnedby 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

Page 237: Manual Do FiveWin

This function signals the device context that theapplication has finished writing to a page. Normallywe 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 functionreturned zero.

SP_USERABORT User terminated the job by usingWindows Print Manager (PRINTMAN.EXE).

SP_OUTOFDISK Not enough disk space is currentlyavailable for spooling, and no morespace will become available.

SP_OUTOFMEMORY Not enough memory is available forspooling.

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 thegiven window. This function is required foreach BeginPaint() but only after painting iscomplete.

Parameters:

<hWnd> The handle of the window that is beingcurrently painted.

<cPS> A string that hold relevant informationabout the painting process. (it holds aPAINTSTRUCT 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

Page 238: Manual Do FiveWin

Syntax: ExitWindowsExec( <cExeName>, <cParams> ) --><lSuccess>

Parameters:

<cExeName> Identifies the MsDos EXE to execute. For batchfiles, it is the path of the command.com.

<cParams> Identifies the parameters to supply to theMsDos app. For a batch file you have toinclude '/c':

"/c batfile.bat"Returns:

<lSuccess> A logical value indicating that the operationwas 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 froma 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 isreturned.

Returns:

<hIcon> The handle of the icon. It is 0 if theoperation 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

Page 239: Manual Do FiveWin

rectangular region, using the currently selectedfont.

Parameters:

<hDC> The handle of the device context.

<nRow>, <nCol> The coordinates where to paint inside the rectspecified 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 wassuccessful.

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

Page 240: Manual Do FiveWin

<nYStart>

<nRGBColor> The RGB color to use for filling.

Returns:

<lSuccess> A logical value indicating if the operationwas 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 thetransmision or receiving queue of the specifiedcommunications 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 parameteris zero, the transmision queue is flushed. If theparameter 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 validdevice or if nQueue is not a valid device. Thereturn value is positive if there is an error for thespecified device. For a list of the possible errorvalues, 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 countof the loaded library module. When the reference countreaches zero, the memory occupied by the module isfreed.

Parameters:

<hInstance> The handle of the DLL. It is the valuereturned by LoadLibrary().

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

Page 241: Manual Do FiveWin

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 returnsa handle of a FiveWin logo built from memory. Itis 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 createsa bitmap to build the FiveWin extended style brushes.

Parameters:

<nBrushId> A numeric identifier to select the predefinedtype of brush.

Returns:

<hBitmap> The handle of the just created bitmap. FiveWinuses it to build the brush. The destruction of thisbitmap 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

Page 242: Manual Do FiveWin

Parameters: None

Returns: Nil

Comments: This function generates a GPF and breaksthe application. Don't use it! It is only providedin order to try the new FiveWin user definedGPFs 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 theactive window.

Parameters: None

Returns:

<hWnd> The handle of the window, or null if there isno 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

Page 243: Manual Do FiveWin

This function returns the handle of the windowthat 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 valuesrepresenting 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 kindof 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

Page 244: Manual Do FiveWin

Syntax: GetClientRect( <hWnd> ) --> <aRect>

This function retrieves the dimensions of thewindow 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 theClipBoard. FiveWin, right now, only supportstext manipulation through the Clipboard (thoughit is not a FiveWin limitation, just because wedid 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 thebitmap data.

CF_DIF The data is in Data Interchange Format(DIF).

CF_DSPBITMAP The data is a bitmap representation of aprivate format. This data is displayed inbitmap format in lieu of the privatelyformatted data.

CF_DSPMETAFILEPICT The data is a metafile representationof a private data format. This data isdisplayed in metafile-picture format inlieu of the privately formatted data.

CF_DSPTEXT The data is a textual representation of aprivate data format. This data is displayedin text format in lieu of the privatelyformatted data.

CF_METAFILEPICT The data is a metafile (see thedescription of the METAFILEPICT structure.

CF_OEMTEXT The data is an array of text charactersin the OEM character set. Each line endswith a carriage returnlinefeed (CR-LF)combination. A null character signals theend of the data.

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

Page 245: Manual Do FiveWin

CF_OWNERDISPLAY The data is in a private format thatthe 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.

Eachline ends with a carriage returnlinefeed(CR-LF) combination. A null charactersignals 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 asubset of the CF_RIFF data format; it canbe 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 valueand current status for the specified device.

Parameters:

<nIdComDev> The communications device identifier createdwith the OpenComm() function.

<cComStat> A string that will receive the informationfor 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

Page 246: Manual Do FiveWin

Syntax: GetCoors( <hWnd> ) --> <aCoors>

This is a FiveWin function that retrieves theabsolute 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 devicecontext 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 virtualscreen. Something similar when in MsDos we didDispBegin() and DispEnd() with Clipper.

GetDC() it is like DispBegin(). Starts workingwith a virtual screen. ReleaseDC() it is likeDispEnd(), and updates all painting to thevisible screen.

If you don't ReleaseDC() after you do a GetDC(),you are unbalancing windows, and the systemfinally 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

Page 247: Manual Do FiveWin

This funtion retrieves the handle of the desktopwindow.

Parameters: None

Returns:

<hWndDesktop> The handle of the desktiop window.

Observations: The desktop window it is also a window, createdby windows and you may manipulate it and controlit 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 informationabout 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 plotterDT_RASDISPLAY Raster displayDT_RASPRINTER Raster printerDT_RASCAMERA Raster cameraDT_CHARSTREAM Character streamDT_METAFILE MetafileDT_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

Page 248: Manual Do FiveWin

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 validonly if the device driver sets the RC_PALETTE bit in theRASTERCAPS index; it is available only if the driver iswritten for Windows 3.0 or later.

NUMRESERVED Number of reserved entries in the system palette. Thisindex is valid only if the device driver sets theRC_PALETTE bit in the RASTERCAPS index; it is availableonly if the driver is written for Windows 3.0 or later.

COLORRES Color resolution of the device, in bits per pixel. This indexis

valid only if the device driver sets the RC_PALETTE bit inthe RASTERCAPS index; it is available only if the driver iswritten for Windows 3.0 or later.

RASTERCAPS Raster capabilities the device supports. It can be acombination 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 acombination 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

Page 249: Manual Do FiveWin

CC_ROUNDRECT Supports rectangles with rounded corners.

LINECAPS Line capabilities the device supports. It can be acombination 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 acombination 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 acombination of the following values:

Value Meaning

TC_OP_CHARACTER Supports character output precision, which indicates thedevice can place device fonts at any pixel location. This isrequired for any device with device fonts.

TC_OP_STROKE Supports stroke output precision, which indicates thedevice can omit any stroke ofa device font.

TC_CP_STROKE Supports stroke clip precision, which indicates the device canclip device fonts to a pixel boundary.

TC_CR_90 Supports 90-degree character rotation, which indicates thedevice can rotate characters only 90 degrees at a time.

TC_CR_ANY Supports character rotation at any degree, which indicatesthe device can rotate device fonts through any angle.

TC_SF_X_YINDEP Supports scaling independent of x and y directions, whichindicates the device can scale device fonts separately in xand y directions.

TC_SA_DOUBLE Supports doubled characters for scaling, which indicates thedevice can double the size of device fonts.

TC_SA_INTEGER Supports integer multiples for scaling, which indicates thedevice can scale the size of device fonts in any integermultiple.

TC_SA_CONTIN Supports any multiples for exact scaling, which indicatesthe device can scale device fonts by any amount but stillpreserve the x and y ratios.

TC_EA_DOUBLE Supports double-weight characters, which indicates thedevice can make device fonts bold. If this bit is not set for

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

Page 250: Manual Do FiveWin

printer drivers, graphics device interface (GDI) attempts tocreate bold device fonts by printing them twice.

TC_IA_ABLE Supports italics, which indicates the device can makedevice fonts italic. If this bit is not set, GDI assumesitalics are not available.

TC_UA_ABLE Supports underlining, which indicates the device canunderline device fonts. If this bit is not set, GDI createsunderlines for device fonts.

TC_SO_ABLE Supports strikeouts, which indicates the device canstrikeout device fonts. If this bit is not set, GDI createsstrikeouts for device fonts.

TC_RA_ABLE Supports raster fonts, which indicates that GDI shouldenumerate any raster or TrueType fonts available forthis device in response to a call to the EnumFonts orEnumFontFamilies function. If this bit is not set,GDI-supplied raster or TrueType fonts are not enumerated whenthese functions are called.

TC_VA_ABLE Supports vector fonts, which indicates that GDI shouldenumerate any vector fonts available for this device inresponse to a call to the EnumFonts or EnumFontFamiliesfunction. This is significant for vector devices only (thatis, for plotters). Display drivers (which must be able touse raster fonts) and raster printer drivers always enumeratevector fonts, because GDI rasterizes vector fonts beforesending 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

Page 251: Manual Do FiveWin

#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 unitsused by Windows when creating DialogBoxes. Anapplication should use these values to calculatethe average width of characters in the system font.

Parameters: None

Returns:

<nBaseUnits> A long value ( 4 bytes ) containing the widthand the height in pixels used by Windows in theconversion of units for the DialogBoxes coordinates:( in Windows, DialogBoxes use logical units )

nWidth = ( x * nLoWord( GetDialogBaseUnits() ) ) / 4nHeight = ( y * nHiWord( GetDialogBaseUnits() ) ) / 8

x and y are the width and height in units of theDialogBox.

FiveWin controls all these processes automaticallythrough the TDialog Class and DialogBoxes xBasecommands.

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 fromits first file.

Returns:

<aFileInfo> An array of 9 items containing the following

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

Page 252: Manual Do FiveWin

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 filenameaFileInfo[ 3 ] // DateaFileInfo[ 4 ] // TimeaFileInfo[ 5 ] // File sizeaFileInfo[ 6 ] // Compressed sizeaFileInfo[ 7 ] // offset insize the ZIP fileaFileInfo[ 8 ] // Pack MethodaFileInfo[ 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 controlfrom 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 tothe file. Use the format: "HH:MM:SS".

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

Page 253: Manual Do FiveWin

<cdDate> Specifies a different date to be set tothe file. Use the format: "DD:MM:YYYY". Youcan use both a date or a string type.

Returns:

<aDateTime> An array of two elements with the time anddate 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 somespecific 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

Page 254: Manual Do FiveWin

Syntax: GetFreeSpace() --> <nSize>

This function scans the global heap and returnsthe 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 continuoussize.

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 Windowsassigns 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 beeingpressed.

Parameters:

<nKey> The code of the key that we want tocheck (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

Page 255: Manual Do FiveWin

<uLocal>

Parameters:

<nStackLevel> The depth of the activation level to query.(Similar to Clipper ProcName(...) parameters). A 0value means the current one. 1 means the previous,2 the previous of that one, etc... By default it is0.

<nIndex> The order in which the local variableswere 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 modefor 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 toarbitrary units with arbitrarilyscaled axes.Setting the mapping mode toMM_ANISOTROPIC does not change thecurrent window or viewport settings.To change the units, orientation, andscaling, an application should use theSetWindowExt and SetViewportExtfunctions.

MM_HIENGLISH Each logical unit is converted to0.001 inch. Positive x is to theright; positive y is up.

MM_HIMETRIC Each logical unit is converted to 0.01millimeter. Positive x is to the right;positive y is up.

MM_ISOTROPIC Logical units are converted toarbitrary units with equally scaledaxes; that is, one unit along thex-axis is equal to one unit along the

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

Page 256: Manual Do FiveWin

y-axis. The SetWindowExt andSetViewportExt

functions must be used to specifythe desired units and the orientationof the axes. GDI makes adjustments asnecessary to ensure that the x and yunits remain the same size.

MM_LOENGLISH Each logical unit is converted to 0.01inch. Positive x is to the right;positive y is up.

MM_LOMETRIC Each logical unit is converted to 0.1millimeter. Positive x is to theright; positive y is up.

MM_TEXT Each logical unit is converted to onedevice pixel. Positive x is to theright; positive y is down.

MM_TWIPS Each logical unit is converted to 1/20of a point. (Because a point is 1/72inch, a twip is 1/1440 inch). Positivex 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 followingnext file in ZIP information. GetFirstInZip() mustbe 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 filenameaFileInfo[ 3 ] // DateaFileInfo[ 4 ] // TimeaFileInfo[ 5 ] // File sizeaFileInfo[ 6 ] // Compressed sizeaFileInfo[ 7 ] // offset insize the ZIP fileaFileInfo[ 8 ] // Pack MethodaFileInfo[ 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

Page 257: Manual Do FiveWin

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

Syntax: GetParam( <nStackLevel>, <nIndex> ) --><uParameter>

Parameters:

<nStackLevel> The depth of the activation level to query.(Similar to Clipper ProcName(...) parameters). A 0value means the current one. 1 means the previous,2 the previous of that one, etc... By default it is0.

<nIndex> The order in which the parameter valueswere 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 containerwindow (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

Page 258: Manual Do FiveWin

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 WindowsDialogBox to select printing conditions andreturns the associated device context createdfor the printer.

Parameters:

<hWndOwner> The handle of the window that may containsthe DialogBox. By default it is GetActiveWindow().

Returns:

<hDC> The handle of the device context for theprinter.

Observations: FiveWin offers a powerfull TPrint Class and a ReportEngine that automatizes all printing processes makingthem 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 thesystem printer. This system printer is the printerthat is installed in Windows as the default priner.

Observations: This function is automatically called from theTPrinter class to create a printer object withoutprompting with the standard printing selectionDialogBox.

Source code: SOURCE\\WINAPI\\PrintDc.c

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

Page 259: Manual Do FiveWin

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 previouslywe have loaded with LoadLibrary().

<cProcName> The name of the function, or its order numberinside the DLL.

<lPascalType> True is the function to be used is PASCAL type.Normally most of Windows API functions are PASCALtype.

<nReturnType> A numeric value that indicates the type of valuereturned by the function to be called.

The nReturnType possible values are inside FiveWinDLL.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 ofthe DLL function to be called plus necessary informationabout the type, parameters and return type.

The information here contained is vital to properlybuild a C-language alike stack and its manipulation.

Observations: This function is automatically used from the FiveWinDLL management xBase commands. We strongly recommendto use the xBase commands to use this function, as

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

Page 260: Manual Do FiveWin

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 ifthe entry cannot be found.

Returns:

<nValue> The numeric value in the INI file that followsthe specified entry.

Observations: This function retrieves a value from the WIN.INIfile.

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 ifthe entry cannot be found.

Returns:

<cValue> The string value in the INI file that followsthe specified entry.

Observations: This function retrieves a value from the WIN.INIfile.

Sample: SAMPLES\\TestIni.prg

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

Page 261: Manual Do FiveWin

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 tobe searched.

<cPropIdentifier> A string identifies the data to be retrieved.

Returns:

<hData> The data handle of the associated propertyof the window.

Observations: FiveWin uses this API function for storing someextra values related to the windows, dialogs andcontrols.

Basicly these functions let you assciate extravalues to the windows, and later you can retrievethem. 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 ifthe 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 followsthe specified entry.

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

Page 262: Manual Do FiveWin

Observations: This function retrieves a value from a user definedINI 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 ifthe 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 followsthe specified entry.

Observations: This function retrieves a value from a user definedINI 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 toretrieve the handle. This parameter can be oneof 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

Page 263: Manual Do FiveWin

#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, dialogbox controls, and other text. In Windowsversions 3.0 and later, the systemfont is a variable-pitch font width;earlier versions of Windows use afixed-pitch system font.

SYSTEM_FIXED_FONT Fixed-pitch system font used inWindows versions Earlier than 3.0.This object is available forcompatibility with earlier versions ofWindows.

DEFAULT_PALETTE Default color palette. This paletteconsists of the static colors in thesystem palette.

Returns:

<hGDIObject> The return value is the handle of the specifiedobject 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

Page 264: Manual Do FiveWin

<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 heightis to be retrieved.

Returns:

<nFontHeight> The height of the currently selected fontfor 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 heightis to be retrieved.

Returns:

<nFontWidth> The width of the currently selected font forthat 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 Windowsand MsDos versions:

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

Page 265: Manual Do FiveWin

{ 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 originalfunction and the returned window. This parametercan be one of the following values:

GW_CHILD Identifies the window's first childwindow.

GW_HWNDFIRST Returns the first sibling window fora child window; otherwise, itreturns the first top-level window inthe list.

GW_HWNDLAST Returns the last sibling window for achild window; otherwise, itreturns the last top-level window inthe list.

GW_HWNDNEXT Returns the sibling window thatfollows the given window in thewindow manager's list.

GW_HWNDPREV Returns the previous sibling window inthe window manager's list.

GW_OWNER Identifies the window's owner.

Returns:

<hWndSearched> The handle of the searched window. 0 if itnot successful.

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

Page 266: Manual Do FiveWin

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 beretrieved.

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 associatedword ( two bytes ) value is to be retrieved.

<nIndex> Specifies the zero-based index order of the valueto be retrieved.

#define GWW_HINSTANCE (-6)#define GWW_HWNDPARENT (-8)#define GWW_ID (-12)

GWW_HINSTANCE Specifies the instance handle of themodule that owns the window.

GWW_HWNDPARENT Specifies the handle of the parentwindow, if any. The SetParent functionchanges the parent window of a childwindow. An application should not callthe SetWindowWord function to changethe parent of a child window.

GWW_ID Specifies the identifier of the childwindow.

Returns:

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

Page 267: Manual Do FiveWin

<nValue> The returned value specifies information about thegiven 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 mainapplication 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 framewindow.

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 isto 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

Page 268: Manual Do FiveWin

--------------------------------------------------------------------------------GetWndTask() Retrieves the window associated task handle--------------------------------------------------------------------------------

Syntax: GetWndTask( <hWnd> ) --> <hTask>

Parameters:

<hWnd> The handle of the window whose task isto be retrieved.

Returns:

<hTask> The handle of the task in which thatparticular 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 atomtable to return a unique value for it.

Returns:

<nAtom> A numeric value (nAtom) unique for thatstring.

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 notit returns again the same <hGlobalMem> supplied.

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

Page 269: Manual Do FiveWin

Observations: This functions are only recommend for very advancedwindows 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

Page 270: Manual Do FiveWin

Parameters

cString Is an optional parameter to specify the string we want tosearch.

Returns

Nothing

Description

HelpSearch() calls the WinHelp search Dialog. If we have specifieda string to search then, automatically, the result of the searchis 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 thecoordinates where WinHelp appears. Windowsassigns logical dimensions of 1024 x 1024dots 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

Page 271: Manual Do FiveWin

cTopic is a string that let us specify the default topicwhere automatically show help.

Returns

Nothing

Description

It lets us select a help default topic. We may change this topicfrom 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 toreview. If we specify strings we have to use '_' insteadof 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

Page 272: Manual Do FiveWin

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 theread byte.

Comments: Use these functions only to accesshardware ports. Communication ports must beaccessed 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 theread word.

Comments: Use these functions only to accesshardware ports. Communication ports must beaccessed 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 evaluatewhen an occasional GPF occurs.

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

Page 273: Manual Do FiveWin

Returns:

<lSuccess> A logical value indicating if the GPF controllerwas properly installed.

Comments: Though FiveWin has been extensively testedagainst GPFs, we wanted to offer control overa possible GPF offering so an opportunity to takecontrol to close all files and generating anerror.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 controllerwas properly uninstalled.

Comments: Though FiveWin has been extensively testedagainst GPFs, we wanted to offer control overa possible GPF offering so an opportunity to takecontrol to close all files and generating anerror.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 asabove.

Parameters:

<hWnd> The handle of the window whose update regionget invalid and should be painted.

<aRect> Specifies the dimensions of the rectangle thatneeds 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

Page 274: Manual Do FiveWin

Returns: Nil.

Observations: This function forces a window region or its wholearea to be repainted. Basically it generates aWM_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 windowrectangle. Basically if performs an xOR operationover the colors. Thus, inverting twice a regionwill 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 specifieddrive 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

Page 275: Manual Do FiveWin

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 specifieddrive 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 itis iconized.

Returns:

<lIconic> A logical value indicating if the window isiconized.

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 avalid ZIP file.

Sample: SAMPLES\\TestZip.prg

Source code: SOURCE\\FUNCTION\\UnZip.c

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

Page 276: Manual Do FiveWin

--------------------------------------------------------------------------------IsZoomed() Checks if a window is maximized--------------------------------------------------------------------------------

Syntax: IsZoomed( <hWnd> ) --> <lMaximized>

Parameters:

<hWnd> The handle of the window to check if itis maximized.

Returns:

<lMaximized> A logical value indicating if the window ismaximized.

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 itis a valid handle.

Returns:

<lIsWindow> A logical value indicating if the window handleis 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 itis visible.

Returns:

<lVisible> A logical value indicating if the window isvisible.

Source code: SOURCE\\WINAPI\\WndIs.c

--------------------------------------------------------------------------------KillTimer() Removes the specified timer--------------------------------------------------------------------------------

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

Page 277: Manual Do FiveWin

Syntax: KillTimer( <hWnd>, <nIdTimer> ) --> <lSuccess>

Parameters:

<hWnd> The handle of the window associated withthe timer to be removed. This must be the samevalue passed as the hWnd parameter of the SetTimerfunction that created the timer.

<nIdTimer> Identifies the timer to be removed. It is thevalue returned by SetTimer() function.

Returns:

<lSuccess> A logical value indicating the result of theKillTimer() 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 withnValue2.

<nValue1> A numeric value to be bit-anded withnValue1.

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

Page 278: Manual Do FiveWin

Returns:

<lResult> A logical value with the result of the bit-andoperation.

Observations: This function basically checks if a certain bitflag 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 controlwhose nItem text is to be retrieved.

<nItem> Identifies the 1 based index of the item whosetext is to be retrieved.

Returns:

<cText> The text associated with that ListBox item.

Observations: This function is used by FiveWin in the TListBoxclass. Use the TListBox class methods insteadof 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() couldchange into it.

Sample: lChDir( "c:\\" )

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

Page 279: Manual Do FiveWin

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 checkif 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

Page 280: Manual Do FiveWin

<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 paintingposition 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 bitmapto be loaded.

<cnBitmap> The name or the numeric identifier of thebitmap to load.

Returns:

<hBitmap> The handle of the bitmap loaded.

Observations: Don't use this function to load a bitmap fromdisk. 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 cursorto be loaded.

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

Page 281: Manual Do FiveWin

<cnCursor> The name or the numeric identifier ofthe cursor to be loaded.

Returns:

<hCursor> The handle of the loaded cursor. 0 ifnot 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 thatcontains the icon to be loaded.

<cnIcon> The name or the numeric identifier ofthe icon to be loaded.

Returns:

<hIcon> The handle of the loaded icon, or 0if 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

Page 282: Manual Do FiveWin

containing WIN.COM); the GetWinDir()function retrieves the path of this directory.

3 The Windows system directory (the directorycontaining such system files as GDI.EXE);the GetSysDir() function retrieves the path ofthis directory.

4 The directory containing the executable filefor the current task; the GetModuleFileNamefunction retrieves the path of this directory.

5 The directories listed in the PATH environmentvariable.

6 The list of directories mapped in a network.

The return value is the instance handle of the loaded library module if thefunction is successful. Otherwise, it is an error value less thanHINSTANCE_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 relocationswere 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 functionloads it from the specified file.

LoadLibrary increments the reference count for a library module each timean application calls the function. When it has finished using the module, theapplication should use the FreeLibrary function to decrement (decrease by one)the reference count.

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

Page 283: Manual Do FiveWin

An application can use the GetProcAddress function to access functions in alibrary 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 containsthe string to be loaded.

<nResId> The numeric identifier of the stringresource 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 tobe mapped into device coordinates.

Returns:

<lSuccess> If the operation was completed successfully.

Observations: This function store the new values inside thesame 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

Page 284: Manual Do FiveWin

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 willbe 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 toa File. Please note, that you can not save a codeblockto disc; if an Array element contains such acodeblock, it will be NIL after retrieval.

If you need to work with a codeblock in a class, thenhardcode the block as a setget method instead ofstoring 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 isalready working.

Observations: This function is used by FiveWin to check thatthe app is already processing and dispatchingevents.

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 theresult.

Returns:

<lSuccess> If the operation was completed successfully.

Observations: This function simplifies several API function,

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

Page 285: Manual Do FiveWin

using them automatically to perform thedesired 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 theaRect 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 intoa 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 aMEASUREITEM WinApi struct.

<nHeight> The height to be assigned into thatMEASUREITEM struct.

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

Page 286: Manual Do FiveWin

Returns:

<lSuccess> If the operation has been performedsuccessfully.

Observations: This function is managed automatically byFiveWin 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 themenuitem

<oMenu> The oMenu container of this menuitem

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

Page 287: Manual Do FiveWin

<bBlock> The action to be performed by this menuitem suppliedas 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 frominside 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 FiveWinfrom 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 allits submenus built and initialized.

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

Page 288: Manual Do FiveWin

Observations: This function is used automatically by FiveWinfrom 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 byusing the computer speaker.

MB_ICONASTERISK Plays the sound identified by theSystemAsterisk entry in the [sounds]section of WIN.INI.

MB_ICONEXCLAMATION Plays the sound identified by theSystemExclamation entry in the[sounds] section of WIN.INI.

MB_ICONHAND Plays the sound identified by theSystemHand entry in the [sounds]section of WIN.INI.

MB_ICONQUESTION Plays the sound identified by theSystemQuestion entry in the [sounds]section of WIN.INI.

MB_OK Plays the sound identified by theSystemDefault 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 themessagebox dialog to be created. If it is 0, it willnot have a container window.

<cText> The message to be displayed.

<cTitle> The dialogbox title to be displayed. Default valueis "Error".

<nStyle> Specifies the contents and behavior of the DialogBox.

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

Page 289: Manual Do FiveWin

This parameter can be a combination of the followingvalues:

Value Meaning

MB_ABORTRETRYIGNORE The message box contains threepush buttons: Abort, Retry, andIgnore.

MB_APPLMODAL The user must respond to themessage box before continuingwork in the window identified bythe hwndParent parameter. However,the user can move to the windowsof other applications and work inthose windows. MB_APPLMODAL is thedefault if neither MB_SYSTEMMODALnor MB_TASKMODAL is specified.

MB_DEFBUTTON1 The first button is the default.Note that the first button isalways the default unlessMB_DEFBUTTON2 or MB_DEFBUTTON3 isspecified.

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 inthe message box.

MB_ICONQUESTION A question-mark icon appears inthe message box.

MB_ICONSTOP A stop-sign icon appears in themessage box.

MB_OK The message box contains one pushbutton: OK.

MB_OKCANCEL The message box contains two pushbuttons: OK and Cancel.

MB_RETRYCANCEL The message box contains two pushbuttons: Retry and Cancel.

MB_SYSTEMMODAL All applications are suspendeduntil the user responds to themessage box. Unless the applicationspecifies MB_ICONHAND, the messagebox does not become modal untilafter it is created; consequently,the parent window and other windowscontinue to receive messagesresulting from its activation.System-modal message boxes areused to notify the user of serious,potentially damaging errors thatrequire immediate attention (forexample, running out of memory).

MB_TASKMODAL Same as MB_APPLMODAL except thatall the top-level windowsbelonging to the current taskare disabled if the hwndParentparameter is NULL. This flag

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

Page 290: Manual Do FiveWin

should be used when the callingapplication or library does nothave a window handle availablebut still needs to prevent inputto other windows in the currentapplication without suspendingother applications.

MB_YESNO The message box contains two pushbuttons: Yes and No.

MB_YESNOCANCEL The message box contains threepush 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 enoughmemory to create the message box. Otherwise,it is one of the following menu-item valuesreturned 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

Page 291: Manual Do FiveWin

value will be returned if either the ESC key ispressed or the Cancel button is selected. If themessage box has no Cancel button, pressing ESC hasno effect.

Observations: FiveWin supplies as built-in function the mostcommon 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 displaythe cText

Returns: Always 0

Observations: This function is automatically used by FiveWinfrom inside the Class TMeter. This function wasdesigned 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

Page 292: Manual Do FiveWin

--------------------------------------------------------------------------------MoveTo() Changes the painting coordinates--------------------------------------------------------------------------------

Syntax: MoveTo( <hDC>, <nCol>, <nRow> ) --> <nLOldPos>

Parameters:

<hDC> The handle of the device context wherewhere are going to paint.

<nCol>, <nRow> The coordinates where to start painting.

Returns:

<nLOldPos> A numeric LONG ( four bytes ) value thatstores 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 topreviously determinate the position where to startpainting. 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 thisoperation

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

Page 293: Manual Do FiveWin

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 undocumentedWinApi function ShellAbout(), which it is the oneused by Windows in all standard applications whenyou select about.

The standard dialogbox shows an icon, by defaultit is a windows logo. To provide your icon toMsgAbout() you should define an icon with thenumber 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 thestandard WinApi function MessageBox() with theproper 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

Page 294: Manual Do FiveWin

--------------------------------------------------------------------------------MsgBeep() MessageBeep beep tone--------------------------------------------------------------------------------

Syntax: MsgBeep() --> nil

Parameters: None

Returns: nil

Observations: This function simplifies the use of the WinApifunction MessageBeep( 0 ), and follows theFiveWin 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 besidesthe GET.

Returns:

<lOk> A logical value indicating if the user selectedOk (.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 displaya DialogBox with a GET to accept some user infoinput.Using MsgGet() you avoid designing a DialogBox,defining it and activating it just for this samepurpose. 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

Page 295: Manual Do FiveWin

--------------------------------------------------------------------------------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 thestandard WinApi function MessageBox() with theproper 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 nameof 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 willlook for it inside the resources.

<nSeconds> An optional numeric value, indicating how manyseconds the logo has to be shown. By default it waitsfor four seconds.

Returns: nil

Observations: This function let you show an initial applicationlogo 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

Page 296: Manual Do FiveWin

Syntax: MsgMeter( <bAction> [,<cMsg>] [,<cTitle>] ) --> nil

Parameters:

<bAction> The codeblock to evaluate while themeter 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) objectthat your user defined function(YourAction()) will receive.

<oText> Is a reference to the oText (TSay) objectthat your user defined function(YourAction()) will receive.You can <oText>:SetText(<cNewText>) tochange its contains while themeter evolves.

<oDlg> Is a reference to the oDlg (TDialog)that your user defined function(YourAction()) will receive.

<lEnd> A logical value supplied byreference. If you set it to .t., thenall the process will end.

<cMsg> The text of the SAY object placed at theMsgMeter dialogBox. By default it is"Processing..."

<cTitle> The title of the DialogBox. By default itis "Please, wait"

Returns: nil

Observations: This function simplifies the process ofcreating and displaying a DialogBox where aprogress meter is displayed.This is very typically an operation to perform whenyou are reindexing, or doing some operation thatrequires some user waiting and processinginvolved.This function, though it may seem a little confusingto 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

Page 297: Manual Do FiveWin

Parameters:

<hWnd> The handle of the window of the MsgBarcontrol that is been painted

<cMsg> The message to display

<cMsgDef> The alternative default message to be displayedif 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 theclass TMsgBar. INTERNAL !!!

Sample: Most of the FiveWin samples manages bottommessage 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 itjust waits 1 second and finish. MsgRun() will endautomatically the modal DialogBox once the codeblockaction is performed.

Returns: nil

Observations: This function simplifies the process of showinga brief message to the user and issuing an action,without having to design and manage a non-modalDialogBox. This function uses a Modal DialogBox whichguaranties that the application execution will waituntil 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

Page 298: Manual Do FiveWin

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 thestandard WinApi function MessageBox() with theproper 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 windowobject 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 orthe BMP resources to use to display the up stateof each toolbar button.

<aBmps2> An array with the names of the BMP files orthe BMP resources to use to display the down stateof each toolbar button.

Returns: nil

Observations: This function lets simplifies the design andactivation of a floating toolbar.Its main goal is to increase productivity witha minimum effort.

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

Page 299: Manual Do FiveWin

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 defaultjust waits 4 seconds. MsgWait() will automaticallyend the DialogBox that appears.

Returns: nil

Observations: This function simplifies the process of showinga brief message to the user and waiting a little.This function uses a Modal DialogBox which guarantiesthat the application execution will wait until theDialogBox is removed.

Sample: SAMPLES\\TestMsg.prg

Source code: SOURCE\\FUNCTION\\MsgRun.prg

See also: All Msg...() functions. They greatly simplifyyour 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 thestandard WinApi function MessageBox() with theproper style to show the question icon and

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

Page 300: Manual Do FiveWin

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 thestandard WinApi function MessageBox() with theproper style to show the question icon andthe 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 othernumeric values.

<nValue2> More numeric values to be bit-ANDded.<nValueN>

Returns:

<nResult> A numeric value as result of bit-ANDdedall the numeric values supplied as parameters.

Observations: Just a little remembering:

1 AND 1 = 1

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

Page 301: Manual Do FiveWin

1 AND 0 = 00 AND 1 = 00 AND 0 = 0

This is applicable to each bits in thosenumeric 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 theapplication, thus is like calling PCount() + 1 juststarting the app, though nArgC() may be calledfrom 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 ofthat 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

Page 302: Manual Do FiveWin

--------------------------------------------------------------------------------nDlgBox() Automatic DialogBox testing function.--------------------------------------------------------------------------------

Syntax: nDlgBox( <cDlgName> ) --> <nResult>

Parameters:

<cDlgName> The name of the resource of a dialogboxto quickly execute and test.

Returns:

<nResult> The value supplied to EndDlg() to end thedialog.

Observations: This function was developed with the intentionof quickly test dialog boxes, in a prototypestage.

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 typeof files that was selected from inside thestandard DialogBox WinApi cGetFile() function.

Returns:

<nType> A numeric value with the order of thetype of files selected from cGetFile()

Observations: This value only has meaning when several typesof 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

Page 303: Manual Do FiveWin

<cColor> An xBase string color representation.

Returns:

<nBackRGB> A numeric RGB value corresponding tothe 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 tothe 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 containssome icons (EXE, DLL, ICO, etc...)

Returns:

<nIcons> The number of icons contained insidethat 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

Page 304: Manual Do FiveWin

Syntax: nOr( <nValue1>, <nValue2> [,...<nValueN>] )--> <nResult>

Parameters:

<nValue1> A numeric value to be bit-ORed with othernumeric values.

<nValue2> More numeric values to be bit-ORed.<nValueN>

Returns:

<nResult> A numeric value as result of bit-ORedall the numeric values supplied as parameters.

Observations: Just a gentle reminder:

1 OR 1 = 11 OR 0 = 10 OR 1 = 10 OR 0 = 0

This is applicable to each bits in thosenumeric 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 fromwhere we want to generate a random number. By defaulta 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

Page 305: Manual Do FiveWin

--------------------------------------------------------------------------------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 tothe red, green and blue values specified.

Observations: Though FiveWin supplies a preprocessor RGB()function, also this function is supplied tolet 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 hashvalue for that specific string.

Observations: Hash techniques is a powerfull way to increasespeed doing a search. Given a string we calculateits hash value, and using that hashvalue we knowexactly where a certain string will be located ina 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

Page 306: Manual Do FiveWin

// 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 textrow 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 getthe next control handle.

<hControl> The handle of a known control used as areference

<lNext> A logical value meaning if we want the next or theprevious

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

Page 307: Manual Do FiveWin

--------------------------------------------------------------------------------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

Page 308: Manual Do FiveWin

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

Page 309: Manual Do FiveWin

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 MessageBoxfor all the possible values

Observations: This function just simplifies the use of thestandard MessageBox function, though FiveWinoffers all the Msg...() functions that simplifiesmuch 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 indexposition.

Returns:

<nRelativeRecNoPos> It is a numeric value with the resulting relativerecord position.

Source code: SOURCE\\Function\\NtxPos.c

Comments FiveWin provides this function to query a NTXfile for a record relative position. It is neededfor properly update a browse scrollbar afterperforming 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

Page 310: Manual Do FiveWin

--------------------------------------------------------------------------------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 aWindows string.

Returns:

<cWindowText> The result Windows string.

Obervations Normally all the data that you capture from MsDosinto a DBF is stored as OEM text. In this situationyou may call OemToAnsi() to properly review it frominside Windows.

Text that is captured from Windows is in Ansiformat. To use it from MsDos later, store it asthe 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 associatedwith the open clipboard

Returns:

<lSuccess> .t. is was possible to open it, .f. if anotherapplication was alread using it

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

Page 311: Manual Do FiveWin

Observations: FiveWin automatically manages all thesefunctions 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 ina 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 thefollowing error values:

Value Meaning

IE_BADID The device identifier is invalid orunsupported.

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 setto zero, the return value is IE_OPEN if the device isalready open or IE_MEMORY if the device is not open.

Windows allows COM ports 1 through 9 and LPT ports 1through 3. If the device driver does not supporta communications port number, the OpenComm functionwill fail.

The communications device is initialized to a defaultconfiguration. The SetCommState function should be used

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

Page 312: Manual Do FiveWin

to initialize the device to alternate values.The receiving and transmission queues are used byinterrupt-driven device drivers. LPT ports are notinterrupt driven--for these ports, the cbInQueue andcbOutQueue parameters are ignored and the queue sizeis 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 theread byte.

Returns: nil

Comments: Use these functions only to accesshardware ports. Communication ports must beaccessed 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 theread word.

Returns: nil.

Comments: Use these functions only to accesshardware ports. Communication ports must beaccessed 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

Page 313: Manual Do FiveWin

Syntax: OutputDebugWindow( <cText> ) --> nil

Parameters:

<cText> A text to display of the Microsoft dbwin.exedebugging monitor utility. Microsoft provides thissmall dbwin.exe utility to help tracing severalWindows API operations.

Returns: nil.

Comments: Some Windows API can not be interrupted, thisis why dbwin.exe is extremelly usefull to tracesome sections of the activity of our application.

DbWin.exe must be loaded before we can useOutputDebugInfo().

FiveWin also supplies this function from low levelC source code, so we can use it from our own Croutines.

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 amessage

<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 aremanaged in the same way, except that toretrieve a value you have to place anunderscore before the DATA message name:

MsgInfo( OSend( oWnd, "_hWnd" ) )

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

Page 314: Manual Do FiveWin

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 look3D.

Returns: nil

Observations: This is an old function we used to have 3D lookbefore 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 specialFiveWin format to store a bitmap handle and itsassociated palette handle:

hPalette = nHiWord( <hPalBmp> )hBitmap = nLoWord( <hPalBmp> )

This handle is automatically generated by theFiveWin functions:

PalBmpRead( <hDC>, <cBmpFileName> ) --> <hPalBmp>

PalBmpLoad( <hDC>, <cBmpResName> ) --> <hPalBmp>

And destroyed calling:

PalBmpFree( <hPalBmp> )

These functions are automatically called fromTBitmap Class.

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

Page 315: Manual Do FiveWin

<nWidth> The target dimensions for the dipplayed bitmap.<nHeight> By tdefault the own bitmap dimensions are used.

<nRaster> A numeric value that specifies the rasteroperation to be performed. Raster operation codesdefine how the graphics device interface (GDI)combines colors in output operations that involvea current brush, a possible source bitmap, and adestination bitmap. This parameter can be one ofthe 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 ANDoperator.

MERGEPAINT Combines the inverted source bitmapwith the destination bitmap byusing the Boolean OR operator.

NOTSRCCOPY Copies the inverted source bitmapto the destination.

NOTSRCERASE Inverts the result of combiningthe destination and source bitmapsby using the Boolean OR operator.

PATCOPY Copies the pattern to the destinationbitmap.

PATINVERT Combines the destination bitmapwith the pattern by using theBoolean XOR operator.

PATPAINT Combines the inverted source bitmapwith the pattern by using the BooleanOR operator. Combines the result ofthis operation with the destinationbitmap by using the Boolean ORoperator.

SRCAND Combines pixels of the destinationand source bitmaps by using theBoolean AND operator.

SRCCOPY Copies the source bitmap to thedestination bitmap.

SRCERASE Inverts the destination bitmap andcombines the result with the sourcebitmap by using the Boolean ANDoperator.

SRCINVERT Combines pixels of the destinationand source bitmaps by using theBoolean XOR operator.

SRCPAINT Combines pixels of the destinationand source bitmaps by using theBoolean 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

Page 316: Manual Do FiveWin

#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 ( aprocess 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 FiveWinwill place a MSG struct in a string format.

<hWnd> Identifies a window whose messages are to beexamined

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

Page 317: Manual Do FiveWin

<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 operationwas successfully.

The result is stored by reference inside <cMsg>

Observations: This functions are automatically managed byFiveWin. We just document them here with thewish of a better understanding, but we stresson the idea that you should let FiveWin manageall 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 drawingan elliptical arc whose center and two endpoints arejoined by lines.

Returns

<lSuccess> A logical value indicating if the operation wassuccessfull.

Comments The center of the arc drawn by the Pie function is the

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

Page 318: Manual Do FiveWin

center of the bounding rectangle specified by thenLeftRect, nTopRect, nRightRect, and nBottomRectparameters. The starting and ending points of the arcare specified by the nxStartArc, nyStartArc, nxEndArc,and nyEndArc parameters. The function draws the arc byusing the selected pen, moving in a counterclockwisedirection. It then draws two additional lines fromeach endpoint to the arc's center. Finally, it fillsthe pie-shaped area by using the current brush.

If nxStartArc equals nxEndArc and nyStartArc equalsnyEndArc, the result is an ellipse with a single linefrom the center of the ellipse to the point(nxStartArc,nyStartArc) or (nxEndArc,nyEndArc).

The figure drawn by this function extends up to butdoes not include the right and bottom coordinates.This means that the height of the figure isnBottomRect - nTopRect and the width of the figureis nRightRect - nLeftRect.

Both the width and the height of a rectangle must begreater 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 tobe the same.

<aPolygonN>

aPolygon = { { nCol1, nRow1 }, { nCol2, nRow2 },... { nColN, nRowN }, { nCol1, nRow1 } }

Returns:

<lSuccess> A logical value indicating that the operationwas 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

Page 319: Manual Do FiveWin

<hWnd> Identifies the window to which the messagewill be posted. If this parameter isHWND_BROADCAST (-1), the message will be postedto all top level windows, including disabledor 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 operationwas 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 FiveWinclasses. 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 withthat 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

Page 320: Manual Do FiveWin

bitmaps from disk. It lets the user of our applicationsupply 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 referencewhere ReadComm() will place the read bytes.

The length of the initial supplied valuespecifies the wished number of bytes to be read.

You may use, i.e., Space( ... ) to initializethis buffer.

Returns:

<nBytesRead> The number of bytes read. 0 if there wasan error. Use GetCommError() to determine thecause 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

Page 321: Manual Do FiveWin

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 becombined by using the bitwise OR operator. This canbe any combination of the following values:

Value Meaning

CS_BYTEALIGNCLIENT Aligns the client area of a windowon the byte boundary (in thex-direction).

CS_BYTEALIGNWINDOW Aligns a window on the byteboundary (in the x-direction).This flag should be set byapplications that perform bitmapoperations in windows by using theBitBlt function.

CS_CLASSDC Gives the window class its owndisplay context (shared byinstances).

CS_DBLCLKS Sends double-click messages to awindow.

CS_GLOBALCLASS Specifies that the window class isan application global class. Anapplication global class is createdby an application or library and isavailable to all applications. Theclass is destroyed when theapplication or library that createdthe class exits; it is essential,therefore, that all windows createdwith the application global classbe closed before this occurs.

CS_HREDRAW Redraws the entire window if thehorizontal size changes.

CS_NOCLOSE Inhibits the close option on theSystem menu.

CS_OWNDC Gives each window instance its owndisplay context. Note thatalthough the CS_OWNDC style isconvenient, it must be used withdiscretion because each displaycontext occupies approximately 800bytes of memory.

CS_PARENTDC Gives the display context of the

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

Page 322: Manual Do FiveWin

parent window to the window class.CS_SAVEBITS Specifies that the system should

try to save the screen imagebehind a window created from thiswindow class as a bitmap. Later,when the window is removed, thesystem uses the bitmap to quicklyrestore the screen image.This style is useful for smallwindows that are displayed brieflyand then removed before much otherscreen activity takes place (forexample, menus or dialog boxes).This style increases the timerequired to display the windowsince the system must firstallocate memory to store the bitmap.

CS_VREDRAW Redraws the entire window if thevertical size changes.

<nClsExtra> Specifies the number of bytes to allocate followingthe window class structure. These bytes areinitialized to 0.

<nWndExtra> Specifies the number of bytes to allocate followingthe window instance. Those bytes are initializedto 0.

<hCursor> Identifies the class cursor.

<hBrush> Identifies the class background brush. By defaultFiveWin assigns drak gray color brush.

<cMenuName> Identifies the name of a resource menu.

<nWndProc> A pointer to the window procedure. Bydefault 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 theintention that you get a better understanding,but we insist on the idea that you let FiveWinmanage 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

Page 323: Manual Do FiveWin

Parameters: None

Returns: nil

Observations: This function releases the mouse capture andrestores 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 isto be released.

<hDC> Identifies the device context to be released.

Returns:

<lSuccess> A logical value indicating if the operation wascompleted sucessfully.

Observations: An application must call ReleaseDC() for eachGetDC() function call.

FiveWin manages all these functions automaticallythrough 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 orthe 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 theWindows font table should send a WM_FONTCHANGE messageto all top-level windows in the system by using the

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

Page 324: Manual Do FiveWin

SendMessage function with the hwnd parameter set to-1 (HWND_BROADCAST).

In some cases, the RemoveFont function may not removethe font resource immediately. If there are outstandingreferences to the resource, it remains loaded untilthe 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 tobe 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 objectto be used to retrieve its associated cAliasDATA contents.

Returns: nil

Observations: This function allows the quickly implementationof reports in our browses placed in dialogboxes.

This function has been greatly enhanced in thenew METHOD TWBrowse:Report().

Sample: SAMPLES\\FwBrow.prg

Source code: SOURCE\\FUNCTION\\Browse.prg

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

Page 325: Manual Do FiveWin

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 oldprocedure is to be restored.

<nOldProc> A pointer of the windows old procedure.

Returns: nil

Observations: This function is automatically used by FiveWinto 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 topaint.

<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 standard3D Ctl3d.dll Microsoft look.

Source code: SOURCE\\FUNCTION\\Say3D.c

See also: SET 3DLOOK

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

Page 326: Manual Do FiveWin

--------------------------------------------------------------------------------ScreenToClient() Converts screens coordinates in Client coordinates--------------------------------------------------------------------------------

Syntax: ScreenToClient( <hWnd>, <aPoint> ) --> nil

This function converts the screen coordinates of agiven point on the screen to client coordinates.

Parameters:

<hWnd> Is the handle of the window whose client area isused for the conversion.

<aPoint> An array of two elements that holds thecoordinates of the point. The two elements of thisarray are transformed acordingly with the newcalculated 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 horizontalscrolling. This parameter must be a negative valueto scroll to the left.

<nRow> Specifies the amount in device units of verticalscrolling. This parameter must be a negative valueto 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

Page 327: Manual Do FiveWin

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 beselected 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 themessage will be sent. If this parameter isHWND_BROADCAST (-1) then it is sent to all windows.

<nMsg> Specifies the message to be sent

<nWParam> A numeric value specifying 16 bits of additionalmessage dependant information.

<nLParam> A numeric value specifying 32 bits of additionalmessage dependant information.

Returns:

<nLResult> The result of the message processing and dependson 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

Page 328: Manual Do FiveWin

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 whereselect 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 bitmapdata.

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 inbitmap format in lieu of the privatelyformatted data.

CF_DSPMETAFILEPICT The data is a metafile representationof a private data format. This data isdisplayed in metafile-picture format inlieu of the privately formatted data.

CF_DSPTEXT The data is a textual representation of aprivate data format. This data is displayedin text format in lieu of the privately

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

Page 329: Manual Do FiveWin

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 inthe OEM character set. Each line ends witha carriage returnlinefeed (CR-LF)

combination.A null character signals the end of the data.

CF_OWNERDISPLAY The data is in a private format thatthe 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 nullcharacter 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 asubset of the CF_RIFF data format; it canbe 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 theclipboard if successfull or 0 if there is aproblem.

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() resetsthe current bIdleAction, so it stops the previousdefined idle codeblock.

Returns: nil

Observations: It is very important that you don't process largeroutines here or you will freeze the whole system.

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

Page 330: Manual Do FiveWin

Processes may be really, really fast !!!

Don't confuse idle periods with timers. Idle periodsare those during there are no pending messages toprocess. As soon as the application starts processingmessages, 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 whereselect 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 toreceive all mouse messages.

Returns:

<hWndPrev> The handle of the previous window thatwas receiving all mouse messages, if defined.It not, it returns 0.

Observations: When the window no longer requires all mouseinput, 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

Page 331: Manual Do FiveWin

--------------------------------------------------------------------------------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 valueto change.

Valid values are in the range zero through the numberof bytes of class memory, minus two (for example, if10 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 backgroundbrush.

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 thespecified word, if the function is successful.Otherwise, it is zero.

Observations: The SetClassWord function sets a word value at thespecified offset into the extra class memory for thewindow class to which the given window belongs. Extraclass memory is reserved by specifying a nonzero valuein the cbClsExtra member of the WNDCLASSstructure 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

Page 332: Manual Do FiveWin

Syntax: SetClpData( <nFormat>, <uData> ) --> <lSuccess>

Parameters:

<nFormat> Specifies the format of the data. It can be any oneof the system-defined formats or a format registeredby the RegisterClipboardFormat function.

CF_BITMAP The data is a bitmap.

CF_DIB The data is a memory object containinga BITMAPINFO structure followed by thebitmap data.

CF_DIF The data is in Data Interchange Format(DIF).

CF_DSPBITMAP The data is a bitmap representation ofa private format. This data is displayedin bitmap format in lieu of the privatelyformatted data.

CF_DSPMETAFILEPICT The data is a metafilerepresentation of a private data format.This data is displayed inmetafile-picture format in lieu of theprivately formatted data.

CF_DSPTEXT The data is a textual representation ofa private data format. This data isdisplayed in text format in lieu of theprivately data.

CF_METAFILEPICT The data is a metafile (see thedescription of the METAFILEPICT structure.

CF_OEMTEXT The data is an array of text charactersin the OEM character set. Each line endswith a carriage returnlinefeed (CR-LF)combination. A null character signalsthe end of the data.

CF_OWNERDISPLAY The data is in a private format thatthe clipboard owner must display.

CF_PALETTE The data is a color palette.

CF_PENDATA The data is for the pen extensions tothe Windows operating system.

CF_RIFF The data is in Resource Interchange FileFormat (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 carriagereturnlinefeed (CR-LF) combination. Anull character signals the end of thedata.

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

Page 333: Manual Do FiveWin

CF_TIFF The data is in Tag Image File Format(TIFF).

CF_WAVE The data describes a sound wave. This isa subset of the CF_RIFF data format; itcan be used only for RIFF WAVE files.

Private data formats in the range CF_PRIVATEFIRSTthrough CF_PRIVATELAST are not automatically freedwhen the data is removed from the clipboard. Datahandles associated with these formats should be freedupon receiving a WM_DESTROYCLIPBOARD message.

Private data formats in the range CF_GDIOBJFIRSTthrough

CF_GDIOBJLAST will be automatically removed by a callto the DeleteObject function when the data is removedfrom the clipboard. If Windows Clipboard is running, itwill not update its window to show the data placed inthe clipboard by the SetClipboardData until after theCloseClipboard function is called.

<uData> The handle of the data to place at theClipboard. Right now FiveWin only supports text,due not to a FiveWin limitation since that allformats 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 structurevalues. The DCB structure is automatically buildby 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

Page 334: Manual Do FiveWin

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 supplieddate 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 asthe desktop bitmap.

Returns:

<lSuccess> If the operation was successful.

Observations: This is an undocumented WinApi function. Don'texpect that is available in next Windows versions.Also, this function does not store the value

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

Page 335: Manual Do FiveWin

for the next Windows startup. You have to modifyWIN.INI file in order to asure that it willbe the desktop BMP next time.

Sample: SAMPLES\\FwBrow.prg

See SAMPLES\\Install.prg for a better way ofchanging 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 tothe file. Use the format: "HH:MM:SS".

<cdDate> Specifies a different date to be set tothe file. Use the format: "DD:MM:YYYY". Youcan 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 keyboardinput. If this parameter is 0, keystrokes areignored.

Returns:

<hWndPrev> Identifies the window that previously hadthe focus.

Observations: This function sends a WM_KILLFOCUS to thewindow that previously had the focus, anda WM_SETFOCUS to the window that recievesthe focus.

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

Page 336: Manual Do FiveWin

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 theapplication requires. This count can not be greaterthan 255.

Returns:

<nHandlesAvailables> Is the number of handles availables to theapplication.

Observations: By default, the number of available handles is20.

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 defaultfrom our program.

Returns

Nothing

Description

SetHelpFile() Selects the default HLP file to be called when requestinghelp. GetHelpFile() will return the Help file name weselect here.

Example

SetHelpFile( "FiveWin.hlp" )

Source: HELP.C

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

Page 337: Manual Do FiveWin

--------------------------------------------------------------------------------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 followingvalues:

Value Meaning

MM_ANISOTROPIC Logical units are converted toarbitrary units with arbitrarily scaled axes.Setting the mapping mode to MM_ANISOTROPICdoes not change the current window or viewportsettings. To change the units, orientation,and scaling, an application should use theSetWindowExt and SetViewportExt functions.

MM_HIENGLISH Each logical unit is converted to 0.001inch. Positive x is to the right; positive y isup.

MM_HIMETRIC Each logical unit is converted to 0.01millimeter. Positive x is to the right; positivey is up.

MM_ISOTROPIC Logical units are converted to arbitraryunits with equally scaled axes; that is, oneunit along the x-axis is equal to one unitalong the y-axis. The SetWindowExt andSetViewportExt functions must be used tospecify the desired units and the orientationof the axes. GDI makes adjustments asnecessary to ensure that the x and y unitsremain the same size.

MM_LOENGLISH Each logical unit is converted to 0.01inch. Positive x is to the right; positive y isup.

MM_LOMETRIC Each logical unit is converted to 0.1millimeter. Positive x is to the right;positive y is up.

MM_TEXT Each logical unit is converted to one devicepixel. Positive x is to the right; positive yis down.

MM_TWIPS Each logical unit is converted to 1/20 of apoint. (Because a point is 1/72 inch, a twipis 1/1440 inch). Positive x is to theright; positive y is up.

Returns:

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

Page 338: Manual Do FiveWin

<nOldMode> The previous mapping mode if the functionis successful.

Observations: The MM_TEXT mode allows applications to work in devicepixels, where one unit is equal to one pixel. Thephysical size of a pixel varies from device to device.

The MM_HIENGLISH, MM_HIMETRIC, MM_LOENGLISH,MM_LOMETRIC, and MM_TWIPS modes are useful forapplications that must draw in physically meaningfulunits (such as inches or millimeters).

The MM_ISOTROPIC mode ensures a 1:1 aspect ratio,which is useful when it is important to preservethe exact shape of an image.

The MM_ANISOTROPIC mode allows the x- andy-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 getsproperly 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 whereto paint.

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

Page 339: Manual Do FiveWin

<nCol>, <nRow> The coordinates of the point where to set thepixel.

<nRGBColor> The color to use for that pixel.

Returns:

<nRGBColor> The color used if the operation wassuccessful. This color may vary from theoriginal 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 propertylist receives the new entry.

<cProp> Identifies the prop name.

<nData> Identifies the data to be copied to the propertylist

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 pointand a rectangle that bounds the text. The point can beeither the current position or coordinates specifiedby a text-output function (such as the ExtTextOutfunction). The rectangle that bounds the text is

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

Page 340: Manual Do FiveWin

defined by the adjacent character cells in the textstring.

The <nAlignMode> parameter can be one or more flagsfrom the following three categories.

Choose only one flag from each category.The first category affects text alignment in thex-direction:

Value Meaning

TA_CENTER Aligns the point with the horizontalcenter of the bounding rectangle.

TA_LEFT Aligns the point with the left side ofthe bounding rectangle. This is thedefault setting.

TA_RIGHT Aligns the point with the right side ofthe bounding rectangle.

The second category affects text alignment in they-direction:

Value Meaning

TA_BASELINE Aligns the point with the base line ofthe chosen font.

TA_BOTTOM Aligns the point with the bottom of thebounding rectangle.

TA_TOP Aligns the point with the top of thebounding rectangle. This is the defaultsetting.

The third category determines whether the currentposition is updated when text is written:

Value Meaning

TA_NOUPDATECP Does not update the current positionafter each call to a text-output function.

This is the default setting.

TA_UPDATECP Updates the current x-position after eachcall to a text-output function. The newposition is at the right side of thebounding rectangle for the text. Whenthis flag is set, the coordinatesspecified in calls to the TextOutfunction are ignored.

Returns:

<nOldAlign> The previous text-alignment settings, ifthe function is successful.

Observations: This align flags are used by the TextOut() andExtTextOut() functions.

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

Page 341: Manual Do FiveWin

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 suppliedtime 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 withthe 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 automaticallyand 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

Page 342: Manual Do FiveWin

--------------------------------------------------------------------------------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 deviceunits of the viewport.

Returns:

<aPrevDimensions> An array that holds the previous dimensions:{ nWidth, nHeight }

Observations: When the following mapping modes are set, calls tothe SetWindowExt and SetViewportExt functions areignored:

MM_HIENGLISHMM_HIMETRICMM_LOENGLISHMM_LOMETRICMM_TEXTMM_TWIPS

When the mapping mode is MM_ISOTROPIC, an applicationmust call the SetWindowExt function before callingSetViewportExt.

The x- and y-extents of the viewport define how muchthe graphics device interface (GDI) must stretchor compress units in the logical coordinate system tofit units in the device coordinate system. Forexample, if the x-extent of the window is 2 and thex-extent of the viewport is 4, GDI converts twological units (measured from the x-axis) into fourdevice units. Similarly, if the y-extent of the windowis 2 and the y-extent of the viewport is -1, GDIconverts two logical units (measured from the y-axis)into one device unit.

The extents also define the relative orientation ofthe x- and y-axes in both coordinate systems. Ifthe signs of matching window and viewport extents arethe same, the axes have the same orientation. If thesigns are different, the orientation is reversed. Forexample, if the y-extent of the window is 2 and they-extent of the viewport is -1, GDI converts thepositive y-axis in the logical coordinate system tothe negative y-axis in the device coordinate system.If the x-extents are 2 and 4, GDI converts thepositive x-axis in the logical coordinate system tothe positive x-axis in the device coordinate system.

Source code: SOURCE\\WINAPI\\Dc.c

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

Page 343: Manual Do FiveWin

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 logicalunits, 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-leftposition of the window.

Returns:

<aPrevOrigin> An array with the previous origin values:{ nCol, nRow }

Observations: The window origin is the origin of the logicalcoordinate system for a window. By changing thewindow origin, an application can change the way thegraphics device interface (GDI) converts logicalcoordinates to device coordinates (the viewport). GDIconverts logical coordinates to the devicecoordinates of the viewport in the same way as itconverts the origin.

To convert points to the right, an application canspecify a negative value for the nCol parameter.

Similarly, to convert points down (in the MM_TEXTmapping mode), the nRow parameter can be negative.

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

Page 344: Manual Do FiveWin

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 positionedwindow in the Z-order. This parameter must be awindow handle or one of the following values:

Value Meaning

HWND_BOTTOM Places the window at the bottom ofthe Z-order. If hwnd identifies atopmost window, the window loses itstopmost status; the system places thewindow at the bottom of all otherwindows.

HWND_TOP Places the window at the top of theZ-order.

HWND_TOPMOST Places the window above all non-topmostwindows. The window maintains itstopmost position even when it isdeactivated.

HWND_NOTOPMOST Repositions the window to the top ofall non-topmost windows (that is, behindall topmost windows). This flag has noeffect if the window is already anon-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 followingvalues:

Value Meaning

SWP_DRAWFRAME Draws a frame (defined in the window'sclass description) around the window.

SWP_HIDEWINDOW Hides the window.

SWP_NOACTIVATE Does not activate the window. If thisflag is not set, the window isactivated and moved to the top ofeither the topmost or non-topmost

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

Page 345: Manual Do FiveWin

group (depending on the setting of thehwndInsertAfter parameter).

SWP_NOMOVE Retains the current position (ignoresthe x and y parameters).

SWP_NOSIZE Retains the current size (ignores thecx and cy parameters).

SWP_NOREDRAW Does not redraw changes. If this flagis set, no repainting of any kindoccurs. This applies to the clientarea, the non-client area (includingthe title and scroll bars), and anypart of the parent window uncoveredas a result of the moved window.When this flag is set, the applicationmust explicitly invalidate or redrawany parts of the window and parentwindow that must be redrawn.

SWP_NOZORDER Retains the current ordering (ignoresthe hwndInsertAfter parameter).

SWP_SHOWWINDOW Displays the window.

Returns:

<lSuccess> A logical value indicating if theoperation was performed successfully.

Observations: If the SWP_SHOWWINDOW or the SWP_HIDEWINDOW flags areset, the window cannot be moved or sized.

All coordinates for child windows are clientcoordinates (relative to the upper-left corner of theparent window's client area).

A window can be made a topmost window either bysetting the hwndAfter parameter to HWND_TOPMOSTand ensuring that the SWP_NOZORDER flag is not set,or by setting a window's Z-order so that it is aboveany existing topmost windows. When a non-topmostwindow is made topmost, its owned windows are alsomade topmost. Its owners are not changed.

If neither SWP_NOACTIVATE nor SWP_NOZORDER isspecified (that is, when the application requeststhat a window be simultaneously activated and placedin the specified Z-order), the value specified inhwndAfter is used only in the following circumstances:

Neither HWND_TOPMOST or HWND_NOTOPMOST is specifiedin the hwndAfter parameter.

The window specified in the hwnd parameter is not theactive window.

An application cannot activate an inactive windowwithout 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

Page 346: Manual Do FiveWin

window without restrictions or activate a window andthen move it to the top of the topmost or non-topmostwindows. A topmost window is no longer topmost if itis repositioned to the bottom (HWND_BOTTOM) of theZ-order or after any non-topmost window. When atopmost window is made non-topmost, all of its ownersand its owned windows are also made non-topmost windows.

A non-topmost window may own a topmost window, but notvice versa. Any window (for example, a dialog box)owned by a topmost window is itself made a topmostwindow, to ensure that all owned windows stay abovetheir 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 whosetext 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 besent to the given window or control.

If the window specified by the hwnd parameter is acontrol, the text within the control is set. If thespecified window is a list-box control created withWS_CAPTION style, however, SetWindowText will setthe caption for the control, not for the list-boxentries.

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

Page 347: Manual Do FiveWin

<cTitle> The title of the about dialogbox. By defaultit shows "About".

<hIcon> The handle of the icon to show. By defaultit uses the first icon included inside the EXE asresource. It shows the typical Windows icon ifno icon is found.

Returns: nil

Observations: This function is also included now inside FiveWinas MsgAbout. We plan to remove this in nextversions and just keep MsgAbout for compatibilitywith FiveOS2 and fiveDos.

It is very usefull as it also shows the amountof 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. Thisparameter can be one of the following values:

Value Meaning

SW_HIDE Hides the window and passes activation toanother window.

SW_MINIMIZE Minimizes the specified window andactivates the top-level window in thesystem's list.

SW_RESTORE Activates and displays a window. If thewindow is minimized or maximized, Windowsrestores it to its original size andposition (same as SW_SHOWNORMAL).

SW_SHOW Activates a window and displays it in itscurrent size and position.

SW_SHOWMAXIMIZED Activates a window and displays itas a maximized window.

SW_SHOWMINIMIZED Activates a window and displays itas an icon.

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

Page 348: Manual Do FiveWin

SW_SHOWMINNOACTIVE Displays a window as an icon. Thewindow that is currently active remainsactive.

SW_SHOWNA Displays a window in its current state. Thewindow that is currently active remainsactive.

SW_SHOWNOACTIVATE Displays a window in its mostrecent size and position. The window that iscurrently active remains active.

SW_SHOWNORMAL Activates and displays a window. If thewindow is minimized or maximized, Windowsrestores it to its original size andposition (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 operationwas 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 atresources to play. It may be a string or a numericidentifier. To include a WAV file into an RC, youmust specify a new user defined resource type named"WAVE":

MyApp.rc

OKSOUND WAVE "OkSound.wav"

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

Page 349: Manual Do FiveWin

NOSOUND WAVE "NoSound.wav"

or

110 WAVE "OkSound.wav"120 WAVE "NoSound.wav"

<nMode> Specifies options for playing the sound using one ormore of the following flags:

SND_SYNC The sound is played synchronously and thefunction does not return until the soundends.

SND_ASYNC The sound is played asynchronously and thefunction returns immediately after beginningthe sound. To terminate anasynchronously-played sound, callsndPlaySound with cSndName set to 0.

SND_NODEFAULT If the sound can't be found, thefunction returns silently without playingthe default sound.

SND_MEMORY The parameter specified by cSndName to anin-memory image of a waveform sound.

SND_LOOP The sound will continue to play repeatedlyuntil sndPlaySound is called again with thecSndName parameter set to 0. You must alsospecify the SND_ASYNC flag to loop sounds.

SND_NOSTOP If a sound is currently playing, thefunction will immediately return FALSEwithout 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 operationwas 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

Page 350: Manual Do FiveWin

Parameters:

<cSndName> Specifies the name of the sound to play. The functionsearches the [sounds] section of WIN.INI for an entrywith this name and plays the associated waveform file.If no entry by this name exists, then it assumes thename is the name of a waveform file. If thisparameter is 0, any currently playing sound isstopped.

<nMode> Specifies options for playing the sound using one ormore of the following flags:

SND_SYNC The sound is played synchronously and thefunction does not return until the soundends.

SND_ASYNC The sound is played asynchronously and thefunction returns immediately after beginningthe sound. To terminate anasynchronously-played sound, callsndPlaySound with cSndName set to 0.

SND_NODEFAULT If the sound can't be found, thefunction returns silently without playingthe default sound.

SND_MEMORY The parameter specified by cSndName to anin-memory image of a waveform sound.

SND_LOOP The sound will continue to play repeatedlyuntil sndPlaySound is called again with thecSndName parameter set to 0. You must alsospecify the SND_ASYNC flag to loop sounds.

SND_NOSTOP If a sound is currently playing, thefunction will immediately return FALSEwithout 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 operationwas 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

Page 351: Manual Do FiveWin

Syntax: StartDoc( <hDC> ) --> <nRetCode>

Parameters:

<hDC> Identifies the device context for the print job.

Returns:

<nRetCode> The return value is positive if the function issuccessful. 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 issuccessful.

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 32bits 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

Page 352: Manual Do FiveWin

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

Syntax: StrToken( <cText>, <nOcurrence> [,<cSepChar>] )--> <cToken>

Parameters:

<cText> The text from where we want to extract atoken.

<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_QUITmessage was issued, so the app should befinished.

Observations: This FiveWin function is extremelly important andhas no counterpart in standard Windows API.

SysRefresh() processes all pending messages,letting Windows keep controlling all itspending activities.

We must use SysRefresh() from inside thoseprocesses that may be time consuming.

The big benefit and advantadge of SysRefresh()is that it lets us keep doing 'standard' linearprogramming without having to send ourselvesmessages to keep processing a long task.

Use it in loops, seeks, and any time consumingprocesses to avoid Windows from losingprocessing control.

Sample: SAMPLES\\TestMMT.prg

Source code: Not provided.

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

Page 353: Manual Do FiveWin

--------------------------------------------------------------------------------SysTime() Changes the time of the system--------------------------------------------------------------------------------

Syntax: SysTime( <nNewTime> ) --> nil

Parameters:

<nNewTime> The new time we want to set the systemtime 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 operationwas 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 numericvalues: { nMsSinceStart, nMsThisVM }

nMsSinceStart: It is the milliseconds sincethe app started.

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

Page 354: Manual Do FiveWin

nMsThisVM: It is the milliseconds since theWindows virtual machine started (virtualmachine refers to Windows internal info andit 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 useas the open tree bitmap.

<cBmpClose> The name of the resourced bitmap to useas the close tree bitmap.

Returns:

<oTree> The just new created tree reference.

Observations: These functions are automatically managed byFiveWin 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 usefor this specific treeitem, when it is opened.

<cResName2> The name of the resource bitmap to usefor this specific treeitem, when it is close.

<cBmpOpen> The name of the bitmap file to usefor this specific treeitem, when it is opened.

<cBmpClose> The name of the bitmap file to usefor this specific treeitem, when it is closed.

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

Page 355: Manual Do FiveWin

<lOpened> A logical value indicating if the treeitemoriginally is opened.

Returns:

<oTreeItem> A reference to the just new created treeitem.

Observations: These functions are automatically managed byFiveWin 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 byFiveWin 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 aspecific type.

<uType> It is value, whose type determines the kindof 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

Page 356: Manual Do FiveWin

--------------------------------------------------------------------------------uLoadStruct() Restore an array or an object from disk--------------------------------------------------------------------------------

Syntax: uLoadStruct( <cObjFile> ) --> <oObject>

Parameters:

<cObjFile> The name of a file on disk which containsan array or an object previously saved withlSaveStruct().

Returns:

<oObject> A reference of the array or the objectjust beeing created.

Observations: In order to let Clipper properly rebuild aspecific class object, an external referenceto 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 ZIPfile.

<nFileOffset> The offset inside the ZIP file where thisfile to extract is located. It is the seventhitem of the array returned by GetFirstInZip() andGetNextInZip() functions.

<hWnd> The handle of the window or Dialog whereInfo-Unz.dll will report the unzip progress. Thiswindow will automatically evaluate its DATA bUnZipcodeblock:

<oWnd>:bUnZip = { | nPercent | ... }

From that codeblock you may update a Meter control,

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

Page 357: Manual Do FiveWin

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 thewindow 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

Page 358: Manual Do FiveWin

Parameters:

<nCmdLine> A string that contains the command lineto execute. If it does not contains a path,then Windows searches in this order:

1 The current directory.

2 The Windows directory (the directorycontaining WIN.COM); the GetWinDir()function retrieves the path of this directory.

3 The Windows system directory (the directorycontaining such system files as GDI.EXE); theGetSysDir() function retrieves the path ofthis directory.

4 The directory containing the executable filefor the current task; the GetModuleFileNamefunction retrieves the path of this directory.

5 The directories listed in the PATH environmentvariable.

6 The directories mapped in a network.

<nCmdShow> Specifies how the windows application has to beshown. See ShowWindow() for a description of allpossible values.

Returns:

<hInstance> The return value identifies the instance of theloaded module, if the function is successful.Otherwise, the return value is an error value lessthan 32:

0 System was out of memory, executable file wascorrupt, or relocations were invalid.

2 File was not found.

3 Path was not found.

5 Attempt was made to dynamically link to atask, or there was a sharing ornetwork-protection error.

6 Library required separate data segments foreach task.

8 There was insufficient memory to start theapplication.

10 Windows version was incorrect.

11 Executable file was invalid. Either it wasnot a Windows application or there was anerror in the .EXE image.

12 Application was designed for a different

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

Page 359: Manual Do FiveWin

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-modeapplication (developed for an earlier versionof Windows).

16 Attempt was made to load a second instanceof an executable file containing multipledata segments that were not marked read-only.

19 Attempt was made to load a compressedexecutable file. The file must be decompressedbefore it can be loaded.

20 Dynamic-link library (DLL) file was invalid.One of the DLLs required to run thisapplication was corrupt.

21 Application requires 32-bit extensions.

Observations: This function works exactly as WinExec() withthe difference that it waits for the new task issuedto 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 sometext 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 whenscrolling 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

Page 360: Manual Do FiveWin

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 retrievethe handle of a hidden, disabled, or transparentwindow, even if the point is within the window. Anapplication should use the ChildWindowFromPointfunction 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 lineto execute. If it does not contains a path,then Windows searches in this order:

1 The current directory.

2 The Windows directory (the directorycontaining WIN.COM); the GetWinDir()function retrieves the path of this directory.

3 The Windows system directory (the directorycontaining such system files as GDI.EXE); theGetSysDir() function retrieves the path ofthis directory.

4 The directory containing the executable filefor the current task; the GetModuleFileNamefunction retrieves the path of this directory.

5 The directories listed in the PATH environmentvariable.

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

Page 361: Manual Do FiveWin

6 The directories mapped in a network.

<nCmdShow> Specifies how the windows application has to beshown. See ShowWindow() for a description of allpossible values.

Returns:

<hInstance> The return value identifies the instance of theloaded module, if the function is successful.Otherwise, the return value is an error value lessthan 32:

0 System was out of memory, executable file wascorrupt, or relocations were invalid.

2 File was not found.

3 Path was not found.

5 Attempt was made to dynamically link to atask, or there was a sharing ornetwork-protection error.

6 Library required separate data segments foreach task.

8 There was insufficient memory to start theapplication.

10 Windows version was incorrect.

11 Executable file was invalid. Either it wasnot a Windows application or there was anerror in the .EXE image.

12 Application was designed for a differentoperating 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-modeapplication (developed for an earlier versionof Windows).

16 Attempt was made to load a second instanceof an executable file containing multipledata segments that were not marked read-only.

19 Attempt was made to load a compressedexecutable file. The file must be decompressedbefore it can be loaded.

20 Dynamic-link library (DLL) file was invalid.One of the DLLs required to run thisapplication was corrupt.

21 Application requires 32-bit extensions.

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

Page 362: Manual Do FiveWin

Observations: The LoadModule() function provides an alternativemethod 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 haveHLP extension and use a Windows own format.

nHelpType Selects the kind of service to execute. Windowsoffers multiple services through this functionso it may be quite confusing to obtain all itsposibilities. This is the reason why we havecreated Help...() functions, which are specialfunctions based on WinHelp().

ncAditionalData Certain parameters acording to the requestedWinHelp() 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

Page 363: Manual Do FiveWin

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

Page 364: Manual Do FiveWin

on screen.

<hWndParent> An optional handle of a window to useas 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 whoseimage is going to be placed at the clipboard.

<lAll> An optional logical value indicating if allthe window area is to be copied or just thewindow client area. By default only the clientarea 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 windowimage 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

Page 365: Manual Do FiveWin

--------------------------------------------------------------------------------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 ofthe 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

Page 366: Manual Do FiveWin

<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 operationwas 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

Page 367: Manual Do FiveWin

<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 operationwas 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 tobe 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

Page 368: Manual Do FiveWin

--------------------------------------------------------------------------------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 calculatethe 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 beadjusted.

<nPixels> The total length in pixels.

<cChar> An optional character to use to fillby the left side the <cText> string.

Returns:

<cNewText> A new string whose left side has beenadded with extra <cChar> characters to reachthe <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

Page 369: Manual Do FiveWin

adjusted.

<nPixels> The total length in pixels.

<cChar> An optional character to use to fillby both sides the <cText> string.

Returns:

<cNewText> A new string whose extremes side has beenadded with extra <cChar> characters to reachthe <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 beadjusted.

<nPixels> The total length in pixels.

<cChar> An optional character to use to fillby right side the <cText> string.

Returns:

<cNewText> A new string whose right side has beenadded with extra <cChar> characters to reachthe <nPixels> size.

Sample: SOURCE\\CLASSES\\WBrowse.prg

Source code: SOURCE\\FUNCTION\\xPad.prg

See also: xPadC() xPadL()

--------------------------------------------------------------------------------FiveWin Functions - classified by cathegory--------------------------------------------------------------------------------ClipboardOpenClipboard() 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 .

ColorChooseColor() 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

Page 370: Manual Do FiveWin

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 .

CommunicationsOpenComm() 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 / TimeSetDate() Changes the date of the system .SetTime() Changes the time of the system .

Debugging facilitiesLogFile() 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 .

DialogBoxesCreateDlg() 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 maintenanceCurDrive() 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 .

DLLsLoadLibrary() Load a Dynamic link library to use it .FreeLibrary() Free a DLL library in use or decrements its counter useGetProcAddress() Retrieves the address of the given module function .CallDll() Calls a function placed into a DLL .

DrawingArc() Draws an elliptical arc .Chord() Draws a chord .Ellipse() Draws an ellipse .

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

Page 371: Manual Do FiveWin

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 appsWaitRun() Executes another windows application (waits) .WinExec() Executes another windows application (no waits) .ExitWindowsExec() Exit windows, exec a Dos app, returns Windows ( " ) .

Files managementcFileDisk() 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 ManagementGetHelpFile() 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 .

IconsnIcons() 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 FilesGetProfInt() 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 entryGetPvpProfString() 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 .

KeyboardGetASyncKeyState() Returns whether a key is up or down .

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

Page 372: Manual Do FiveWin

GetKeyState() Retrieves the state of the specified virtual key .GetKeyToggle() Returns the state of a toggled key .KeyToggle() Toggles the specified key .

Memory/Variables useMemMax() 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 .

MouseSetCapture() 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 managementDelDbfMdx() 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 manipulationB2Bin() 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 .

OemAnsiAnsiToOem() Windows string to OEM conversion .IsAnsi() Is it an ansi string .IsOem() Is it an oem string .OemToAnsi() OEM string to Windows string .

OOPSaOData() 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 ProtectionnStrCRC() 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

Page 373: Manual Do FiveWin

Decrypt() Decrypts a text with an optional key .nSerialHD() Returns the hardDisk serial number .

SoundMessageBeep() 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 .

StringscValToChar() 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 .

SystemInportByte() 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 .

TimersSetTimer() Installs a system timer .KillTimer() Removes the specified timer .

User Quick DialogBoxesMsgAbout() 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

Page 374: Manual Do FiveWin

--------------------------------------------------------------------------------FiveWin Header Files--------------------------------------------------------------------------------Colors.ch Color constants definitionsConstant.ch Text to Graphics constants definitionsDDE.ch Commands for Dynamic Data ExchangeDialog.ch Dialog BoxesDLL.ch Dynamic Linking Libraries calling at RunTimeFiveWin.ch FiveWin main header fileFolder.ch Folders and Tabs managementFont.ch Fonts managementIni.ch INI FilesMail.ch Windows MAPI email supportMenu.ch Managing MenusObjects.ch Object Oriented Engine of FiveWinODBC.ch Open DataBase connectivity supportPrint.ch Using the PrinterReport.ch Report engineSQL.ch ODBC headerTcBrowse.ch Column based new BrowseTree.ch Trees supportVideo.ch Video media AVI SupportVKey.ch Windows keys valuesWinApi.ch Windows API definitionsClipApi.h Clipper internal management declarationsWinTen.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

Page 375: Manual Do FiveWin

#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

Page 376: Manual Do FiveWin

// 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

Page 377: Manual Do FiveWin

[ 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

Page 378: Manual Do FiveWin

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

#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

Page 379: Manual Do FiveWin

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

Page 380: Manual Do FiveWin

--------------------------------------------------------------------------------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

Page 381: Manual Do FiveWin

[ 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

Page 382: Manual Do FiveWin

#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

Page 383: Manual Do FiveWin

[ <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

Page 384: Manual Do FiveWin

[ <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

Page 385: Manual Do FiveWin

[ <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 deeste 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

Page 386: Manual Do FiveWin

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

Page 387: Manual Do FiveWin

#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, WORDwError );#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

Page 388: Manual Do FiveWin

// =======================================#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

Page 389: Manual Do FiveWin

#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

Page 390: Manual Do FiveWin

[ 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

Page 391: Manual Do FiveWin

+--------------------------------------------------------------------------+*/

#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

Page 392: Manual Do FiveWin

{<{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

Page 393: Manual Do FiveWin

#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

Page 394: Manual Do FiveWin

#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

Page 395: Manual Do FiveWin

#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

Page 396: Manual Do FiveWin

[ 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

Page 397: Manual Do FiveWin

[ <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

Page 398: Manual Do FiveWin

[ 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

Page 399: Manual Do FiveWin

#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

Page 400: Manual Do FiveWin

#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

Page 401: Manual Do FiveWin

#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

Page 402: Manual Do FiveWin

#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

Page 403: Manual Do FiveWin

#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

Page 404: Manual Do FiveWin

#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

Page 405: Manual Do FiveWin

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 typestypedef 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

Page 406: Manual Do FiveWin

// 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

Page 407: Manual Do FiveWin

/////////////////////////////////////////////////////////// EXTEND Module - Clipper Extend system functions ///////////////////////////////////////////////////////////

extern WORD _parinfo( WORD );extern WORD _parinfa( WORD, WORD );

#ifndef __FLAT__extern LPSTR _parc( WORD wParam, ... );#elseLPSTR 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 Arrayextern 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 parametersextern 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

Page 408: Manual Do FiveWin

// General Terminaltypedef struct{ // R G B +*

RGB Fore; // FF FF FF 00RGB 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.01WORD _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, LPWORDwResult );WORD _gtRepChar( WORD wRow, WORD wCol, WORD wChar, WORD wTimes );

// Undocumented Windowing System !!!

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

Page 409: Manual Do FiveWin

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 conventionsextern void _color( void );

// extended GT - RUNsoftvoid _gtShadow( WORD wTop, WORD wLeft, WORD wBottom, WORD wRight );void _gtClrReverse( WORD wColor );void _gtSayHot( WORD wRow, WORD wCol, LPSTR szText, WORD wClrNormal, WORDwClrHot );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

// staticsextern PCLIPVAR _sbase; // STATIC BASE

// Clipper Stack tos = TO S tackextern 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 _tosextern void _xPushM( LPCLIPVAR );

// calling Clipper from Cextern void _PutSym( PCLIPSYMBOL );// ( ++_tos )->wType = NIL; <-- We place nil at Self !!!

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

Page 410: Manual Do FiveWin

// 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 paramsextern void _cEval0( PCLIPVAR CodeBlock ); // evalua codeblock sin parametros.extern void _cEval1( PCLIPVAR CodeBlock, PCLIPVAR Param1 ); // idem con unpar.metro.

// same but with one param

extern PCLIPVAR _GetGrip( PCLIPVAR ); // allocates new clipvar in high stackpos.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 WORDextern LONG _sptol( PCLIPVAR ); // IDEM as LONG

// Copy wBytes from Source to Destinationextern void _bcopy( LPBYTE pDest, LPBYTE pSource, WORD wBytes );

// Inicializes wLen Bytes with the value wValueextern void _bset( LPBYTE pStart, WORD wValue, WORD wLen );

// Retrieves an element of an arrayextern void _cAt( PCLIPVAR vArray, WORD wIndex, WORD wFlag, PCLIPVAR vDest );

// Changes an element of an arrayextern void _cAtPut( PCLIPVAR vArray, WORD wIndex, PCLIPVAR vSource );

// Stores a String into an array elementextern void _cAtPutStr( PCLIPVAR vArray, WORD wIndex, LPSTR szString,

WORD wStrLen );

// Strings// Creates a new String. Stores a CLIPVAR at _evalextern void pascal _BYTESNEW( WORD wLenBytes );

// Locks a CLIPVAR String to access its bytes// if need unlock returns TRUEextern BOOL pascal _VSTRLOCK( PCLIPVAR vString );

// Gets the LPSTR of the String. It must be locked before with _VSTRLOCKextern LPSTR pascal _VSTR( PCLIPVAR vString );

// UnLocks the Stringextern void pascal _VSTRUNLOCK( PCLIPVAR vString );

#ifndef __FLAT__#ifndef _BC5WORD strlen( LPSTR szText );

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

Page 411: Manual Do FiveWin

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 arrayextern WORD pascal _VARRAYLEN( PCLIPVAR vArray );

// Creates and returns an Array in _evalextern void pascal _ARRAYNEW( WORD wLen );

// Add a new element to an array// _tos + 1 --> array// _tos + 2 --> element// _tos must be incrementedextern void pascal __AADD( void );

// Resizes an Array// Parameters must be placed usign _tos// pcount must be updatedextern void pascal ASIZE( void );

// Retrieves the Symbol of a Stringextern PCLIPSYMBOL _Get_Sym( LPSTR szName );extern PCLIPSYMBOL _Chk_Sym( LPSTR szName );

////////////////////////////////////////////////////////// SEND Module - OOPS Management !////////////////////////////////////////////////////////

// Creates a new ClassLONG _mdCreate( WORD wMethods, PCLIPSYMBOL pClassName );

// Adds a new Method to a ClassHextern _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 + 1extern PCLIPFUNC _isendp( void );

// Retrieves the ClassH of an Objectextern LONG _VDict( PCLIPVAR );

// Changes the ClassH of an Object or Arrayextern 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

Page 412: Manual Do FiveWin

// 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 Handlerextern WORD _evRegReceiverFunc( EVENTFUNCP pFunc, WORD wType );

extern void _evDeRegReceiver( WORD wHandlerOrder );

extern void _evSendId( WORD wMessage, WORD wHandlerOrder ); // 0xFFFF a Todosextern 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

Page 413: Manual Do FiveWin

void _DynLoadModule( PWORD pHandle, LPSTR szModule );WORD _DynGetNamedAddr( WORD wHandle, LPSTR szEntryModule, PDLMSERVER pServer );LONG _DynGetOrdAddr( WORD wHandle, WORD wService );

// ERRORvoid _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 ModuleLPSTR _tbname( PCLIPVAR, WORD ); // Same as ProcName. 2. param no matter

// 1 param is _ActInfo( WORD )// LAS "DATE"// "DATE" ones

// gets the date at _tos, returnsextern 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

Page 414: Manual Do FiveWin

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

Page 415: Manual Do FiveWin

#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

Page 416: Manual Do FiveWin

#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

Page 417: Manual Do FiveWin

// 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

Page 418: Manual Do FiveWin

#define OleSave _OleSave#define DispInvoke _DispInvoke

#endif#endif

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

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