> 16; $pos = wb_get_position($list, true); $size = wb_get_size($list); if(($x >= $pos[0] - 4) && ($x <= $pos[0] + $size[0] - 4) && ($y >= $pos[1] + $size[1] - 30) && ($y <= $pos[1] + $size[1] + 10)) wb_set_cursor(null, 'SIZENS'); else wb_set_cursor(null, 'ARROW'); } elseif($lparam & WBC_LBUTTON) { // Simulate a split window $x = $lparam2 & 0xFFFF; // Mouse cursor position $y = ($lparam2 & 0xFFFF0000) >> 16; $pos = wb_get_position($list, true); $size = wb_get_size($list); if(!$capturing) if(!(($x >= $pos[0] - 4) && ($x <= $pos[0] + $size[0] - 4) && ($y >= $pos[1] + $size[1] - 30) && ($y <= $pos[1] + $size[1] + 10))) break; if($lparam & WBC_MOUSEDOWN) { SetCapture($window); $capturing = true; } else if($lparam & WBC_MOUSEUP) { ReleaseCapture(); $capturing = false; } if($capturing) { wb_set_cursor(null, 'SIZENS'); $dim = wb_get_size($window, true); $winwidth = $dim[0]; $winheight = $dim[1]; // Set size of first control wb_set_position($list, $winwidth / 2 - 51, 20); wb_set_size($list, $winwidth - ($winwidth / 2 - 51) - 4, min(max(40, $y - 22), ($winheight - 100))); // Set size/position of second control wb_set_position($list2, $winwidth / 2 - 51, $size[1] + 24); wb_set_size($list2, $winwidth - ($winwidth / 2 - 51) - 4, ($winheight - 35) - ($size[1] + 24)); $lasty = $y; } } else { // Just changes the mouse cursor $x = $lparam2 & 0xFFFF; // Mouse cursor position $y = ($lparam2 & 0xFFFF0000) >> 16; $pos = wb_get_position($list, true); $size = wb_get_size($list); if(($x >= $pos[0] - 4) && ($x <= $pos[0] + $size[0] - 4) && ($y >= $pos[1] + $size[1] - 30) && ($y <= $pos[1] + $size[1] + 10)) wb_set_cursor(null, 'SIZENS'); if($lparam == WBC_RESIZE) { // Resize control $dim = wb_get_size($window, true); $winwidth = $dim[0]; $winheight = $dim[1]; // Set size/position of first control wb_set_position($list, $winwidth / 2 - 51, 20); wb_set_size($list, $winwidth - ($winwidth / 2 - 51) - 4, min(max(20, $lasty - 22), ($winheight - 80))); // Set size/position of second control $size = wb_get_size($list); wb_set_position($list2, $winwidth / 2 - 51, $size[1] + 24); wb_set_size($list2, $winwidth - ($winwidth / 2 - 51) - 4, ($winheight - 35) - ($size[1] + 24)); // Set size of third control $pos = wb_get_position($list, true); wb_set_size($list3, $pos[0] - 24, $winheight - 108); wb_set_position(wb_get_control($window, ID_AUTO), 10, $winheight - 53); // Show window size using $lparam $dim = wb_get_size($window); $winwidth = $dim[0]; $winheight = $dim[1]; wb_set_text($statusbar, "Window area: $winwidth x $winheight pixels -- " . "Client area: " . ($lparam3 & 0x0000FFFF) . " x " . (($lparam3 & 0xFFFF0000) / 0x10000) . " pixels\n"); } } break; case IDCLOSE: wb_destroy_window($window); } } function init_dlls() { global $USER, $KERNEL, $GDI; // Most common Windows libraries $USER = wb_load_library("USER"); $KERNEL = wb_load_library("KERNEL"); $GDI = wb_load_library("GDI"); // Declare constants related to Windows and WinBinder structures define("WBOBJ", "Vhwnd/Vid/Vuclass/litem/lsubitem/Vstyle/Vparent/Vhandler/Vlparam/V8lparams/Vpbuffer"); define("WBOBJ_RAW", "V3l2V13"); define("WBOBJ_SIZE", 72); define("SC_MAXIMIZE", 61488); } function SetCapture($hwnd) { global $USER; static $pfn = null; $wbobj = unpack(WBOBJ, wb_peek($hwnd, WBOBJ_SIZE)); if($pfn === null) $pfn = wb_get_function_address("SetCapture", $USER); return wb_call_function($pfn, array($wbobj["hwnd"])); } function ReleaseCapture() { global $USER; static $pfn = null; if($pfn === null) $pfn = wb_get_function_address("ReleaseCapture", $USER); return wb_call_function($pfn); } function DisableMaximizeButton($hwnd) { global $USER; static $gsm = null, $dmi; $wbobj = unpack(WBOBJ, wb_peek($hwnd, WBOBJ_SIZE)); if($dmi === null) $dmi = wb_get_function_address("DeleteMenu", $USER); if($gsm === null) $gsm = wb_get_function_address("GetSystemMenu", $USER); $sysmenu = wb_call_function($gsm, array($wbobj["hwnd"], false)); return wb_call_function($dmi, array($sysmenu, SC_MAXIMIZE, 0)); } //------------------------------------------------------------------ END OF FILE ?>