本文整理汇总了C++中AfxRegisterWndClass函数的典型用法代码示例。如果您正苦于以下问题:C++ AfxRegisterWndClass函数的具体用法?C++ AfxRegisterWndClass怎么用?C++ AfxRegisterWndClass使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AfxRegisterWndClass函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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 );
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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
);
}
示例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);
}
示例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;
}