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
 /**
  * fmod_LoadLibrary
  *
  * Loads the fmod.dll from current directorie and
  * creates an array of function-addresses.
  *
  * @access protected
  */
 function fmodlib_LoadLibrary()
 {
     $fmodLib = wb_load_library("fmod.dll");
     if ($fmodLib) {
         $this->fmodLibFunc['init'] = wb_get_function_address("FSOUND_Init", $fmodLib);
         $this->fmodLibFunc['close'] = wb_get_function_address("FSOUND_Close", $fmodLib);
         $this->fmodLibFunc['sound_playEx'] = wb_get_function_address("FSOUND_PlaySoundEx", $fmodLib);
         $this->fmodLibFunc['sound_stop'] = wb_get_function_address("FSOUND_StopSound", $fmodLib);
         $this->fmodLibFunc['setbuffer'] = wb_get_function_address("FSOUND_SetBufferSize", $fmodLib);
         $this->fmodLibFunc['setmixer'] = wb_get_function_address("FSOUND_SetMixer", $fmodLib);
         $this->fmodLibFunc['setoutput'] = wb_get_function_address("FSOUND_SetOutput", $fmodLib);
         $this->fmodLibFunc['setpaused'] = wb_get_function_address("FSOUND_SetPaused", $fmodLib);
         $this->fmodLibFunc['setpan'] = wb_get_function_address("FSOUND_SetPan", $fmodLib);
         $this->fmodLibFunc['sourround'] = wb_get_function_address("FSOUND_SetSurround", $fmodLib);
         $this->fmodLibFunc['setmute'] = wb_get_function_address("FSOUND_SetMute", $fmodLib);
         $this->fmodLibFunc['setvol'] = wb_get_function_address("FSOUND_SetVolume", $fmodLib);
         $this->fmodLibFunc['setdrv'] = wb_get_function_address("FSOUND_SetDriver", $fmodLib);
         $this->fmodLibFunc['getvol'] = wb_get_function_address("FSOUND_GetVolume", $fmodLib);
         $this->fmodLibFunc['getoutput'] = wb_get_function_address("FSOUND_GetOutput", $fmodLib);
         $this->fmodLibFunc['getdrv'] = wb_get_function_address("FSOUND_GetDriver", $fmodLib);
         $this->fmodLibFunc['getnumdrv'] = wb_get_function_address("FSOUND_GetNumDrivers", $fmodLib);
         $this->fmodLibFunc['getdrvcaps'] = wb_get_function_address("FSOUND_GetDriverCaps", $fmodLib);
         $this->fmodLibFunc['getdrvname'] = wb_get_function_address("FSOUND_GetDriverName", $fmodLib);
         $this->fmodLibFunc['geterr'] = wb_get_function_address("FSOUND_GetError", $fmodLib);
         $this->fmodLibFunc['fx_disable'] = wb_get_function_address("FSOUND_FX_Disable", $fmodLib);
         $this->fmodLibFunc['fx_enable'] = wb_get_function_address("FSOUND_FX_Enable", $fmodLib);
         $this->fmodLibFunc['fx_seteq'] = wb_get_function_address("FSOUND_FX_SetParamEQ", $fmodLib);
         $this->fmodLibFunc['fx_setchor'] = wb_get_function_address("FSOUND_FX_SetChorus", $fmodLib);
         $this->fmodLibFunc['fx_setcomp'] = wb_get_function_address("FSOUND_FX_SetCompressor", $fmodLib);
         $this->fmodLibFunc['fx_setdist'] = wb_get_function_address("FSOUND_FX_SetDistortion", $fmodLib);
         $this->fmodLibFunc['fx_setecho'] = wb_get_function_address("FSOUND_FX_SetEcho", $fmodLib);
         $this->fmodLibFunc['fx_setflangr'] = wb_get_function_address("FSOUND_FX_SetFlanger", $fmodLib);
         $this->fmodLibFunc['fx_setgargle'] = wb_get_function_address("FSOUND_FX_SetGargle", $fmodLib);
         $this->fmodLibFunc['fx_setreverb'] = wb_get_function_address("FSOUND_FX_SetI3DL2Reverb", $fmodLib);
         $this->fmodLibFunc['fx_setwavrev'] = wb_get_function_address("FSOUND_FX_SetWavesReverb", $fmodLib);
         $this->fmodLibFunc['strm_open'] = wb_get_function_address("FSOUND_Stream_Open", $fmodLib);
         $this->fmodLibFunc['strm_play'] = wb_get_function_address("FSOUND_Stream_PlayEx", $fmodLib);
         $this->fmodLibFunc['strm_close'] = wb_get_function_address("FSOUND_Stream_Close", $fmodLib);
         $this->fmodLibFunc['strm_stop'] = wb_get_function_address("FSOUND_Stream_Stop", $fmodLib);
         $this->fmodLibFunc['strm_create'] = wb_get_function_address("FSOUND_Stream_Create", $fmodLib);
         $this->fmodLibFunc['strm_bsize'] = wb_get_function_address("FSOUND_Stream_SetBufferSize", $fmodLib);
         $this->fmodLibFunc['strm_getlen'] = wb_get_function_address("FSOUND_Stream_GetLengthMs", $fmodLib);
         $this->fmodLibFunc['strm_gettime'] = wb_get_function_address("FSOUND_Stream_GetTime", $fmodLib);
         $this->fmodLibFunc['strm_getpos'] = wb_get_function_address("FSOUND_Stream_GetPosition", $fmodLib);
         $this->fmodLibFunc['strm_netbuf'] = wb_get_function_address("FSOUND_Stream_Net_SetBufferProperties", $fmodLib);
         $this->fmodLibFunc['strm_netmeta'] = wb_get_function_address("FSOUND_Stream_Net_SetMetadataCallback", $fmodLib);
         $this->fmodLibFunc['strm_netlast'] = wb_get_function_address("FSOUND_Stream_Net_GetLastServerStatus", $fmodLib);
         $this->fmodLibFunc['strm_netstat'] = wb_get_function_address("FSOUND_Stream_Net_GetStatus", $fmodLib);
         $this->fmodLibFunc['strm_nettime'] = wb_get_function_address("FSOUND_Stream_Net_SetTimeout", $fmodLib);
         $this->fmodLibFunc['strm_getstate'] = wb_get_function_address("FSOUND_Stream_GetOpenState", $fmodLib);
         $this->fmodLibFunc['strm_gettags'] = wb_get_function_address("FSOUND_Stream_GetNumTagFields", $fmodLib);
         $this->fmodLibFunc['strm_findtag'] = wb_get_function_address("FSOUND_Stream_FindTagField", $fmodLib);
         $this->fmodLibFunc['strm_gettag'] = wb_get_function_address("FSOUND_Stream_GetTagField", $fmodLib);
         $this->fmodLibFunc['strm_getbytes'] = wb_get_function_address("FSOUND_Stream_GetLength", $fmodLib);
         $this->fmodLibFunc['smp_load'] = wb_get_function_address("FSOUND_Sample_Load", $fmodLib);
         $this->fmodLibFunc['smp_alloc'] = wb_get_function_address("FSOUND_Sample_Alloc", $fmodLib);
         $this->fmodLibFunc['smp_lock'] = wb_get_function_address("FSOUND_Sample_Lock", $fmodLib);
         $this->fmodLibFunc['smp_free'] = wb_get_function_address("FSOUND_Sample_Free", $fmodLib);
         $this->fmodLibFunc['smp_unlock'] = wb_get_function_address("FSOUND_Sample_Unlock", $fmodLib);
         $this->fmodLibFunc['smp_getlen'] = wb_get_function_address("FSOUND_Sample_GetLength", $fmodLib);
         $this->fmodLibFunc['smp_getdef'] = wb_get_function_address("FSOUND_Sample_GetDefaults", $fmodLib);
         $this->fmodLibFunc['rec_getdrv'] = wb_get_function_address("FSOUND_Record_GetDriver", $fmodLib);
         $this->fmodLibFunc['rec_getdrvn'] = wb_get_function_address("FSOUND_Record_GetDriverName", $fmodLib);
         $this->fmodLibFunc['rec_getnumdrv'] = wb_get_function_address("FSOUND_Record_GetNumDrivers", $fmodLib);
         $this->fmodLibFunc['rec_getpos'] = wb_get_function_address("FSOUND_Record_GetPosition", $fmodLib);
         $this->fmodLibFunc['rec_setdrv'] = wb_get_function_address("FSOUND_Record_SetDriver", $fmodLib);
         $this->fmodLibFunc['rec_start'] = wb_get_function_address("FSOUND_Record_StartSample", $fmodLib);
         $this->fmodLibFunc['rec_stop'] = wb_get_function_address("FSOUND_Record_Stop", $fmodLib);
     }
 }
Example #5
0
	function  1($n){
		if(self::$ffi===false) self:: initFFI();
		if(self::$Lib===false){ self::$Lib=wb_load_library(self::LibName); if(self::$Lib===false) return false; }
		if(!isset(self::$Fns[$n]) || self::$Fns[$n]===true){
			self::$Lib=wb_load_library(self::LibName);
			self::$Fns[$n]=($x=wb_get_function_address($n, self::$Lib))===null ? false : $x;
		}
		if(self::$Fns[$n]===false){
			return method_exists(self::$ffi,$n);
		}
		return self::$Fns[$n];
	}