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

C++ IS_INTRESOURCE函数代码示例

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

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



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

示例1: MyRegisterClass

ATOM MyRegisterClass(CONST WNDCLASSW *wndClass)
{
  if (g_IsNT)
    return RegisterClassW(wndClass);
  WNDCLASSA wndClassA;
  wndClassA.style = wndClass->style;
  wndClassA.lpfnWndProc = wndClass->lpfnWndProc;
  wndClassA.cbClsExtra = wndClass->cbClsExtra;
  wndClassA.cbWndExtra = wndClass->cbWndExtra;
  wndClassA.hInstance = wndClass->hInstance;
  wndClassA.hIcon = wndClass->hIcon;
  wndClassA.hCursor = wndClass->hCursor;
  wndClassA.hbrBackground = wndClass->hbrBackground;
  AString menuName;
  AString className;
  if (IS_INTRESOURCE(wndClass->lpszMenuName))
    wndClassA.lpszMenuName = (LPCSTR)wndClass->lpszMenuName;
  else
  {
    menuName = GetSystemString(wndClass->lpszMenuName);
    wndClassA.lpszMenuName = menuName;
  }
  if (IS_INTRESOURCE(wndClass->lpszClassName))
    wndClassA.lpszClassName = (LPCSTR)wndClass->lpszClassName;
  else
  {
    className = GetSystemString(wndClass->lpszClassName);
    wndClassA.lpszClassName = className;
  }
  return RegisterClassA(&wndClassA);
}
开发者ID:BIAINC,项目名称:7Zip,代码行数:31,代码来源:Window.cpp


示例2: return

bool CWindow::CreateEx(DWORD exStyle, LPCWSTR className,
      LPCWSTR windowName, DWORD style,
      int x, int y, int width, int height,
      HWND parentWindow, HMENU idOrHMenu,
      HINSTANCE instance, LPVOID createParam)
{
  if (g_IsNT)
  {
    _window = ::CreateWindowExW(exStyle, className, windowName,
      style, x, y, width, height, parentWindow,
      idOrHMenu, instance, createParam);
     return (_window != NULL);
  }
  AString classNameA;
  LPCSTR classNameP;
  if (IS_INTRESOURCE(className))
    classNameP = (LPCSTR)className;
  else
  {
    classNameA = GetSystemString(className);
    classNameP = classNameA;
  }
  AString windowNameA;
  LPCSTR windowNameP;
  if (IS_INTRESOURCE(windowName))
    windowNameP = (LPCSTR)windowName;
  else
  {
    windowNameA = GetSystemString(windowName);
    windowNameP = windowNameA;
  }
  return CreateEx(exStyle, classNameP, windowNameP,
      style, x, y, width, height, parentWindow,
      idOrHMenu, instance, createParam);
}
开发者ID:BIAINC,项目名称:7Zip,代码行数:35,代码来源:Window.cpp


示例3: EnumResNameProc

static BOOL CALLBACK EnumResNameProc(HMODULE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG_PTR /*lParam*/)
{
	g_uResNumber++;
	UINT uSize = 0;
	HRSRC hResInfo = FindResource(hModule, lpszName, lpszType);
	if (hResInfo)
	{
		uSize = SizeofResource(hModule, hResInfo);
		g_uTotalSize += uSize;
	}
#if 0
	TRACE(_T("%3u: "), g_uResNumber);
	if (IS_INTRESOURCE(lpszType))
	{
		if ((DWORD)lpszType == (DWORD)RT_GROUP_ICON)
			TRACE(_T("RT_GROUP_ICON"));
		else if ((DWORD)lpszType == (DWORD)RT_ICON)
			TRACE(_T("RT_ICON"));
		else if ((DWORD)lpszType == (DWORD)RT_BITMAP)
			TRACE(_T("RT_BITMAP"));
		else
			TRACE(_T("type=%u"), (UINT)lpszType);
	}
	else
		TRACE(_T("type=\"%s\""), lpszType);
	TRACE(_T("  size=%5u"), uSize);
	if (IS_INTRESOURCE(lpszName))
		TRACE(_T("  name=*%u"), (UINT)lpszName);
	else
		TRACE(_T("  name=\"%s\""), lpszName);
	TRACE(_T("\n"));
#endif
	return TRUE;
}
开发者ID:HackLinux,项目名称:eMule-IS-Mod,代码行数:34,代码来源:SelfTest.cpp


示例4: if

// Moves every item right and gives it the WS_EX_RIGHT extended style
void CDialogTemplate::ConvertToRTL() {
  for (unsigned int i = 0; i < m_vItems.size(); i++) {
    bool addExStyle = false;

    // Button
    if (int(m_vItems[i]->szClass) == 0x80) {
      m_vItems[i]->dwStyle ^= BS_LEFTTEXT;
      m_vItems[i]->dwStyle ^= BS_RIGHT;
      m_vItems[i]->dwStyle ^= BS_LEFT;

      if ((m_vItems[i]->dwStyle & (BS_LEFT|BS_RIGHT)) == (BS_LEFT|BS_RIGHT)) {
        m_vItems[i]->dwStyle ^= BS_LEFT;
        m_vItems[i]->dwStyle ^= BS_RIGHT;
        if (m_vItems[i]->dwStyle & (BS_RADIOBUTTON|BS_CHECKBOX|BS_USERBUTTON)) {
          m_vItems[i]->dwStyle |= BS_RIGHT;
        }
      }
    }
    // Edit
    else if (int(m_vItems[i]->szClass) == 0x81) {
      if ((m_vItems[i]->dwStyle & ES_CENTER) == 0) {
        m_vItems[i]->dwStyle ^= ES_RIGHT;
      }
    }
    // Static
    else if (int(m_vItems[i]->szClass) == 0x82) {
      if ((m_vItems[i]->dwStyle & SS_TYPEMASK) == SS_LEFT || (m_vItems[i]->dwStyle & SS_TYPEMASK) == SS_LEFTNOWORDWRAP)
      {
        m_vItems[i]->dwStyle &= ~SS_TYPEMASK;
        m_vItems[i]->dwStyle |= SS_RIGHT;
      }
      else if ((m_vItems[i]->dwStyle & SS_TYPEMASK) == SS_ICON) {
        m_vItems[i]->dwStyle |= SS_CENTERIMAGE;
      }
    }
    else if (!IS_INTRESOURCE(m_vItems[i]->szClass) && !strcmpi(m_vItems[i]->szClass, "RichEdit20A")) {
      if ((m_vItems[i]->dwStyle & ES_CENTER) == 0) {
        m_vItems[i]->dwStyle ^= ES_RIGHT;
      }
    }
    else if (!IS_INTRESOURCE(m_vItems[i]->szClass) && !strcmpi(m_vItems[i]->szClass, "SysTreeView32")) {
      m_vItems[i]->dwStyle |= TVS_RTLREADING;
      addExStyle = true;
    }
    else addExStyle = true;

    if (addExStyle)
      m_vItems[i]->dwExtStyle |= WS_EX_RIGHT;

    m_vItems[i]->dwExtStyle |= WS_EX_RTLREADING;

    m_vItems[i]->sX = m_sWidth - m_vItems[i]->sWidth - m_vItems[i]->sX;
  }
  m_dwExtStyle |= WS_EX_RIGHT | WS_EX_RTLREADING;
}
开发者ID:kichik,项目名称:nsis-1,代码行数:56,代码来源:DialogTemplate.cpp


示例5: OleUIPasteSpecialA

/***********************************************************************
 *           OleUIPasteSpecialA (OLEDLG.4)
 */
UINT WINAPI OleUIPasteSpecialA(LPOLEUIPASTESPECIALA psA)
{
    OLEUIPASTESPECIALW ps;
    UINT ret;
    TRACE("(%p)\n", psA);

    memcpy(&ps, psA, psA->cbStruct);

    ps.lpszCaption = strdupAtoW(psA->lpszCaption);
    if(!IS_INTRESOURCE(ps.lpszTemplate))
        ps.lpszTemplate = strdupAtoW(psA->lpszTemplate);

    if(psA->cPasteEntries > 0)
    {
        DWORD size = psA->cPasteEntries * sizeof(ps.arrPasteEntries[0]);
        UINT i;

        ps.arrPasteEntries = HeapAlloc(GetProcessHeap(), 0, size);
        memcpy(ps.arrPasteEntries, psA->arrPasteEntries, size);
        for(i = 0; i < psA->cPasteEntries; i++)
        {
            ps.arrPasteEntries[i].lpstrFormatName =
                strdupAtoW(psA->arrPasteEntries[i].lpstrFormatName);
            ps.arrPasteEntries[i].lpstrResultText =
                strdupAtoW(psA->arrPasteEntries[i].lpstrResultText);
        }
    }

    ret = OleUIPasteSpecialW(&ps);

    if(psA->cPasteEntries > 0)
    {
        UINT i;
        for(i = 0; i < psA->cPasteEntries; i++)
        {
            HeapFree(GetProcessHeap(), 0, (WCHAR*)ps.arrPasteEntries[i].lpstrFormatName);
            HeapFree(GetProcessHeap(), 0, (WCHAR*)ps.arrPasteEntries[i].lpstrResultText);
        }
        HeapFree(GetProcessHeap(), 0, ps.arrPasteEntries);
    }
    if(!IS_INTRESOURCE(ps.lpszTemplate))
        HeapFree(GetProcessHeap(), 0, (WCHAR*)ps.lpszTemplate);
    HeapFree(GetProcessHeap(), 0, (WCHAR*)ps.lpszCaption);

    /* Copy back the output fields */
    psA->dwFlags = ps.dwFlags;
    psA->lpSrcDataObj = ps.lpSrcDataObj;
    psA->nSelectedIndex = ps.nSelectedIndex;
    psA->fLink = ps.fLink;
    psA->hMetaPict = ps.hMetaPict;
    psA->sizel = ps.sizel;

    return ret;
}
开发者ID:WASSUM,项目名称:longene_travel,代码行数:57,代码来源:pastespl.c


示例6: StringCchLength

//--------------------------------------------------------------------------------------
int DialogResourceManager::AddTexture( LPCWSTR strResourceName, HMODULE hResourceModule )
{
	// See if this texture already exists
	for( int i=0; i < (int)m_TextureCache.size(); i++ )
	{
		TextureNode* pTextureNode = m_TextureCache.at(i);
		if( !pTextureNode->bFileSource &&      // Sources must match
			pTextureNode->hResourceModule == hResourceModule ) // Module handles must match
		{
			if( IS_INTRESOURCE( strResourceName ) )
			{
				// Integer-based ID
				if( (INT_PTR)strResourceName == pTextureNode->nResourceID )
					return i;
			}
			else
			{
				// String-based ID
				size_t nLen = 0;
				StringCchLength( strResourceName, MAX_PATH, &nLen );        
				if( 0 == _wcsnicmp( pTextureNode->strFilename, strResourceName, nLen ) )
					return i;
			}
		}
	}

	// Add a new texture and try to create it
	TextureNode* pNewTextureNode = new TextureNode();
	if( pNewTextureNode == NULL )
		return -1;

	ZeroMemory( pNewTextureNode, sizeof(TextureNode) );
	pNewTextureNode->hResourceModule = hResourceModule;
	if( IS_INTRESOURCE( strResourceName ) )
	{
		pNewTextureNode->nResourceID = (int)(size_t)strResourceName;
	}
	else
	{
		pNewTextureNode->nResourceID = 0;
		StringCchCopy( pNewTextureNode->strFilename, MAX_PATH, strResourceName );
	}

	m_TextureCache.push_back( pNewTextureNode );

	int iTexture = (int)m_TextureCache.size()-1;

	// If a device is available, try to create immediately
	if( m_pd3d9Device )
		CreateTexture9( iTexture );

	return iTexture;
}
开发者ID:oksangman,项目名称:Ant,代码行数:54,代码来源:DialogManager.cpp


示例7: BeginUpdateResource

BOOL CALLBACK CResModule::EnumResWriteLangCallback(HMODULE /*hModule*/, LPCTSTR lpszType, LPTSTR lpszName, WORD wLanguage, LONG_PTR lParam)
{
	BOOL bRes = FALSE;
	CResModule* lpResModule = (CResModule*)lParam;


	int count = 0;
	do 
	{
		lpResModule->m_hUpdateRes = BeginUpdateResource(lpResModule->sDestFile.c_str(), FALSE);
		if (lpResModule->m_hUpdateRes == NULL)
			Sleep(100);
		count++;
	} while ((lpResModule->m_hUpdateRes == NULL)&&(count < 5));

	if (lpszType == RT_STRING)
	{
		if (IS_INTRESOURCE(lpszName))
		{
			bRes = lpResModule->ReplaceString(LOWORD(lpszName), wLanguage);
		}
	} 
	else if (lpszType == RT_MENU)
	{
		if (IS_INTRESOURCE(lpszName))
		{
			bRes = lpResModule->ReplaceMenu(LOWORD(lpszName), wLanguage);
		}
	}
	else if (lpszType == RT_DIALOG)
	{
		if (IS_INTRESOURCE(lpszName))
		{
			bRes = lpResModule->ReplaceDialog(LOWORD(lpszName), wLanguage);
		}
	}
	else if (lpszType == RT_ACCELERATOR)
	{
		if (IS_INTRESOURCE(lpszName))
		{
			bRes = lpResModule->ReplaceAccelerator(LOWORD(lpszName), wLanguage);
		}
	}

	if (!EndUpdateResource(lpResModule->m_hUpdateRes, !bRes))
		MYERROR;
	return bRes;

}
开发者ID:andmedsantana,项目名称:TortoiseGit,代码行数:49,代码来源:ResModule.cpp


示例8: GetFrameTitle

CString CXTPTaskDialogFrame::GetFrameTitle() const
{
    CString strWindowTitle;

    if (m_pConfig->pszWindowTitle != NULL)
    {
        if (IS_INTRESOURCE(m_pConfig->pszWindowTitle))
        {
            XTPLoadStringInst(m_pConfig->hInstance,
                              (UINT)(UINT_PTR)m_pConfig->pszWindowTitle, &strWindowTitle);
        }
        else
        {
            strWindowTitle = m_pConfig->pszWindowTitle;
        }
    }

    if (strWindowTitle.IsEmpty())
    {
        TCHAR szModuleName[_MAX_PATH];
        ::GetModuleFileName(AfxGetInstanceHandle(), szModuleName, _MAX_PATH);

        TCHAR szFileName[_MAX_FNAME], szExt[_MAX_EXT];
        SPLITPATH_S(szModuleName, NULL, NULL, szFileName, szExt);

        strWindowTitle.Format(_T("%s%s"), szFileName, szExt);
    }

    return strWindowTitle;
}
开发者ID:ylyking,项目名称:ThisIsASoftRenderer,代码行数:30,代码来源:XTPTaskDialogFrame.cpp


示例9: dump_pastespecial

static void dump_pastespecial(const OLEUIPASTESPECIALW *ps)
{
    UINT i;
    dump_ps_flags(ps->dwFlags);
    TRACE("hwnd %p caption %s hook %p custdata %lx\n",
          ps->hWndOwner, debugstr_w(ps->lpszCaption), ps->lpfnHook, ps->lCustData);
    if(IS_INTRESOURCE(ps->lpszTemplate))
        TRACE("hinst %p template %04x hresource %p\n", ps->hInstance, (WORD)(ULONG_PTR)ps->lpszTemplate, ps->hResource);
    else
        TRACE("hinst %p template %s hresource %p\n", ps->hInstance, debugstr_w(ps->lpszTemplate), ps->hResource);
    TRACE("dataobj %p arrpasteent %p cpasteent %d arrlinktype %p clinktype %d\n",
          ps->lpSrcDataObj, ps->arrPasteEntries, ps->cPasteEntries,
          ps->arrLinkTypes, ps->cLinkTypes);
    TRACE("cclsidex %d lpclsidex %p nselect %d flink %d hmetapict %p size(%d,%d)\n",
          ps->cClsidExclude, ps->lpClsidExclude, ps->nSelectedIndex, ps->fLink,
          ps->hMetaPict, ps->sizel.cx, ps->sizel.cy);
    for(i = 0; i < ps->cPasteEntries; i++)
    {
        TRACE("arrPasteEntries[%d]: cFormat %08x pTargetDevice %p dwAspect %d lindex %d tymed %d\n",
              i, ps->arrPasteEntries[i].fmtetc.cfFormat, ps->arrPasteEntries[i].fmtetc.ptd,
              ps->arrPasteEntries[i].fmtetc.dwAspect, ps->arrPasteEntries[i].fmtetc.lindex,
              ps->arrPasteEntries[i].fmtetc.tymed);
        TRACE("\tformat name %s result text %s flags %04x\n", debugstr_w(ps->arrPasteEntries[i].lpstrFormatName),
              debugstr_w(ps->arrPasteEntries[i].lpstrResultText), ps->arrPasteEntries[i].dwFlags);
    }
    for(i = 0; i < ps->cLinkTypes; i++)
        TRACE("arrLinkTypes[%d] %08x\n", i, ps->arrLinkTypes[i]);
    for(i = 0; i < ps->cClsidExclude; i++)
        TRACE("lpClsidExclude[%d] %s\n", i, debugstr_guid(&ps->lpClsidExclude[i]));

}
开发者ID:WASSUM,项目名称:longene_travel,代码行数:31,代码来源:pastespl.c


示例10: lock

 HCURSOR SResProviderMgr::LoadCursor( LPCTSTR pszResName ,BOOL bFromFile /*= FALSE*/)
 {
     SAutoLock lock(m_cs);
     if(IS_INTRESOURCE(pszResName))
         return ::LoadCursor(NULL, pszResName);
     else 
     {
         LPCTSTR pszCursorID=SysCursorName2ID(pszResName);
         if(pszCursorID)
             return ::LoadCursor(NULL, pszCursorID);
     }
     const CURSORMAP::CPair * pPair  = m_mapCachedCursor.Lookup(pszResName);
     if(pPair) return pPair->m_value;
     
     HCURSOR hRet = NULL;
     if(bFromFile)
     {
         hRet = SResLoadFromFile::LoadCursor(pszResName);
     }else
     {
         IResProvider *pResProvider=GetMatchResProvider(KTypeCursor,pszResName);
         if(pResProvider)
             hRet =pResProvider->LoadCursor(pszResName);
     }
     if(hRet)
     {
         m_mapCachedCursor[pszResName]=hRet;
     }
     return hRet;
 }
开发者ID:435420057,项目名称:soui,代码行数:30,代码来源:SResProviderMgr.cpp


示例11: FindWindowExA

/*
 * @implemented
 */
HWND WINAPI
FindWindowExA(HWND hwndParent,
              HWND hwndChildAfter,
              LPCSTR lpszClass,
              LPCSTR lpszWindow)
{
    LPWSTR titleW = NULL;
    HWND hwnd = 0;

    if (lpszWindow)
    {
        DWORD len = MultiByteToWideChar( CP_ACP, 0, lpszWindow, -1, NULL, 0 );
        if (!(titleW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return 0;
        MultiByteToWideChar( CP_ACP, 0, lpszWindow, -1, titleW, len );
    }

    if (!IS_INTRESOURCE(lpszClass))
    {
        WCHAR classW[256];
        if (MultiByteToWideChar( CP_ACP, 0, lpszClass, -1, classW, sizeof(classW)/sizeof(WCHAR) ))
            hwnd = FindWindowExW( hwndParent, hwndChildAfter, classW, titleW );
    }
    else
    {
        hwnd = FindWindowExW( hwndParent, hwndChildAfter, (LPCWSTR)lpszClass, titleW );
    }

    HeapFree( GetProcessHeap(), 0, titleW );
    return hwnd;
}
开发者ID:hoangduit,项目名称:reactos,代码行数:33,代码来源:window.c


示例12: Dump

void CColorDialog::Dump( CDumpContext &dc ) const
/***********************************************/
{
    CCommonDialog::Dump( dc );

    dc << "m_cc.lStructSize = " << m_cc.lStructSize << "\n";
    dc << "m_cc.hwndOwner = " << m_cc.hwndOwner << "\n";
    dc << "m_cc.hInstance = " << m_cc.hInstance << "\n";
    dc << "m_cc.rgbResult = ";
    dc.DumpAsHex( m_cc.rgbResult );
    dc << "\n";
    dc << "m_cc.lpCustColors = " << m_cc.lpCustColors << "\n";
    dc << "m_cc.Flags = ";
    dc.DumpAsHex( m_cc.Flags );
    dc << "\n";
    dc << "m_cc.lCustData = ";
    dc.DumpAsHex( m_cc.lCustData );
    dc << "\n";
    if( m_cc.lpfnHook == AfxCommDlgProc ) {
        dc << "m_cc.lpfnHook = AfxCommDlgProc\n";
    } else {
        dc << "m_cc.lpfnHook = " << m_cc.lpfnHook << "\n";
    }
    if( IS_INTRESOURCE( m_cc.lpTemplateName ) ) {
        dc << "m_cc.lpTemplateName = " << (UINT)m_cc.lpTemplateName << "\n";
    } else {
        dc << "m_cc.lpTemplateName = " << m_cc.lpTemplateName << "\n";
    }
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:29,代码来源:colordlg.cpp


示例13: b_heap

CTaskDialog::HeapResString::HeapResString(HINSTANCE hInstance, LPCWSTR lpwsz)
	: b_heap(true)
	, lpwsz_(0)
{
	if (IS_INTRESOURCE(lpwsz)) {

		// load entire resource string in a heap-allocated buffer

#pragma warning (push)
#pragma warning (disable: 4311)

		DWORD dwSize = 128;
		DWORD dwLen = 0;
		wsz_ = reinterpret_cast<WCHAR*>(::HeapAlloc(::GetProcessHeap(), HEAP_ZERO_MEMORY, (dwSize + 1) * sizeof(WCHAR)));
		while ((dwLen = ::LoadString(hInstance, reinterpret_cast<UINT>(lpwsz), wsz_, dwSize)) == dwSize - 1) {
			dwSize *= 1.50;
			wsz_ = reinterpret_cast<WCHAR*>(::HeapReAlloc(::GetProcessHeap(), HEAP_ZERO_MEMORY, wsz_, (dwSize + 1) * sizeof(WCHAR)));
		}

#pragma warning (pop)

	}

	else {

		b_heap = false;
		lpwsz_ = lpwsz;
	}
}
开发者ID:cherry-wb,项目名称:upgradr,代码行数:29,代码来源:CTaskDialog.cpp


示例14: CPythonPropertyPage

// @pymethod <o PyCPropertyPage>|win32ui|CreatePropertyPage|Creates a property page object.
PyObject *PyCPropertyPage::create( PyObject *self, PyObject *args )
{
	TCHAR *Template=NULL;
	PyObject *obTemplate = NULL;
	int idCaption = 0;
	if (!PyArg_ParseTuple(args,"O|i", 
		&obTemplate, // @pyparm <o PyResourceId>|resource||String template name or inteter resource ID to use for the page.
		&idCaption)) // @pyparm int|caption|0|The ID if the string resource to use for the caption.
		return NULL;
	CPythonPropertyPage *pPP;
	if (!PyWinObject_AsResourceId(obTemplate, &Template, FALSE))
		return NULL;

	if (IS_INTRESOURCE(Template)){
		if (!PropSheetCheckForPageCreate((UINT)Template))
			return NULL;
		GUI_BGN_SAVE;
		pPP = new CPythonPropertyPage((UINT)Template, idCaption);
		GUI_END_SAVE;
		}
	else{
		if (!PropSheetCheckForPageCreate(Template))
			return NULL;
		GUI_BGN_SAVE;
		pPP = new CPythonPropertyPage(Template, idCaption);
		GUI_END_SAVE;
	}
	PyWinObject_FreeResourceId(Template);
	PyCPropertyPage *ret = (PyCPropertyPage *)ui_assoc_object::make( PyCPropertyPage::type, pPP);
	return ret;
}
开发者ID:DavidGuben,项目名称:rcbplayspokemon,代码行数:32,代码来源:win32prop.cpp


示例15: RETURN_TYPE_ERR

// @pymethod <o PyCPropertySheet>|win32ui|CreatePropertySheet|Creates a property sheet object.
PyObject *PyCPropertySheet::create( PyObject *self, PyObject *args )
{
	PyObject 	*obParent = NULL,
			*obCaption;
	TCHAR *Caption;
	CWnd *pParent = NULL;
	int iSelect = 0;
	if (!PyArg_ParseTuple(args,"O|Oi", 
	          &obCaption, // @pyparm <o PyResourceId>|caption||The caption for the property sheet, or id of the caption
	          &obParent,  // @pyparm <o PyCWnd>|parent|None|The parent window of the property sheet.
	          &iSelect))  // @pyparm int|select|0|The index of the first page to be selected.
		return NULL;
	if (obParent) {
		if (!ui_base_class::is_uiobject(obParent, &PyCWnd::type))
			RETURN_TYPE_ERR("parameter 2 must be a PyCWnd object");
  		pParent = (CWnd *)PyCWnd::GetPythonGenericWnd(obParent);
	}
	CPythonPropertySheet *pPS;
	if (!PyWinObject_AsResourceId(obCaption, &Caption, FALSE))
		return NULL;

	if (IS_INTRESOURCE(Caption)){
		GUI_BGN_SAVE;
		pPS = new CPythonPropertySheet(MAKEINTRESOURCE(Caption), pParent, iSelect);
		GUI_END_SAVE;
	}
	else{
		GUI_BGN_SAVE;
		pPS = new CPythonPropertySheet(Caption, pParent, iSelect);
		GUI_END_SAVE;
	}
	PyWinObject_FreeResourceId(Caption);
	PyCPropertySheet *ret = (PyCPropertySheet *)ui_assoc_object::make( PyCPropertySheet::type, pPS);
	return ret;
}
开发者ID:DavidGuben,项目名称:rcbplayspokemon,代码行数:36,代码来源:win32prop.cpp


示例16: LOG

string16 ResourceBundle::GetLocalizedString(int message_id)
{
    // 如果没有本地纯资源DLL, 返回一个空字符串(比崩溃好).
    if(!locale_resources_data_)
    {
        base::StackTrace().PrintBacktrace(); // See http://crbug.com/21925.
        LOG(WARNING) << "locale resources are not loaded";
        return string16();
    }

    DCHECK(IS_INTRESOURCE(message_id));

    // Get a reference directly to the string resource.
    HINSTANCE hinstance = locale_resources_data_;
    const STRINGRESOURCEIMAGE* image = GetStringResourceImage(hinstance, message_id);
    if(!image)
    {
        base::StackTrace().PrintBacktrace(); // See http://crbug.com/21925.
        NOTREACHED() << "unable to find resource: " << message_id;
        return std::wstring();
    }

    // Copy into a string16 and return.
    return string16(image->achString, image->nLength);
}
开发者ID:hgl888,项目名称:x-framework,代码行数:25,代码来源:resource_bundle.cpp


示例17: GetApplicationIcon

wxIcon GetApplicationIcon()
{
    HMODULE hParentExe = GetModuleHandle(NULL);
    if ( !hParentExe )
        return wxNullIcon;

    LPTSTR iconName = 0;
    EnumResourceNames(hParentExe, RT_GROUP_ICON, GetFirstIconProc, (LONG_PTR)&iconName);

    if ( GetLastError() != ERROR_SUCCESS && GetLastError() != ERROR_RESOURCE_ENUM_USER_STOP )
        return wxNullIcon;

    HANDLE hIcon = LoadImage(hParentExe, iconName, IMAGE_ICON, 48, 48, LR_DEFAULTCOLOR);

    if ( !IS_INTRESOURCE(iconName) )
        free(iconName);

    if ( !hIcon )
        return wxNullIcon;

    wxIcon icon;
    icon.SetHICON(static_cast<WXHICON>(hIcon));
    icon.SetWidth(48);
    icon.SetHeight(48);

    return icon;
}
开发者ID:fengabe,项目名称:winsparkle,代码行数:27,代码来源:ui.cpp


示例18: EnumPickIconResourceProc

BOOL CALLBACK EnumPickIconResourceProc(HMODULE hModule,
    LPCWSTR lpszType,
    LPWSTR lpszName,
    LONG_PTR lParam
)
{
    WCHAR szName[100];
    int index;
    HICON  hIcon;
    PPICK_ICON_CONTEXT pIconContext = (PPICK_ICON_CONTEXT)lParam;

    if (IS_INTRESOURCE(lpszName))
        swprintf(szName, L"%u", lpszName);
    else
        wcscpy(szName, (WCHAR*)lpszName);


    hIcon = LoadIconW(pIconContext->hLibrary, (LPCWSTR)lpszName);
    if (hIcon == NULL)
        return TRUE;

    index = SendMessageW(pIconContext->hDlgCtrl, LB_ADDSTRING, 0, (LPARAM)szName);
    if (index != LB_ERR)
        SendMessageW(pIconContext->hDlgCtrl, LB_SETITEMDATA, index, (LPARAM)hIcon);

    return TRUE;
}
开发者ID:RareHare,项目名称:reactos,代码行数:27,代码来源:dialogs.cpp


示例19: RETURN_TYPE_ERR

// @pymethod |PyCDialogBar|CreateWindow|Creates the window for the <o PyCDialogBar> object.
static PyObject *PyCDialogBar_CreateWindow(PyObject *self, PyObject *args)
{
	TCHAR *szTemplate;
	UINT style, id;
	PyObject *obParent, *obTemplate;
	// @pyparm <o PyCWnd>|parent||The parent window
	// @pyparm <o PyResourceId>|template||Template name or integer resource id
	// @pyparm int|style||The style for the window
	// @pyparm int|id||The ID of the window
    if (!PyArg_ParseTuple(args, "OOii", &obParent, &obTemplate, &style, &id))
		return NULL;

    CDialogBar *pDialog = PyCDialogBar::GetDialogBar(self);
    if (pDialog==NULL) return NULL;
	CWnd *pParent = NULL;
	if (obParent != Py_None) {
		pParent = PyCWnd::GetPythonGenericWnd(obParent, &PyCWnd::type);
		if (pParent==NULL)
			RETURN_TYPE_ERR("The parent window is not a valid PyCWnd");
	}
	if (!PyWinObject_AsResourceId(obTemplate, &szTemplate, FALSE))
		return NULL;
	BOOL rc;
    GUI_BGN_SAVE;
    if (IS_INTRESOURCE(szTemplate))
		rc=pDialog->Create(pParent, MAKEINTRESOURCE(szTemplate), style, id);
	else
        rc=pDialog->Create(pParent, szTemplate, style, id);
    GUI_END_SAVE;
	PyWinObject_FreeResourceId(szTemplate);
	if (!rc)
        RETURN_ERR("CDialogBar::Create failed");
    RETURN_NONE;
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:35,代码来源:win32dlgbar.cpp


示例20: strlenW

/**********************************************************************
 *  find_entry_by_name
 *
 * Find an entry by name in a resource directory
 */
static const IMAGE_RESOURCE_DIRECTORY *find_entry_by_name( const IMAGE_RESOURCE_DIRECTORY *dir,
                                                           LPCWSTR name, const void *root,
                                                           int want_dir )
{
    const IMAGE_RESOURCE_DIRECTORY_ENTRY *entry;
    const IMAGE_RESOURCE_DIR_STRING_U *str;
    int min, max, res, pos, namelen;

    if (IS_INTRESOURCE(name)) return find_entry_by_id( dir, LOWORD(name), root, want_dir );
    entry = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1);
    namelen = strlenW(name);
    min = 0;
    max = dir->NumberOfNamedEntries - 1;
    while (min <= max)
    {
        pos = (min + max) / 2;
        str = (const IMAGE_RESOURCE_DIR_STRING_U *)((const char *)root + entry[pos].u.s.NameOffset);
        res = strncmpW( name, str->NameString, str->Length );
        if (!res && namelen == str->Length)
        {
            if (!entry[pos].u2.s2.DataIsDirectory == !want_dir)
            {
                TRACE("root %p dir %p name %s ret %p\n",
                      root, dir, debugstr_w(name), (const char*)root + entry[pos].u2.s2.OffsetToDirectory);
                return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry[pos].u2.s2.OffsetToDirectory);
            }
            break;
        }
        if (res < 0) max = pos - 1;
        else min = pos + 1;
    }
    TRACE("root %p dir %p name %s not found\n", root, dir, debugstr_w(name) );
    return NULL;
}
开发者ID:AndreRH,项目名称:wine,代码行数:39,代码来源:resource.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ IS_IN_DEV_GROUP函数代码示例发布时间:2022-05-30
下一篇:
C++ IS_INTEGER函数代码示例发布时间: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