Please enable JavaScript to view this site.

KOL/MCK - User Guide

function MsgBox( const S: KOLString; Flags: DWORD ): DWORD;

Displays message box with the same title as Applet.Caption. If applet is not running, and Applet global variable is not assigned, caption 'Error' is displayed (but actually this is not an error - the system does so, if nil is passed as a title).

Returns ID_... result (correspondently to flags passed (MB_OK, MBYESNO, etc. -> ID_OK, ID_YES, ID_NO, etc.)

 

procedure MsgOK( const S: KOLString );

Displays message box with the same title as Applet.Caption (or 'Error', if Applet is not running).

 

function ShowMsg( const S: KOLString; Flags: DWORD ): DWORD;

Displays message box like MsgBox, but uses Applet.Handle as a parent (so the message has no button on a task bar).

 

function ShowMsgCentered( Ctl: PControl; const S: KOLString; Flags: DWORD ): DWORD;

Displays message box like ShowMsg, but centers it on a control (or form) given by Ctl parameter.

 

procedure ShowMessage( const S: KOLString );

Like ShowMsg, but has only styles MB_OK and MB_SETFOREGROUND.

 

function SysErrorMessage( ErrorCode: Integer ): KOLString;

Creates and returns a string containing formatted system error message. It is possible then to display this message or write it to a log file, e.g.:

ShowMsg( SysErrorMessage( GetLastError ) );

 

function ShowQuestion( const S: KOLString; Answers: KOLString ): Integer;

Modal dialog like ShowMsgModal. It is based on KOL form, so it can be called also out of message loop, e.g. after finishing the application. Also, this function *must* be used in MDI applications in place of any dialog functions, based on MessageBox.

The the second parameter should be empty AnsiString or several possible answers separated by '/', e.g.: 'Yes/No/Cancel'. Result is a number answered, starting from 1. For example, if  'Cancel' was pressed, 3 will be returned.

User can also press ESCAPE key, or close modal dialog. In such case -1 is returned.

 

function ShowQuestionEx( S: KOLString; Answers: KOLString; CallBack: TOnEvent ): Integer;

Like ShowQuestion, but with CallBack function, called just before showing the dialog.

 

procedure ShowMsgModal( const S: KOLString );

This message function can be used out of a message loop (e.g., after finishing the application). It is always modal.

Actually, a form with word-wrap label (decorated as borderless edit box with btnFace color) and with OK button is created and shown modal. When a dialog is called from outside message loop, caption 'Information' is always displayed.

Dialog form is automatically resized vertically to fit message text (but until screen height is achieved) and shown always centered on screen. The width is fixed (400 pixels).

Do not use this function outside the message loop for case, when the Applet variable is not used in an application.

 

 

procedure SpeakerBeep( Freq: Word; Duration: DWORD );

On Windows NT, calls Windows.Beep. On Windows 9x, produces beep on speaker of desired frequency during given duration time (in milliseconds).

 

 

KOL / MCK User Guide - Created by Carl Peeraer - Diamant Soft, based on the work of Vladimir Kladov - Artwerp.be

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Nav Header: ALT+n
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Exit Menu/Up: ESC