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


C++ AfxGetApp函数代码示例

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


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

示例1: gg

void CZSingleton::SetDrop()
{
	CString gg(AfxGetApp()->m_pszExeName);
	::SetProp(AfxGetApp()->GetMainWnd()->GetSafeHwnd(), gg, (HANDLE)1);
	gg.Empty();
}
开发者ID:zhaojunlucky,项目名称:Audio,代码行数:6,代码来源:ZSingleton.cpp

示例2: SetDllDirectory


//.........这里部分代码省略.........

    GetTooltipManager ()->SetTooltipParams (
        AFX_TOOLTIP_TYPE_ALL,
        RUNTIME_CLASS (CMFCToolTipCtrl),
        &params);

    CCmdLineParser parser = CCmdLineParser(this->m_lpCmdLine);

    g_sGroupingUUID = parser.GetVal(L"groupuuid");

    if (parser.HasKey(L"?") || parser.HasKey(L"help"))
    {
        CString sHelpText;
        sHelpText.LoadString(IDS_COMMANDLINEHELP);
        MessageBox(nullptr, sHelpText, L"TortoiseMerge", MB_ICONINFORMATION);
        return FALSE;
    }

    // Initialize OLE libraries
    if (!AfxOleInit())
    {
        AfxMessageBox(IDP_OLE_INIT_FAILED);
        return FALSE;
    }
    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
    SetRegistryKey(L"TortoiseMerge");

    if (CRegDWORD(L"Software\\TortoiseMerge\\Debug", FALSE)==TRUE)
        AfxMessageBox(AfxGetApp()->m_lpCmdLine, MB_OK | MB_ICONINFORMATION);

    // To create the main window, this code creates a new frame window
    // object and then sets it as the application's main window object
    CMainFrame* pFrame = new CMainFrame;
    if (!pFrame)
        return FALSE;
    m_pMainWnd = pFrame;

    // create and load the frame with its resources
    if (!pFrame->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, nullptr, nullptr))
        return FALSE;

    // Fill in the command line options
    pFrame->m_Data.m_baseFile.SetFileName(parser.GetVal(L"base"));
    pFrame->m_Data.m_baseFile.SetDescriptiveName(parser.GetVal(L"basename"));
    pFrame->m_Data.m_baseFile.SetReflectedName(parser.GetVal(L"basereflectedname"));
    pFrame->m_Data.m_theirFile.SetFileName(parser.GetVal(L"theirs"));
    pFrame->m_Data.m_theirFile.SetDescriptiveName(parser.GetVal(L"theirsname"));
    pFrame->m_Data.m_theirFile.SetReflectedName(parser.GetVal(L"theirsreflectedname"));
    pFrame->m_Data.m_yourFile.SetFileName(parser.GetVal(L"mine"));
    pFrame->m_Data.m_yourFile.SetDescriptiveName(parser.GetVal(L"minename"));
    pFrame->m_Data.m_yourFile.SetReflectedName(parser.GetVal(L"minereflectedname"));
    pFrame->m_Data.m_mergedFile.SetFileName(parser.GetVal(L"merged"));
    pFrame->m_Data.m_mergedFile.SetDescriptiveName(parser.GetVal(L"mergedname"));
    pFrame->m_Data.m_mergedFile.SetReflectedName(parser.GetVal(L"mergedreflectedname"));
    pFrame->m_Data.m_sPatchPath = parser.HasVal(L"patchpath") ? parser.GetVal(L"patchpath") : L"";
    pFrame->m_Data.m_sPatchPath.Replace('/', '\\');
    if (parser.HasKey(L"patchoriginal"))
        pFrame->m_Data.m_sPatchOriginal = parser.GetVal(L"patchoriginal");
    if (parser.HasKey(L"patchpatched"))
        pFrame->m_Data.m_sPatchPatched = parser.GetVal(L"patchpatched");
    pFrame->m_Data.m_sDiffFile = parser.GetVal(L"diff");
开发者ID:YueLinHo,项目名称:TortoiseSvn,代码行数:67,代码来源:TortoiseMerge.cpp

示例3: TraySetIcon

void CTrayDialog::TraySetIcon(LPCTSTR lpszResourceName)
{
	TraySetIcon(AfxGetApp()->LoadIcon(lpszResourceName));
}
开发者ID:LjApps,项目名称:eMule-VeryCD,代码行数:4,代码来源:TrayDialog.cpp

示例4: OnSiteDataInit

// 现场数据对象初始化
void CSensorListCtrl::OnSiteDataInit()
{
    data_base_helper_ = ((CLineApp*)AfxGetApp())->get_data_base_helper();
}
开发者ID:svn2github,项目名称:jy00755131,代码行数:5,代码来源:SensorListCtrl.cpp

示例5: AfxGetApp

BOOL COptionsDialog::OnInitDialog() 
{
	CDialog::OnInitDialog();

	CGeneralManager * m = ((CReportAsistentApp *) AfxGetApp())->m_pGeneralManager;
	CReportAsistentApp * App = ((CReportAsistentApp *) AfxGetApp());

	//Set Language radio buttons
	if (m->getLanguage() == CString("cz"))
		CheckRadioButton(IDC_CZECH_RADIO, IDC_ENGLISH_RADIO, IDC_CZECH_RADIO);
	else
		CheckRadioButton(IDC_CZECH_RADIO, IDC_ENGLISH_RADIO, IDC_ENGLISH_RADIO);
		
	//Set Tree Items
	//Height edit
	CString Pom;
	Pom.Format("%d",App->m_iTreeItemHeight);
	m_HeightEdit.SetWindowText(Pom);
	m_HeightEdit.SetLimitText(2);

	//Indent Edit
	Pom.Format("%d",App->m_iTreeItemIndent);
	m_IndentEdit.SetWindowText(Pom);
	m_IndentEdit.SetLimitText(2);

	m_LinesCheckBox.SetCheck( App->m_bTreeHasLines);
	m_IdInTreeCheckBox.SetCheck( App->m_bIdInItemName);
	m_ButtonsCheckBox.SetCheck( App->m_bTreeHasButtons);

	//Name Length Edit
	Pom.Format("%d",App->m_iTreeItemNameLength);
	m_NameLengthEdit.SetWindowText(Pom);
	m_NameLengthEdit.SetLimitText(3);

	// Size of text in TextEdit in Text Element dialog
	Pom.Format("%d",App->m_iTextEditSize);
	m_TextEditSize.SetWindowText(Pom);
	m_TextEditSize.SetLimitText(3);

	//Set orphans radio buttons:
	CString OrphSol = App->FirstDocumentInFirstTemplate()->GetReportSettings("orphans_solution");
	if (OrphSol== CString("ignore"))
			CheckRadioButton( IDC_IGNORE_RADIO , IDC_SET_DEFAULT_RADIO, IDC_IGNORE_RADIO );
	else		
		if (OrphSol== CString("delete"))
			CheckRadioButton( IDC_IGNORE_RADIO , IDC_SET_DEFAULT_RADIO, IDC_DELETE_RADIO );
		else
			if (OrphSol== CString("set_default"))
				CheckRadioButton( IDC_IGNORE_RADIO , IDC_SET_DEFAULT_RADIO, IDC_SET_DEFAULT_RADIO );
			else
			{
				CheckRadioButton( IDC_IGNORE_RADIO , IDC_SET_DEFAULT_RADIO, IDC_IGNORE_RADIO );
				App->FirstDocumentInFirstTemplate()->SetReportSettings("orphans_solution","ignore");
			}
	//set mark orphans
	m_MarkOrphansCheckBox.SetCheck( App->m_bMarkOrphans);


	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:BackupTheBerlios,项目名称:reportasistent-svn,代码行数:61,代码来源:OptionsDialog.cpp

示例6: GetWindowText

BOOL CMyEdit::PreTranslateMessage(MSG* pMsg) 
{

	if((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_RETURN)
			&& (GetKeyState(VK_SHIFT) >= 0)){

		CString strText;
		GetWindowText(strText);
		if(!strText.IsEmpty()){

			m_aHistory.Add(strText);
		}
		::SendMessage(AfxGetApp()->m_pMainWnd->m_hWnd, UWM_INPUT, 0, 0);
	}
	else if((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_RETURN)
				&& (GetKeyState(VK_SHIFT) < 0) && (GetStyle() & ES_MULTILINE)){

		CString strText;
		GetWindowText(strText);
		strText+="\r\n";
		SetWindowText(strText);
		SetSel(0, -1, FALSE);
		SetSel(-1, 0, FALSE);
		return TRUE;
	}
	else if((pMsg->message == WM_MOUSEWHEEL || pMsg->message == WM_KEYDOWN) && !m_bEx){

		ASSERT(m_pCommands);
		///////////////////////////////////////////////////////
		// Scroll through RCMS commands UP (PAGE UP)
		///////////////////////////////////////////////////////
		if((pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_PRIOR) || 
			(pMsg->message == WM_MOUSEWHEEL && ((short)HIWORD(pMsg->wParam)) > 0)){
		
			if(!m_pCommands) return TRUE;
			if(m_pCommands->GetSize() == 0) return TRUE;
			SetSel(0,-1);
			TCHAR szTempStr[1024];
			if(SendMessage(WM_GETTEXT, 1024, (LPARAM)szTempStr)){
		
				//DWORD dwIndex = atol(szTempStr);
				DWORD dwIndex = SearchRCMSItem(szTempStr);
				if(dwIndex == 0){

					lstrcpy(szTempStr, m_pCommands->GetAt(m_aCommandsNUM - 1));
					ReplaceSel(szTempStr, TRUE);
					SendMessage(WM_KEYDOWN, VK_END, 0);
					CString strTemp = m_pCommands->GetAt(m_aCommandsNUM - 1);
					int nStart = strTemp.Find(" ", 0);
					if(nStart > 0) SetSel(nStart+1, -1, FALSE);
					return TRUE;
				}
				else if((dwIndex == 1) || (dwIndex > m_aCommandsNUM)){

					ReplaceSel("", TRUE);
				}
				else{

					lstrcpy(szTempStr, m_pCommands->GetAt(dwIndex - 2));
					ReplaceSel(szTempStr, TRUE);
					CString strTemp = m_pCommands->GetAt(dwIndex - 2);
					int nStart = strTemp.Find(" ", 0);
					SendMessage(WM_KEYDOWN, VK_END, 0);
					if(nStart > 0) SetSel(nStart+1, -1, FALSE);
				}
				return TRUE;
			}
			else{

				lstrcpy(szTempStr, m_pCommands->GetAt(m_aCommandsNUM - 1));
				ReplaceSel(szTempStr, TRUE);
				SendMessage(WM_KEYDOWN, VK_END, 0);
				CString strTemp = m_pCommands->GetAt(m_aCommandsNUM - 1);
				int nStart = strTemp.Find(" ", 0);
				if(nStart > 0) SetSel(nStart+1, -1, FALSE);
				return TRUE;
			}
		}
		///////////////////////////////////////////////////////
		// RCMS Down (PAGE DOWN)
		///////////////////////////////////////////////////////
		else if(((pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_NEXT) || 
			(pMsg->message == WM_MOUSEWHEEL && ((short)HIWORD(pMsg->wParam)) <= 0)) && !m_bEx){
		
			if(!m_pCommands) return TRUE;
			if(m_pCommands->GetSize() == 0) return TRUE;
			SetSel(0,-1);
			TCHAR szTempStr[1024];
			if(SendMessage(WM_GETTEXT, 1024, (LPARAM)szTempStr)){

				//DWORD dwIndex = atol(szTempStr);
				DWORD dwIndex = SearchRCMSItem(szTempStr);
				if(dwIndex >= m_aCommandsNUM){

					ReplaceSel("", TRUE);
					//Beep(1000, 50);
				}
				else{

					lstrcpy(szTempStr, m_pCommands->GetAt(dwIndex));
//.........这里部分代码省略.........
开发者ID:MXControl,项目名称:RoboServ,代码行数:101,代码来源:MyEdit.cpp

示例7: AfxGetApp

BOOL CSystemTray::SetIcon(UINT nIDResource)
{
    HICON hIcon = AfxGetApp()->LoadIcon(nIDResource);

    return SetIcon(hIcon);
}
开发者ID:K0F,项目名称:2008,代码行数:6,代码来源:SystemTray.cpp

示例8: Scintilla_RegisterClasses

// COpenHoldemApp initialization
BOOL COpenHoldemApp::InitInstance()
{
	Scintilla_RegisterClasses(AfxGetInstanceHandle());

	// Initialize richedit2 library
	AfxInitRichEdit2();

	// Change class name of Dialog
	WNDCLASS wc;
	GetClassInfo(AfxGetInstanceHandle(), "#32770", &wc);

	wc.lpszClassName = "OpenHoldemFormula";
	wc.hIcon = AfxGetApp()->LoadIcon(IDI_ICON1);
	RegisterClass(&wc);

	// InitCommonControlsEx() 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.
	INITCOMMONCONTROLSEX InitCtrls;
	InitCtrls.dwSize = sizeof(InitCtrls);
	// Set this to include all the common control classes you want to use
	// in your application.
	InitCtrls.dwICC = ICC_WIN95_CLASSES;
	InitCommonControlsEx(&InitCtrls);

	CWinApp::InitInstance();

	// 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
	bool load_from_registry = true;
	for (int i = 1; i < __argc; i++)
	{
		LPCTSTR pszParam = __targv[i];
		if (_tcsncmp(pszParam, "/ini:", 5) == 0) {
			CString path(pszParam+5);
			path.Replace("~", _startup_path);
			free((void*)m_pszProfileName);
			m_pszProfileName = _strdup(path);
			load_from_registry = false;
		}
		if (_tcscmp(pszParam, "/ini") == 0) {
			CString path;
			path.Format("%s\\openholdem.ini", _startup_path);
			free((void*)m_pszProfileName);
			m_pszProfileName = _strdup(path);
			load_from_registry = false;
		}
	}
	if (load_from_registry)
		SetRegistryKey(_T("OpenHoldem"));
	prefs.LoadPreferences(load_from_registry);
	
	// Classes
	if (!p_sessioncounter) p_sessioncounter = new CSessionCounter;
	// Start logging immediatelly after the loading the preferences
	// and initializing the sessioncounter.
	start_log();
	InstanciateAllSingletonsExceptSessionCounter(); 

	// mouse.dll - failure in load is fatal
	_mouse_dll = LoadLibrary("mouse.dll");
	if (_mouse_dll==NULL)
	{
		CString		t = "";
		t.Format("Unable to load mouse.dll, error: %d\n\nExiting.", GetLastError());
		OH_MessageBox(t, "OpenHoldem mouse.dll ERROR", MB_OK | MB_TOPMOST);
		return false;
	}
	else
	{
		_dll_mouse_process_message = (mouse_process_message_t) GetProcAddress(_mouse_dll, "ProcessMessage");
		_dll_mouse_click = (mouse_click_t) GetProcAddress(_mouse_dll, "MouseClick");
		_dll_mouse_click_drag = (mouse_clickdrag_t) GetProcAddress(_mouse_dll, "MouseClickDrag");

		if (_dll_mouse_process_message==NULL || _dll_mouse_click==NULL || _dll_mouse_click_drag==NULL)
		{
			CString		t = "";
			t.Format("Unable to find all symbols in mouse.dll");
			OH_MessageBox(t, "OpenHoldem mouse.dll ERROR", MB_OK | MB_TOPMOST);

			FreeLibrary(_mouse_dll);
			_mouse_dll = NULL;
			return false;
		}
	}

	// keyboard.dll - failure in load is fatal
	_keyboard_dll = LoadLibrary("keyboard.dll");
	if (_keyboard_dll==NULL)
	{
		CString		t = "";
		t.Format("Unable to load keyboard.dll, error: %d\n\nExiting.", GetLastError());
		OH_MessageBox(t, "OpenHoldem keyboard.dll ERROR", MB_OK | MB_TOPMOST);
		return false;
	}
	else
//.........这里部分代码省略.........
开发者ID:ohzooboy,项目名称:oh,代码行数:101,代码来源:OpenHoldem.cpp

示例9: CDialogEx

CStitchCamDlg::CStitchCamDlg(CWnd* pParent /*=NULL*/)
    : CDialogEx(CStitchCamDlg::IDD, pParent)
{
    m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
开发者ID:neon-izm,项目名称:StitchCam,代码行数:5,代码来源:StitchCamDlg.cpp

示例10: OnClose

void CMainFrame::OnClose()
{
	static_cast<CHbgMainApp*>(AfxGetApp())->HbgGetEngine()->Finalize();

	CFrameWndEx::OnClose();
}
开发者ID:plantrue,项目名称:Hambugger,代码行数:6,代码来源:MainFrm.cpp

示例11: OnUpdateConnected

void CMainFrame::OnUpdateConnected(CCmdUI *pCmdUI)
{
	pCmdUI->Enable(static_cast<CHbgMainApp*>(AfxGetApp())->HbgGetEngine()->Running());
}
开发者ID:plantrue,项目名称:Hambugger,代码行数:4,代码来源:MainFrm.cpp

示例12: _T

LONG WINAPI CMiniDump::UnhandledExceptionFilter(_EXCEPTION_POINTERS* lpTopLevelExceptionFilter)
{
    LONG    retval = EXCEPTION_CONTINUE_SEARCH;
    BOOL    bDumpCreated = FALSE;
    HMODULE hDll = nullptr;
    TCHAR   szResult[800];
    szResult[0] = _T('\0');
    CPath   dumpPath;

#if ENABLE_MINIDUMP
    hDll = ::LoadLibrary(_T("dbghelp.dll"));

    if (hDll != nullptr) {
        MINIDUMPWRITEDUMP pMiniDumpWriteDump = (MINIDUMPWRITEDUMP)::GetProcAddress(hDll, "MiniDumpWriteDump");
        if (pMiniDumpWriteDump != nullptr && AfxGetMyApp()->GetAppSavePath(dumpPath)) {
            // Check that the folder actually exists
            if (!FileExists(dumpPath)) {
                VERIFY(CreateDirectory(dumpPath, nullptr));
            }

            CString strDumpName = AfxGetApp()->m_pszExeName;
            strDumpName.Append(_T(".exe.") + VersionInfo::GetVersionString() + _T(".dmp"));
            dumpPath.Append(strDumpName);

            // create the file
            HANDLE hFile = ::CreateFile(dumpPath, GENERIC_WRITE, FILE_SHARE_WRITE, nullptr, CREATE_ALWAYS,
                                        FILE_ATTRIBUTE_NORMAL, nullptr);

            if (hFile != INVALID_HANDLE_VALUE) {
                _MINIDUMP_EXCEPTION_INFORMATION ExInfo;

                ExInfo.ThreadId = ::GetCurrentThreadId();
                ExInfo.ExceptionPointers = lpTopLevelExceptionFilter;
                ExInfo.ClientPointers = FALSE;

                // write the dump
                bDumpCreated = pMiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, MiniDumpNormal, &ExInfo, nullptr, nullptr);
                if (bDumpCreated) {
                    _stprintf_s(szResult, _countof(szResult), ResStr(IDS_MPC_CRASH), dumpPath);
                    retval = EXCEPTION_EXECUTE_HANDLER;
                } else {
                    _stprintf_s(szResult, _countof(szResult), ResStr(IDS_MPC_MINIDUMP_FAIL), dumpPath, GetLastError());
                }

                ::CloseHandle(hFile);
            } else {
                _stprintf_s(szResult, _countof(szResult), ResStr(IDS_MPC_MINIDUMP_FAIL), dumpPath, GetLastError());
            }
        }
        FreeLibrary(hDll);
    }

    if (szResult[0]) {
        switch (MessageBox(nullptr, szResult, _T("MPC-HC - Mini Dump"), bDumpCreated ? MB_YESNO : MB_OK)) {
            case IDYES:
                ShellExecute(nullptr, _T("open"), BUGS_URL, nullptr, nullptr, SW_SHOWDEFAULT);
                ExploreToFile(dumpPath);
                break;
            case IDNO:
                retval = EXCEPTION_CONTINUE_SEARCH; // rethrow the exception to make easier attaching a debugger
                break;
        }
    }
#else
    if (MessageBox(nullptr, ResStr(IDS_MPC_BUG_REPORT), ResStr(IDS_MPC_BUG_REPORT_TITLE), MB_YESNO) == IDYES) {
        ShellExecute(nullptr, _T("open"), DOWNLOAD_URL, nullptr, nullptr, SW_SHOWDEFAULT);
    }
#endif // DISABLE_MINIDUMP

    return retval;
}
开发者ID:DanHenebry,项目名称:mpc-hc,代码行数:71,代码来源:MiniDump.cpp

示例13: SetIcon

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	SetIcon(m_hIcon, TRUE);			// 设置大图标
	SetIcon(m_hIcon, FALSE);		// 设置小图标
	///工具栏创建
	
	m_imageList.Create(16,16,ILC_COLOR32|ILC_MASK,0,0);
	m_imageList.Add(AfxGetApp()->LoadIcon(IDI_ICON_LEFT));//0
	m_imageList.Add(AfxGetApp()->LoadIcon(IDI_ICON_MIDDLE));//1
	m_imageList.Add(AfxGetApp()->LoadIcon(IDI_ICON_RIGHT));//2
	m_imageList.Add(AfxGetApp()->LoadIcon(IDI_ICON_TOP));//6
	m_imageList.Add(AfxGetApp()->LoadIcon(IDI_ICON_BOTTOM));//7
	m_imageList.Add(AfxGetApp()->LoadIcon(IDI_ICON_WIDTH));//3
	m_imageList.Add(AfxGetApp()->LoadIcon(IDI_ICON_HEIGHT));//4
	m_imageList.Add(AfxGetApp()->LoadIcon(IDI_ICON_SAMESIZE));//5
	m_imageList.Add(AfxGetApp()->LoadIcon(IDI_ICON_HORI));//8
	m_imageList.Add(AfxGetApp()->LoadIcon(IDI_ICON_VERI));//9

	UINT btnIDs[12]; 
	btnIDs[0]=IDI_ICON_LEFT;
	btnIDs[1]=IDI_ICON_MIDDLE;
	btnIDs[2]=IDI_ICON_RIGHT;
	btnIDs[3]=IDI_ICON_TOP;
	btnIDs[4]=IDI_ICON_BOTTOM;
	btnIDs[5]=ID_SEPARATOR;
	btnIDs[6]=IDI_ICON_WIDTH;
	btnIDs[7]=IDI_ICON_HEIGHT;
	btnIDs[8]=IDI_ICON_SAMESIZE;
	btnIDs[9]=ID_SEPARATOR;
	btnIDs[10]=IDI_ICON_HORI;
	btnIDs[11]=IDI_ICON_VERI;

	m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_NOALIGN
		| CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
	m_wndToolBar.SetButtons(btnIDs,12);
	m_wndToolBar.SetButtonText(0,toolLeftText);
	m_wndToolBar.SetButtonText(1,toolMiddleText);
	m_wndToolBar.SetButtonText(2,toolRightText);
	m_wndToolBar.SetButtonText(3,toolTopText);
	m_wndToolBar.SetButtonText(4,toolBottomText);
	m_wndToolBar.SetButtonText(6,toolWidthText);
	m_wndToolBar.SetButtonText(7,toolHeightText);
	m_wndToolBar.SetButtonText(8,toolSameSizeText);
	m_wndToolBar.SetButtonText(10,toolHorText);
	m_wndToolBar.SetButtonText(11,toolVerText);
	
	m_wndToolBar.GetToolBarCtrl().SetExtendedStyle(TBSTYLE_EX_DRAWDDARROWS);
	/*
	TBMETRICS tbmer;
	tbmer.cbSize=sizeof(TBMETRICS);
	tbmer.dwMask=TBMF_BUTTONSPACING;
	tbmer.cxButtonSpacing=5;//设置间隔
	m_wndToolBar.GetToolBarCtrl().SetMetrics(&tbmer);
	*/
	m_wndToolBar.GetToolBarCtrl().SetImageList(&m_imageList);
	CRect temp;
	m_wndToolBar.GetItemRect(0,&temp);
	m_wndToolBar.SetSizes(CSize(temp.Width(),temp.Height()),CSize(16,16));   
	//Make the toolbar dockable
	m_wndToolBar.EnableDocking(CBRS_ALIGN_TOP);
	EnableDocking(CBRS_ALIGN_TOP);
	DockControlBar(&m_wndToolBar);

	////////////////////////////去掉默认菜单栏
	SetMenu(NULL);
	DestroyMenu(m_hMenuDefault);
	///////////////////////////
	LONG style=::GetWindowLong(this->m_hWnd,GWL_STYLE);//取消标题栏
	style &= ~WS_CAPTION;
	SetWindowLong(m_hWnd,GWL_STYLE,style);

	
	
//	GetWindowPlacement(&m_oldWindowPlaceMent);
	

//	FullScreen();
	///////////////////////////////////////
	theApp.ReadLogicVariablesFromFile();

	SetTimer(AUTOSHUTDOWN,1000,NULL);
	///////////////////////
	DeleteLogFile();
	//////////////////////
	AddTrayIcon();
	///////////////
	return 0;
}
开发者ID:Forlearngit,项目名称:HallQueFront,代码行数:90,代码来源:MainFrm.cpp

示例14: CDialogEx

CIPNotFound::CIPNotFound(CWnd* pParent /*=NULL*/)
	: CDialogEx(CIPNotFound::IDD, pParent)
{
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
	
}
开发者ID:ChunmeiZhang915,项目名称:Talk2Me,代码行数:6,代码来源:IpNotFound.cpp

示例15: AfxGetApp

void CMainFrame::OnFileCloseAll()
{
	// TODO: 在此添加命令处理程序代码
	AfxGetApp()->CloseAllDocuments(TRUE);
}
开发者ID:ECNU-ZR,项目名称:physwf-c-lab,代码行数:5,代码来源:MainFrm.cpp


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