OK\n" . "calling second time _> see (through)", 10, 70, 200, 80, 0, WBC_CENTER); wb_set_handler($mainwin, "process_main"); wb_set_visible($mainwin, true); // Enter application loop wb_main_loop(); // -------------------------------------------------------------------- FUNCTIONS /* Process main window commands */ function process_main($window, $id) { global $statusbar; switch ($id) { case ID_ABOUT: wb_message_box($window, "WinBinder version " . WBC_VERSION . "\nPHP version " . PHP_VERSION . "\n" . wb_get_system_info("osversion"), "About " . APPNAME, WBC_INFO); break; case 109: call_draw_window(); break; case IDCLOSE: // IDCLOSE is predefined wb_destroy_window($window); break; } } function call_draw_window() { create_draw_window(); // wb_main_loop(); // would create a new intance of php-exe! } // -------------------------------------------------------------------- FUNCTIONS // Create main window function create_draw_window() { global $settings, $wb, $ctrl_list; // Create main window (invisible) and controls $draw_win = wb_create_window(null, ResizableWindow, APPNAMESEC, WBC_CENTER, WBC_CENTER, 589, 468, /* WBC_INVISIBLE | */ WBC_NOTIFY | WBC_CUSTOMDRAW, WBC_REDRAW); // Size, move and show main window wb_set_handler($draw_win, "process_draw"); wb_set_visible($draw_win, true); } function process_draw($window, $id, $ctrl, $lparam1 = 0, $lparam2 = 0) { switch ($id) { case IDDEFAULT: if($lparam1 & WBC_REDRAW) { // Set some variables $xoffset = 20; $yoffset = 20; $buffer = $lparam2; $dim = wb_get_size($window, true); $winwidth = $dim[0]; $winheight = $dim[1]; // Draw a flat background (remove the line below if you want the default window color) wb_draw_rect($buffer, 0, 0, $winwidth, $winheight, 0x838F80); // Draw a grid for($y = $yoffset + 0; $y < $winheight - 20; $y += 20) wb_draw_line($buffer, $xoffset + 0, $y, $winwidth - 20, $y, 0xE8D8D8); for($x = $xoffset + 0; $x < $winwidth - 20; $x += 20) wb_draw_line($buffer, $x, $yoffset, $x, $winheight - 20, 0xE8D8D8); // Draw a decorative string $font = wb_create_font("Arial", 25, BLACK, FTA_BOLD); wb_draw_text($buffer, "WinBinder", $winwidth - 188, 24, $font); wb_destroy_font($font); $font = wb_create_font("Arial", 25, WHITE, FTA_BOLD); wb_draw_text($buffer, "WinBinder", $winwidth - 190, 22, $font); wb_destroy_font($font); } break; case IDCLOSE: // IDCLOSE is predefined wb_destroy_window($window); break; } } // ------------------------------------------------------------------ END OF FILE ?>