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

C++ AfxRegisterClass函数代码示例

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

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



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

示例1: AfxGetInstanceHandle

CTitleTip::CTitleTip()
{
	// Register the window class if it has not already been registered.
	WNDCLASS wndcls;
	HINSTANCE hInst = AfxGetInstanceHandle();
	if(!(::GetClassInfo(hInst, TITLETIP_CLASSNAME, &wndcls)))
	{
		// otherwise we need to register a new class
		wndcls.style			= CS_SAVEBITS;
		wndcls.lpfnWndProc		= ::DefWindowProc;
		wndcls.cbClsExtra		= wndcls.cbWndExtra = 0;
		wndcls.hInstance		= hInst;
		wndcls.hIcon			= NULL;
		wndcls.hCursor			= LoadCursor( hInst, IDC_ARROW );
		wndcls.hbrBackground	= (HBRUSH)(COLOR_INFOBK +1);
		wndcls.lpszMenuName		= NULL;
		wndcls.lpszClassName	= TITLETIP_CLASSNAME;

		if (!AfxRegisterClass(&wndcls))
			AfxThrowResourceException();
	}

    m_dwLastLButtonDown = ULONG_MAX;
    m_dwDblClickMsecs   = GetDoubleClickTime();
    m_bCreated          = FALSE;
    m_pParentWnd        = NULL;
}
开发者ID:saladyears,项目名称:Sea3D,代码行数:27,代码来源:TitleTip.cpp


示例2: TraceLineI

/////////////////////////////////////////////////////////////////////////////
// ZTitleTip
//
ZTitleTip::ZTitleTip( zLONG lHoverDelay )
{
#ifdef DEBUG_ALL
   TraceLineI( "ZTitleTip::ctor Delay: ", lHoverDelay );
#endif

   // Register the window class if it has not already been registered.
   WNDCLASS wndcls;
   HINSTANCE hInst = AfxGetInstanceHandle( );

   if ( ::GetClassInfo( hInst, ZTITLETIP_CLASSNAME, &wndcls ) == 0 )
   {
      // Otherwise we need to register a new class.
      wndcls.style         = CS_SAVEBITS;
      wndcls.lpfnWndProc   = ::DefWindowProc;
      wndcls.cbClsExtra    = wndcls.cbWndExtra = 0;
      wndcls.hInstance     = hInst;
      wndcls.hIcon         = 0;
      wndcls.hCursor       = LoadCursor( hInst, IDC_ARROW );
      wndcls.hbrBackground = (HBRUSH)(COLOR_INFOBK + 1);
      wndcls.lpszMenuName  = 0;
      wndcls.lpszClassName = ZTITLETIP_CLASSNAME;
      if ( AfxRegisterClass( &wndcls ) == 0 )
         AfxThrowResourceException( );
   }

   m_dwLastLButtonDown  = ULONG_MAX;
   m_ulDblClickInterval = GetDoubleClickTime( );
   m_bCreated           = FALSE;
   m_pParentWnd         = 0;
   m_lHoverDelay        = lHoverDelay;
}
开发者ID:DeegC,项目名称:ZeidonTools,代码行数:35,代码来源:ZdCtl.cpp


示例3: ASSERT_VALID

BOOL CToolTipWnd::Create(CWnd *pParentWnd)
{
	ASSERT_VALID(pParentWnd);

	WNDCLASS wndcls;
	HINSTANCE hInst = AfxGetInstanceHandle();
	if(!(::GetClassInfo(hInst, m_szClassName, &wndcls)))
	{
		// otherwise we need to register a new class
		wndcls.style			= CS_SAVEBITS;
		wndcls.lpfnWndProc		= ::DefWindowProc;
		wndcls.cbClsExtra		= wndcls.cbWndExtra = 0;
		wndcls.hInstance		= hInst;
		wndcls.hIcon			= NULL;
		wndcls.hCursor			= ::LoadCursor(NULL, IDC_ARROW);
		wndcls.hbrBackground	= NULL;
		wndcls.lpszMenuName		= NULL;
		wndcls.lpszClassName	= m_szClassName;

		if(!AfxRegisterClass(&wndcls))
		{
			AfxThrowResourceException();
		}
	}

	DWORD dwStyle = WS_POPUP; 
	DWORD dwExStyle = WS_EX_TOOLWINDOW;// | WS_EX_TOPMOST;

	if (!CreateEx(dwExStyle, m_szClassName, NULL, dwStyle, 0, 0, 0, 0, pParentWnd->GetSafeHwnd(), NULL, NULL))
	{
		return FALSE;
	}

	return TRUE;
}
开发者ID:bluewx,项目名称:TabSiPlus,代码行数:35,代码来源:ToolTipWnd.cpp


示例4: AfxGetResourceHandle

BOOL CFilePreviewDlgArea::RegisterWindowClass()
{
    WNDCLASS wndcls;
    //HINSTANCE hInst = AfxGetInstanceHandle();
   HINSTANCE hInst = AfxGetResourceHandle();

    if (!(::GetClassInfo(hInst, _T("FilePreviewDlgArea"), &wndcls)))
    {
        // otherwise we need to register a new class
        wndcls.style            = CS_OWNDC | CS_SAVEBITS | CS_HREDRAW | CS_VREDRAW ;
        wndcls.lpfnWndProc      = ::DefWindowProc;
        wndcls.cbClsExtra       = wndcls.cbWndExtra = 0;
        wndcls.hInstance        = hInst;
        wndcls.hIcon            = NULL;
        wndcls.hCursor          = AfxGetApp()->LoadCursor(IDC_ARROW);
        wndcls.hbrBackground    = NULL;
        wndcls.lpszMenuName     = NULL;
        wndcls.lpszClassName    = _T("FilePreviewDlgArea");

        if (!AfxRegisterClass(&wndcls))
        {
            AfxThrowResourceException();
            return FALSE;
        }
    }

    return TRUE;
}
开发者ID:uesoft,项目名称:AutoPFA,代码行数:28,代码来源:FilePreviewDlgArea.cpp


示例5: TraceLineS

/////////////////////////////////////////////////////////////////////////////
// ZListTip
//
ZListTip::ZListTip( zLONG lHoverDelay )
{
#ifdef DEBUG_ALL
   TraceLineS( "ZListTip::ctor", "====================>>>>" );
#endif
   // Register the window class if it has not already been registered.
   WNDCLASS wndcls;
   HINSTANCE hInst = AfxGetInstanceHandle( );

   if ( ::GetClassInfo( hInst, "ZeidonListTip", &wndcls ) == 0 )
   {
      // Otherwise we need to register a new class.
      wndcls.style         = CS_SAVEBITS;
      wndcls.lpfnWndProc   = ::DefWindowProc;
      wndcls.cbClsExtra    = wndcls.cbWndExtra = 0;
      wndcls.hInstance     = hInst;
      wndcls.hIcon         = 0;
      wndcls.hCursor       = LoadCursor( hInst, IDC_ARROW );
      wndcls.hbrBackground = (HBRUSH)(COLOR_INFOBK + 1);
      wndcls.lpszMenuName  = 0;
      wndcls.lpszClassName = "ZeidonListTip";
      if ( AfxRegisterClass( &wndcls ) == 0 )
         AfxThrowResourceException( );
   }

   m_ulDblClickInterval = 0;
   m_ptStart.x = m_ptStart.y = 0;
   m_lHoverDelay = lHoverDelay;
}
开发者ID:DeegC,项目名称:ZeidonTools,代码行数:32,代码来源:ZdCtl.cpp


示例6: AfxGetInstanceHandle

BOOL CLabKnob::RegisterWindowClass()
{
   WNDCLASS wndcls;
   HINSTANCE hInst = AfxGetInstanceHandle();
   HBRUSH background;
   background = ::GetSysColorBrush(COLOR_BTNFACE);

   if (!(::GetClassInfo(hInst, "MFCLabKnob", &wndcls)))
   {
      // otherwise we need to register a new class
      wndcls.style            = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
      wndcls.lpfnWndProc      = ::DefWindowProc;
      wndcls.cbClsExtra       = wndcls.cbWndExtra = 0;
      wndcls.hInstance        = hInst;
      wndcls.hIcon            = NULL;
      wndcls.hCursor          = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
      wndcls.hbrBackground    = background;
      wndcls.lpszMenuName     = NULL;
      wndcls.lpszClassName    = "MFCLabKnob";

      if (!AfxRegisterClass(&wndcls))
      {
         AfxThrowResourceException();
         return FALSE;
      }
   }

   return TRUE;
}
开发者ID:fville,项目名称:MFCLabWidget,代码行数:29,代码来源:LabKnob.cpp


示例7: AfxGetInstanceHandle

BOOL CTimeViewer::RegisterWindowClass()
{
	WNDCLASS wndcls;
	HINSTANCE hInst = AfxGetInstanceHandle();

	if (!(::GetClassInfo(hInst, TIMEVIEWER_CLASSNAME, &wndcls)))
	{
		// otherwise we need to register a new class

		wndcls.style            = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
		wndcls.lpfnWndProc      = ::DefWindowProc;
		wndcls.cbClsExtra       = wndcls.cbWndExtra = 0;
		wndcls.hInstance        = hInst;
		wndcls.hIcon            = NULL;
		wndcls.hCursor          = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
		wndcls.hbrBackground    = (HBRUSH) (COLOR_3DFACE + 1);
		wndcls.lpszMenuName     = NULL;
		wndcls.lpszClassName    = TIMEVIEWER_CLASSNAME;

		if (!AfxRegisterClass(&wndcls))
		{
			AfxThrowResourceException();
			return FALSE;
		}
	}

	return TRUE;
}
开发者ID:yongxiu,项目名称:sudoku,代码行数:28,代码来源:TimeViewer.cpp


示例8: AfxGetInstanceHandle

BOOL CAdvComboBox::RegisterWindowClass()
{
	WNDCLASS wndcls;
	HINSTANCE hInst;
	hInst = AfxGetInstanceHandle();

	ASSERT( hInst != 0 );

    if( !(::GetClassInfo(hInst, ADVCOMBOBOXCTRL_CLASSNAME, &wndcls)) )
    {
        wndcls.style            = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
        wndcls.lpfnWndProc      = ::DefWindowProc;
        wndcls.cbClsExtra       = 0;
		wndcls.cbWndExtra		= 0;
        wndcls.hInstance        = hInst;
        wndcls.hIcon            = NULL;
        wndcls.hCursor          = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
        wndcls.hbrBackground    = (HBRUSH) (COLOR_WINDOW);
        wndcls.lpszMenuName     = NULL;
        wndcls.lpszClassName    = ADVCOMBOBOXCTRL_CLASSNAME;

        if( !AfxRegisterClass(&wndcls) )
        {
            AfxThrowResourceException();
            return FALSE;
        }
    }
    return TRUE;
}
开发者ID:yunhaisoft,项目名称:aoctm,代码行数:29,代码来源:AdvComboBox.cpp


示例9: AfxGetInstanceHandle

CTitleTip::CTitleTip()
{
	// Register the window class if it has not already been registered.
	WNDCLASS wndcls;
	HINSTANCE hInst = AfxGetInstanceHandle();
	if(!(::GetClassInfo(hInst, TITLETIP_CLASSNAME, &wndcls)))
	{
		// otherwise we need to register a new class
		wndcls.style			= CS_SAVEBITS;
		wndcls.lpfnWndProc		= ::DefWindowProc;
		wndcls.cbClsExtra		= wndcls.cbWndExtra = 0;
		wndcls.hInstance		= hInst;
		wndcls.hIcon			= NULL;
		wndcls.hCursor			= LoadCursor( hInst, IDC_ARROW );
		wndcls.hbrBackground	= NULL;//(HBRUSH)(COLOR_INFOBK + 1); 
		wndcls.lpszMenuName		= NULL;
		wndcls.lpszClassName	= TITLETIP_CLASSNAME;

		if (!AfxRegisterClass(&wndcls))
			AfxThrowResourceException();
	}

    m_bHasBorder        = true;
    m_bIsTransparent    = false;
}
开发者ID:modmanmatt,项目名称:blackcats-mirc,代码行数:25,代码来源:TitleTip.cpp


示例10: AfxGetInstanceHandle

BOOL CCamWnd::PreCreateWindow(CREATESTRUCT& cs) 
{
  WNDCLASS wc;
  HINSTANCE hInstance = AfxGetInstanceHandle();
  if (::GetClassInfo(hInstance, CAMERA_WINDOW_CLASS, &wc) == FALSE)
  {
    // Register a new class
  	memset (&wc, 0, sizeof(wc));
    wc.style         = CS_NOCLOSE | CS_OWNDC;
    wc.lpszClassName = CAMERA_WINDOW_CLASS;
    wc.hCursor       = LoadCursor (NULL,IDC_ARROW);
    wc.lpfnWndProc   = CamWndProc;
    if (AfxRegisterClass(&wc) == FALSE)
      Error ("CCamWnd RegisterClass: failed");
  }

  cs.lpszClass = CAMERA_WINDOW_CLASS;
  cs.lpszName = "CAM";
  if (cs.style != QE3_CHILDSTYLE)
    cs.style = QE3_SPLITTER_STYLE;

	BOOL bResult = CWnd::PreCreateWindow(cs);

  // See if the class already exists and if not then we need
  // to register our new window class.
  return bResult;
	
}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:28,代码来源:CamWnd.cpp


示例11: AfxGetInstanceHandle

BOOL CZegoAVView::RegisterWndClass(void)
{
	WNDCLASS windowclass;
	HINSTANCE hInst = AfxGetInstanceHandle();

	if (!(::GetClassInfo(hInst, L"ZegoAVView", &windowclass)))
	{
		windowclass.style = CS_DBLCLKS;
		windowclass.lpfnWndProc = ::DefWindowProc;
		windowclass.cbClsExtra = windowclass.cbWndExtra = 0;
		windowclass.hInstance = hInst;
		windowclass.hIcon = NULL;
		windowclass.hCursor = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
		windowclass.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH);
		windowclass.lpszMenuName = NULL;
		windowclass.lpszClassName = L"ZegoAVView";

		if (!AfxRegisterClass(&windowclass))
		{
			AfxThrowResourceException();
			return FALSE;
		}
	}

	return TRUE;
}
开发者ID:zegodev,项目名称:ZegoLiveDemo,代码行数:26,代码来源:ZegoAVView.cpp


示例12: Input

/******************************************************************************
Function Name   : RegisterWindowClass
Input(s)        : -
Output          : BOOL
Functionality   : Register the Indicator window as a custom Window control.
Member of       : CWaitIndicator
Friend of       : -
Author(s)       : Venkatanarayana Makam
Date Created    :
Modifications   :
******************************************************************************/
BOOL CWaitIndicator::RegisterWindowClass(void)
{
    WNDCLASS wndcls;
    HINSTANCE hInst = AfxGetInstanceHandle();

    if (!(::GetClassInfo(hInst, INDICATOR_CLASSNAME, &wndcls)))
    {
        // otherwise we need to register a new class
        wndcls.style            = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW ;
        wndcls.lpfnWndProc      = ::DefWindowProc;
        wndcls.cbClsExtra       = wndcls.cbWndExtra = 0;
        wndcls.hInstance        = hInst;
        wndcls.hIcon            = nullptr;
        wndcls.hCursor          = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
        wndcls.hbrBackground    = (HBRUSH) (COLOR_ACTIVEBORDER + 1);
        wndcls.lpszMenuName     = nullptr;
        wndcls.lpszClassName    = INDICATOR_CLASSNAME;

        if (!AfxRegisterClass(&wndcls))
        {
            AfxThrowResourceException();
            return FALSE;
        }
    }

    return TRUE;
}
开发者ID:BlackVodka,项目名称:busmaster,代码行数:38,代码来源:WaitIndicator.cpp


示例13: m_CurrentSelectedRow

// CCustomListScrollableArea constructor
CCustomListScrollableArea::CCustomListScrollableArea(CCustomList* parent) :
    m_CurrentSelectedRow(-1),
    m_RowCount(0),
    m_Parent(parent),
    m_ListRowsArray(NULL),
    m_ScrollPos(0)
{
    // create font for text items
    LOGFONT lf;                        // Used to create the CFont.
    memset(&lf, 0, sizeof(LOGFONT));   // Clear out structure.
    lf.lfHeight = CCustomList::FONTHEIGHT;
    strcpy(lf.lfFaceName, "Microsoft Sans Serif");    //    with face name "Arial".
    m_Font.CreateFontIndirect(&lf);    // Create the font.

    // create the row objects
    m_ListRowsArray = new CCustomListRowWnd*[CCustomList::MAXROWS];
    for(INT32 i=0; i<CCustomList::MAXROWS; i++)
    {
        m_ListRowsArray[i] = NULL;
    }

    //	set up window class for the rows
    WNDCLASS NewWindowClass;
    memset(&NewWindowClass, 0, sizeof(WNDCLASS));
    NewWindowClass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS ;
    NewWindowClass.lpfnWndProc = ::DefWindowProc;
    NewWindowClass.hInstance = AfxGetInstanceHandle();
    NewWindowClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); ;//(HBRUSH) ((COLOR_BTNFACE));
    NewWindowClass.lpszMenuName = NULL;
    NewWindowClass.lpszClassName = _T("RowClass");
    AfxRegisterClass(&NewWindowClass);
}
开发者ID:vata,项目名称:xarino,代码行数:33,代码来源:customlist.cpp


示例14: AfxGetInstanceHandle

/*

* Method preamble ************************************************************
*
* CLASS:            TFXDataTip
* NAME:             RegisterWnd
*
* DESCRIPTION:      This method registers the window class used by the DataTip
*                   windows. This must be called after the class background
*                   brush has been constructed.
*
* PARAMETERS:       none
*
* RETURN TYPE:      void
*
******************************************************************************
*                                  REVISION HISTORY                                                               
*
******************************************************************************
*/
void TFXDataTip::RegisterWnd( )
{
    // check for prior registration
    if (_registered) return;

    // initialise the basic information before registration
    HINSTANCE hInst = AfxGetInstanceHandle( );

    // initialise the window class information
	WNDCLASS wndcls;
	wndcls.style         = CS_SAVEBITS | CS_DBLCLKS;
    wndcls.lpfnWndProc   = ::DefWindowProc;
	wndcls.cbClsExtra    = 0;
    wndcls.cbWndExtra    = 0;
	wndcls.hInstance     = hInst;
	wndcls.hIcon         = NULL;
    wndcls.hCursor       = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
	wndcls.hbrBackground = *_brush;
	wndcls.lpszMenuName  = NULL;
	wndcls.lpszClassName = _T("TFXDataTip");

    // register the window class
    if (!AfxRegisterClass(&wndcls))
		AfxThrowResourceException();

    _registered = TRUE;
}
开发者ID:SnipeDragon,项目名称:gamecq,代码行数:47,代码来源:Tfxdatatip.cpp


示例15: lstrcpyn

//--------------------------------------------------------------------------------------------------------------//
BOOL CFrmMain::PreCreateWindow(CREATESTRUCT& cs)
{
	if (FALSE == CFrameWnd::PreCreateWindow(cs)) return FALSE;

	cs.dwExStyle &= ~WS_EX_CLIENTEDGE;

	lstrcpyn(AfxGetThreadState()->m_szTempClassName, c_szSingleInstanceId, 
		sizeof(AfxGetThreadState()->m_szTempClassName) / sizeof(TCHAR));

	cs.lpszClass = AfxGetThreadState()->m_szTempClassName;
	
	WNDCLASS wndcls = {0};
	HINSTANCE hInst = NULL;
	hInst = AfxGetInstanceHandle();
	if (FALSE == ::GetClassInfo(hInst, cs.lpszClass, &wndcls))
	{
		wndcls.style = 0;
		wndcls.lpfnWndProc = ::DefWindowProc;
		wndcls.cbClsExtra = wndcls.cbWndExtra = 0;
		wndcls.hInstance = hInst;
		wndcls.hIcon = NULL;
		wndcls.hCursor = NULL;
		wndcls.hbrBackground = NULL;
		wndcls.lpszMenuName = NULL;
		wndcls.lpszClassName = cs.lpszClass;
		if (!AfxRegisterClass(&wndcls)) AfxThrowResourceException();	
	}
	else
	{
		ASSERT(wndcls.style == 0);
		return TRUE;
	}
	
	return TRUE;
}
开发者ID:AlexS2172,项目名称:IVRMstandard,代码行数:36,代码来源:FrmMain.cpp


示例16: AfxGetInstanceHandle

CFHDragWnd::CFHDragWnd()
{
	// Register the window class if it has not already been registered.
	WNDCLASS wndclass;
	HINSTANCE hInst = AfxGetInstanceHandle();

	if(!(::GetClassInfo(hInst, FHDRAGWND_CLASSNAME, &wndclass)))
	{
		// otherwise we need to register a new class
		wndclass.style = CS_SAVEBITS ;
		wndclass.lpfnWndProc = ::DefWindowProc;
		wndclass.cbClsExtra = wndclass.cbWndExtra = 0;
		wndclass.hInstance = hInst;
		wndclass.hIcon = NULL;
		wndclass.hCursor = LoadCursor( hInst, IDC_ARROW);
		wndclass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); 
		wndclass.lpszMenuName = NULL;
		wndclass.lpszClassName = FHDRAGWND_CLASSNAME;
		if (!AfxRegisterClass(&wndclass))
			AfxThrowResourceException();
	}

	m_pFlatHeaderCtrl = NULL;
	m_iItem = -1;
	m_lphdiItem = NULL;
}
开发者ID:GFFavourite,项目名称:Script.NET,代码行数:26,代码来源:FlatHeaderCtrl.cpp


示例17: AfxGetInstanceHandle

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT &cs)
{
    if(cs.hMenu != NULL)
    {
        ::DestroyMenu(cs.hMenu); // delete menu if loaded
        cs.hMenu = NULL; // no menu for this window
    }

    if(!CFrameWnd::PreCreateWindow(cs))
    {
        return FALSE;
    }

    WNDCLASS wc;
    wc.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc = AfxWndProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = AfxGetInstanceHandle();
    wc.hIcon = NULL;
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
    wc.lpszMenuName = NULL;
    wc.lpszClassName = _T("Ditto");

    // Create the QPaste window class
    if(!AfxRegisterClass(&wc))
    {
        return FALSE;
    }

    cs.lpszClass = wc.lpszClassName;

    return TRUE;
}
开发者ID:wilsonr990,项目名称:Ditto-clipboard-manager,代码行数:35,代码来源:MainFrm.cpp


示例18: AfxGetInstanceHandle

// コントロールのウィンドウクラス登録
bool CCellListCtrl::RegisterWindowClass()
{
	HINSTANCE hInstance = AfxGetInstanceHandle();
	WNDCLASS wndclass = {};
	if (::GetClassInfo(hInstance, CELLLISTCTRL_CLASSNAME, &wndclass)) {
		// 既に登録済みなら何もしない
		return true;
	}

	wndclass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
	wndclass.lpfnWndProc = ::DefWindowProc;
	wndclass.cbClsExtra = 0;
	wndclass.cbWndExtra = 0;
	wndclass.hInstance = hInstance;
	wndclass.hIcon = NULL;
	wndclass.hCursor = ::LoadCursor(NULL, IDC_ARROW);
	wndclass.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_3DFACE + 1);
	wndclass.lpszMenuName = NULL;
	wndclass.lpszClassName = CELLLISTCTRL_CLASSNAME;

	if (!AfxRegisterClass(&wndclass)) {
		return false;
	}

	return true;
}
开发者ID:chokuto,项目名称:CellListCtrl,代码行数:27,代码来源:CellListCtrl.cpp


示例19: RegisterWindowClass

BOOL CXTPSyntaxEditTipWnd::RegisterWindowClass(HINSTANCE hInstance /*= NULL*/)
{
	WNDCLASS wndcls;
	if (hInstance == NULL) hInstance = AfxGetInstanceHandle();

	if (!(::GetClassInfo(hInstance, XTP_EDIT_CLASSNAME_LBOXTIP, &wndcls)))
	{
		// otherwise we need to register a new class
		wndcls.style = CS_SAVEBITS | CS_HREDRAW | CS_VREDRAW;
		wndcls.lpfnWndProc = ::DefWindowProc;
		wndcls.cbClsExtra = wndcls.cbWndExtra = 0;
		wndcls.hInstance = hInstance;
		wndcls.hIcon = NULL;
		wndcls.hCursor = ::LoadCursor(0, IDC_ARROW);
		wndcls.hbrBackground = (HBRUSH)(COLOR_INFOBK + 1);
		wndcls.lpszMenuName = NULL;
		wndcls.lpszClassName = XTP_EDIT_CLASSNAME_LBOXTIP;

		if (!AfxRegisterClass(&wndcls))
		{
			AfxThrowResourceException();
			return FALSE;
		}
	}

	return TRUE;
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:27,代码来源:XTPSyntaxEditTipWnd.cpp


示例20: m_pTreeListCtrl

CTreeListColumnDropWnd::CTreeListColumnDropWnd() :
  m_pTreeListCtrl( NULL )
{
  // register the window class
  WNDCLASS wndclass;
  HINSTANCE hInst = AfxGetInstanceHandle();

  if(!(::GetClassInfo(hInst, TLCDROPWND_CLASSNAME, &wndclass)))
  {
    wndclass.style = CS_HREDRAW | CS_VREDRAW ; //CS_SAVEBITS ;
    wndclass.lpfnWndProc = ::DefWindowProc;
    wndclass.cbClsExtra = wndclass.cbWndExtra = 0;
    wndclass.hInstance = hInst;
    wndclass.hIcon = NULL;
    wndclass.hCursor = LoadCursor( hInst, IDC_ARROW);
    wndclass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); 
    wndclass.lpszMenuName = NULL;
    wndclass.lpszClassName = TLCDROPWND_CLASSNAME;
    if (!AfxRegisterClass(&wndclass))
      AfxThrowResourceException();
  }

  if( g_lpfnUpdateLayeredWindow == NULL || g_lpfnSetLayeredWindowAttributes == NULL )
  {
    HMODULE hUser32 = GetModuleHandle(_T("USER32.DLL"));

    g_lpfnUpdateLayeredWindow =  (lpfnUpdateLayeredWindow)GetProcAddress( hUser32, _T("UpdateLayeredWindow") );
    g_lpfnSetLayeredWindowAttributes = (lpfnSetLayeredWindowAttributes)GetProcAddress( hUser32, _T("SetLayeredWindowAttributes") );

    if( g_lpfnUpdateLayeredWindow == NULL || g_lpfnSetLayeredWindowAttributes == NULL )
      m_bLayeredWindows = FALSE;
    else
      m_bLayeredWindows = TRUE;
  }
}
开发者ID:derekqian,项目名称:GPUSim_ATTILA,代码行数:35,代码来源:TreeListColumnDropWnd.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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