当前位置: 首页>>代码示例>>C++>>正文


C++ IS_INTRESOURCE函数代码示例

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


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


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