contents   index   previous   next



SElib.doWindows()

syntax:

SElib.doWindows(immediateReturn)

where:

immediateReturn - if true return immediately, regardless of messages. Default is false.

 

return:

boolean - true if any of the windows created with SElib.makeWindow() or subclassed with SElib.subclassWindow() are still open, that is, have not received a WM_NCDESTROY message. Returns false if there are no valid windows registered with the ScriptEase Window Manager.

 

description:

For Win32 and Win16

 

Starts the ScriptEase Window Manager to activate whatever windows have been created or subclassed with SElib.makeWindow() or SElib.subclassWindow(). All such windows are registered with the Window Manager. The Window Manager controls the messages sent to the windows in its registry and routes them to their respective window functions.

 

There should not be more than one copy of the Window Manager running at a time. Generally, SElib.doWindows() is called only once with a succession of windows. All windows created or subclassed after a call to SElib.doWindows() are automatically registered with the Window Manager.

 

The flags that define window messages are kept in the library file, message.jsh.

 

If the optional parameter immediateReturn is true, the method returns immediately, regardless of whether there are messages for this application or not. Otherwise this method yields control to other applications until a message has been processed, subject to filtering by SElib.messageFilter(), for this application or for any window subclassed by this application.

 

The example below displays a standard Windows window. If you click anywhere in the window, the string "You clicked me!" is displayed briefly in the middle of the window. When the window is closed, the script terminates.

 

see:

SElib.makeWindow(), SElib.subclassWindow(), Window object in winobj.jsh

 

example:

#include <message.jsh>

#include <window.jsh>

function main()

{

   var hWnd = SElib.makeWindow(null, null,

      WindowFunction, "Display Windows' messages",

      WS_OVERLAPPEDWINDOW | WS_VISIBLE,

      CW_USEDEFAULT, CW_USEDEFAULT,

      500, 350, null, 0);

   SElib.messageFilter(hWnd, WM_LBUTTONDOWN);

   while(SElib.doWindows()) ;

}

 

function WindowFunction(hWnd, msg, param1, 

                        param2, counter)

{

   if (msg == WM_LBUTTONDOWN)

   {

      var msgHwnd = SElib.makeWindow(hWnd,

         "static", null, "You clicked me!",

         WS_CHILD | WS_VISIBLE,

         200, 150, 100, 50, null, 0);

         SElib.suspend(1000);

         SElib.breakWindow(msgHwnd);

   }

}

 


SElib.fullpath()