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

C++ AfxRegisterWndClass函数代码示例

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

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



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

示例1: AfxRegisterWndClass

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
	cs.cx = 472;
	cs.cy = 460;

	if( !CFrameWnd::PreCreateWindow(cs) )
		return FALSE;
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
	cs.lpszClass = AfxRegisterWndClass(0);
	return TRUE;
}
开发者ID:sqhe,项目名称:Airpollution,代码行数:14,代码来源:MainFrm.cpp


示例2: AfxRegisterWndClass

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
	if( !CFrameWnd::PreCreateWindow(cs) )
		return FALSE;
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	//需要调整此值,使得client大小恰好为1280*720
	cs.cx = 1296;
	cs.cy = 778;
	cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
	cs.lpszClass = AfxRegisterWndClass(0);
	return TRUE;
}
开发者ID:zhangyongproject,项目名称:VC,代码行数:14,代码来源:MainFrm.cpp


示例3: CreateEx

BOOL CSplashScreen::Create(CWnd* pParentWnd /*= nullptr*/)
{
    BOOL bResult = FALSE;
    if (m_ouBitMapImage.LoadBitmap(IDR_BMP_SPLASH_SCREEN) == TRUE)
    {
        BITMAP BitMap;
        m_ouBitMapImage.GetBitmap(&BitMap);

        bResult = CreateEx(0,
                           AfxRegisterWndClass(0, AfxGetApp()->LoadStandardCursor(IDC_ARROW)),
                           nullptr, WS_POPUP | WS_VISIBLE, 0, 0, BitMap.bmWidth, BitMap.bmHeight, pParentWnd->GetSafeHwnd(), nullptr);
    }
    return bResult;
}
开发者ID:BlackVodka,项目名称:busmaster,代码行数:14,代码来源:Splash.cpp


示例4: sprintf

BOOL
CProjectWindow::Create()
{
#ifndef FLOATING_PROJECT_WINDOW
  char szProjectName[512];
  sprintf(szProjectName, "Project [%s]", m_Project->GetGameSubDirectory());

  // create the window
  CMDIChildWnd::Create(
      AfxRegisterWndClass(CS_NOCLOSE, NULL, NULL, AfxGetApp()->LoadIcon(IDI_PROJECT)),
      szProjectName,
      WS_CHILD | WS_VISIBLE | WS_OVERLAPPEDWINDOW);
#endif
  
  // create widgets
  m_TreeControl.Create(
      WS_VISIBLE | WS_CHILD | TVS_SHOWSELALWAYS | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS | TVS_DISABLEDRAGDROP,
      CRect(0, 0, 0, 0),
      this,
      TreeID);
  //m_TreeControl.SetFocus();

  HIMAGELIST image_list = ImageList_Create(16, 16, ILC_COLOR8 | ILC_MASK, 3, 1);
  ImageList_AddIcon(image_list, AfxGetApp()->LoadIcon(IDI_PV_GAME_SETTINGS));
  ImageList_AddIcon(image_list, AfxGetApp()->LoadIcon(IDI_PV_CLOSED_FOLDER));
  ImageList_AddIcon(image_list, AfxGetApp()->LoadIcon(IDI_PV_OPEN_FOLDER));  
  ImageList_AddIcon(image_list, AfxGetApp()->LoadIcon(IDI_UNKNOWN));

  // add filetype icons
  ImageList_AddIcon(image_list, AfxGetApp()->LoadIcon(IDI_MAP));
  ImageList_AddIcon(image_list, AfxGetApp()->LoadIcon(IDI_SPRITESET));
  ImageList_AddIcon(image_list, AfxGetApp()->LoadIcon(IDI_SCRIPT));
  ImageList_AddIcon(image_list, AfxGetApp()->LoadIcon(IDI_SOUND));
  ImageList_AddIcon(image_list, AfxGetApp()->LoadIcon(IDI_FONT));
  ImageList_AddIcon(image_list, AfxGetApp()->LoadIcon(IDI_WINDOWSTYLE));
  ImageList_AddIcon(image_list, AfxGetApp()->LoadIcon(IDI_IMAGE));
  ImageList_AddIcon(image_list, AfxGetApp()->LoadIcon(IDI_ANIMATION));
  ImageList_AddIcon(image_list, AfxGetApp()->LoadIcon(IDI_TILESET));
  
  m_TreeControl.SetImageList(CImageList::FromHandle(image_list), TVSIL_NORMAL);

  // make sure they are in the right place
  RECT rect;
  GetClientRect(&rect);
  OnSize(0, rect.right, rect.bottom);

  Update();
  DragAcceptFiles();
  return TRUE;
}
开发者ID:FlyingJester,项目名称:sphere,代码行数:50,代码来源:ProjectWindow.cpp


示例5: LoadCursor

BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs)
{
    if (!CWnd::PreCreateWindow(cs))
        return FALSE;

    m_hCursor = LoadCursor(NULL, IDC_ARROW);
    cs.dwExStyle |= WS_EX_CLIENTEDGE;
    cs.style &= ~WS_BORDER;
    cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS,
        m_hCursor, HBRUSH(COLOR_WINDOW+1), NULL);
    m_hCursor = LoadCursor(NULL, IDC_ARROW);

    return TRUE;
}
开发者ID:Emiyasviel,项目名称:Arianrhod,代码行数:14,代码来源:ChildView.cpp


示例6: AfxRegisterWndClass

BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs) 
{
	if (!CWnd::PreCreateWindow(cs))
		return FALSE;

	cs.dwExStyle |= WS_EX_CLIENTEDGE;
	cs.style &= ~WS_BORDER;
	cs.cx = 256;
	cs.cy = 240;
	cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS, 
		::LoadCursor(NULL, IDC_ARROW), reinterpret_cast<HBRUSH>(COLOR_WINDOW+1), NULL);

	return TRUE;
}
开发者ID:minnowc,项目名称:nes,代码行数:14,代码来源:ChildView.cpp


示例7: CreateEx

/////////////////////////////////////////////////////////////////////////////
// COpenScreenWnd message handlers
void COpenScreenWnd::CreatScreenWnd()
{
	//建立大小与位图大小相同的窗口
	CreateEx(0,AfxRegisterWndClass(0,AfxGetApp()->LoadStandardCursor(IDC_ARROW)),
		"ImageScreen",
		WS_POPUP,
		0,
		0,
		m_bm.bmWidth,
		m_bm.bmHeight,
		NULL,
		NULL,
		NULL );
}
开发者ID:ustcdane,项目名称:Npcas,代码行数:16,代码来源:OpenScreenWnd.cpp


示例8: AfxRegisterWndClass

CPlVodWnd::CPlVodWnd(HWND hParent, UINT nID)
//: CPlWnd(hParent, nID)
{
	m_hParent = hParent;
	LPCTSTR lpWndClass = AfxRegisterWndClass(CS_DBLCLKS, 
											NULL,
											(HBRUSH)GetStockObject(BLACK_BRUSH),
											0);
	CString wndName;
	wndName.Format("Vod Player Window:%d",nID);
	CreateEx(NULL,lpWndClass,wndName,
		WS_CHILD | WS_VISIBLE | WS_BORDER | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 
		0,0,0,0, hParent ,(HMENU)nID);	
}
开发者ID:dulton,项目名称:jorhy-prj,代码行数:14,代码来源:pl_vod_wnd.cpp


示例9: rc

BOOL CDownloads_Progress::Create(CWnd *pParent)
{
	CRect rc (0, 0, 50, 50);

	if (FALSE == CWnd::Create (AfxRegisterWndClass (0, LoadCursor (NULL, IDC_ARROW), (HBRUSH) (COLOR_WINDOW+1), NULL) ,
			NULL, WS_CHILD, rc, pParent, 0x121))
		return FALSE;

	m_brProgress.CreateSolidBrush (RGB (255, 255, 255));
	m_brDone.CreateSolidBrush (RGB (158, 208, 235));
	m_penQ.CreatePen (PS_SOLID, 1, RGB (0, 115, 170));

	return TRUE;
}
开发者ID:andyTsing,项目名称:freedownload,代码行数:14,代码来源:Downloads_Progress.cpp


示例10: AfxRegisterWndClass

// PreCreateWindow 先于 CWinApp::Run 执行
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
    if (!CFrameWnd::PreCreateWindow(cs))
        return FALSE;

    // NOTE: 不要在这里设置窗口大小 (cs.cx, cs,cy), 因为将根据视频模式重新设置窗口大小

    cs.style &= ~(WS_THICKFRAME | WS_MAXIMIZEBOX);
    cs.lpszClass = AfxRegisterWndClass(0, ::LoadCursor(NULL, IDC_ARROW), NULL, AfxGetApp()->LoadIcon(IDR_MAINFRAME));

    m_Style = cs.style;
    m_Menu = cs.hMenu;
    return TRUE;
}
开发者ID:7zhang,项目名称:studies,代码行数:15,代码来源:MainFrame.cpp


示例11: ASSERT

BOOL COptionTreeColorPopUp::Create(CPoint pPoint, COLORREF crColor, CWnd* pParentWnd, LPCTSTR szDefaultText, LPCTSTR szCustomText)
{
    // Declare variables
	CString strClassName;
	
	// Verify window
	ASSERT(pParentWnd && ::IsWindow(pParentWnd->GetSafeHwnd()));
  
    // Se variables
	m_wndParent = pParentWnd;
    m_crColor = m_crInitialColor = crColor;

    // Get the class name and create the window
    strClassName = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW, 0, (HBRUSH) (COLOR_BTNFACE+1), 0);

	// Create window
    if (!CWnd::CreateEx(0, strClassName, _T(""), WS_POPUP | WS_VISIBLE, pPoint.x, pPoint.y, 100, 100, pParentWnd->GetSafeHwnd(), 0, NULL))
	{
        return FALSE;
	}

	// Show window
	ShowWindow(SW_SHOWNA);

    // Store the Custom text
    if (szCustomText != NULL) 
	{
        m_strCustomText = szCustomText;
	}

    // Store the Default Area text
    if (szDefaultText != NULL) 
	{
        m_strDefaultText = szDefaultText;
	}
        
    // Set the window size
    SetWindowSize();

    // Create the tooltips
    CreateToolTips();

    // Find which cell (if any) corresponds to the initial color
    FindCellFromColor(crColor);

    // Capture all mouse events for the life of this window
    SetCapture();

    return TRUE;
}
开发者ID:gaopan461,项目名称:acoral,代码行数:50,代码来源:OptionTreeColorPopUp.cpp


示例12: AfxRegisterWndClass

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
	if( !CFrameWnd::PreCreateWindow(cs) )
		return FALSE;
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	cs.style = WS_OVERLAPPED | WS_CAPTION | FWS_ADDTOTITLE
		 | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;

	cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
	cs.lpszClass = AfxRegisterWndClass(0);
	return TRUE;
}
开发者ID:12019,项目名称:system-config,代码行数:14,代码来源:MainFrm.cpp


示例13: AfxRegisterWndClass

BOOL
CLayerView::Create(ILayerViewHandler* handler, CWnd* parent, sMap* map)
{
  m_Handler = handler;
  m_Map = map;
  return CWnd::Create(
    AfxRegisterWndClass(0, LoadCursor(NULL, IDC_ARROW), NULL, LoadIcon(NULL, IDI_APPLICATION)),
    "LayerView",
    WS_CHILD | WS_VISIBLE | WS_VSCROLL,
    CRect(0, 0, 0, 0),
    parent,
    0
  );
}
开发者ID:FlyingJester,项目名称:sphere,代码行数:14,代码来源:LayerView.cpp


示例14: AfxRegisterWndClass

BOOL CMeterCtrl::Create(LPCTSTR lpszWindowName, DWORD dwStyle,
		const RECT& rect, CWnd* pParentWnd, HMENU nID)
{
	// TODO: 在此添加专用代码和/或调用基类
	static CString className = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW);

	return CWnd::CreateEx(WS_EX_STATICEDGE, //WS_EX_CLIENTEDGE | WS_EX_STATICEDGE,
		className, lpszWindowName, dwStyle,
		rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top,
		pParentWnd->GetSafeHwnd(), (HMENU) nID);

//	return CWnd::Create(lpszClassName, lpszWindowName, dwStyle,
//			rect, pParentWnd, nID, pContext);
}
开发者ID:1514louluo,项目名称:acl,代码行数:14,代码来源:MeterCtrl.cpp


示例15: RUNTIME_CLASS

int CDlgResLib::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDialogEx::OnCreate(lpCreateStruct) == -1)
		return -1;

	// Initialize a context for the view. CMyTreeView is my view and 
	// is defined as :  class CMyTreeView : public CTreeView. 
	CCreateContext ccc; 
	ccc.m_pNewViewClass      = RUNTIME_CLASS(CMineSplitterView); 
	ccc.m_pCurrentDoc           = NULL; 
	ccc.m_pNewDocTemplate = NULL; 
	ccc.m_pLastView              = NULL; 
	ccc.m_pCurrentFrame       = NULL; 

	// Because the CFrameWnd needs a window class, we will create 
	// a new one. I just copied the sample from MSDN Help. 
	// When using it in your project, you may keep CS_VREDRAW and 
	// CS_HREDRAW and then throw the other three parameters. 
	CString strMyClass = AfxRegisterWndClass(CS_VREDRAW | 
		CS_HREDRAW, 
		::LoadCursor(NULL, IDC_ARROW), 
		(HBRUSH) ::GetStockObject(WHITE_BRUSH), 
		::LoadIcon(NULL, IDI_APPLICATION)); 

	// Create the frame window with "this" as the parent 
	m_pFrameWnd = new CFrameWnd(); 
	m_pFrameWnd->Create(strMyClass,"", WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 
		CRect(0,0,1,1), this); 
	m_pFrameWnd->ShowWindow(SW_SHOW); 
	m_pFrameWnd->MoveWindow(0,0,300,300); 

	m_wndSplitter.CreateStatic (m_pFrameWnd, 1, 2
		, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN
		, ID_JIANMO_COMPONENT_SPLITTER);

	theApp.m_nSpliterViewFlag = theApp.SPLVF_COMPONENT_TREE;
	m_wndSplitter.CreateView (0, 0, RUNTIME_CLASS (CMineSplitterView)
		, CSize (100, 100), &ccc);

	theApp.m_nSpliterViewFlag = theApp.SPLVF_COMPONENT_LIST;
	m_wndSplitter.CreateView (0, 1, RUNTIME_CLASS (CMineSplitterView), 
		CSize (200, 100), &ccc);

	m_wndSplitter.GetPane(0, 0)->ModifyStyle(NULL, WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
	m_wndSplitter.GetPane(0, 1)->ModifyStyle(NULL, WS_CLIPSIBLINGS | WS_CLIPCHILDREN);

	theApp.m_nSpliterViewFlag = -1;
	return 0;
}
开发者ID:cugxiangzhenwei,项目名称:MySrcCode,代码行数:49,代码来源:DlgResLib.cpp


示例16: ASSERT_VALID

int CKSFileDialog::DoModal()
{
	ASSERT_VALID(this);
	DWORD nOffset = lstrlen(m_ofn.lpstrFile)+1;
	memset(m_ofn.lpstrFile+nOffset, 0, (m_ofn.nMaxFile-nOffset)*sizeof(TCHAR));

	HWND hWndFocus = ::GetFocus();
	BOOL bEnableParent = FALSE;
	//m_ofn.hwndOwner = PreModal();
	
	CWnd dummy;
	dummy.CreateEx(NULL,AfxRegisterWndClass(0, AfxGetApp()->LoadStandardCursor(IDC_ARROW)),NULL,NULL,CRect(0,0,0,0),NULL,NULL);
	dummy.CenterWindow();
	CRect rect;
	dummy.GetWindowRect(rect);
	dummy.SetWindowPos(NULL, rect.left-230, rect.top-180, -1, -1,
		SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);	dummy.ShowWindow(SW_HIDE);
	m_ofn.hwndOwner=dummy.GetSafeHwnd();
	if (m_ofn.hwndOwner==NULL) m_ofn.hwndOwner=PreModal();
	if (m_ofn.hwndOwner != NULL && ::IsWindowEnabled(m_ofn.hwndOwner))
	{
		bEnableParent = TRUE;
		::EnableWindow(m_ofn.hwndOwner, FALSE);
	}

	_AFX_THREAD_STATE* pThreadState = AfxGetThreadState();
	ASSERT(pThreadState->m_pAlternateWndInit == NULL);

	m_ofn.lpfnHook = NULL;
	m_ofn.lpTemplateName = NULL;
	int nResult;
	if (m_bOpenFileDialog)
		nResult = ::GetOpenFileName(&m_ofn);
	else
		nResult = ::GetSaveFileName(&m_ofn);

	if (nResult)
		ASSERT(pThreadState->m_pAlternateWndInit == NULL);
	pThreadState->m_pAlternateWndInit = NULL;

	// WINBUG: Second part of special case for file open/save dialog.
	if (bEnableParent)
		::EnableWindow(m_ofn.hwndOwner, TRUE);
	if (::IsWindow(hWndFocus))
		::SetFocus(hWndFocus);

	PostModal();
	return nResult ? nResult : IDCANCEL;
}
开发者ID:amikey,项目名称:tradingstrategyking,代码行数:49,代码来源:XFDialog.cpp


示例17: AfxRegisterWndClass

BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs) 
{
	//Trace("CChildView::PreCreate - Initializing");
	if (!CWnd::PreCreateWindow(cs))
		return FALSE;

	cs.dwExStyle |= WS_EX_CLIENTEDGE;
	cs.style &= ~WS_BORDER;
    cs.style |= WS_CLIPCHILDREN | WS_CLIPSIBLINGS;//for OpenGL
	cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS, 
		::LoadCursor(NULL, IDC_ARROW), HBRUSH(COLOR_WINDOW+1), NULL);

	//Trace("CChildView::PreCreate - Done");
	return TRUE;
}
开发者ID:machinaut,项目名称:xflr5,代码行数:15,代码来源:ChildView.cpp


示例18: AfxRegisterWndClass

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
	if( !CFrameWndEx::PreCreateWindow(cs) )
		return FALSE;
	// TODO: 在此处通过修改
	//  CREATESTRUCT cs 来修改窗口类或样式

	cs.style = WS_OVERLAPPED | WS_CAPTION | FWS_ADDTOTITLE
		 | WS_THICKFRAME | WS_MINIMIZEBOX /*| WS_MAXIMIZEBOX | WS_MAXIMIZE*/ | WS_SYSMENU;

	cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
	cs.lpszClass = AfxRegisterWndClass(0);

	return TRUE;
}
开发者ID:KnicknackCadillac,项目名称:AgoraDemo,代码行数:15,代码来源:MainFrm.cpp


示例19: AfxRegisterWndClass

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
	if( !CFrameWnd::PreCreateWindow(cs) )
		return FALSE;
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	cs.cx = MainWindowWidth;
	cs.cy = MainWindowHeight;
	cs.style &= ~WS_MAXIMIZEBOX;
	cs.style &= ~WS_SIZEBOX;
	cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
	cs.lpszClass = AfxRegisterWndClass(0);
	return TRUE;
}
开发者ID:Isuroku,项目名称:QuadTreeDemo,代码行数:15,代码来源:MainFrm.cpp


示例20: LoadCursor

BOOL CKaiView::PreCreateWindow(CREATESTRUCT& cs)
{
    // TODO: Modify the Window class or styles here by modifying
    //  the CREATESTRUCT cs
    HCURSOR h_cursor;
    h_cursor = LoadCursor (NULL, IDC_IBEAM);
  
    cs.lpszClass = AfxRegisterWndClass (CS_HREDRAW | CS_VREDRAW |
                                            CS_BYTEALIGNWINDOW | CS_DBLCLKS,
                                        h_cursor,
                                        NULL,  // no brush
                                        NULL);

    return CView::PreCreateWindow (cs);
}
开发者ID:kbogatyrev,项目名称:Kai,代码行数:15,代码来源:KaiView.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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