Personal tools
From wiki.swiftlytilting.com
< WinBinder Manual
Revision as of 08:28, 15 June 2007 by Frantik (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

WinBinder Manual/The main loop

The Windows main loop is done by as a single function call, wb_main_loop(), that must be called if the application has a window. This function uses the standard Windows approach, that is, a loop that uses the API function GetMessage() to retrieve a message from the queue and DispatchMessage() to send it to the window procedure.

All the additional tasks needed to run a Windows program, including DLL loading, initialization, and cleanup, are done when PHP calls the WinBinder library upon startup.

There are a few special cases where a Windows programs will not need a message loop, namely when the only tasks to be performed are the creation of message boxes or system dialog boxes. For example:


<?

// This program does not need a call to wb_main_loop()

include("../include/winbinder.php");       // Include WinBinder library
if(wb_message_box(null, "This program has no Windows loop.\nCan you believe it?", null, WBC_YESNO))
    wb_sys_dlg_color(NULL);

?>


WinBinder Manual Contents
Getting started

Overview

How WinBinder works
The main loop
Callback functions and window handlers
Windows messages and events
Function parameters and return values
WinBinder objects
Database support
Naming conventions

Function reference

Other reference

Information for C developers

See also

Winbinder Projects