The routines in this section are specific to the Windows 3.x version of ScriptEase. They are included internally to the ScriptEase program, and are available to any ScriptEase program executed by ScriptEase under Windows.
Most of these routines allow the programmer to have more power than is generally acknowledged as safe under ScriptEase' guidelines. So be careful when you use these commands, they provide plenty of rope with which to hang yourself.
Windows is built on top of DOS, so the functions in the DOS library are also available in the Windows version of ScriptEase.
Instance |
|
---|---|
DESCRIPTION |
Get ScriptEase instance for this session. |
SYNTAX |
int Instance() |
RETURN |
Returns instance for this ScriptEase session. |
MessageFilter |
|
---|---|
DESCRIPTION |
Restrict message handled by ScriptEase window functions. |
SYNTAX |
int[] MessageFilter(int WinHandle ,int MessageID1 int[] MessageFilter(int WinHandle, int[] MessageIDs) int[] MessageFilter(int WinHandle) // remove all message filters |
COMMENTS |
This function restricts the messages handled by ScriptEase for a window created with MakeWindow() or subclassed with SubclassWindow(). When Windows sends lots of messages, but you're only interested in handling a few of them within ScriptEase code, you can increase performance by specifying only those messages you want to handle in MessageFilter(). Any messages that have not been specified to MessageFilter() will not be handle by your WindowFunction and might not cause DoWindows() to return immediately (if Peek==False). Initially, there are no message filters so all messages are processed by ScriptEase. To remove all message filters, so that all messages are passed through to the ScriptEase handler, use the third form of MessageFilter(). WinHandle is handle for a windows created with MakeWindow() or subclassed with SubclassWindow(). MessageID1 , MessageID2 ,... are messages to be added to those being filtered. MessageIDs is an array of messages to be added to those being filtered. |
RETURN |
Returns an array of messages begin filtered prior to taking this call. Returns NULL if no messages are in the filter (i.e., all messages are passed through to ScriptEase functions) or if WinHandle is not a handle from a MakeWindow() or SubclassWindow() window. |
SEE ALSO |
DoWindows(), BaseWindowFunction(), MakeWindow(), SubclassWindow() |
MultiTask |
|
---|---|
DESCRIPTION |
Turn Windows multitasking on or off |
SYNTAX |
void MultiTask(bool) |
COMMENTS |
Normally, multitasking is enabled. You should only turn multitasking off for very brief, critical sections of code. No messages are received by this program or any other program while multitasking is off. MultiTask() is additive, meaning that if you call MultiTask(FALSE) twice, then you must call MultiTask(TRUE) twice before multitasking is resumed. |
EXAMPLE |
The following section of code empties the clipboard. Multitasking is turned off during this brief interval to ensure that no other program tries to open the clipboard while this program is accessing it. MultiTask(FALSE); DynamicLink("USER","OPENCLIPBOARD",SWORD16, PASCAL,ScreenHandle()); DynamicLink("USER","EMPTYCLIPBOARD",SWORD16,PASCAL); DynamicLink("USER","CLOSECLIPBOARD",SWORD16,PASCAL); MultiTask(TRUE); |
ScreenHandle |
|
---|---|
DESCRIPTION |
Get Windows' handle for the ScriptEase text screen. |
SYNTAX |
int ScreenHandle() |
RETURN |
Returns handle the for ScriptEase text window corresponding to stdout. |
SubClassWindow |
|
DESCRIPTION |
Hook into Window function for any window. |
SYNTAX |
bool SubclassWindow(int WindowHandle, |
COMMENT |
This function will hook the specified WindowFunction() into the message loop for this window such that your function is called before the window's default or previously-defined function. WindowHandle is the window handle of the existing window to subclass. WindowFunction is the same as in the MakeWindow() function. See MakeWindow(). Note that, as in the MakeWindow()function, if this function returns a value, then the default or subclassed function is not called. If this function returns no value then call is passed on to the previous function. This function may be used to subclass any Window that is not already being managed by a WindowFunction for this ScriptEase instance. If the windows was created with MakeWindow() or is already SubClassed then this function will fail. Note that this function may be used (but only once) with the window handle returned by ScreenHandle(). If you want to SubClass the main ScriptEase window, it is best to open another instance of ScriptEase and SubClass that rather than to subclass the instance that is powering your script. (Although it is possible to subclass that window, if you try to do anything with it you'll most likely get caught up in an infinite loop and hang). To undo the window subclassing, or remove WindowFunction from the message loop, then use BreakWindow(). |
MODIFY |
Your WindowFunction() may modify UtilityVar. |
WARNING |
In your function that handles messages for another process, certain limits are set as to what you can do with system resources. For example, an open file handle will be invalid while processing another program's message, because Windows will map any file handles into a table for that other program. To work around this problem, you may want to send a message to one of your ScriptEase windows to handle the processing; this will switch Windows' tables to your program while handling that SendMessage() to yourself. |
RETURN |
Returns boolean False if WindowHandle is invalid, was created with MakeWindow(), or is already Subclassed with this function; else return boolean True. |
SEE ALSO |
DoWindows(), BaseWindowFunction(), BreakWindow(), MakeWindow(), MessageFilter() |
For Windows 3.X, there is a set of useful ScriptEase libraries that include wrappers for most of the common Windows DLL's. The following is a brief summary of the functionality provided. These libraries are text files, and a more detailed explanation of the functions contained in each library appears at the beginning of each. The supplied ScriptEase sample scripts provide examples of how these functions are to be used. Additional libraries (and sample scripts) are available for download from Nombas' Website at:
http://www.nombas.com/download
BMP.hmm |
Library of routines for working with bitmaps (.BMP files). |
Comm.hmm |
Library of routines for accessing COM ports. |
Clipbrd.hmm |
Routines for working with the Clipboard. |
DDE.hmm |
Library of common routines and definitions for Dynamic Data Exchange (DDE). |
DDEcli.hmm |
Library of routines for a DDE client. |
DDEsrv.hmm |
Library of routines for a DDE server. |
Dlgctrl.hmm |
Library of functions for controlling dialog boxes via child windows (buttons etc.). |
DOSintr.hmm |
Functions to provide access to low-level DOS calls. |
DOS_BOSS.hmm |
Functions for controlling a windowed or full-screen DOS session. |
GDI.hmm |
Routines for working with some of Window's graphics routines. |
GloblMem.hmm |
Functions to work with Windows' global memory resources. |
HotKey.hmm |
Library of functions to simplify the creation of keyboard shortcuts. |
Icon.hmm |
Routines useful for working with icons. |
Inputbox.hmm |
Routines to allow the creation of simple input and information boxes (windows). |
KeyPush.hmm |
Routines to control or mimic the pushing of keys on the keyboard. The functions in this library work by sending virtual keystrokes to the active window. |
MenuCtrl.hmm |
Functions for creating and controlling window menus. |
Message.hmm |
ScriptEase code wrapper for the SendMessage() and PostMessage() Windows functions. With these routines, any message can be sent or posted to any window. |
Msgbox.hmm |
Library to provide the Windows MessageBox() function, to allow creation of simple message boxes. |
PickFile.hmm |
Routines for the GetOpenFileName() function in the Windows Common Dialog DLL. |
Profile.hmm |
Routines to interface with Windows' Profile (i.e. *.INI) files. |
Progman.hmm |
Library for interacting with Program Manager through DDE. |
Realmem.hmm |
Functions for ScriptEase for Windows to allow access to memory that is specified as DOS-like real memory addresses, instead of Windows-like protected memory. |
Shellexe.hmm |
Cmm code wrapper for the ShellExecute function. |
Window.hmm |
Defines used with the MakeWindow, BreakWindow, and DoWindows functions. |
WindowID.hmm |
Routine to find a sub-window within a larger window based on window ID. |
Winexec.hmm |
Cmm code wrapper for the WinExec function. |
WinTools.hmm |
Functions for setting the state of Windows. |
WinUtil.hmm |
A small selection of utilities that may be #included in ScriptEase code to get simple access to Windows DLL functions. |