Contents
gebacom Custom Control Kit for Windows

Contents

GCCK consist of user controls (buttons, scroll, animated), information viewers (gauge, hint window, message boxes) and style elements (font styles, static controls). In the list below you can see the contents of GCCK classified by its functional parts. For a quick start with GCCK choose 'overview' from contents list.

Overview	- a introduction to gcck

Dialog box	- GCCK dropdown dialog class

Push buttons	- GCCK buttons with bitmaps and hints

Radio buttons	- GCCK styles for radio buttons

Check boxes	- GCCK styles for checkboxes, switch control

Static controls	- GCCK text and layout elements

Scroll controls	- spin control, horizontal and vertical regulators

Animated controls	- buttons displaying animated sequenzes

Gauge controls	- GCCK process indicator control

Message Boxes	- easier handling and new styles for user messages

Hint window	- additional contextsensitive help in bubbles

Messages	- GCCK windows messages names

Library functions	- list of GCCK interface functions

Font styles	- GCCK-supported face types

GCCK special feature:

OZ multivolume pack/unpack DLL

The GCCK add on OZ.DLL provides you a API to fast and easy packing/unpacking algorithms.


gebacom Custom Control Kit - overview
gebacom Custom Control Kit

Overview

gebacom Custom Control Kit is a development tool for C-programmers. It provides new control classes for usage in windows applications. gebacom Custom Control Kit helps you create a excellent user interface for your application by simple way. Main features of GCCK are user dialog controls (buttons, scroll, animated), information viewers (gauge, hint window, message boxes) and style elements (font styles, static controls).

gebacom Custom Control Kit is full compatible with Borland Resource Workshop (versions 1.0, 1.02 and 4.0). You can use it also without Workshop by simple editing resource script files.

To include custom controls in your application you must:

1. Include import library GCCK.LIB in your project-file or linker call;

    (gcck.lib contains calling information of gcck-functions)

2. Insert the line #include "cl_use.h" in your source code;

    (this is the GCCK-header file with constants and function declarations)

3. Make sure that the line #include "cl_rc" occur in your resource script

    (this is the GCCK header file like "cl_use.h", just for resources)

4. Insert function call clLoadLibrary() before message loop in WinMain() procedure;

    (this call is required to initialize the DLL before using their functions)

5. Insert function call clSetDialogBackground(),

    (if you want to change default dialog background settings,

    this is a very quick way to change and test several looks of dialogs.)

4. Insert function call clFreeLibrary() after message loop in WinMain procedure;

    (this call is required to close the DLL and free all reserved memory)

Example1:

The C-sequence include GCCK in your application looks like the following:

 . . .

#include <windows.h>

#include "cl_use.h"

. . .

HINSTANCE gcckInst;

 . . .

int PASCAL WinMain(HANDLE hInstance,HANDLE hPrevInst,LPSTR lpCmdLine,int nCmdShow)

{

   MSG msg;

 . . .

   gcckInst = clLoadLibrary();

 . . .

   while (GetMessage(&msg,NULL,NULL,NULL))

...{

...   TranslateMessage(&msg);

...   DispatchMessage(&msg);

   };

 . . .

   clFreeLibrary();

 . . .

   return (msg.wParam);

}

Now you can use the CreateWindow() function from SDK in the common way to create GCCK-controls and handle their events in the message loop of their parent window.

Example2:

. . .

// create a GCCK push button from class 'clButton'

CreateWindow

    (

    "clButton",

    "Hello",

    WS_CHILD | WS_VISIBLE  | CL_BSNOADJUSTMENT |CL_BSDEFPUSHBUTTON | BS_PUSHBUTTON,

    xPos,

    yPos,

    xWidth,

    yHeight,

    hParentWnd,	// id of parent window

    iChildId,	// child window id of this control

    hInstance,

    NULL

    );

// set hint window text for this control

SendDlgItemMessage(hWnd,iChildId,WM_SETCTLHINT,IDS_HINTTEXT,0L);

. . .

long CALLBACK _export ParentWndProc(HWND hWin,unsigned message,WORD wParam,long lParam)

{

    . . .

    switch (message)

    {

        . . .

        case WM_HINTREQ:

            clShowHint(hInstance,wParam,lParam);

            return NULL;

            break;

        . . .

        case WM_COMMAND:

            if (wParam == iChildId)

                clMessageBox (NULL, "gcck", "button pressed", MB_ICONINFORMATION | MB_OK);

        . . .

    }

    . . .

}

Important files in your GCCK-Directory:

GCCK.DLL	developers gcck for use with borland's workshop.

GCCK.LIB	library file to include in your linker call

GCCK.HLP	GCCK help file / programmers reference

gcckrdst\GCCK.DLL.

redistributable version of GCCK

you may distribute this file with your applications

REGISTER.TXT

registration form for ordering a full version of gcck

(if you´ve just a shareware version).

CL_USE.H	header for including in *.C files

CL_RC.H	header for including in *.RC files

sample\buttonex\EXAMPLE.*

push button demo and source code

sample\gdemo\GD*.*

full GCCK controls example. This program demonstrate you all types of custom controls, show their notifications and allow to change their styles and properties. The documented source code gives you insight in the technique and possibilities of programming with GCCK.

sample\ozdemo\OZPACK.*

this small application demonstrates you use of GCCK-gauge control with a further gebacom programming tool 'oz.dll'. This library provides a quick and effective algorithm to pack/unpack files and directories and also for create multi-file archives. The size of ozpack.c (just 4 KB) demonstrates the programming power you get using these tools.

How to contact gebacom:

Please, send your orders, questions and proposals to:

gebacom GmbH

GCCK-Support

Steinerne Furt 76

86167 Augsburg

Germany

If you want send a fax, call (+49) 821 740 30 20

Our Mailbox is open for you 24 hours per day, call (+49) 821 740 30 99

Ofcourse you can also talk with us, call (+49) 821 740 30 0

For now we wish you fun and success using gebacom software.

gebacom development team.

See also:

Library functions

"cl_use.h"

"cl_rc.h"

OZ Archive DLL

Push Buttons

A GCCK Push Button looks like this:

there is a bitmap area (1) and text area (2). GCCK push buttons provides following features:

- standard bitmaps for predefined buttons

- selfcreated bitmaps

- hint windows

- change font styles

Bitmaps for predefined buttons are placed in the library, but you can redefine these buttons by placing appropriate bitmaps in your application. gebacom 3D-font styles 'inset' and 'raised' are supported for push buttons.

Class Name: "clButton"

push button window styles:

CL_BSDEFPUSHBUTTON - is the same as standard BS_DEFPUSHBUTTON style. A default push button has a thick border around it to show user the default application response.

CL_BSRIGHTBMP - is used to display push button with right aligned bitmap.

CL_BSNODEFAULT - is used to display push button without default border. It is useful for non dialog windows in application.

CL_BSNOBITMAP - is used to display simple push button without any bitmap. This button looks like standard Windows push button.

CL_BSNOADJUSTMENT - is used to forbid initial vertical resize of push button with size of used bitmap. By default the height of a button is oriented on height of its bitmap.

Messages:

(commands inherited from standard Windows push buttons:)

BM_SETSTYLE

The Windows dialog manager uses this message to toggle between the BS_DEFPUSHBUTTON and BS_PUSHBUTTON types.

BM_SETSTATE

This message changes the "highlight" state of a button. If the wParam of the message is nonzero, the button is highlighted (drawn as if it were pressed).

BM_GETSTATE

This message determines whether a button is highlighted. It returns a nonzero value when the button is highlighted and zero when the button is not highlighted.

(messages unique to GCCK:)

BM_SETBITMAP

(notification inherited from standard Windows push buttons:)

BN_CLICKED

The button sends this message when it has been "pressed" by the user, either by clicking while the mouse pointer is within the button window or by either of the following keyboard actions:

- user press the Spacebar or the Enter key when the button has keyboard focus.

- user press the button's accelerator key when keyboard focus is in another control.

Button resource ID numbering scheme

The Microsoft resource compiler does not provide user-specified control initialization data when it parses the Windows dialog template data structure. Because of this, gebacom Custom Control Kit uses the control ID field as a base from which to derive the resource IDs of the bitmaps required by a button. For each push button there is only one image for VGA and higher-resolution devices.

Bitmap resource IDs are derived from the button control using the following formulas:

     Button_ID + 21000: - VGA-resolution image

See also:

Radio Buttons

Check Boxes

Static Controls

Scroll controls

Animated controls

Gauge controls

source file 'example.c' in subdirectory 'samples\buttonex'


Radio Buttons

Functionality of gebacom Radio Buttons is similar to standard Windows buttons with BS_AUTORADIOBUTTON style. That is, when the user selects one of these buttons, it is automatically marked, and the previously selected button within the group is deselected, without the intervention of the application program.

GCCK provides three predefined styles of radio buttons:

- red eye

- rsm like

- borland like

It is also possible to place own bitmaps in radio buttons.

gebacom 3D-font styles and hint windows are supported for radio buttons.

Class Name: "clRadio"

Window Styles:

CL_RSLEFTTEXT

This style inherited from standard BS_LEFTTEXT style

CL_RSAPPBMP

This style allows to make radio buttons which based on application resource bitmaps. In this case radio button ID must be within range from 1001 to 3000, and appropriate bitmaps - within range from 25001 to 27000.

CL_RSREDEYE (default)

 - unchecked;

 - highlighted;

 - Checked

CL_RSMSLIKE

 - unchecked;

 - highlighted;

 - checked

CL_RSBORLANDLIKE

 - unchecked;

 - highlighted;

 - checked

Messages:

(messages inherited from standard Windows radio buttons:)

BM_GETCHECK

This message causes the button to return its current "check" state (the message names and descriptions all use check box imagery). If it is checked (pressed), it returns a nonzero value. Otherwise, it returns zero.

BM_SETCHECK

This message changes the check state of a button. If the wParam of the message is nonzero, the button is checked.

BM_GETSTATE

The return value specifies the current state of the button.

Mask	Description

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

0x0003	Specifies the check state. A value of 0 indicates the button is unchecked. A value of 1 indicates the button is checked.

0x0004	Specifies the highlight state. A nonzero value indicates that the button is highlighted. A button is highlighted when the user presses and holds the left mouse button.

0x0008	Specifies the focus state. A nonzero value indicates that the button has the focus.

BM_SETSTATE

This message changes the highlight state of a button. If the wParam of the message is nonzero, the button is highlighted.

(message unique to GCCK:)

BM_SETBITMAP

(notification inherited from standard Windows radio buttons:)

BN_CLICKED

The button sends this message when it has been "pressed" by the user, either by clicking while the mouse pointer is within the button window or by either of the following keyboard actions:

- user press the Spacebar when the button has keyboard focus.

- user press the button's accelerator key when keyboard focus is in another control.

See also:

Push Buttons

Check Boxes

Static Controls

Scroll controls

Animated controls

Gauge controls


Check Boxes

Functionality of gebacom Check Boxes is similar to standard Windows button with BS_AUTOCHECKBOX style. GCCK provides several new checkbox styles:

- blue cross

- csm-like

- borland like

- switch

It is also possible to place own bitmaps in check boxes.

gebacom 3D-font styles and hint windows are supported for check boxes.

Class Name: "clCheck"

Window Styles:

CL_CSLEFTTEXT

This style inherited from standard BS_LEFTTEXT style

CL_CSAPPBMP

This style allows to make check boxes which are based on application resource bitmaps. In this case check box ID must be within range from 3001 to 5000, and appropriate bitmaps - within range from 27001 to 29000.

CL_CSBLUECROSS (default)

 - unchecked;

 - highlighted;

 - checked

CL_CSMSLIKE

 - Unchecked;

 - Highlighted;

 - Checked

CL_CSBORLANDLIKE

 - Unchecked;

 - Highlighted;

 - Checked

CL_CSSWITCH

 - Unchecked;

 - Highlighted;

 - Checked

Messages:

(messages inherited from standard Windows check boxes:)

BM_GETCHECK

This message causes the button to return its current "check" state. If it is checked, it returns a nonzero value. Otherwise, it returns zero.

BM_SETCHECK

This message changes the check state of a check box. If the wParam of the message is nonzero, the box is checked.

BM_GETSTATE

The return value specifies the current state of the check box.

Mask	Description

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

0x0003	Specifies the check state. A value of 0 indicates the box is unchecked. A value of 1 indicates the box is checked.

0x0004	Specifies the highlight state. A nonzero value indicates that the box is highlighted. A box is highlighted when the user presses and holds the left mouse button.

0x0008	Specifies the focus state. A nonzero value indicates that the box has the focus.

BM_SETSTATE

This message changes the highlight state of a check box. If the wParam of the message is nonzero, the box is highlighted.

(messages unique to GCCK:)

BM_SETBITMAP

(notification inherited from standard Windows check boxes:)

BN_CLICKED

The check box sends this message when it has been "pressed" by the user, either by clicking while the mouse pointer is within the button window or by either of the following keyboard actions:

- user presses the Spacebar when the button has keyboard focus.

- user presses the button's accelerator key.

See also:

Push Buttons

Radio Buttons

Static Controls

Scroll controls

Animated controls

Gauge controls


Static Controls

gebacom Static Controls

Class Name: "clStatic"

     Window Styles:

CL_SSPANEL

This style is used to display 3D text on a 3D background, to group other controls on a 3D background as an alternative to the group box, or to lend a 3D appearance to standard controls such as list boxes, combo boxes, scroll bars etc.

CL_SSGROUPBOX

This style emulates the standard group box, which provides a graphical grouping of controls, also allows the use of 3D text (right, left, or centered in the frame), and the frame itself can appear raised or inset.

CL_SSBITMAP

This style is used to display bitmap on a 3D background. Bitmap is defined by static control caption.

CL_SSICON

This style is used to display icon on a 3D background. Icon is defined by static control caption. If you create a static icon control in Borland´s Workshop, you will not see it in the Dialog Window during Workshop session. This problem occurs because of absence of a appropriate Workshop function to load an icon. Be sure that in your application everything will be right.

CL_SSLEFTTEXT

This style is used to display left aligned text on static control.

CL_SSCENTERTEXT

This style is used to display centered text on static control.

CL_SSRIGHTTEXT

This style is used to display right aligned text on static control.

CL_SSMULTILINE

This style is used to display multiple lines of text on static control.

CL_SSVCENTER

This style is used to display vertically centered text (single line only) on static control.

CL_SSTOP

This style is used to display top aligned text (single line only) on static control.

CL_SSBOTTOM

This style is used to display bottom aligned text (single line only) on static control.

CL_SSNOPREFIX

This style is used to display text with '&'-character on static control.

CL_SSNEXTCTLBORDER

This style allows to lend a 3D appearance to standard controls such as list boxes, combo boxes, scroll bars etc.

CL_SSBWIDTH1

This style sets the border width 1 pixel.

CL_SSBWIDTH2

This style sets the border width 2 pixels.

CL_SSBWIDTH3

This style sets the border width 3 pixels.

CL_SSBWIDTH4

This style sets the border width 4 pixels.

CL_SSNOADJUSTMENT

This style forbids initial resize of static control with CL_SSBITMAP or CL_SSICON style. With this style you can use any alignment styles to align bitmap or icon inside static control.

CL_SSTRANSPARENT

This style forbids erasing background of static control.

Messages:

SM_NOBLINK

SM_SETBKCOLOR

See also:

Push Buttons

Radio Buttons

Check Boxes

Scroll controls

Animated controls

Gauge controls


3D Font Styles

gebacom Custom Control Kit supports 3D font face types:

Raised Font - control text looks raised.

     Appropriate control style is CL_RAISEDFONT.

Inset Font - control text looks inset

     Appropriate control style is CL_INSETFONT.

See also:

"cl_use.h"


Predefined Push Buttons

.-.Undefined Button (You'll see this bitmap in your dialog box editor for buttons with bitmaps defined in application)

 - "Ok" Button (ID = CL_OK = IDOK = 1)

 - "Cancel" Button (ID = CL_CANCEL = IDCANCEL = 2)

 - "Help" Button (ID = CL_HELP = 3)

 - "Yes" Button (ID = CL_YES = 4)

 - "No" Button (ID = CL_NO = 5)

 - "New" Button (ID = CL_NEW = 6)

 - "Delete" Button (ID = CL_DELETE = 7)

See also:

"cl_use.h"


"CL_USE.H"

Header file CL_USE.H contains prototypes of library functions and file CL_RC.H, which contains all GCCK defines (such as styles, masks, colors and so on). You have to insert following string  in your C-source files which calls GCCK functions or uses GCCK defines:

#include cl_use.h

If you use .RC file in your project you must insert following string in this .RC file to have possibility to use GCCK defines:

#include cl_rc.h


"CL_RC.H"

Header file CL_RC.H contains following defines:

GCCK_VERSION

GCCK_SVERSION

clDialog styles:

DS_DROPDOWN

Control font mask:

CL_SMFONTTYPE

     Values:

     CL_SIMPLEFONT

     CL_RAISEDFONT

     CL_INSETFONT

Push button styles:

     CL_BSDEFPUSHBUTTON

     CL_BSRIGHTBMP

     CL_BSNODEFAULT

     CL_BSNOBITMAP

     CL_BSNOADJUSTMENT

Radio button mask:

CL_SMRADIOFACE

     Values:

     CL_RSREDEYE

     CL_RSMSLIKE

     CL_RSBORLANDLIKE

Radio button styles:

     CL_RSLEFTTEXT

     CL_RSAPPBMP

     CL_RSNOTEXT

Check box mask:

CL_SMCHECKFACE

     Values:

     CL_CSBLUECROSS

     CL_CSMSLIKE

     CL_CSBORLANDLIKE

     CL_CSSWITCH

Check box styles:

     CL_CSLEFTTEXT

     CL_CSAPPBMP

     CL_CSNOTEXT

Static control masks:

CL_SMMAINTYPE

     Values:

     CL_SSPANEL (default)

     CL_SSGROUPBOX

     CL_SSBITMAP

     CL_SSICON

CL_SMTEXTJUSTIFICATION

     Values:

     CL_SSLEFTTEXT (default)

     CL_SSCENTERTEXT

     CL_SSRIGHTTEXT

     CL_SSMULTILINE

CL_SMBORDERTYPE

     Values:

     CL_NOBORDER

     CL_RAISEDBORDER

     CL_INSETBORDER

CL_SMBORDERWIDTH

     Values:

     CL_SSBWIDTH1 (default)

     CL_SSBWIDTH2

     CL_SSBWIDTH3

     CL_SSBWIDTH4

Static control styles:

     CL_SSVCENTER

     CL_SSTOP

     CL_SSBOTTOM

     CL_SSNOADJUSTMENT

     CL_SSNOPREFIX

     CL_SSNEXTCTLBORDER

     CL_SSTRANSPARENT

Scroll control masks:

CL_SMSCROLLTYPE

     Values:

     CL_SCSROTARY

     CL_SCSHORZ

     CL_SCSVERT

     CL_SCSSPIN

CL_SMSCROLLFACE

     Values:

CL_SCSROTARY style:

     CL_SCSLINE

     CL_SCSREDPOINT

CL_SCSHORZ and CL_SCSVERT styles:

     CL_SCSBAR

     CL_SCSCIRCLE

CL_SCSSPIN style:

     CL_SCSTRIANGLE

     CL_SCSPLUSMINUS

Animated control styles:

     CL_ASEVENTDRIVEN

     CL_ASTIMERDRIVEN

     CL_ASBMPBYTEXT

     CL_ASBMPBYID

Gauge masks:

CL_SMGAUGETYPE

     Values:

     CL_GSHORZ

     CL_GSVERT

CL_SMGAUGEBARBORDERTYPE

     Values:

     CL_GSINSETBAR

     CL_GSRAISEDBAR

     CL_GSNORMALBAR

CL_SMGAUGEBARBORDERWIDTH

     Values:

     CL_GSBARBORDER1

     CL_GSBARBORDER2

     CL_GSBARBORDER3

     CL_GSBARBORDER4

CL_SMGAUGEPATHBORDERTYPE

     Values:

     CL_GSINSETPATH

     CL_GSRAISEDPATH

     CL_GSNORMALPATH

CL_SMGAUGEPATHBORDERWIDTH

     Values:

     CL_GSPATHBORDER1

     CL_GSPATHBORDER2

     CL_GSPATHBORDER3

     CL_GSPATHBORDER4

Gauge styles:

     CL_GSLEFTTORIGHT

     CL_GSRIGHTTOLEFT

     CL_GSBOTTOMTOTOP

     CL_GSTOPTOBOTTOM

     CL_GSSCALE

     CL_GSSHOWPERCENT

     CL_GSCOLORBASED

     CL_GSBITMAPBASED

     CL_GSENABLEMESSAGELOOP


BM_SETBITMAP message

hBitmap = (HBITMAP)wParam

fRedraw = (int)lParam

The application uses this message to pass bitmap handle to the button, radio button or check box. Normally, the buttons use the button control ID to automatically load bitmap from the library or user's resources. If the bitmap does not exist, the button caption is drawn into a default bitmap.

To use this message, you must first create bitmap image, then you must send message BM_SETBITMAP to button, you want.

Parameter	Description

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

hBitmap	Value of wParam. Specifies the handle of bitmap.

fRedraw	Value of lParam. Specifies whether the control should redrawn to reflect the change. It this parameter is TRUE the control is redrawn. If it is FALSE the control is not redrawn.

Comment

The application must not call the DeleteObject function to delete bitmap handle transferred to GCCK control because control will call DeleteObject automatically during WM_DESTROY message processing.

     C sample:

    HBITMAP hBitmap;

    HWND  hWndButton = GetDlgItem(hWnd,ID_BUTTON);

...

    hBitmap = LoadBitmap(...);

...

    SendMessage(hWndButton,BM_SETBITMAP,hBitmap,0L);


gebacom Dialog Class

Class name:    clDialog

     Dialog Styles:

DS_DROPDOWN

     This style allows you to reduce height of dialog box to height caption line, and restore it by simple click on dialog drop down button:

 - click this button to reduce dialog height;

 - click this button to restore dialog height.

     Dialog messages:

WM_DLGSHOW


Library functions

clSetDialogBackground

clLoadLibrary

clFreeLibrary

clMessageBox

clMes

clShowHint

clShowHintEx

clSetAutoHintColor

clMesDLL

clDrawTextLine

clCheckVersion


Hint window

The hint window capability of GCCK allow you to include a context sensitive - shown on klick - information window for any control in your application. Common usage of hint windows is to click on the right mouse button in the area of a control (e.g. a pushbutton) and to see a help text for this control immediately. After releasing of right mouse button this window will be hidden again.

To make hint windows available in your application you must create needed string resources, and send WM_SETCTLHINT message to appropriate controls.

Important note:

If parent of control is not dialog of clDialog class you should process special message WM_HINTREQ in parent window procedure to set hint possibility.

long CALLBACK _export ParentWndProc(HWND hWin,unsigned message,WORD wParam,long lParam)

{

...

   switch (message) {

   ...

      case WM_HINTREQ:

        clShowHint(hInstance,wParam,lParam);

         return NULL;

   ...

   }

...

}

hInstance - instance of module, containing hint string, which is identified by wParam.

To see Hint window press the right mouse button on control.

To hide Hint window release right mouse button.


WM_SETCTLHINT message

idHint = (int)wParam

lParam = 0L

The application uses this message to pass hint string resource number to any gebacom control. Normally, the control has no hint string.

To use this message, you must create string resource in your application and then you must send message WM_SETCTLHINT to control while processing WM_INITDIALOG message.

Parameter	Description

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

idHint	Value of wParam. Specifies integer identifier of the string to be set as control hint. It is 0 if no hint available for this control.

     C sample:

case WM_INITDIALOG:

SendDlgItemMessage(hDlg,idControl,WM_SETCTLHINT,idString,0L);


Scroll Controls

gebacom Scroll Controls:

Class Name: "clScroll"

Window styles:

CL_SCSROTARY

This style creates an rotary knob.

CL_SCSHORZ

This style creates an horizontal volume control bar.

CL_SCSVERT

This style creates a vertical volume control bar

CL_SCSSPIN

This style creates a spin value control.

Messages:

(Messages unique to GCCK:)

     SCM_SETPOS

     SCM_GETPOS

     SCM_SETRANGE

     SCM_GETRANGE

     SCM_SETSTARTANGLE - Only for scroll control with CL_SCSROTARY style.

     SCM_SETENDANGLE - Only for scroll control with CL_SCSROTARY style.

     SCM_SETSCALE

Notification unique to GCCK:

     SCN_POSCHANGED

The scroll control sends this message when the scroll position has been changed.

     SCN_POSTRACK

The scroll control sends this message during the scroll position being changed.

See also:

Push Buttons

Radio Buttons

Check Boxes

Static Controls

Animated controls

Gauge controls


SCM_SETPOS message

iPos = (int)wParam

lParam = 0L

The application uses this message to pass new position to gebacom scroll control.

Parameter	Description

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

iPos	Value of wParam. Specifies the new position of the scroll control. It must be within the scrolling range.

     C sample:

case WM_INITDIALOG:

SendDlgItemMessage(hDlg,idScrollControl,SCM_SETRANGE,FALSE,MAKELONG(0,100));

SendDlgItemMessage(hDlg,idScrollControl,SCM_SETPOS,50,0L);


SCM_SETRANGE message

fRedraw = (BOOL)wParam

iMinPos = (int)LOWORD(lParam)

iMaxPos = (int)HIWORD(lParam)

The application uses this message to pass new maximum and minimum positions to gebacom scroll control.

Parameter	Description

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

fRedraw	Value of wParam. Specifies whether the scroll control should redrawn to reflect the change. It this parameter is TRUE the scroll control is redrawn. If it is FALSE the scroll control is not redrawn.

iMinPos	Low word of lParam. Specifies the minimum scrolling position.

iMaxPos	High word of lParam. Specifies the maximum scrolling position.

     C sample:

case WM_INITDIALOG:

...

SendDlgItemMessage(hDlg,idScrollControl,SCM_SETRANGE,TRUE,MAKELONG(0,100));


SCM_GETPOS message

wParam = 0

lParam = 0L

The return value specifies the current position of the scroll control.


SCM_GETRANGE message

wParam = 0

lParam = 0L

The low word of return value specifies the minimum position of the scroll control, the high word of return value specifies the maximum position of the scroll control.


SCM_SETSTARTANGLE message

iAngle = (int)wParam

fRedraw = (int)lParam

The application uses this message to pass scale start angle to gebacom scroll control with CL_SCSROTARY style. Default start angle is 260 degrees.

Parameter	Description

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

iAngle	Value of wParam. Specifies the new scale start angle (in degrees) of the scroll control.

fRedraw	Value of lParam. Specifies whether the scroll control should redrawn to reflect the change. It this parameter is TRUE the scroll control is redrawn. If it is FALSE the scroll control is not redrawn.

     C sample:

case WM_INITDIALOG:

SendDlgItemMessage(hDlg,idScrollControl,SCM_SETSTARTANGLE,50,0L);


SCM_SETENDANGLE message

iAngle = (int)wParam

fRedraw = (int)lParam

The application uses this message to pass scale end angle to gebacom scroll control with CL_SCSROTARY style. Default end angle is 280 degrees.

Parameter	Description

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

iAngle	Value of wParam. Specifies the new scale end angle (in degrees) of the scroll control.

fRedraw	Value of lParam. Specifies whether the scroll control should redrawn to reflect the change. It this parameter is TRUE the scroll control is redrawn. If it is FALSE the scroll control is not redrawn.

     C sample:

case WM_INITDIALOG:

SendDlgItemMessage(hDlg,idScrollControl,SCM_SETENDANGLE,50,0L);


SCM_SETSCALE message

iAngle = (int)wParam

fRedraw = (int)lParam

The application uses this message to pass scale sector value to gebacom scroll control with CL_SCSROTARY, CL_SCSHORZ or CL_SCSVERT style.

Default value for scroll control with CL_SCSROTARY style is 34 degrees.

Default value for scroll control with CL_SCSHORZ or CL_SCSVERT style is 10 units.

Parameter	Description

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

iAngle	Value of wParam. Specifies the new scale sector value (in degrees for CL_SCSROTARY or in units for CL_SCSHORZ and CL_SCSVERT) of the scroll control.

fRedraw	Value of lParam. Specifies whether the scroll control should redrawn to reflect the change. It this parameter is TRUE the scroll control is redrawn. If it is FALSE the scroll control is not redrawn.

     C sample:

case WM_INITDIALOG:

SendDlgItemMessage(hDlg,idRotaryScrollControl,SCM_SETSCALE,17,0L);

SendDlgItemMessage(hDlg,idVertScrollControl,SCM_SETSCALE,5,0L);


Message boxes

To show message boxes that looks like custom gebacom dialogs, following functions are used:

clMessageBox

clMes


clSetDialogBackground

int CALLBACK clSetDialogBackground(WORD type,long color)

clSetDialogBackground creates brush to use as dialog background.

Parameter	Description

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

type	Specifies the type of dialog background. High byte specifies the width of raised border of dialog's client area. Low byte can be one of the following values:

Value	Description

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

CL_DLGBPAN	Sets solid brush with color value specified by color parameter.

CL_DLGBAPPBMP	Sets pattern brush based on application bitmap. Parameter color in this case points to a null-terminated string that contains the name of the bitmap resource to be loaded.

CL_DLGBDLLBMP	Sets pattern brush based on predefined library bitmap.

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

color	Specifies whether color (first parameter - CL_DLGBPAN) of solid brush or name of bitmap resource (first parameter - CL_DLGBAPPBMP), or (first parameter - CL_DLGBDLLBMP) one of the following values:

CL_WHITE1

CL_WHITE2

CL_GRAY1

CL_GRAY2

CL_GRAY3

CL_BLACK1

CL_BLACK2

     C sample:

clSetDialogBackground(CL_DLGBPAN,RGB(128,0,0));

clSetDialogBackground(0x200|CL_DLGBAPPBMP,(long)(LPSTR)"MyBitmap");

clSetDialogBackground(0x400|CL_DLGBDLLBMP,CL_WHITE1);


clLoadLibrary

HINSTANCE CALLBACK clLoadLibrary(void)

clLoadLibrary initiates DLL if needed. This function must be called by your application before creating any gebacom controls (usually before message loop);

Returns:

     Return value is module instance of DLL.

    c sample:

clLoadLibrary();

clSetDialogBackground(0x200|CL_DLGBDLLBMP,CL_WHITE1);

while (GetMessage(&msg,NULL,NULL,NULL)) {

TranslateMessage(&msg);

DispatchMessage(&msg);

};

clFreeLibrary();

return (msg.wParam);

See also:

clCheckVersion


clFreeLibrary

int CALLBACK clFreeLibrary(void)

clFreeLibrary release all DLL's objects if needed . This function must be called by your application after message loop;

Returns:

     Return value is TRUE if the function is successful, otherwise it is FALSE.

    c sample:

clLoadLibrary();

clSetDialogBackground(0x200|CL_DLGBDLLBMP,CL_WHITE1);

while (GetMessage(&msg,NULL,NULL,NULL)) {

TranslateMessage(&msg);

DispatchMessage(&msg);

};

clFreeLibrary();

return (msg.wParam);

See also:

clCheckVersion


clMessageBox

int CALLBACK clMessageBox(HWND parent, LPSTR text, LPSTR caption, WORD type)

The clMessageBox function creates, displays, and operates a message-box window. The message box contains an application-defined message and title, plus any combination of the predefined icons and push buttons described in the fuStyle parameter.

Parameter	Description

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

parent	Identifies the parent window of the message box to be created. If this parameter is NULL, the message box will have no parent window.

text	Points to a null-terminated string containing the message to be displayed.

caption	Points to a null-terminated string to be used for the dialog box title. If this parameter is NULL, the default title Error is used.

type	Specifies the contents and behavior of the dialog box. This parameter can be a combination of the following values:

Value	Meaning

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

MB_DEFBUTTON1	The first button is the default. Note that the first button is always the default unless MB_DEFBUTTON2 or MB_DEFBUTTON3 is specified.

MB_DEFBUTTON2	The second button is the default.

MB_DEFBUTTON3	The third button is the default.

MB_ICONASTERISK	Same as MB_ICONINFORMATION.

MB_ICONHAND	Same as MB_ICONSTOP.

MB_ICONINFORMATION	An information con appears in the message box.

MB_ICONQUESTION	A question-mark icon appears in the message box.

MB_ICONSTOP	A stop-sign icon appears in the message box.

MB_OK	The message box contains one push button: OK.

MB_OKCANCEL	The message box contains two push buttons: OK and Cancel.

MB_YESNO	The message box contains two push buttons: Yes and No.

MB_YESNOCANCEL	The message box contains three push buttons: Yes, No, and Cancel.

Returns

The return value is zero if there is not enough memory to create the message box. Otherwise, it is one of the following menu-item values returned by the dialog box:

Value	Meaning

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

IDCANCEL	Cancel button was selected.

IDNO	No button was selected.

IDOK	OK button was selected.

IDYES	Yes button was selected.


clMes

int CALLBACK clMes(HWND parent, int itext, int icaption, WORD type)

The clMes function creates, displays, and operates a message-box window. The message box contains an application-defined message and title, plus any combination of the predefined icons and push buttons described in the fuStyle parameter.

Parameter	Description

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

parent	Identifies the parent window of the message box to be created. If this parameter is NULL, the message box will have no parent window.

text	Identifies string resource to be displayed.

caption	Identifies string resource to be used for the dialog box title.

type	Specifies the contents and behavior of the dialog box. This parameter can be a combination of the following values:

Value	Meaning

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

MB_DEFBUTTON1	The first button is the default. Note that the first button is always the default unless MB_DEFBUTTON2 or MB_DEFBUTTON3 is specified.

MB_DEFBUTTON2	The second button is the default.

MB_DEFBUTTON3	The third button is the default.

MB_ICONASTERISK	Same as MB_ICONINFORMATION.

MB_ICONHAND	Same as MB_ICONSTOP.

MB_ICONINFORMATION	An information con appears in the message box.

MB_ICONQUESTION	A question-mark icon appears in the message box.

MB_ICONSTOP	A stop-sign icon appears in the message box.

MB_OK	The message box contains one push button: OK.

MB_OKCANCEL	The message box contains two push buttons: OK and Cancel.

MB_YESNO	The message box contains two push buttons: Yes and No.

MB_YESNOCANCEL	The message box contains three push buttons: Yes, No, and Cancel.

Returns

The return value is zero if there is not enough memory to create the message box. Otherwise, it is one of the following menu-item values returned by the dialog box:

Value	Meaning

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

IDCANCEL	Cancel button was selected.

IDNO	No button was selected.

IDOK	OK button was selected.

IDYES	Yes button was selected.


clShowHint

void CALLBACK clShowHint(HINSTANCE hInst,DWORD xParam,long lParam)

The clShowHint function displays, and operates a hint window.

Parameter	Description

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

hInst	  Identifies an instance of the module whose executable file contains the string resource to be loaded. This parameter used if the high order word of xParam is zero.

xParam	  Points to a null-terminated string to be displayed. Alternatively, this parameter can consist of the string identifier in the low order word and zero in the high order word.

lParam	  The low order word specifies x-coordinate of hint window and the high order word specifies y-coordinate of hint window. Coordinates are relative to the upper-left corner of the screen.

c example:

case WM_RBUTTONDOWN:

ClientToScreen(hwnd,(LPPOINT)&lParam);

clShowHint(GetWindowWord(hwnd,GWW_HINSTANCE),STRID,lParam);

break;


clShowHintEx

void CALLBACK clShowHintEx(HINSTANCE hInst,DWORD xParam,long lParam,int vkcode)

The clShowHintEx function displays, and operates a hint window.

Parameter	Description

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

hInst	Identifies an instance of the module whose executable file contains the string resource to be loaded. This parameter used if the high order word of xParam is zero.

xParam	Points to a null-terminated string to be displayed. Alternatively, this parameter can consist of the string identifier in the low order word and zero in the high order word.

lParam	The low order word specifies x-coordinate of hint window and the high order word specifies y-coordinate of hint window. Coordinates are relative to the upper-left corner of the screen.

vkcode	Specifies virtual key code for key to control hint window. When this key will be released, the hint window hides.

   c example:

case WM_KEYDOWN:

clShowHintEx(hInstance,STRID,lParam,wParam);

break;


clSetAutoHintColor

void CALLBACK clSetAutoHintColor(int color)

The clSetAutoHintColor function sets text color for controls with installed hint.

Parameter	Description

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

color	Specifies the text color. See gauge and text colors for available values.

C example:

clSetAutoHintColor(CL_GREEN);

After this call all controls in application to which WM_SETCTLHINT message will be sent, will have green caption.


clMesDLL

int CALLBACK clMesDLL(HINSTANCE hInst,HWND hPar,int n,int c,WORD type)

The clMesDLL function creates, displays, and operates a message-box window. Unlike clMes function, this function may be used in dynamic link libraries. The message box contains an DLL-defined message and title, plus any combination of the predefined icons and push buttons described in the fuStyle parameter.

Parameter	Description

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

hInst	Identifies the instance associated with the desired data segment.

All other parameters are the same as for clMes function.


clDrawTextLine

int CALLBACK clDrawTextLine(HDC hDC,char far *text,RECT far *r,WORD dtFormat,COLORREF bc,COLORREF fc,WORD order)

The clDrawTextLine function draws formatted text (with TRANSPARENT mode) into a given rectangle. It aligning text to the left, right, or center of the rectangle, and breaking text into lines that fit within the rectangle.The clDrawTextLine function uses the device context's selected font. All formatting is assumed to have multiple lines unless the DT_SINGLELINE format is specified.

Parameter	Description

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

hDC	Identifies the device context. This cannot be a metafile device context.

text	Points to the string to be drawn, the string must be null-terminated.

r	Points to a RECT structure that contains the logical coordinates of the upper-left and lower-right corners of the rectangle in which the text is to be formatted.

dtFormat	Specifies an array of flags that determine how to draw the text. This parameter is the same as for standard DrawText function.

bc	Specifies first (background) text color RGB value.

fc	Specifies second (fopreground) text color RGB value.

order	Specifies drawing order, must be one of the following values:

CL_INSETFONT - moves rectangle r one pixel right and down, draws text with text color, specified by bc parameter, restores rectangle and draws text with text color, specified by fc parameter.

CL_RAISEDFONT - moves rectangle r one pixel left and top, draws text with text color, specified by bc parameter, restores rectangle and draws text with text color, specified by fc parameter.

CL_NORMALFONT - simple draws text with text color, specified by fc parameter.


WM_SETTEXTCOLOR message

iColor = (int)wParam

fRedraw = (int)lParam

The application uses this message to pass new text color value to gebacom control.

Default value is CL_BLACK (0).

Parameter	Description

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

iColor	Value of wParam. Specifies the new text color. See gauge and text colors for available values.

fRedraw	Value of lParam. Specifies whether the control should redrawn to reflect the change. It this parameter is TRUE the control is redrawn. If it is FALSE the control is not redrawn.

     C sample:

case WM_INITDIALOG:

SendDlgItemMessage(hDlg,idControl,WM_SETTEXTCOLOR,CL_RED,1L);


Messages

All controls

WM_SETCTLHINT

WM_SETTEXTCOLOR

clButton, clCheck and clRadio controls

BM_SETBITMAP

clDialog control

WM_DLGSHOW

WM_HINTREQ

WM_DRAWCAPTION

clScroll control

SCM_SETPOS

SCM_GETPOS

SCM_SETRANGE

SCM_GETRANGE

SCM_SETSTARTANGLE - Only for scroll control with CL_SCSROTARY style.

SCM_SETENDANGLE - Only for scroll control with CL_SCSROTARY style.

SCM_SETSCALE

clGauge control

GM_INC

GM_DEC

GM_SETMAX

GM_GETMAX

GM_SETPOS

GM_GETPOS

GM_SETPATHCOLOR

GM_GETPATHCOLOR

GM_SETBARCOLOR

GM_GETBARCOLOR

clAnimated control

AM_SETPICWIDTH

AM_SETCURPIC

AM_SHOWALLPIC

AM_SETPICMAX

AM_SETDELAY

AM_GETDELAY

AM_GETPICMAX

AM_GETCURPIC

AM_GETPICWIDTH

AM_SETBITMAP


WM_DLGSHOW message

fShow = (BOOL) wParam;

The WM_DLGSHOW message is sent to a dialog when it size is about to be reduced or restored.

Parameter	Description

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

fShow	Value of wParam. Specifies whether a dialog height is being restored. It is TRUE if dialog size is being restored, it is FALSE if the height is being reduced.


Animated controls

gebacom Animated Controls:

Class Name: "clAnimated"

Window styles:

CL_ASEVENTDRIVEN

This style is used to give application full control on animated sequence. Nothing will appear until AM_SETCURPIC or AM_SHOWALLPIC messages will be send.

CL_ASTIMERDRIVEN

CL_ASBMPBYTEXT

CL_ASBMPBYID

Styles derived from GCCK static control:

CL_ASLEFTTEXT

This style is used to display left aligned text on animated control.

CL_ASCENTERTEXT

This style is used to display centered text on animated control.

CL_ASRIGHTTEXT

This style is used to display right aligned text on animated control.

CL_ASMULTILINE

This style is used to display multiple lines of text on animated control.

CL_ASVCENTER

This style is used to display vertically centered text (single line only) on animated control.

CL_ASTOP

This style is used to display top aligned text (single line only) on animated control.

CL_ASBOTTOM

This style is used to display bottom aligned text (single line only) on animated control.

CL_ASNOPREFIX

This style is used to display text with '&'-character on animated control.

CL_ASBWIDTH1

This style sets the border width 1 pixel.

CL_ASBWIDTH2

This style sets the border width 2 pixels.

CL_ASBWIDTH3

This style sets the border width 3 pixels.

CL_ASBWIDTH4

This style sets the border width 4 pixels.

Messages:

AM_SETPICWIDTH

AM_SETCURPIC

AM_SHOWALLPIC

AM_SETPICMAX

AM_SETDELAY

AM_GETDELAY

AM_GETPICMAX

AM_GETCURPIC

AM_GETPICWIDTH

AM_SETBITMAP

Notifications:

AN_LBUTTONDOWN

AN_LBUTTONUP

AN_CHANGE

Animated resource scheme

To use animated control in your application you must create bitmap for it first.

Typical bitmap for animated control looks like following:

There is simple algorithm to create appropriate bitmap without any special tools:

First, draw or import single picture into Resource Workshop, then change bitmap size to increase width with width of picture, copy previous picture to the right side of current bitmap and make changes for this picture. Repeat this process N times and you will see sequence like above.

You must set picture width or number of pictures during WM_INITDIALOG message:

SendDlgItemMessage(hDlg,ID_ANIMATED,AM_SETPICWIDTH,32,0L);

or

SendDlgItemMessage(hDlg,ID_ANIMATED,AM_SETPICMAX,14,0L);

With your own bitmap value of wParam will be different.

See also:

Push Buttons

Radio Buttons

Check Boxes

Static Controls

Scroll controls

Gauge controls


Gauge controls

gebacom Gauge Controls:

Class Name: "clGauge"

Window styles:

Basic styles:

     CL_GSHORZ

     CL_GSVERT

To retrieve basic type of gauge control you can use CL_SMGAUGETYPE mask:

Direction styles:

     CL_GSLEFTTORIGHT - for horizontal gauges.

     CL_GSRIGHTTOLEFT - for horizontal gauges.

     CL_GSBOTTOMTOTOP - for vertical gauges.

     CL_GSTOPTOBOTTOM - for vertical gauges.

Miscellaneous styles:

     CL_GSSCALE

     CL_GSSHOWPERCENT - this style is used to draw current percent value automatically at the center of gauge. In any case gauge parent will receive GN_PERCENT notification.

     CL_GSENABLEMESSAGELOOP - this style activates built-in message loop after processing each GM_INC, GM_DEC or GM_SETPOS message to peek and dispatch messages from queue. Thus user can move and resize windows, jump to another application and work while during still active, without any problem.

     CL_GSCOLORBASED - this style is used to draw gauge bar with solid color. Default values: light gray path and green bar, to change defaults application must use GM_SETBARCOLOR and GM_SETPATHCOLOR messages.

     CL_GSBITMAPBASED - this style is used to draw gauge bar as a sequence of bitmaps. Name of bitmap in this case is defined by gauge caption, gauge automatically adjusts with bitmap size.

Raised/Inset effects:

For gauge with CL_GSCOLORBASED style:

     CL_GSINSETBAR

     CL_GSRAISEDBAR

     CL_GSNORMALBAR

     CL_GSBARBORDER1

     CL_GSBARBORDER2

     CL_GSBARBORDER3

     CL_GSBARBORDER4

For any gauge control:

     CL_GSINSETPATH

     CL_GSRAISEDPATH

     CL_GSNORMALPATH

     CL_GSPATHBORDER1

     CL_GSPATHBORDER2

     CL_GSPATHBORDER3

     CL_GSPATHBORDER4

Messages unique to GCCK:

GM_INC

GM_DEC

GM_SETMAX

GM_GETMAX

GM_SETPOS

GM_GETPOS

GM_SETPATHCOLOR

GM_GETPATHCOLOR

GM_SETBARCOLOR

GM_GETBARCOLOR

Notifications:

See also:

Push Buttons

Radio Buttons

Check Boxes

Static Controls

Scroll controls

Animated controls


SCN_POSCHANGED

The SCN_POSCHANGED notification message is sent when user finished dragging scroll handle or turning knob (left mouse button or some direction key is realized). The parent window of the scroll control receives this notification message through a WM_COMMAND message.

Parameter	Description

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

wParam	Specifies the identifier of the scroll control.

lParam	Specifies the handle of the scroll control in the low-order word, and specifies the SCN_POSCHANGED notification message in the high-order word.

Comment

To retrieve current position of scroll control, application must use GM_GETPOS message


SCN_POSTRACK

The SCN_POSTRACK notification message is sent when user drags scroll handle or turns knob to specified position (left mouse button or some direction key is pressed). The parent window of the scroll control receives this notification message through a WM_COMMAND message.

Parameter	Description

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

wParam	Specifies the identifier of the scroll control.

lParam	Specifies the handle of the scroll control in the low-order word, and specifies the SCN_POSTRACK notification message in the high-order word.

Comment

To retrieve current position of scroll control, application must use GM_GETPOS message


GN_PERCENT

The GN_PERCENT notification message is sent when the current percent value of a gauge is about to change. The parent window of the gauge receives this notification message through a WM_COMMAND message.

Parameter	Description

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

wParam	Specifies the identifier of the gauge.

lParam	Specifies the handle of the gauge in the low-order word, and specifies the GN_PERCENT notification message in the high-order word.


AN_LBUTTONDOWN

The AN_LBUTTONDOWN notification message is sent when the user presses left mouse button when cursor is within an animated control. The parent window of the animated control receives this notification message through a WM_COMMAND message.

Parameter	Description

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

wParam	Specifies the identifier of the animated control.

lParam	Specifies the handle of the gauge in the low-order word, and specifies the AN_LBUTTONDOWN notification message in the high-order word.


AN_LBUTTONUP

The AN_LBUTTONUP notification message is sent when the user realizes left mouse button when cursor is within an animated control. The parent window of the animated control receives this notification message through a WM_COMMAND message.

Parameter	Description

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

wParam	Specifies the identifier of the animated control.

lParam	Specifies the handle of the gauge in the low-order word, and specifies the AN_LBUTTONUP notification message in the high-order word.


AN_CHANGE

The AN_CHANGE notification message is sent when the current picture of animated control has changed. The parent window of the animated control receives this notification message through a WM_COMMAND message.

Parameter	Description

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

wParam	Specifies the identifier of the animated control.

lParam	Specifies the handle of the gauge in the low-order word, and specifies the AN_CHANGE notification message in the high-order word.


GM_INC message

wParam = 0

fRedraw = (int)lParam

The application uses this message to increment current position of gebacom gauge control.

Parameter	Description

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

fRedraw	Value of lParam. Specifies whether the control should redrawn to reflect the change. It this parameter is TRUE the control is redrawn. If it is FALSE the control is not redrawn.

     C sample:

SendDlgItemMessage(hDlg,idGauge,GM_INC,0,1L);


GM_DEC message

wParam = 0

fRedraw = (int)lParam

The application uses this message to decrement current position of gebacom gauge control.

Parameter	Description

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

fRedraw	Value of lParam. Specifies whether the control should redrawn to reflect the change. It this parameter is TRUE the control is redrawn. If it is FALSE the control is not redrawn.

     C sample:

SendDlgItemMessage(hDlg,idGauge,GM_DEC,0,1L);


GM_SETMAX message

wMax = wParam

fRedraw = (int)lParam

The application uses this message to set new upper position of gebacom gauge control.

Parameter	Description

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

wPos	Value of wParam. Specifies the new upper position of gauge.

fRedraw	Value of lParam. Specifies whether the control should redrawn to reflect the change. It this parameter is TRUE the control is redrawn. If it is FALSE the control is not redrawn.

Returns

The low order word of return value contains the previous upper position of gauge control.

     C sample:

case WM_INITDIALOG:

SendDlgItemMessage(hDlg,idGauge,GM_SETMAX,NewMaxValue,0L);


GM_GETMAX message

wParam = 0

lParam = 0

The application uses this message to retrieve current upper position of gebacom gauge control.

Returns

The low order word of return value contains the previous upper position of gauge control.

     C sample:

MaxPos = LOWORD(SendDlgItemMessage(hDlg,idGauge,GM_GETMAX,0,0L));


GM_SETPOS message

wPos = wParam

fRedraw = (int)lParam

The application uses this message to set new position of gebacom gauge control.

Parameter	Description

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

wPos	Value of wParam. Specifies the new position of gauge.

fRedraw	Value of lParam. Specifies whether the control should redrawn to reflect the change. It this parameter is TRUE the control is redrawn. If it is FALSE the control is not redrawn.

     C sample:

SendDlgItemMessage(hDlg,idGauge,GM_SETPOS,NewPosValue,1L);


GM_GETPOS message

wParam = 0

lParam = 0

The application uses this message to retrieve current position of gebacom gauge control.

Returns

The low order word of return value contains current position of gauge control.

     C sample:

wPos = LOWORD(SendDlgItemMessage(hDlg,idGauge,GM_GETPOS,0,0L));


GM_SETPATHCOLOR message

iColor = (int)wParam

lParam = 0

The application uses this message to pass path color value to gebacom gauge control.

Parameter	Description

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

iColor	Value of wParam. Specifies the new path color. See gauge and text colors for possible values.

     C sample:

case WM_INITDIALOG:

SendDlgItemMessage(hDlg,idGauge,GM_SETPATHCOLOR,CL_LIGHTGRAY,0L);


GM_GETPATHCOLOR message

wParam = 0

lParam = 0

The application uses this message to retrieve path color value from gebacom gauge control.

Returns

The low order word of return value contains path color value (from gauge and text colors set) of gauge control.

     C sample:

iColor = LOWORD(SendDlgItemMessage(hDlg,idGauge,GM_GETPATHCOLOR,0,0L));


GM_SETBARCOLOR message

iColor = (int)wParam

lParam = 0

The application uses this message to pass bar color value to gebacom gauge control with CL_GSCOLORBASED.style.

Parameter	Description

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

iColor	Value of wParam. Specifies the new path color. See gauge and text colors for possible values.

     C sample:

case WM_INITDIALOG:

SendDlgItemMessage(hDlg,idGauge,GM_SETBARCOLOR,CL_CYAN,0L);


GM_GETBARCOLOR message

wParam = 0

lParam = 0

The application uses this message to retrieve bar color value from gebacom gauge control with CL_GSCOLORBASED.style.

Returns

The low order word of return value contains path color value (from gauge and text colors set) of gauge control.

     C sample:

iColor = LOWORD(SendDlgItemMessage(hDlg,idGauge,GM_GETBARCOLOR,0,0L));


Gauge and text colors

CL_BLACK	0

CL_RED	1

CL_GREEN	2

CL_SWAMP	3

CL_BLUE	4

CL_MAGENTA	5

CL_CYAN	6

CL_DARKGRAY	7

CL_DISABLED	CL_DARKGRAY

CL_LIGHTGRAY	8

CL_LIGHTRED	9

CL_LIGHTGREEN	10

CL_YELLOW	11

CL_LIGHTBLUE	12

CL_LIGHTMAGENTA	13

CL_LIGHTCYAN	14

CL_WHITE	15


AM_SETPICWIDTH message

iWidth = (int)wParam

lParam = 0

The application uses this message to set picture width and number of pictures for gebacom animated control.

Parameter	Description

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

iWidth	Value of wParam. Specifies the new width of picture.

     C sample:

WM_INITDIALOG:

SendDlgItemMessage(hDlg,idAnimated,AM_SETPICWIDTH,iWidth,0L);


AM_SETCURPIC message

iPicNum = wParam

fRedraw = (int)lParam

The application uses this message to set new picture of gebacom animated control.

Parameter	Description

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

iPicNum	Value of wParam. Specifies the new picture of animated control. If iPicNum is -1 picture following current will be set.

fRedraw	Value of lParam. Specifies whether the control should redrawn to reflect the change. It this parameter is TRUE the control is redrawn. If it is FALSE the control is not redrawn.

     C sample:

for (i = 0; i <= iBound; I++) {

. . .

SendDlgItemMessage(hDlg,idAnimated,AM_SETCURPIC,-1,1L);

}


AM_SHOWALLPIC message

wParam = 0

lParam = 0

The application uses this message to show all pictures of gebacom animated control.

     C sample:

case ID_ANIMATED:

if (HIWORD(lParam) == AN_LBUTTONUP)

SendMessage(LOWORD(lParam),AM_SHOWALLPIC,0,0L);


AM_SETPICMAX message

iNumOfPic = (int)wParam

lParam = 0

The application uses this message to set number of pictures and picture width for gebacom animated control.

Parameter	Description

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

iNumOfPic	Value of wParam. Specifies the new number of pictures.

     C sample:

WM_INITDIALOG:

SendDlgItemMessage(hDlg,idAnimated,AM_SETPICMAX,iNumOfPic,0L);


AM_SETDELAY message

wDelay = wParam

lParam = 0

The application uses this message to set new delay value for gebacom animated control. Default value of delay is 62 milliseconds.

Parameter	Description

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

wDelay	Value of wParam. Specifies the new delay value in milliseconds.

     C sample:

WM_INITDIALOG:

SendDlgItemMessage(hDlg,idAnimated,AM_SETDELAY,100,0L);


AM_GETDELAY message

wParam = 0

lParam = 0

The application uses this message to retrieve current delay value of gebacom animated control.

Returns

Low order word of return value contains current delay in milliseconds.

     C sample:

wDelay  = LOWORD(SendDlgItemMessage(hDlg,idAnimated,AM_GETDELAY,0,0L));


AM_GETPICMAX message

wParam = 0

lParam = 0

The application uses this message to retrieve current number of pictures for gebacom animated control.

Returns

Low order word of return value contains current number of pictures.

     C sample:

iNumOfPic = (int)LOWORD(SendDlgItemMessage(hDlg,idAnimated,AM_GETPICMAX,0,0L));


AM_GETCURPIC message

wParam = 0

lParam = 0

The application uses this message to retrieve current picture of gebacom animated control.

Returns

Low order word of return value contains number of current picture.

     C sample:

iCurPic = (int)LOWORD(SendDlgItemMessage(hDlg,idAnimated,AM_GETCURPIC,0,0L));


AM_GETPICWIDTH message

wParam = 0

lParam = 0

The application uses this message to retrieve width of picture for gebacom animated control.

Returns

Low order word of return value contains width of picture.

     C sample:

iWidth = (int)LOWORD(SendDlgItemMessage(hDlg,idAnimated,AM_GETPICWIDTH,0,0L));


AM_SETBITMAP message

hBitmap = (HBITMAP)wParam

fRedraw = (int)lParam

The application uses this message to pass bitmap handle to the animated control.

To use this message, you must first create bitmap image, then you must send message AM_SETBITMAP to animated control, you want.

Parameter	Description

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

hBitmap	Value of wParam. Specifies the handle of bitmap.

fRedraw	Value of lParam. Specifies whether the control should redrawn to reflect the change. It this parameter is TRUE the control is redrawn. If it is FALSE the control is not redrawn.

Comment

The application must not call the DeleteObject function to delete bitmap handle transferred to GCCK control because control will call DeleteObject automatically during WM_DESTROY message processing.

     C sample:

    HBITMAP hBitmap;

    HWND  hWndAnimated = GetDlgItem(hWnd,ID_ANIMATED);

...

    hBitmap = LoadBitmap(...);

...

    SendMessage(hWndAnimated,AM_SETBITMAP,hBitmap,0L);


SM_NOBLINK message

fNoBlink = (int)wParam

lParam = 0

The application uses this message to set special drawing mode for static control to avoid possible blinking while control caption is changed. It is very useful for static controls, which are changed often to reflect some actions.

Parameter	Description

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

fNoBlink	Value of wParam. Specifies whether the nonblinking mode is about set or cleared. It this parameter is TRUE the mode is set. If it is FALSE the mode is cleared.

     C sample:

case WM_INITDIALOG:

SendDlgItemMessage(hDlg,ID_OFTENCHANGEDTEXT,SM_NOBLINK,1,0L);


SM_SETBKCOLOR message

iColor = (int)wParam

fRedraw = (int)lParam

The application uses this message to pass new background color value to gebacom static control.

Default value is CL_LIGHTGRAY.

Parameter	Description

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

iColor	Value of wParam. Specifies the new background color. See gauge and text colors for available values.

fRedraw	Value of lParam. Specifies whether the control should redrawn to reflect the change. It this parameter is TRUE the control is redrawn. If it is FALSE the control is not redrawn.

     C sample:

case WM_INITDIALOG:

SendDlgItemMessage(hDlg,idStatic,SM_SETBKCOLOR,CL_LIGHTCYAN,0L);


clCheckVersion

int CALLBACK clCheckVersion(int iNeededVersion)

The clCheckVersion function check version number for loaded library. It is useful for future GCCK versions, application will be able to test loaded library to avoid trouble.

Parameter	Description

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

iNeededVersion	Identifies the version number working with application.

Returns

The return value is zero if loaded library has version number less then specified one. Otherwise, it returns 1.

C example

HINSTANCE gcckInst;

gcckInst = clLoadLibrary();

if (!clCheckVersion(GCCK_VERSION)) {

clFreeLibrary();

return (NULL);

};

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

//   Special example (for ancient versions of GCCK, less then 1.10)

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

HINSTANCE gcckInst;

gcckInst = clLoadLibrary();

if (GetProcAddress(gcckInst,CLCHECKVERSION) == NULL || !clCheckVersion(GCCK_VERSION)) {

clFreeLibrary();

return (NULL);

};

case WM_INITDIALOG:

SendDlgItemMessage(hDlg,idStatic,SM_SETBKCOLOR,CL_LIGHTCYAN,0L);


oz pack/unpack dll
gebacom OZ pack/unpack DLL

This page introduces you to the gebacom OZ-packer/unpacker-dll included to gcck. OZ.DLL allow you to pack and unpack easy files and directories and can create fast high packed multi volume archives.

In directory samples\ozdemo under your GCCK directory you can find the C-source of the example application 'ozpack' which demonstrates usage of oz.dll. See file ozpack.c to get a touch how easy to use these features.

To include OZ.DLL in your application you must:

1. Include import library OZ.LIB in your project-file or linker call;

    (oz.lib contains calling information of pack/unpack-functions)

2. Insert the line #include "oz.h" in your C-source file;

    (this is the OZ-header file with function declarations)

OZ DLL API

int CALLBACK ozZip (long maxsize,char far *zipname,char far *mask,HWND hWin,unsigned message);

This function create a multivolume packed file.

arguments:

maxsize - specifies maximal size of volume,value -1 means unlimited size of packed file;

zipname - null terminated string, which specifies name of packed file;

mask - null terminated string with an optional drive specifier,path, and the filename of the file to be placed in packed file. The file name portion can contain wildcard match characters ('?','*');

hWin - specifies HWND of window to receive notification, specified by message parameter;

message - specifies user defined message, window, specified by hWin parameter will receive this message every time when new file will be placed into packed file. lParam will specify null terminated string, containing current file name. Application must return NULL to continue process, and -1 to cancel packing.

return values:

1 on success,

0 on error.

-----

int CALLBACK ozUnZip (char far *path,char far *zipname,HWND hWin,unsigned message);

This function restores files from a multivolume packed file created by ozZip() function

arguments:

path - null terminated string, which specifies target path to restore files and subdirectories;

zipname - null terminated string, which specifies name of packed file;

hWin - specifies HWND of window to receive notification, specified by message parameter;

message - specifies user defined message, window, specified by hWin parameter will receive this message every time when new file will be extracted from packed file. lParam will specify null terminated string, containing current file name. Application must return NULL to continue process, and -1 to cancel packing.

return values:

1 on success,

0 on error.

-----

long CALLBACK ozGetInfo (char far *zipname,int far *nof);

This function returns information about packed file, which was made by ozZip() function

arguments:

zipname - null terminated string, which specifies name of packed file;

nof - points to integer variable to receive number of files containing into packed file.

return value:

sum of sizes of all files from packed file.

-----

DWORD CALLBACK ozCalcSize (char far *mask);

This function recurse subdirectories to calculate sum of sizes of all files

specified by mask parameter.

arguments:

mask - null terminated string with an optional drive specifier, path, and the filename of the file to be processed. The file name portion can contain wildcard match characters ('?','*');

return value:

sum of sizes of all specified files.


CL_SMBORDERTYPE 0xC000

Allows to take 3D border type of static control.


CL_SMFONTTYPE 0x3000

Allows to take 3D font type of control.


CL_NOBORDER 0

Creates static control without 3D border.


CL_RAISEDBORDER 0x8000

Creates static control with raised 3D border.


CL_INSETBORDER 0x4000

Creates static control with inset 3D border.


CL_SIMPLEFONT 0

Creates control with usual font face.


CL_RAISEDFONT 0x2000

Creates control with raised 3D font face.


CL_INSETFONT 0x1000

Creates control with inset 3D font face.


CL_BSDEFPUSHBUTTON 1

Creates a button that has a heavy black border. In any dialog window user can select this button by pressing the ENTER key.


CL_BSRIGHTBMP 2

Creates a button that has right aligned bitmap.


CL_BSNODEFAULT 4

Creates a button that doesn't have heavy black border. This feature useful within non dialog windows.


CL_BSNOBITMAP 8

Creates a button with no bitmap.


CL_BSNOADJUSTMENT 0x10

Creates a button without initial adjustment with bitmap height.


CL_RSLEFTTEXT 0x200

Creates a radio button with right aligned bitmap.


CL_RSAPPBMP 0x10

Creates a radio button with user defined bitmap.


CL_RSNOTEXT 0x20

Creates a radio button without text.


CL_SMRADIOFACE 0xF

Allows to take number of current face of radio button.


CL_RSREDEYE 0

Creates a radio button with face "Red eye" (default).


CL_RSMSLIKE 1

Creates a radio button which looks like Microsoft 3D radio button.


CL_RSBORLANDLIKE 2

Creates a radio button which looks like Borland radio button.


CL_CSLEFTTEXT 0x200

Creates a check box with right aligned bitmap.


CL_CSAPPBMP 0x10

Creates a check box with user defined bitmap.


CL_CSNOTEXT 0x20

Creates a check box without text.


CL_SMCHECKFACE                0xF

Allows to take number of current face of check box.


CL_CSBLUECROSS 0

Creates a check box with face "Blue cross" (default).


CL_CSMSLIKE 1

Creates a check box which looks like Microsoft 3D checkr box.


CL_CSBORLANDLIKE 2

Creates a check box which looks like Borland check box.


CL_CSSWITCH 3

Creates a check box which looks like simple switch.


CL_SMMAINTYPE 3

Allows to take main type of static control.


CL_SSPANEL 0

Creates a static control looks like 3D panel.


CL_SSGROUPBOX 1

Creates a 3D group box.


CL_SSBITMAP 2

Creates a static control with bitmap at background.The given text is the name of an bitmap

defined elsewhere in the resource file. The width and height of window are ignored; the

control automatically sizes itself.


CL_SSICON 3

Creates a static control with icon at background.The given text is the name of an icon

defined elsewhere in the resource file. The width and height of window are ignored; the

control automatically sizes itself.


CL_SMTEXTJUSTIFICATION 0xC

Allows to take text justification type of static control.


CL_SSLEFTTEXT 0

Displays the given text left-aligned in the rectangle.


CL_SSCENTERTEXT 4

Displays the given text centered in the rectangle.


CL_SSRIGHTTEXT 8

Displays the given text right-aligned in the rectangle.


CL_SSMULTILINE 0xC

Displays multiple lines of text. Words that would extend past the end of a line

are automatically wrapped to the beginning of the next line.


CL_SSVCENTER 0x20

Displays the given text, bitmap or icon vertically centered in the rectangle (single line only).


CL_SSTOP 0

Displays the given text, bitmap or icon top aligned in the rectangle (single line only).


CL_SSBOTTOM 0x400

Displays the given text, bitmap or icon bottom aligned in the rectangle (single line only).


CL_SSNOADJUSTMENT 0x800

Ignores initial adjustment of bitmap or icon based static control with bitmap size.

Thus justification will be available for that static control.


CL_SSTRANSPARENT WS_TABSTOP

Displays the given text, bitmap or icon without erasing background.


CL_SSNOPREFIX 0x40

Prevents interpretation of any & characters in the control's text as accelerator prefix

characters (which are displayed with the & removed and the next character in the

string underlined).


CL_SMBORDERWIDTH 0x180

Allows to take 3D border width of static control.


CL_SSNEXTCTLBORDER 0x200

Creates a static control (usually panel without any text) that serves as 3D border for next dialog control.


CL_SSBWIDTH1 0

Creates a static control with border width 1 pixel.


CL_SSBWIDTH2 0x80

Creates a static control with border width 2 pixels.


CL_SSBWIDTH3 0x100

Creates a static control with border width 3 pixels.


CL_SSBWIDTH4 0x180

Creates a static control with border width 4 pixels.


CL_SMSCROLLFACE 0xF

Allows to take face of scroll control.


CL_SCSLINE 0

Creates a scroll control (rotary knob) with line mark.


CL_SCSREDPOINT 1

Creates a scroll control (rotary knob) with red point mark.


CL_SMSCROLLTYPE 0x30

Allows to take type of scroll control.


CL_SCSROTARY 0

Creates a scroll control which looks like rotary knob (default).


CL_SCSHORZ 0x10

Creates horizontal scroll control.


CL_SCSVERT 0x20

Creates vertical scroll control.


CL_SCSSPIN 0x30

Creates editable scroll control (spin).


CL_SCSTRIANGLE 0

Creates a scroll control (spin) with UP and DOWN buttons.


CL_SCSPLUSMINUS 1

Creates a scroll control (spin) with PLUS and MINUS buttons.


CL_SCSBAR 0

Creates a scroll control (horizontal or vertical) with bar like handle.


CL_SCSCIRCLE 1

Creates a scroll control (horizontal or vertical) with round handle.


DS_DROPDOWN 0x8000

Creates a an dialog (of clDialog class) with (shrink to caption)/(restore) button.


CL_SMGAUGETYPE 3

Allows to take main type gauge control.


CL_GSHORZ 0

Creates horizontal gauge control.


CL_GSVERT 1

Creates vertical gauge control.


CL_GSENABLEMESSAGELOOP 2

Creates gauge control with built-in message loop.


CL_GSLEFTTORIGHT 0

Creates horizontal gauge control with increment direction from left to right.


CL_GSRIGHTTOLEFT 4

Creates horizontal gauge control with increment direction from right to left.


CL_GSBOTTOMTOTOP 0

Creates vertical gauge control with increment direction from bottom to top.


CL_GSTOPTOBOTTOM 4

Creates vertical gauge control with increment direction from top to bottom.


CL_GSSCALE 8

Creates gauge control with scale.


CL_GSSHOWPERCENT 0x10

Displays current percentage at the center of gauge control.


CL_GSCOLORBASED 0

Draws gauge bar using one of 16 system colors.


CL_GSBITMAPBASED 0x20

Draws gauge bar using application defined bitmap.


CL_GSINSETBAR 0x40

Draws gauge bar (of gauge with CL_GSCOLORBASED style) with inset border.


CL_GSRAISEDBAR 0x200

Draws gauge bar (of gauge with CL_GSCOLORBASED style) with raised border.


CL_GSNORMALBAR 0

Draws gauge bar without any border.


CL_SMGAUGEBARBORDERTYPE 0x240

Allows to take bar border type of gauge control.


CL_SMGAUGEBARBORDERWIDTH 0xC00

Allows to take bar border width of gauge control.


CL_GSBARBORDER1 0

Creates gauge control with bar border width 1 pixel.


CL_GSBARBORDER2 0x400

Creates gauge control with bar border width 2 pixels.


CL_GSBARBORDER3 0x800

Creates gauge control with bar border width 3 pixels.


CL_GSBARBORDER4 0xC00

Creates gauge control with bar border width 4 pixels.


CL_GSINSETPATH 0x4000

Draws gauge path with inset border.


CL_GSRAISEDPATH 0x8000

Draws gauge path with raised border.


CL_GSNORMALPATH 0

Draws gauge path without any border.


CL_SMGAUGEPATHBORDERTYPE 0xC000

Allows to take path border type of gauge control.


CL_SMGAUGEPATHBORDERWIDTH 0x180

Allows to take path border width of gauge control.


CL_GSPATHBORDER1 0

Creates gauge control with path border width 1 pixel.


CL_GSPATHBORDER2 0x80

Creates gauge control with path border width 2 pixels.


CL_GSPATHBORDER3 0x100

Creates gauge control with path border width 3 pixels.


CL_GSPATHBORDER4 0x180

Creates gauge control with path border width 4 pixels.


CL_ASEVENTDRIVEN 0

Creates event driven animated control.


CL_ASTIMERDRIVEN 1

Creates timer driven animated control.


CL_ASBMPBYTEXT 0

Name of bitmap defines by animated control caption.


CL_ASBMPBYID 2

Name of bitmap defines by animated control ID.


DS_DROPDOWN 0x8000

Creates dialog with (shrink to caption)/(restore) button.


WM_HINTREQ (WM_USER+500)

Reserved for internal use.


WM_DRAWCAPTION (WM_USER+501)

Reserved for internal use.


CL_ASLEFTTEXT 0

Displays the given text left-aligned in the rectangle.


CL_ASCENTERTEXT 4

Displays the given text centered in the rectangle.


CL_ASRIGHTTEXT 8

Displays the given text right-aligned in the rectangle.


CL_ASMULTILINE 0xC

Displays multiple lines of text. Words that would extend past the end of a line

are automatically wrapped to the beginning of the next line.


CL_ASVCENTER 0x20

Displays the given text vertically centered in the rectangle (single line only).


CL_ASTOP 0

Displays the given text, bitmap or icon top aligned in the rectangle (single line only).


CL_ASBOTTOM 0x400

Displays the given text bottom aligned in the rectangle (single line only).


CL_ASNOPREFIX 0x40

Prevents interpretation of any & characters in the control's text as accelerator prefix

characters (which are displayed with the & removed and the next character in the

string underlined).


CL_ASBWIDTH1 0

Creates an animated control with border width 1 pixel.


CL_ASBWIDTH2 0x80

Creates an animated control with border width 2 pixels.


CL_ASBWIDTH3 0x100

Creates an animated control with border width 3 pixels.


CL_ASBWIDTH4 0x180

Creates an animated control with border width 4 pixels.


GCCK_VERSION

Integer value which identifies current version of GCCK.


GCCK_SVERSION

String which identifies current version of GCCK.