function EnableCloseButton($hwnd, $enable)
{
    global $USER;
    static $emi = null, $gsm = null;
    $wbobj = unpack(WBOBJ, wb_peek($hwnd, WBOBJ_SIZE));
    if ($emi === null) {
        $emi = wb_get_function_address("EnableMenuItem", $USER);
    }
    if ($gsm === null) {
        $gsm = wb_get_function_address("GetSystemMenu", $USER);
    }
    $sysmenu = wb_call_function($gsm, array($wbobj["hwnd"], false));
    return wb_call_function($emi, array($sysmenu, SC_CLOSE, !$enable));
}
Example #2
0
function process_main($window, $id)
{
    // Try to load the multimedia dll
    $winmmlib = wb_load_library("winmm");
    $mciSendString = wb_get_function_address("mciSendString", $winmmlib);
    static $file_filter = array(array("MP3 file", "*.mp3"));
    switch ($id) {
        case ID_OPEN:
            $filename = wb_sys_dlg_open($window, "Get It", $file_filter);
            if ($filename) {
                wb_call_function($mciSendString, array("open \"" . $filename . "\" type mpegvideo alias " . $filename, NULL, 0, 0));
            }
            wb_call_function($mciSendString, array("play \"" . $filename . "\" from 0 notify", NULL, 0, 0));
            break;
        case IDCLOSE:
            // IDCLOSE is predefined
            wb_destroy_window($window);
            break;
    }
}
Example #3
0
function FreeImage_Rescale($dib, $dst_width, $dst_height, $filter = 0)
{
    global $FI;
    static $pfn = null;
    if ($pfn === null) {
        $pfn = wb_get_function_address("FreeImage_Rescale", $FI);
    }
    return wb_call_function($pfn, array($dib, $dst_width, $dst_height, $filter));
}
Example #4
0
 /**
  * fmodlib_GetErrorMessage
  * To be called right after a library function was executed. If the function
  * call fails, then this function will read the error-id and return the
  * string accordingly.
  *
  * @return string Error Message
  * @access private
  */
 function fmodlib_GetErrorMessage()
 {
     $fmoderr = wb_call_function($this->fmodLibFunc['geterr'], array());
     switch ($fmoderr) {
         case 1:
             $err = "Cannot call this command after FSOUND_Init. Call FSOUND_Close first. ";
             break;
         case 2:
             $err = "This command failed because FSOUND_Init or FSOUND_SetOutput was not called ";
             break;
         case 3:
             $err = "Error initializing output device.";
             break;
         case 4:
             $err = "Error initializing output device, but more specifically, \nthe output device is already in use and cannot be reused.";
             break;
         case 5:
             $err = "Playing the sound failed.";
             break;
         case 6:
             $err = "Soundcard does not support the features needed for this soundsystem (16bit stereo output) ";
             break;
         case 7:
             $err = "Error setting cooperative level for hardware. ";
             break;
         case 8:
             $err = "Error creating hardware sound buffer. ";
             break;
         case 9:
             $err = "File not found";
             break;
         case 10:
             $err = "Unknown file format";
             break;
         case 11:
             $err = "Error loading file";
             break;
         case 12:
             $err = "Not enough memory or resources ";
             break;
         case 13:
             $err = "The version number of this file format is not supported";
             break;
         case 14:
             $err = "An invalid parameter was passed to this function";
             break;
         case 15:
             $err = "Tried to use an EAX command on a non EAX enabled channel or output. ";
             break;
         case 16:
             $err = "Failed to allocate a new channel ";
             break;
         case 17:
             $err = "Recording is not supported on this machine ";
             break;
         case 18:
             $err = "Windows Media Player not installed so cannot play wma or use internet streaming.";
             break;
         case 19:
             $err = "An error occured trying to open the specified CD device ";
             break;
         default:
             $err = false;
             break;
     }
     return $err;
 }
Example #5
0
	function ReleaseDC($hWnd,$hDC){
		$Fn=self:: 1(__FUNCTION__); if(false===$Fn) return false;
		
		$hWnd=(int)$hWnd;	// HWND 
		$hDC=(int)$hDC;		// HDC 
		return wb_call_function($Fn,array($hWnd,$hDC));
	}