Creates a window of class wclass.
Contents |
int wb_create_window (int parent, int wclass [, string caption [, int xpos [, int ypos [, int width [, int height [, int style [, int param]]]]]]])
or
int wb_create_window (int parent, int wclass [, string caption [, int width [, int height]]])
$mainwin = wb_create_window(NULL, AppWindow, "WinBinder", WBC_CENTER, WBC_CENTER, 640, 480, WBC_INVISIBLE | WBC_NOTIFY, WBC_DBLCLICK | WBC_GETFOCUS);
// Additional code here
/* Main window processing */
function process_main($window, $id, $ctrl=0, $param=0)
{
global $statusbar;
if($param == WBC_GETFOCUS) {
wb_set_text($statusbar, "Control $id received the focus.");
return; // This is necessary to avoid unexpected behavior
}
switch($id) {
case ID_ITEMLIST:
if($param == WBC_DBLCLICK)
process_main($window, ID_EDITITEM, 0);
else
update_controls($window);
break;
// Additional processing here
}
}
To create a window that minimizes itself as an icon in the TaskBar status area, include the WBC_TASKBAR style flag in the style parameter. All operations will be handled automatically.
$mainwin = wb_create_window(NULL, 100, "Collapsible window", WBC_CENTER, WBC_CENTER, 320, 240, WBC_INVISIBLE | WBC_TASKBAR); // Create window controls wb_set_visible($mainwin, true); // Make window visible