GuiWindowDefaults()

Called once at the beginning of your main script (that creates objects from Window Layout scripts) to set some defaults for all windows. If you do not call GuiWindowDefaults, then Reginald assumes certain defaults for you when you open your first window.


Synopsis

error = GuiWindowDefaults(IconName, CursorName, Color, Styles, Options)


Args

IconName is the name of the icon file that is displayed in each window's titlebar. If a number, then that icon is loaded from the resources of your EXE you have created from your script. If omitted, then the icon numbered 101 in your EXE (or a default REXX icon) is used.

CursorName is the name of the cursor file that is used whenever the mouse is within one of your windows. If a number, then that cursor is loaded from the resources of your EXE you have created from your script. If omitted, then a default cursor is used.

Color determines the background color of the window. It must be a number from 1 to 29. If omitted, it defaults to CTLCOLOR_MSGBOX (1).

Styles can be any or all of the following, each separated by a | character:

Option Meaning
VREDRAW Redraws the entire window if a movement or size adjustment changes the height of the window.
HREDRAW Redraws the entire window if a movement or size adjustment changes the width of the window.
NOCLOSE Disables the Close command on the System menu.
OWNDC Allocates a unique device context for each window you create.
PARENTDC Child windows inherit their parent window's device context. Specifying PARENTDC enhances an application's performance.
CLASSDC Allocates one device context to be shared by all windows in the class. When using multiple threads that create their own windows, the operating system allows only one of the threads to successfully finish its drawing operation if several threads attempt to draw into the same context simultaneously.
DBLCLKS Calls the window's double-click mouse handler when the user double-clicks the mouse while the cursor is within a window (but not over any control).
SAVEBITS Saves, as a bitmap, the portion of the screen image obscured by a window. Windows uses the saved bitmap to re-create the screen image when the window is removed. Windows displays the bitmap at its original location and does not send WM_PAINT messages to windows obscured by the window if the memory used by the bitmap has not been discarded and if other screen actions have not invalidated the stored image. This style is useful for small windows (for example, menus or dialog boxes) that are displayed briefly and then removed before other screen activity takes place. This style increases the time required to display the window, because the operating system must first allocate memory to store the bitmap.
CLIENTALIGN Aligns the window's client area on a byte boundary (in the x direction). This style affects the width of the window and its horizontal placement on the display.
WINDOWALIGN Aligns the window on a byte boundary (in the x direction). This style affects the width of the window and its horizontal placement on the display.
SHADOW Enables the drop shadow effect on a window. The effect is turned on and off through display properties. Typically, this is enabled for small, short-lived windows such as menus to emphasize their Z order relationship to other windows.

If omitted, Styles defaults to 'PARENTDC'.

v can be any or all of the following, each separated by a | character:

Option Meaning
TWAIN Enable automatic twain support. This frees your script from needing to call TwainDoMsg.
HTML Enable HTML support. Your script can't use an HTML control unless this option is first chosen.

If omitted, Options defaults to none of the above.


Returns

An empty string if successful, or an error message if an error.


Notes

GuiWindowDefaults should be called from the main script that creates window objects.

GuiWindowDefaults will return an error if you call it while there are any windows open.

GuiWindowDefaults may return the following error numbers/messages. If you choose to raise a condition, then from your CATCH instructions, you can use CONDITION('D') to fetch the message, and CONDITION('E') to fetch the number. Note that where you see part of a message enclosed within < and >, this will be replaced by some other, more detailed text in the error message.

Number Message
112Window defaults can't be set while a window is still open
197Message will vary. It concerns GuiWindowDefaults failing to register your chosen window defaults