• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ BOOL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中BOOL函数的典型用法代码示例。如果您正苦于以下问题:C++ BOOL函数的具体用法?C++ BOOL怎么用?C++ BOOL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了BOOL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: SJ_ToggleFullScreen

//-----------------------------------------------------------------------------
// Changes presentation parameters for windowed or fullscreen
//-----------------------------------------------------------------------------
void SJ_ToggleFullScreen( )
{
	g_fullScreen = ! g_fullScreen;
	ZeroMemory( &g_d3dpp, sizeof( g_d3dpp ) );
    g_d3dpp.Windowed = !g_fullScreen;
    g_d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
    g_d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
    g_d3dpp.EnableAutoDepthStencil = TRUE;
	g_d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
	GetClientRect( g_hWnd, &g_clRect );
	if ( g_fullScreen )
	{
		g_d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
		g_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
		g_d3dpp.FullScreen_RefreshRateInHz = 0;
		g_d3dpp.BackBufferWidth = SCREEN_WIDTH;
		g_d3dpp.BackBufferHeight = SCREEN_HEIGHT;
		g_clRect.right = SCREEN_WIDTH;
		g_clRect.bottom = SCREEN_HEIGHT;
		SetCursor( NULL );
	}		
	ShowCursor( BOOL(!g_fullScreen) );
	if ( g_pd3dDevice != NULL )
		g_pd3dDevice->ShowCursor( BOOL(!g_fullScreen) );
}
开发者ID:gyakoo,项目名称:superjumper,代码行数:28,代码来源:GfxOs.cpp


示例2: ApplyAER

BOOL vmsTpDownloadMgr::CheckDstFileExists()
{
	if (DWORD (-1) != GetFileAttributes (m_info.strOutputPath + m_info.strFileName)) 
	{
		fsAlreadyExistReaction enAER = m_enAER;

		BOOL bRet = ApplyAER (enAER);

		if (bRet == FALSE)
		{
			RaiseEvent (DE_EXTERROR, DMEE_FATALERROR);
			return FALSE;
		}
		else if (bRet == BOOL (-1))
			return FALSE;
		else if (bRet == BOOL (2))
			SetToRestartState ();

		RaiseEvent (LS (L_OPENINGFILE));
		m_dldr->InitTpStream(m_info.strTorrentUrl, m_info.strOutputPath + m_info.strFileName, GetStreamingSpeed ());
		RaiseEvent (LS (L_SUCCESS), EDT_RESPONSE_S);
	}

	return TRUE;
}
开发者ID:HackLinux,项目名称:Free-Download-Manager-vs2010,代码行数:25,代码来源:vmsTpDownloadMgr.cpp


示例3: icon_list_new

static GtkWidget *
icon_list_new (GladeXML *xml, GType widget_type,
	       GladeWidgetInfo *info)
{
    GtkWidget *gil;
    int flags = 0;
    int icon_width = 0;
    int i;

    for (i = 0; i < info->n_properties; i++) {
	const char *name  = info->properties[i].name;
	const char *value = info->properties[i].value;

	if (!strcmp (name, "text_editable")) {
	    if (BOOL (value))
		flags |= MATE_ICON_LIST_IS_EDITABLE;
	} else if (!strcmp (name, "text_static")) {
	    if (BOOL (value))
		flags |= MATE_ICON_LIST_STATIC_TEXT;
	} else if (!strcmp (name, "icon_width")) {
	    icon_width = INT (value);
	}
    }

    gil = glade_standard_build_widget (xml, widget_type, info);

    mate_icon_list_construct (MATE_ICON_LIST (gil),
			       icon_width, NULL, flags);

    return gil;
}
开发者ID:TheCoffeMaker,项目名称:Mate-Desktop-Environment,代码行数:31,代码来源:glade-mate.c


示例4: s_TEST_WinSystemDll

static void s_TEST_WinSystemDll(void)
{
#if defined NCBI_OS_MSWIN

    CDll dll_user32("USER32", CDll::eLoadLater);
    CDll dll_userenv("userenv.dll", CDll::eLoadNow, CDll::eAutoUnload);

    // Load DLL
    dll_user32.Load();

    // DLL functions definition    
    BOOL (STDMETHODCALLTYPE FAR * dllMessageBeep) 
            (UINT type) = NULL;
    BOOL (STDMETHODCALLTYPE FAR * dllGetProfilesDirectory) 
            (LPTSTR  lpProfilesDir, LPDWORD lpcchSize) = NULL;

    // This is other variant of functions definition
    //
    // typedef BOOL (STDMETHODCALLTYPE FAR * LPFNMESSAGEBEEP) (
    //     UINT uType
    // );
    // LPFNMESSAGEBEEP  dllMessageBeep = NULL;
    //
    // typedef BOOL (STDMETHODCALLTYPE FAR * LPFNGETPROFILESDIR) (
    //     LPTSTR  lpProfilesDir,
    //     LPDWORD lpcchSize
    // );
    // LPFNGETUSERPROFILESDIR  dllGetProfilesDirectory = NULL;

    dllMessageBeep = dll_user32.GetEntryPoint_Func("MessageBeep", &dllMessageBeep );
    if ( !dllMessageBeep ) {
        ERR_FATAL("Error get address of function MessageBeep().");
    }
    // Call loaded function
    dllMessageBeep(-1);

    #ifdef UNICODE
    dll_userenv.GetEntryPoint_Func("GetProfilesDirectoryW", &dllGetProfilesDirectory);
    #else
    dll_userenv.GetEntryPoint_Func("GetProfilesDirectoryA", &dllGetProfilesDirectory);
    #endif
    if ( !dllGetProfilesDirectory ) {
        ERR_FATAL("Error get address of function GetUserProfileDirectory().");
    }
    // Call loaded function
    TCHAR szProfilePath[1024];
    DWORD cchPath = 1024;
    if ( dllGetProfilesDirectory(szProfilePath, &cchPath) ) {
        cout << "Profile dir: " << szProfilePath << endl;
    } else {
        ERR_FATAL("GetProfilesDirectory() failed");
    }

    // Unload USER32.DLL (our work copy)
    dll_user32.Unload();
    // USERENV.DLL will be unloaded in the destructor
    // dll_userenv.Unload();
#endif
}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:59,代码来源:test_ncbidll.cpp


示例5: test_cryptTls

static void test_cryptTls(void)
{
    DWORD  (WINAPI *pI_CryptAllocTls)(void);
    LPVOID (WINAPI *pI_CryptDetachTls)(DWORD dwTlsIndex);
    LPVOID (WINAPI *pI_CryptGetTls)(DWORD dwTlsIndex);
    BOOL   (WINAPI *pI_CryptSetTls)(DWORD dwTlsIndex, LPVOID lpTlsValue);
    BOOL   (WINAPI *pI_CryptFreeTls)(DWORD dwTlsIndex, DWORD unknown);
    DWORD index;
    BOOL ret;

    pI_CryptAllocTls = (void *)GetProcAddress(hCrypt, "I_CryptAllocTls");
    pI_CryptDetachTls = (void *)GetProcAddress(hCrypt, "I_CryptDetachTls");
    pI_CryptGetTls = (void *)GetProcAddress(hCrypt, "I_CryptGetTls");
    pI_CryptSetTls = (void *)GetProcAddress(hCrypt, "I_CryptSetTls");
    pI_CryptFreeTls = (void *)GetProcAddress(hCrypt, "I_CryptFreeTls");

    /* One normal pass */
    index = pI_CryptAllocTls();
    ok(index, "I_CryptAllocTls failed: %08x\n", GetLastError());
    if (index)
    {
        LPVOID ptr;

        ptr = pI_CryptGetTls(index);
        ok(!ptr, "Expected NULL\n");
        ret = pI_CryptSetTls(index, (LPVOID)0xdeadbeef);
        ok(ret, "I_CryptSetTls failed: %08x\n", GetLastError());
        ptr = pI_CryptGetTls(index);
        ok(ptr == (LPVOID)0xdeadbeef, "Expected 0xdeadbeef, got %p\n", ptr);
        /* This crashes
        ret = pI_CryptFreeTls(index, 1);
         */
        ret = pI_CryptFreeTls(index, 0);
        ok(ret, "I_CryptFreeTls failed: %08x\n", GetLastError());
        ret = pI_CryptFreeTls(index, 0);
        ok(!ret, "I_CryptFreeTls succeeded\n");
        ok(GetLastError() == E_INVALIDARG,
         "Expected E_INVALIDARG, got %08x\n", GetLastError());
    }
    /* Similar pass, check I_CryptDetachTls */
    index = pI_CryptAllocTls();
    ok(index, "I_CryptAllocTls failed: %08x\n", GetLastError());
    if (index)
    {
        LPVOID ptr;

        ptr = pI_CryptGetTls(index);
        ok(!ptr, "Expected NULL\n");
        ret = pI_CryptSetTls(index, (LPVOID)0xdeadbeef);
        ok(ret, "I_CryptSetTls failed: %08x\n", GetLastError());
        ptr = pI_CryptGetTls(index);
        ok(ptr == (LPVOID)0xdeadbeef, "Expected 0xdeadbeef, got %p\n", ptr);
        ptr = pI_CryptDetachTls(index);
        ok(ptr == (LPVOID)0xdeadbeef, "Expected 0xdeadbeef, got %p\n", ptr);
        ptr = pI_CryptGetTls(index);
        ok(!ptr, "Expected NULL\n");
    }
}
开发者ID:hoangduit,项目名称:reactos,代码行数:58,代码来源:main.c


示例6: sdl_getMouseState

static VALUE sdl_getMouseState(VALUE mod)
{
  int x,y;
  Uint8 result;
  result=SDL_GetMouseState(&x,&y);
  return rb_ary_new3(5,INT2FIX(x),INT2FIX(y),BOOL(result&SDL_BUTTON_LMASK),
		     BOOL(result&SDL_BUTTON_MMASK),
		     BOOL(result&SDL_BUTTON_RMASK));
}
开发者ID:alokmenghrajani,项目名称:alokmenghrajani.github.com,代码行数:9,代码来源:rubysdl_mouse.c


示例7: ValidateRDesc

void dx10StateManager::SetMultisample(u32 Enable)
{
	ValidateRDesc();

	if (m_RDesc.MultisampleEnable!=BOOL(Enable))
	{
		m_bRSChanged = true;
		m_RDesc.MultisampleEnable=BOOL(Enable);
	}
}
开发者ID:2asoft,项目名称:xray-16,代码行数:10,代码来源:dx10StateManager.cpp


示例8: setInfoToSMPEGInfo

static void setInfoToSMPEGInfo(VALUE obj,SMPEG_Info info)
{
  rb_iv_set(obj,"@has_audio",BOOL(info.has_audio));
  rb_iv_set(obj,"@has_video",BOOL(info.has_video));
  rb_iv_set(obj,"@width",INT2NUM(info.width));
  rb_iv_set(obj,"@height",INT2NUM(info.height));
  rb_iv_set(obj,"@current_frame",INT2NUM(info.current_frame));
  rb_iv_set(obj,"@current_fps",INT2NUM(info.current_fps));
  rb_iv_set(obj,"@audio_string",rb_str_new2(info.audio_string));
  rb_iv_set(obj,"@audio_current_frame",INT2NUM(info.audio_current_frame));
  rb_iv_set(obj,"@current_offset",UINT2NUM(info.current_offset));
  rb_iv_set(obj,"@total_size",UINT2NUM(info.total_size));
  rb_iv_set(obj,"@current_time",UINT2NUM(info.current_time));
  rb_iv_set(obj,"@total_time",UINT2NUM(info.total_time));
}
开发者ID:alokmenghrajani,项目名称:alokmenghrajani.github.com,代码行数:15,代码来源:rubysdl_smpeg.c


示例9: _T

bool CI8DeskSvr::StartRemoteControl()
{
	stdex::tString strFilePath = utility::GetAppPath() + _T("WinVNC\\");
	SetDllDirectory(strFilePath.c_str());

	strFilePath += TEXT("WinVNC.dll");
	m_hRemoteCtrl = LoadLibrary(strFilePath.c_str());
	if (m_hRemoteCtrl == NULL)
		return false;

	typedef BOOL (WINAPI* PFNSTARTVNC)();
	PFNSTARTVNC pfnStartVNC = GetProcAddress(m_hRemoteCtrl, "[email protected]");
	if (pfnStartVNC == NULL)
		return false;

	try
	{
		pfnStartVNC(); 
	}
	catch(...)
	{
		m_pLogger->WriteLog(LM_INFO, TEXT("加载远程控制客户端失败。\r\n"));
		BOOL (WINAPI* pfnStopVNC)();
		pfnStopVNC = GetProcAddress(m_hRemoteCtrl, "[email protected]");
		if (pfnStopVNC == NULL)
			return false;

		pfnStopVNC(); 
	}

	m_pLogger->WriteLog(LM_INFO, TEXT("加载远程控制客户端成功。\r\n"));
	return true;
}
开发者ID:lubing521,项目名称:important-files,代码行数:33,代码来源:I8DeskSvr.cpp


示例10: fclose

S32 LLXfer_File::startDownload()
{
 	S32 retval = 0;  // presume success
	mFp = LLFile::fopen(mTempFilename,"w+b");		/* Flawfinder : ignore */
	if (mFp)
	{
		fclose(mFp);
		mFp = NULL;

		gMessageSystem->newMessageFast(_PREHASH_RequestXfer);
		gMessageSystem->nextBlockFast(_PREHASH_XferID);
		gMessageSystem->addU64Fast(_PREHASH_ID, mID);
		gMessageSystem->addStringFast(_PREHASH_Filename, mRemoteFilename);
		gMessageSystem->addU8("FilePath", (U8) mRemotePath);
		gMessageSystem->addBOOL("DeleteOnCompletion", mDeleteRemoteOnCompletion);
		gMessageSystem->addBOOL("UseBigPackets", BOOL(mChunkSize == LL_XFER_LARGE_PAYLOAD));
		gMessageSystem->addUUIDFast(_PREHASH_VFileID, LLUUID::null);
		gMessageSystem->addS16Fast(_PREHASH_VFileType, -1);
	
		gMessageSystem->sendReliable(mRemoteHost);		
		mStatus = e_LL_XFER_IN_PROGRESS;
	}
	else
	{
		LL_WARNS() << "Couldn't create file to be received!" << LL_ENDL;
		retval = -1;
	}

	return (retval);
}
开发者ID:AlchemyDev,项目名称:Carbon,代码行数:30,代码来源:llxfer_file.cpp


示例11: dpb

// static
void LLKeyTool::onTransferInfo(LLMessageSystem *msg, void **user_data)
{
	S32 params_size = msg->getSize(_PREHASH_TransferInfo, _PREHASH_Params);
	if(params_size < 1) return;
	U8 tmp[1024];
	msg->getBinaryDataFast(_PREHASH_TransferInfo, _PREHASH_Params, tmp, params_size);
	LLDataPackerBinaryBuffer dpb(tmp, 1024);
	LLUUID asset_id;
	dpb.unpackUUID(asset_id, "AssetID");
	S32 asset_type;
	dpb.unpackS32(asset_type, "AssetType");
	S32 status;
	msg->getS32Fast(_PREHASH_TransferInfo, _PREHASH_Status, status, 0);

	BOOL wanted = callback(asset_id, KT_ASSET, (LLAssetType::EType)asset_type, BOOL(status == 0)); // LLTS_OK (e_status_codes)
	if(wanted)
	{
		LLKeyTool::sTransferRequests--;
		if(LLKeyTool::sTransferRequests <= 0)
		{
			LLKeyTool::sTransferRequests = 0;
			gMessageSystem->delHandlerFuncFast(_PREHASH_TransferInfo, &onTransferInfo);
		}
	}
}
开发者ID:fractured-crystal,项目名称:SssnowGlobeeE,代码行数:26,代码来源:llkeytool.cpp


示例12: SetAlpha

SetAlpha(LONG nTrans) {
  HMODULE hDllUser32 = LoadLibrary("user32");
  if (hDllUser32) {
    BOOL (WINAPI *pfnSetLayeredWindowAttributes)(HWND,DWORD,BYTE,DWORD);

    pfnSetLayeredWindowAttributes
      = (BOOL (WINAPI *)(HWND,DWORD,BYTE,DWORD))
          GetProcAddress(hDllUser32, "SetLayeredWindowAttributes");

    if (pfnSetLayeredWindowAttributes) {
      HWND hTop = GetVimWindow();
      if (hTop) {
        if (nTrans == 255) {
          SetWindowLong(hTop, GWL_EXSTYLE,
          GetWindowLong(hTop, GWL_EXSTYLE) & ~WS_EX_LAYERED); 
        } else {
          SetWindowLong(hTop, GWL_EXSTYLE,
          GetWindowLong(hTop, GWL_EXSTYLE) | WS_EX_LAYERED); 
          pfnSetLayeredWindowAttributes(hTop, 0, (BYTE)nTrans, LWA_ALPHA);
        }
      }
    }
    FreeLibrary(hDllUser32);
  }
  return GetLastError();
}
开发者ID:madwenoma,项目名称:vimtweak,代码行数:26,代码来源:vimtweak.c


示例13: BOOL

CAygshellHelper::CAygshellHelper( void )
{
    if( m_hAygshellDLL = LoadLibrary( L"aygshell.dll" ) )
    {
        BOOL (*SHInitExtraControls)() = NULL;
        SHInitExtraControls = (BOOL (*)())GetProcAddress( m_hAygshellDLL, L"SHInitExtraControls" );
        SHInitDialog = (LPSHINITDIALOG)GetProcAddress( m_hAygshellDLL, L"SHInitDialog" );
        SHInputDialog = (LPSHINPUTDIALOG)GetProcAddress( m_hAygshellDLL, L"SHInputDialog" );
        SHSipInfo = (LPSHSIPINFO)GetProcAddress( m_hAygshellDLL, L"SHSipInfo" );
        // SHHandleWMSettingChange isn't exported by name, so reference its ordinal.
        // OEMs shouldn't have to do this since they won't conditionally include aygshell.
        SHHandleWMSettingChange = (LPSHHANDLEWMSETTINGCHANGE)GetProcAddress( m_hAygshellDLL, (LPWSTR)MAKELONG(83, 0) );
        if( !(SHInitDialog && SHInputDialog
        	&& SHInitExtraControls && SHSipInfo
        	&& SHHandleWMSettingChange) )
        {
            FreeLibrary( m_hAygshellDLL );
            m_hAygshellDLL = NULL;
        }
        else
        {
            SHInitExtraControls();
        }
    }
}
开发者ID:nocoolnicksleft,项目名称:DingDong600,代码行数:25,代码来源:aygshell_helper.cpp


示例14: list_tasks_worker

int
list_tasks_worker(worker_t * worker, GError ** error)
{
	struct bulk_s {
		char id[MAX_TASKID_LENGTH];
		gint64 period;
		guint8 busy;
		// used to compute the length of the structure without padding, with
		// the help of offsetof().
		gchar last[];
	} bulk;
	GHashTableIter iter;
	gpointer k, v;

	GByteArray *gba = g_byte_array_new();
	g_hash_table_iter_init(&iter, tasks);
	while (g_hash_table_iter_next(&iter, &k, &v)) {
		task_t *t;
		if (!(t = v))
			continue;
		memset(&bulk, 0, sizeof(bulk));
		g_strlcpy(bulk.id, t->id, sizeof(bulk.id));
		bulk.period = t->period;
		bulk.busy = BOOL(t->busy);
		g_byte_array_append(gba, (guint8*)&bulk, offsetof(struct bulk_s, last));
	}

	return __respond(worker, 1, gba, error);
}
开发者ID:Narthorn,项目名称:oio-sds,代码行数:29,代码来源:task_scheduler.c


示例15: AssertFatal

void 
GWControlProxy::setEnable(const bool in_enable) const
{
   AssertFatal(m_attached == true, "Error, not attached...");
   
   EnableWindow(m_ctrlHWnd, BOOL(in_enable));
}
开发者ID:AltimorTASDK,项目名称:TribesRebirth,代码行数:7,代码来源:gwControlProxy.cpp


示例16: GetFileNamePreview

/***********************************************************************
 *      GetFileNamePreview   [[email protected]]
 */
static BOOL GetFileNamePreview(LPVOID lpofn,BOOL bSave,BOOL bUnicode)
{
  CHAR    szFunctionName[20];
  BOOL    (*fnGetFileName)(LPVOID);
  HMODULE hComdlg32;
  BOOL    ret;

  FIXME("(%p,%d,%d), semi-stub!\n",lpofn,bSave,bUnicode);

  lstrcpyA(szFunctionName, (bSave ? "GetSaveFileName" : "GetOpenFileName"));
  lstrcatA(szFunctionName, (bUnicode ? "W" : "A"));

  hComdlg32 = LoadLibraryA("COMDLG32.DLL");
  if (hComdlg32 == NULL)
    return FALSE;

  fnGetFileName = (LPVOID)GetProcAddress(hComdlg32, szFunctionName);
  if (fnGetFileName == NULL)
    return FALSE;

  /* FIXME: need to add OFN_ENABLEHOOK and our own handler */
  ret = fnGetFileName(lpofn);

  FreeLibrary(hComdlg32);
  return ret;
}
开发者ID:dvdhoo,项目名称:wine,代码行数:29,代码来源:msvideo_main.c


示例17: main

int main(int argc, char** argv)
{
    HANDLE lib;
    HANDLE event;
    int i;
    ULONG_PTR hThread;
    int sum = 0;

    USE_USER32();

    event = CreateEvent(NULL, TRUE, FALSE, NULL);
    hThread = _beginthreadex(NULL, 0, run_func, event, 0, &i);

    for (i=0; i<ITERS; i++) {
        lib = LoadLibrary("win32.reload.dll.dll");
        if (lib == NULL) {
            print("error loading library\n");
            break;
        } else {
            /* don't ask to compute fact or fib too high */
            BOOL (WINAPI *proc)(DWORD);
            proc = (BOOL (WINAPI *)(DWORD))
                GetProcAddress(lib, (LPCSTR)"import_me");
            sum += (*proc)(i % MAX_FACT_FIB);
            FreeLibrary(lib);
        }
    }

    SetEvent(event);
    WaitForSingleObject((HANDLE)hThread, INFINITE);

    print("sum=%d\n", sum);
    check_mem_usage();
    return 0;
}
开发者ID:AVGirl,项目名称:dynamorio,代码行数:35,代码来源:reload.c


示例18: GetSystemInfo

int CSysInfo::GetKernelBitness(void)
{
#ifdef TARGET_WINDOWS
  SYSTEM_INFO si;
  GetSystemInfo(&si);
  if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
    return 64;
  
  BOOL (WINAPI *ptrIsWow64) (HANDLE, PBOOL);
  HMODULE hKernel32 = GetModuleHandleA("kernel32");
  if (hKernel32 == NULL)
    return 0; // Can't detect OS
  ptrIsWow64 = (BOOL (WINAPI *) (HANDLE, PBOOL)) GetProcAddress(hKernel32, "IsWow64Process");
  BOOL wow64proc = FALSE;
  if (ptrIsWow64 == NULL || ptrIsWow64(GetCurrentProcess(), &wow64proc) == FALSE)
    return 0; // Can't detect OS
  return (wow64proc == FALSE) ? 32 : 64;
#elif defined(TARGET_POSIX)
  struct utsname un;
  if (uname(&un) == 0)
  {
    std::string machine(un.machine);
    if (machine == "x86_64" || machine == "amd64" || machine == "arm64" || machine == "aarch64" || machine == "ppc64" || machine == "ia64")
      return 64;
    return 32;
  }
  return 0; // can't detect
#else
  return 0; // unknown
#endif
}
开发者ID:darkblaze101,项目名称:xbmc,代码行数:31,代码来源:SystemInfo.cpp


示例19: DrawThemesPart

HRESULT DrawThemesPart(HDC hDC, int iPartId, int iStateId, LPCSTR uiPartNameID, LPRECT prcBox)
{
    if(!IsWinXP()) return E_FAIL;
    HINSTANCE hDll=LoadLibrary(CString((LPCTSTR)IDS_UTIL_UXTHEME));                                // 'UxTheme.dll'
    if(!hDll) return E_FAIL;

    BOOL (PASCAL* pfnIsThemeActive)();    UINT hTheme=0;
    (FARPROC&)pfnIsThemeActive=GetProcAddress(hDll,IDS_UTIL_THEMEACT);        // 'IsThemeActive'
    HRESULT hResult=E_FAIL;

    if(pfnIsThemeActive && pfnIsThemeActive())
    {    
        CString sPartName((LPCTSTR)uiPartNameID);
        if(sPartName.GetLength()>0)
        {    
            WCHAR swPartName[WPART_NAME_SZ];
#if !defined(UNICODE) && !defined(_UNICODE)
            MultiByteToWideChar(CP_ACP,0,(LPCSTR)sPartName,-1,swPartName,sizeof(swPartName)/sizeof(WCHAR));
#else
            _tcscpy(swPartName, sPartName.GetBuffer());
#endif
            UINT (PASCAL* pfnOpenThemeData)(HWND hwnd, LPCWSTR pszClassList);
            (FARPROC&)pfnOpenThemeData=GetProcAddress(hDll,IDS_UTIL_THEMEOPN);// 'OpenThemeData'
            if(pfnOpenThemeData && (hTheme=pfnOpenThemeData(NULL, swPartName))!=0)
            {    
                UINT (PASCAL* pfnDrawThemeBackground)(UINT htheme,HDC hdc,int iPartID,int iStateID,const RECT* prcBx,const RECT* prcClip);
                (FARPROC&)pfnDrawThemeBackground=GetProcAddress(hDll,IDS_UTIL_THEMEBCKG);    // 'DrawThemeBackground'
                if(pfnDrawThemeBackground)
                    hResult=pfnDrawThemeBackground(hTheme, hDC, iPartId, iStateId, prcBox, NULL);
            }    
        }    
    }
    FreeLibrary(hDll);
    return hResult;
}
开发者ID:CowPanda,项目名称:TeamTalk5,代码行数:35,代码来源:XPTabCtrl.cpp


示例20: ReleaseActContext

void ReleaseActContext(void)
{
    void (WINAPI *ReleaseActCtx)(HANDLE);
    BOOL (WINAPI *DeactivateActCtx)(DWORD dwFlags, ULONG_PTR ulCookie);
    HANDLE k32;

    if (!IsXPOrLater())
        return;

    k32 = LoadLibrary("kernel32");
    ReleaseActCtx = (void*)GetProcAddress(k32, "ReleaseActCtx");
    DeactivateActCtx = (void*)GetProcAddress(k32, "DeactivateActCtx");
    if (!ReleaseActCtx || !DeactivateActCtx)
    {
        VS("Cannot find ReleaseActCtx/DeactivateActCtx exports in kernel32.dll\n");
        return;
    }
    __try
    {
        VS("Deactivating activation context\n");
        if (!DeactivateActCtx(0, actToken))
            VS("Error deactivating context!\n!");
        
        VS("Releasing activation context\n");
        if (hCtx != INVALID_HANDLE_VALUE)
            ReleaseActCtx(hCtx);
        VS("Done\n");
    }
    __except (STATUS_SXS_EARLY_DEACTIVATION)
    {
    	VS("XS early deactivation; somebody left the activation context dirty, let's ignore the problem\n");
    }
}
开发者ID:Matt-Esch,项目名称:anaconda,代码行数:33,代码来源:utils.c



注:本文中的BOOL函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ BOOLSETTING函数代码示例发布时间:2022-05-30
下一篇:
C++ BODY函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap