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


C++ InitCommonControls函数代码示例

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


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

示例1: InitCommonControls

BOOL CTestApp::InitInstance()
{
	// 如果一个运行在 Windows XP 上的应用程序清单指定要
	// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
	//则需要 InitCommonControls()。否则,将无法创建窗口。
	InitCommonControls();

	CWinApp::InitInstance();

	AfxEnableControlContainer();

	// 标准初始化
	// 如果未使用这些功能并希望减小
	// 最终可执行文件的大小,则应移除下列
	// 不需要的特定初始化例程
	// 更改用于存储设置的注册表项
	// TODO: 应适当修改该字符串,
	// 例如修改为公司或组织名
	SetRegistryKey(_T("应用程序向导生成的本地应用程序"));
	CoInitialize(NULL);

	CTestDlg dlg;
	m_pMainWnd = &dlg;
	INT_PTR nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: 在此放置处理何时用“确定”来关闭
		//对话框的代码
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: 在此放置处理何时用“取消”来关闭
		//对话框的代码
	}

	// 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序,
	// 而不是启动应用程序的消息泵。
	return FALSE;
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:39,代码来源:Test.cpp

示例2: DllMain

BOOL APIENTRY DllMain( HINSTANCE instance, DWORD reason, void* /*reserved*/ )
{
	s_classDescMySceneExport.instance = instance;
	
	if ( !s_controlsInit )
	{
		s_controlsInit = true;
		InitCustomControls( instance );
		InitCommonControls();
	}

    switch ( reason )
	{
		case DLL_PROCESS_ATTACH:
		case DLL_THREAD_ATTACH:
		case DLL_THREAD_DETACH:
		case DLL_PROCESS_DETACH:
			break;
	}

	return TRUE;
}
开发者ID:TheRyaz,项目名称:c_reading,代码行数:22,代码来源:maxexport.cpp

示例3: InitCommonControls

void StatusBar::init(HINSTANCE hInst, HWND hPere)
{
	Window::init(hInst, hPere);
    InitCommonControls();

	_hSelf = ::CreateWindowEx(
	               0,
	               STATUSCLASSNAME,
	               "",
	               WS_CHILD /*| SBARS_SIZEGRIP*/,
	               0, 0, 0, 0,
	               _hParent,
				   NULL,
	               _hInst,
	               0);

	if (!_hSelf)
	{
		systemMessage("System Err");
		throw int(9);
	}
}
开发者ID:QingfengLee,项目名称:notepad_plus.10.src,代码行数:22,代码来源:StatusBar.cpp

示例4: InitCommonControls

BOOL CRCTest2App::InitInstance()
{
	// InitCommonControls() is required on Windows XP if an application
	// manifest specifies use of ComCtl32.dll version 6 or later to enable
	// visual styles.  Otherwise, any window creation will fail.
	InitCommonControls();

	CWinApp::InitInstance();

	AfxEnableControlContainer();

	// Standard initialization
	// If you are not using these features and wish to reduce the size
	// of your final executable, you should remove from the following
	// the specific initialization routines you do not need
	// Change the registry key under which our settings are stored
	// TODO: You should modify this string to be something appropriate
	// such as the name of your company or organization
	SetRegistryKey(_T("Local AppWizard-Generated Applications"));

	CRCTest2Dlg dlg;

	m_pMainWnd = &dlg;
	INT_PTR nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with OK
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with Cancel
	}

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}
开发者ID:uvbs,项目名称:SupportCenter,代码行数:39,代码来源:RCTest2.cpp

示例5: WinMain

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpCmdLine, int nCmdShow)
{
    int ret;
    WSADATA wsaData;


    /* Starting Winsock -- for name resolution. */
    WSAStartup(MAKEWORD(2, 0), &wsaData);


    /* Initializing config */
    init_config();

    /* Initializing controls */
    InitCommonControls();

    /* Creating main dialogbox */
    DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAIN), NULL, DlgProc);


    /* Check if service is running and try to start it */
    if((strcmp(config_inst.key, FL_NOKEY) != 0)&&
            (strcmp(config_inst.server, FL_NOSERVER) != 0) &&
            !CheckServiceRunning() &&
            (config_inst.admin_access != 0))
    {
        ret = MessageBox(NULL, "OSSEC Agent not running. "
                "Do you wish to start it?",
                "Wish to start the agent?", MB_OKCANCEL);
        if(ret == IDOK)
        {
            /* Starting the service */
            os_start_service();
        }
    }

    return(0);
}
开发者ID:alexoslabs,项目名称:ossec-hids,代码行数:39,代码来源:os_win32ui.c

示例6: InitPGPDurationControl

VOID WINAPI 
InitPGPDurationControl (VOID) 
{
	WNDCLASS  wc;
	
	InitCommonControls ();

	// register new window class
	wc.style = CS_DBLCLKS | CS_GLOBALCLASS | CS_PARENTDC; // Class style(s).
	wc.lpfnWndProc = (WNDPROC) sDurationMsgProc; 
	wc.cbClsExtra = 0;	                        // No per-class extra data.
	wc.cbWndExtra = sizeof (DCWndData*);		// pointer to extra data 
												//		structure
	wc.hInstance = 0;	
	wc.hIcon = NULL;
	wc.hCursor = LoadCursor (NULL, IDC_ARROW);
	wc.hbrBackground = (HBRUSH) (COLOR_WINDOW+1); // Background color
	wc.lpszMenuName = NULL;						// No menu
	wc.lpszClassName = WC_PGPDURATION;			// Name used in CreateWindow
	RegisterClass (&wc);

}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:22,代码来源:DurationControl.c

示例7: InitApp

BOOL
InitApp(void)
{
    WNDCLASS wc;

    wc.style = 0;
    wc.lpfnWndProc = WndProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = g_hinst;
    wc.hIcon = NULL;
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    wc.lpszMenuName = NULL;
    wc.lpszClassName = TEXT("Scratch");

    if (!RegisterClass(&wc)) return FALSE;

    InitCommonControls();               /* In case we use a common control */

    return TRUE;
}
开发者ID:AnarNFT,项目名称:books-code,代码行数:22,代码来源:092_covered.cpp

示例8: WinMain

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 
                   LPSTR lpCmdLine, int nCmdShow)
{
    CAErrno caErr;
    int nProcExit = CA_PROC_EXIT_OK;

    g_hInstance = hInstance;

    InitCommonControls();
    caErr = CAS_PStartup(__argc, __argv, &g_ocawProc);
    if (CA_ERR_SUCCESS != caErr)
    {
        CAS_Panic(CA_SRC_MARK, CA_PROC_EXIT_INIT_FAILED, 
            TEXT("Startup failed. Can't load run time library or config."
                 "Last Error code (%u). "), caErr);
        return CA_PROC_EXIT_INIT_FAILED;
    }

    nProcExit = CAS_PRun(&g_ocawProc);
    CAS_PCleanup(&g_ocawProc);
    return nProcExit;
}
开发者ID:bactq,项目名称:ocass,代码行数:22,代码来源:ocaw_main.cpp

示例9: WinMain

    int APIENTRY
WinMain(HINSTANCE hInstance,
	HINSTANCE hPrevInstance,
	LPSTR     lpCmdLine,
	int       nCmdShow )
{
    InitCommonControls();
    HWND hwnd = CreateDialog(hInstance,
		MAKEINTRESOURCE(IDD_MAINDIALOG), NULL, dlgproc);
    if (!hwnd)
	return -1;
    g_hwnd = hwnd;
    SetClassLong(g_hwnd, GCL_HICON, (LONG)LoadIcon(hInstance,
		MAKEINTRESOURCE(IDI_NETUPVIM)));

    MSG msg;
    ShowWindow(hwnd, SW_SHOW);
    int res = MessageBox(hwnd,
	    "Vimのネットワークアップデートを開始しますか?\r\n"
	    "\r\n"
	    "アップデートには数分かそれ以上かかる場合も\r\n"
	    "あります。もしも現在Vimを使用している場合、\r\n"
	    "アップデートを始める前にVimを終了してください。"
	    , "Vimアップデートの確認", MB_YESNO | MB_ICONQUESTION);
    if (res == IDNO)
	DestroyWindow(hwnd);
    else
	_beginthread(do_update, 0, 0);
    while (GetMessage(&msg, NULL, 0, 0))
    {
	if (IsDialogMessage(hwnd, &msg))
	    continue;
	TranslateMessage(&msg);
	DispatchMessage(&msg);
    }

    return 0;
}
开发者ID:koron,项目名称:netupdate-netupvim,代码行数:38,代码来源:netupvim.cpp

示例10: InitCommonControls

void StatusBar::init(HINSTANCE hInst, HWND hParent, int nbParts)
{
	Window::init(hInst, hParent);
    InitCommonControls();

	_hSelf = //CreateStatusWindow(WS_CHILD | WS_CLIPSIBLINGS, NULL, _hParent, IDC_STATUSBAR);
	::CreateWindowEx(
	               0,
	               STATUSCLASSNAME,
	               TEXT(""),
	               WS_CHILD | SBARS_SIZEGRIP ,
	               0, 0, 0, 0,
	               _hParent,
				   NULL,
	               _hInst,
	               0);

	if (!_hSelf)
	{
		systemMessage(TEXT("System Err"));
		throw int(9);
	}

    _nbParts = nbParts;
    _partWidthArray = new int[_nbParts];

	// Set the default width
	for (int i = 0 ; i < _nbParts ; i++)
		_partWidthArray[i] = defaultPartWidth;

    // Allocate an array for holding the right edge coordinates.
    _hloc = ::LocalAlloc(LHND, sizeof(int) * _nbParts);
    _lpParts = (LPINT)::LocalLock(_hloc);

	RECT rc;
	::GetClientRect(_hParent, &rc);
	adjustParts(rc.right);
}
开发者ID:TodWulff,项目名称:npp-community,代码行数:38,代码来源:StatusBar.cpp

示例11: InitCommonControls

BOOL CCapVideoApp::InitInstance(){
  InitCommonControls();
  CWinApp::InitInstance();
  SetRegistryKey(_T("6BEE NETWORKS PTE LTD"));
  CWinThread::InitInstance();
  CCapVideoDlg dlg;//main thread start dialog frame
  if(!InitCapture()){
    return FALSE;
  }
  dlg.m_caprawvideo = m_caprawvideo;
  if (m_caprawvideo){//derive a thread to capture video
    m_caprawvideo->PostThreadMessage(WM_STARTPREVIEW,(WPARAM)&(dlg.m_cappreview),(LPARAM)0);
  }
  INT_PTR nResponse = dlg.DoModal();
  if (nResponse == IDCANCEL && strlen(m_caprawvideo->getavfilename())!=0){
    /// @todo temp comment out this -  can use a function in 6beecommond.dll to replace it.
    ///////////////////////////// start to upload /////////////////////////////////
    /*
    USES_CONVERSION;
    CString videopath;
    videopath.Format(_T("%s%s"),_6beed_util::Get6BEEPath(_6bees_const::kVideoDir,true),A2CW(m_caprawvideo->getavfilename()));
    HWND hwndTo = ::FindWindow(0,_6bees_const::kUploader_WndTitle);
    if(!hwndTo){
      CString UploaderCmd = _6beed_util::Get6BEEPath(_6bees_const::kUploaderName);
      UploaderCmd += _T(" -m upload -f \"") + videopath + _T("\"");
      STARTUPINFO si = {sizeof(si)};
      PROCESS_INFORMATION pi;
      if (!CreateProcessW(NULL,const_cast<LPWSTR>(UploaderCmd.GetString()),NULL,NULL,false,0,NULL,NULL,&si,&pi)){
        ::AfxMessageBox(_T("ERROR: Cannot Start 6BeeUpLoader!"));
      }
    }else{
      _6beed_util::SendMsgToUploader(hwndTo,W2CA(videopath),CPYDATA_UPLOAD_2_UPLOAD_DIRECT);
    }
    */
    /////////////////////////////////////////////////////////////////////////////
  }
  return FALSE;
}
开发者ID:henrywoo,项目名称:ultraie,代码行数:38,代码来源:CapVideo.cpp

示例12: WinMain

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    LPWSTR lpCmdLine, int nCmdShow) 
{
	VIRTUALDATA *pvd;
    HANDLE hSem;

    hSem = CreateSemaphore (NULL, 0, 1, APPNAME);
    if ((hSem != NULL) && (GetLastError() == ERROR_ALREADY_EXISTS)) 
	{
		HWND hWndExisting;

        CloseHandle(hSem);

		hWndExisting = FindWindow (NULL, APPNAME);
		if (hWndExisting) 
			SetForegroundWindow ((HWND)(((ULONG)hWndExisting) | 0x01));

		return TRUE;
	}

	g_hinst=hInstance;
	InitCommonControls();

	pvd=(VIRTUALDATA *)malloc(sizeof(VIRTUALDATA));

	if(pvd!=NULL)
	{
		memset(pvd,0x00,sizeof(VIRTUALDATA));

		GetVirtualMemoryStatus(pvd);
		GetProcessNames(pvd);

		DialogBoxParam (g_hinst, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DlgProc, (LPARAM)pvd);

		free(pvd);
	}
	return 0;
}
开发者ID:altopal,项目名称:VMusage,代码行数:38,代码来源:main.c

示例13: InitCommonControls

BOOL CPuzzleGameApp::InitInstance()
{
	// InitCommonControls() is required on Windows XP if an application
	// manifest specifies use of ComCtl32.dll version 6 or later to enable
	// visual styles.  Otherwise, any window creation will fail.
	InitCommonControls();

	CWinApp::InitInstance();

	AfxEnableControlContainer();


	globalData.SetDPIAware ();

	CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2007));
	GdiplusStartupInput gdiplusStartupInput;
	GdiplusStartup(&m_gdiplusToken, &gdiplusStartupInput, NULL);

	CPuzzleGameDlg dlg;
	m_pMainWnd = &dlg;
	INT_PTR nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with OK
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with Cancel
	}

	BCGCBProCleanUp ();

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}
开发者ID:cugxiangzhenwei,项目名称:MySrcCode,代码行数:38,代码来源:PuzzleGame.cpp

示例14: InitCommonControls

void CAddress::Create(HWND hParent, long ID, HINSTANCE hInst)
{
	InitCommonControls();
	m_hInst = hInst;
	m_hParent = hParent;
	m_hAddress = CreateWindow(TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE | TBSTYLE_LIST,
		0, 100, 100, 200,
		m_hParent, (HMENU) ID, m_hInst, NULL);
	m_nID = ID;
	SetButtonImages();
	AddNonButtonControl(_T("STATIC"), _T("Address"), WS_CHILD | WS_VISIBLE, 
			IDC_ADDRESS_STATIC, 50, 50, 0, IDC_ADDRESS_STATIC, 3);
	HFONT hFont = (HFONT) GetStockObject(DEFAULT_GUI_FONT);
	SendMessage(GetDlgItem(m_hAddress, IDC_ADDRESS_STATIC), WM_SETFONT, (WPARAM) hFont, TRUE);

	RECT main;
	GetWindowRect(m_hParent, &main);
	AddNonButtonControl(_T("EDIT"), NULL, WS_CHILD | WS_VISIBLE, 
		IDC_ADDRESS_EDIT, 900, 20, 1, IDC_ADDRESS_EDIT, 1);
	SendMessage(GetDlgItem(m_hAddress, IDC_ADDRESS_EDIT), WM_SETFONT, (WPARAM) hFont, TRUE);

	AddButton(TBSTATE_ENABLED, BTNS_BUTTON, 0 , IDC_ADDRESS_GO, _T("Go"), 0);
}
开发者ID:Slifer7,项目名称:demo,代码行数:23,代码来源:CAddress.cpp

示例15: WinMain

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
        LPSTR lpCmdLine, int nCmdShow )
{
    MSG  msg ;

    InitCommonControls();
    InitProgram (hInstance);
    init_combo_list();
    init_info();

    edit_info_append (">>Ready.\n");

    if (auto_con) 
        on_button_connect_clicked();

    while(GetMessage(&msg, NULL, 0, 0)) {
        if(IsDialogMessage(hwndDlg, &msg))
            continue;
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
    return (int) msg.wParam;
}
开发者ID:BGCX261,项目名称:zruijie4gzhu-svn-to-git,代码行数:23,代码来源:win_main.c


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