您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CenterWindow函数代码示例

51自学网 2021-06-01 20:09:40
  C++
这篇教程C++ CenterWindow函数代码示例写得很实用,希望能帮到您。

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

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

示例1: ColorDialogProc

/** ColorDialogProc:  Allow user to select foreground & background colors.*/BOOL CALLBACK ColorDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam){	static ColorDialogStruct *info;	static HWND hSample;	static COLORREF temp_fg, temp_bg;	int ctrl;	CHOOSECOLOR cc;	HDC hdc;	switch (message)	{	case WM_INITDIALOG:		info = (ColorDialogStruct *) lParam;		temp_fg = GetColor(info->fg);		temp_bg = GetColor(info->bg);		hSample = GetDlgItem(hDlg, IDC_SAMPLETEXT);		CenterWindow(hDlg, hMain);		return TRUE;	case WM_PAINT:		hdc = GetDC(hSample);		SelectPalette(hdc, hPal, FALSE);		SetTextColor(hdc, temp_fg);		SetBkColor(hdc, temp_bg);		InvalidateRect(hSample, NULL, TRUE);		UpdateWindow(hSample);		SelectObject(hdc, GetFont(FONT_TITLES));		TextOut(hdc, 0, 0, szAppName, strlen(szAppName));		ReleaseDC(hSample, hdc);		break;	case WM_COMMAND:		switch(ctrl = GET_WM_COMMAND_ID(wParam, lParam))		{		case IDC_BACKGROUND:		case IDC_FOREGROUND:			memset(&cc, 0, sizeof(CHOOSECOLOR));			cc.lStructSize = sizeof(CHOOSECOLOR);			cc.hwndOwner = hDlg;			cc.rgbResult = (ctrl == IDC_FOREGROUND) ? temp_fg : temp_bg;			cc.lpCustColors = CustColors;			cc.Flags = CC_RGBINIT | CC_FULLOPEN;			if (ChooseColor(&cc) == 0)				return TRUE;			/* Set new color */			if (ctrl == IDC_FOREGROUND)				temp_fg = MAKEPALETTERGB(cc.rgbResult);			else temp_bg = MAKEPALETTERGB(cc.rgbResult);			/* Redraw to see new colors */			InvalidateRect(hDlg, NULL, TRUE);			return TRUE;		case IDOK:			/* Save user's choices */			SetColor(info->fg, temp_fg);			SetColor(info->bg, temp_bg);			MainChangeColor();			EndDialog(hDlg, IDOK);			return TRUE;		case IDCANCEL:			EndDialog(hDlg, IDCANCEL);			return TRUE;		}	}	return FALSE;}
开发者ID:MorbusM59,项目名称:Meridian59,代码行数:83,


示例2: ClientMsgBoxProc

/* * ClientMsgBoxProc:  A substitute implementation of MessageBox's window procedure. *   We have 2 OK buttons and 2 Cancel buttons, to account for the case where one *   or the other is the default button.  We hide the buttons we don't need. */BOOL CALLBACK ClientMsgBoxProc(HWND hDlg, UINT message, UINT wParam, LONG lParam){   static MsgBoxStruct *s;   char *icon = NULL, *temp;   int style, button_style, num_lines, yincrease;   HICON hIcon;   HWND hEdit, hText;   HWND hOK, hCancel, hOK2, hCancel2;   HFONT hFont;   RECT dlg_rect, edit_rect;   switch (message)   {   case WM_ACTIVATE:      CenterWindow(hDlg, GetParent(hDlg));      break;   case WM_SETFOCUS:   case WM_WINDOWPOSCHANGING:      SetFocus(hDlg);      break;   case WM_INITDIALOG:      s = (MsgBoxStruct *) lParam;      button_style = s->style & MB_TYPEMASK;      hText = GetDlgItem(hDlg, IDC_TEXT);      hOK = GetDlgItem(hDlg, IDOK);      hCancel = GetDlgItem(hDlg, IDCANCEL);      hOK2 = GetDlgItem(hDlg, IDOK2);      hCancel2 = GetDlgItem(hDlg, IDCANCEL2);      // Display text      // Put text in invisible edit box to see how much space it will take      hEdit = GetDlgItem(hDlg, IDC_EDIT);      hFont = GetWindowFont(hText);      SetWindowFont(hEdit, hFont, TRUE);      SetWindowFont(hOK, hFont, FALSE);      SetWindowFont(hCancel, hFont, FALSE);      SetWindowFont(hOK2, hFont, FALSE);      SetWindowFont(hCancel2, hFont, FALSE);      SetWindowText(hEdit, s->text);      Edit_GetRect(hEdit, &edit_rect);      num_lines = Edit_GetLineCount(hEdit);      // Count blank lines separately, since edit box not handling them correctly      temp = s->text;      do      {         temp = strstr(temp, "/n/n");         if (temp != NULL)         {            num_lines++;            temp += 2;         }      } while (temp != NULL);      yincrease = GetFontHeight(hFont) * num_lines;      // Resize dialog and text area      GetWindowRect(hDlg, &dlg_rect);      MoveWindow(hDlg, dlg_rect.left, dlg_rect.top, dlg_rect.right - dlg_rect.left,          dlg_rect.bottom - dlg_rect.top + yincrease, FALSE);      ResizeDialogItem(hDlg, hText, &dlg_rect, RDI_ALL, False);      // Move buttons; center OK button if it's the only one      if (button_style == MB_OK)      {         ResizeDialogItem(hDlg, hOK, &dlg_rect, RDI_BOTTOM | RDI_HCENTER, False);         ShowWindow(hCancel, SW_HIDE);         ShowWindow(hCancel2, SW_HIDE);      }      else      {         ResizeDialogItem(hDlg, hOK, &dlg_rect, RDI_BOTTOM, False);         ResizeDialogItem(hDlg, hCancel, &dlg_rect, RDI_BOTTOM, False);         ResizeDialogItem(hDlg, hOK2, &dlg_rect, RDI_BOTTOM, False);         ResizeDialogItem(hDlg, hCancel2, &dlg_rect, RDI_BOTTOM, False);      }      SetWindowText(hDlg, s->title);      SetWindowText(hText, s->text);      ShowWindow(hEdit, SW_HIDE);      // Set icon to appropriate system icon      style = s->style & MB_ICONMASK;      if (style == MB_ICONSTOP)         icon = IDI_HAND;      else if (style == MB_ICONINFORMATION)         icon = IDI_ASTERISK;      else if (style == MB_ICONEXCLAMATION)         icon = IDI_EXCLAMATION;      else if (style == MB_ICONQUESTION)         icon = IDI_QUESTION;//.........这里部分代码省略.........
开发者ID:MorbusM59,项目名称:Meridian59,代码行数:101,


示例3: SetFolderPath

BOOL CMainDlg::OnInitDialog() {		CDialog::OnInitDialog();			SetFolderPath();	//skin	CString sSkinPath;	sSkinPath.Format("%s//skin.bmp",m_sFolderPath);	m_hBmp = (HBITMAP)LoadImage(AfxGetInstanceHandle(),sSkinPath,IMAGE_BITMAP,0,0,LR_LOADFROMFILE);	m_bFirst = TRUE;	//inisialisasi database	CString sDBPath;		m_pDb = new CADODatabase();	sDBPath.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s//db//tts.mdb;Persist Security Info=False",m_sFolderPath);			if(m_pDb->Open(sDBPath))	{					//inisialiasi backpropagation		m_backpro.SetConnDB(m_pDb);				//inisialiasi second positioning asymetric windowing		m_spaw.SetConnDB(m_pDb);		m_spaw.SetBackPro(&m_backpro);				m_spaw.Initialize(WINDOWSIZE,CENTERWINDOWPOS,4000,0.01, 0.01,4000);				//inisialisasi speech			//inisialisai natural language		m_NatLang.SetConnDB(m_pDb);		m_NatLang.m_sFolderPath = m_sFolderPath;		m_NatLang.SetSPAW(&m_spaw);			//inisialisasi tiap dialog di memory				m_pLearningDlg = new CLearningDlg;			m_pLearningDlg->SetSPAW(&m_spaw);		m_pLearningDlg->Create( IDD_LEARNING_DIALOG, &m_cMainPanel);		m_pLearningDlg->ShowWindow(SW_HIDE);							m_pKataDlg = new CKataDlg;		m_pKataDlg->SetSPAW(&m_spaw);		m_pKataDlg->SetDB(m_pDb);		m_pKataDlg->Create( IDD_DATA_KATA, &m_cMainPanel);		m_pKataDlg->ShowWindow(SW_HIDE);				m_pPengecualianDlg = new CPengecualianDlg;		m_pPengecualianDlg->SetDB(m_pDb);		m_pPengecualianDlg->Create(IDD_DATA_PENGECUALIAN, &m_cMainPanel);		m_pPengecualianDlg->ShowWindow(SW_HIDE);		m_pSingkatanDlg = new CSingkatanDlg;		m_pSingkatanDlg->SetDB(m_pDb);		m_pSingkatanDlg->Create(IDD_DATA_SINGKATAN,&m_cMainPanel);		m_pSingkatanDlg->ShowWindow(SW_HIDE);		m_pPengucapanDlg = new CNETtalk2Dlg;		m_pPengucapanDlg->SetNatLang(&m_NatLang);		m_pPengucapanDlg->SetConnDB(m_pDb);		m_pPengucapanDlg->Create(IDD_NETTALK2_DIALOG,&m_cMainPanel);		m_pPengucapanDlg->ShowWindow(SW_SHOW);		m_pPengucapanDlg->m_hLearning = m_pLearningDlg->m_hWnd;		m_pPengucapanDlg->m_sFolderpath = m_sFolderPath;		SetActiveDialog(m_pPengucapanDlg);			SetStyle();	}	else	{		MessageBox("Error dalam membuka database","NETtalk2",MB_OK);			EndDialog(0);	}		SetWindowPos(&CWnd::wndTop,0,0,0,0,SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE);	CenterWindow();	return TRUE;  // return TRUE unless you set the focus to a control	              // EXCEPTION: OCX Property Pages should return FALSE}
开发者ID:araneta,项目名称:NetTalk2,代码行数:76,


示例4: CenterWindow

INT_PTR CHelpFileMissingDialog::OnInitDialog(){	CenterWindow(GetParent(m_hDlg),m_hDlg);	return TRUE;}
开发者ID:Rajuk-,项目名称:explorerplusplus,代码行数:6,


示例5: MachineStateDlg_OnInitDialog

/** * @brief WM_INITDIALOG handler of Machine State dialog. * @param hwnd - window handle. * @param hwndFocus - system-defined focus window. * @param lParam - user-defined parameter. * @return true to setup focus to system-defined control. */static BOOL MachineStateDlg_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam){	lParam; hwndFocus;	_ASSERTE(g_pResManager != NULL);	if (g_pResManager->m_hBigAppIcon)		SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)g_pResManager->m_hBigAppIcon);	if (g_pResManager->m_hSmallAppIcon)		SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)g_pResManager->m_hSmallAppIcon);	CenterWindow(hwnd, GetParent(hwnd));	g_LayoutMgr.InitLayout(hwnd, g_arrMachineStateLayout, countof(g_arrMachineStateLayout));	HWND hwndProcessList = GetDlgItem(hwnd, IDC_PROCESS_LIST);	ListView_SetExtendedListViewStyle(hwndProcessList, LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP);	HWND hwndModuleList = GetDlgItem(hwnd, IDC_PROCESS_MODULES_LIST);	ListView_SetExtendedListViewStyle(hwndModuleList, LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP);	RECT rcList;	GetClientRect(hwndProcessList, &rcList);	rcList.right -= GetSystemMetrics(SM_CXHSCROLL);	TCHAR szColumnTitle[64];	LVCOLUMN lvc;	ZeroMemory(&lvc, sizeof(lvc));	lvc.mask = LVCF_TEXT | LVCF_WIDTH;	lvc.pszText = szColumnTitle;	lvc.cx = rcList.right / 5;	LoadString(g_hInstance, IDS_COLUMN_PID, szColumnTitle, countof(szColumnTitle));	ListView_InsertColumn(hwndProcessList, CID_PROCESS_ID, &lvc);	lvc.cx = rcList.right * 4 / 5;	LoadString(g_hInstance, IDS_COLUMN_PROCESS, szColumnTitle, countof(szColumnTitle));	ListView_InsertColumn(hwndProcessList, CID_PROCESS_NAME, &lvc);	lvc.cx = rcList.right / 2;	LoadString(g_hInstance, IDS_COLUMN_MODULE, szColumnTitle, countof(szColumnTitle));	ListView_InsertColumn(hwndModuleList, CID_MODULE_NAME, &lvc);	lvc.cx = rcList.right / 4;	LoadString(g_hInstance, IDS_COLUMN_VERSION, szColumnTitle, countof(szColumnTitle));	ListView_InsertColumn(hwndModuleList, CID_MODULE_VERSION, &lvc);	lvc.cx = rcList.right / 4;	LoadString(g_hInstance, IDS_COLUMN_BASE, szColumnTitle, countof(szColumnTitle));	ListView_InsertColumn(hwndModuleList, CID_MODULE_BASE, &lvc);	CEnumProcess::CProcessEntry ProcEntry;	if (g_pEnumProc->GetProcessFirst(ProcEntry))	{		LVITEM lvi;		ZeroMemory(&lvi, sizeof(lvi));		lvi.mask = LVIF_TEXT | LVIF_PARAM;		int iItemPos = 0;		do		{			TCHAR szProcessID[64];			_ultot_s(ProcEntry.m_dwProcessID, szProcessID, countof(szProcessID), 10);			lvi.iItem = iItemPos;			lvi.pszText = szProcessID;			lvi.lParam = ProcEntry.m_dwProcessID;			ListView_InsertItem(hwndProcessList, &lvi);			ListView_SetItemText(hwndProcessList, iItemPos, CID_PROCESS_NAME, ProcEntry.m_szProcessName);			++iItemPos;		}		while (g_pEnumProc->GetProcessNext(ProcEntry));	}	// LVM_SETIMAGELIST resets header control image list	g_ProcessListOrder.InitList(hwndProcessList);	g_ModulesListOrder.InitList(hwndModuleList);	return TRUE;}
开发者ID:3rdexp,项目名称:fxfile,代码行数:81,


示例6: _T

LRESULT CErrorReportDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/){   		CErrorReportSender* pSender = CErrorReportSender::GetInstance();	CCrashInfoReader* pCrashInfo = pSender->GetCrashInfo();    // Mirror this window if RTL language is in use.    CString sRTL = pSender->GetLangStr(_T("Settings"), _T("RTLReading"));    if(sRTL.CompareNoCase(_T("1"))==0)    {        Utility::SetLayoutRTL(m_hWnd);    }	// Set dialog caption.    SetWindowText(pSender->GetLangStr(_T("MainDlg"), _T("DlgCaption")));    // Center the dialog on the screen.    CenterWindow();    HICON hIcon = NULL;    // Get custom icon.    hIcon = pCrashInfo->GetCustomIcon();    if(hIcon==NULL)    {        // Use default icon, if custom icon is not provided.        hIcon = ::LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME));    }    // Set window icon.    SetIcon(hIcon, 0);    // Get the first icon in the EXE image and use it for header.    m_HeadingIcon = ExtractIcon(NULL, pCrashInfo->GetReport(0)->GetImageName(), 0);    // If there is no icon in crashed EXE module, use default IDI_APPLICATION system icon.    if(m_HeadingIcon == NULL)    {        m_HeadingIcon = ::LoadIcon(NULL, MAKEINTRESOURCE(IDI_APPLICATION));    }  	// Init controls.    m_statSubHeader = GetDlgItem(IDC_SUBHEADER);    m_link.SubclassWindow(GetDlgItem(IDC_LINK));       m_link.SetHyperLinkExtendedStyle(HLINK_COMMANDBUTTON);	m_link.SetLabel(pSender->GetLangStr(_T("MainDlg"), _T("WhatDoesReportContain")));    m_linkMoreInfo.SubclassWindow(GetDlgItem(IDC_MOREINFO));    m_linkMoreInfo.SetHyperLinkExtendedStyle(HLINK_COMMANDBUTTON);	m_linkMoreInfo.SetLabel(pSender->GetLangStr(_T("MainDlg"), _T("ProvideAdditionalInfo")));    m_statEmail = GetDlgItem(IDC_STATMAIL);    m_statEmail.SetWindowText(pSender->GetLangStr(_T("MainDlg"), _T("YourEmail")));    m_editEmail = GetDlgItem(IDC_EMAIL);	m_editEmail.SetWindowText(pSender->GetCrashInfo()->GetPersistentUserEmail());    m_statDesc = GetDlgItem(IDC_DESCRIBE);    m_statDesc.SetWindowText(pSender->GetLangStr(_T("MainDlg"), _T("DescribeProblem")));    m_editDesc = GetDlgItem(IDC_DESCRIPTION);    m_statIndent =  GetDlgItem(IDC_INDENT);    m_chkRestart = GetDlgItem(IDC_RESTART);    CString sCaption;    sCaption.Format(pSender->GetLangStr(_T("MainDlg"), _T("RestartApp")), pSender->GetCrashInfo()->m_sAppName);    m_chkRestart.SetWindowText(sCaption);    m_chkRestart.SetCheck(BST_CHECKED);    m_chkRestart.ShowWindow(pSender->GetCrashInfo()->m_bAppRestart?SW_SHOW:SW_HIDE);    m_statConsent = GetDlgItem(IDC_CONSENT);    // Init font for consent string.    LOGFONT lf;    memset(&lf, 0, sizeof(LOGFONT));    lf.lfHeight = 11;    lf.lfWeight = FW_NORMAL;    lf.lfQuality = ANTIALIASED_QUALITY;    _TCSCPY_S(lf.lfFaceName, 32, _T("Tahoma"));    CFontHandle hConsentFont;    hConsentFont.CreateFontIndirect(&lf);    m_statConsent.SetFont(hConsentFont);	// Set text of the static    if(pSender->GetCrashInfo()->m_sPrivacyPolicyURL.IsEmpty())        m_statConsent.SetWindowText(pSender->GetLangStr(_T("MainDlg"), _T("MyConsent2")));    else        m_statConsent.SetWindowText(pSender->GetLangStr(_T("MainDlg"), _T("MyConsent")));	// Init Privacy Policy link    m_linkPrivacyPolicy.SubclassWindow(GetDlgItem(IDC_PRIVACYPOLICY));    m_linkPrivacyPolicy.SetHyperLink(pSender->GetCrashInfo()->m_sPrivacyPolicyURL);    m_linkPrivacyPolicy.SetLabel(pSender->GetLangStr(_T("MainDlg"), _T("PrivacyPolicy")));    BOOL bShowPrivacyPolicy = !pSender->GetCrashInfo()->m_sPrivacyPolicyURL.IsEmpty();      m_linkPrivacyPolicy.ShowWindow(bShowPrivacyPolicy?SW_SHOW:SW_HIDE);    m_statCrashRpt = GetDlgItem(IDC_CRASHRPT);//.........这里部分代码省略.........
开发者ID:cpzhang,项目名称:zen,代码行数:101,


示例7: SetWindowText

BOOL CPrintingDialog::OnInitDialog(){	SetWindowText(AfxGetAppName());	CenterWindow();	return CDialog::OnInitDialog();}
开发者ID:anyue100,项目名称:winscp,代码行数:6,


示例8: SetDlgItemText

LRESULT CLogTIDFilterEditDlg::OnInitDialog(HWND /*hwndFocus*/, LPARAM /*lp*/){	SetDlgItemText(IDC_EDIT_LOGTID, tp::cz(L"%u", m_filter->m_tid));	CenterWindow();	return 0;}
开发者ID:timepp,项目名称:bdlog,代码行数:6,


示例9: SetIcon

BOOL CSettings::OnInitDialog(){	BOOL bResult = CTreePropSheet::OnInitDialog();	CAppUtils::MarkWindowAsUnpinnable(m_hWnd);	SetIcon(m_hIcon, TRUE);			// Set big icon	SetIcon(m_hIcon, FALSE);		// Set small icon	if (g_GitAdminDir.HasAdminDir(this->m_CmdPath.GetWinPath()) || g_GitAdminDir.IsBareRepo(this->m_CmdPath.GetWinPath()))	{		CString title;		GetWindowText(title);		SetWindowText(g_Git.m_CurrentDir + _T(" - ") + title);	}	CenterWindow(CWnd::FromHandle(hWndExplorer));	if (this->m_DefaultPage == _T("gitremote"))	{		this->SetActivePage(this->m_pGitRemote);		this->m_pGitRemote->m_bNoFetch = true;	}	else if (this->m_DefaultPage == _T("gitconfig"))	{		this->SetActivePage(this->m_pGitConfig);	}	else if (this->m_DefaultPage == _T("gitcredential"))	{		this->SetActivePage(this->m_pGitCredential);	}	else if (this->m_DefaultPage == _T("main"))	{		this->SetActivePage(this->m_pMainPage);	}	else if (this->m_DefaultPage == _T("overlay"))	{		this->SetActivePage(this->m_pOverlayPage);	}	else if (this->m_DefaultPage == _T("overlays"))	{		this->SetActivePage(this->m_pOverlaysPage);	}	else if (this->m_DefaultPage == _T("overlayshandlers"))	{		this->SetActivePage(this->m_pOverlayHandlersPage);	}	else if (this->m_DefaultPage == _T("proxy"))	{		this->SetActivePage(this->m_pProxyPage);	}	else if (this->m_DefaultPage == _T("diff"))	{		this->SetActivePage(this->m_pProgsDiffPage);	}	else if (this->m_DefaultPage == _T("merge"))	{		this->SetActivePage(this->m_pProgsMergePage);	}	else if (this->m_DefaultPage == _T("alternativeeditor"))	{		this->SetActivePage(this->m_pProgsAlternativeEditor);	}	else if (this->m_DefaultPage == _T("look"))	{		this->SetActivePage(this->m_pLookAndFeelPage);	}	else if (this->m_DefaultPage == _T("dialog"))	{		this->SetActivePage(this->m_pDialogsPage);	}	else if (this->m_DefaultPage == _T("color1"))	{		this->SetActivePage(this->m_pColorsPage);	}	else if (this->m_DefaultPage == _T("color2"))	{		this->SetActivePage(this->m_pColorsPage2);	}	else if (this->m_DefaultPage == _T("color3"))	{		this->SetActivePage(this->m_pColorsPage3);	}	else if (this->m_DefaultPage == _T("save"))	{		this->SetActivePage(this->m_pSavedPage);	}	else if (this->m_DefaultPage == _T("advanced"))	{		this->SetActivePage(this->m_pAdvanced);	}	else if (this->m_DefaultPage == _T("blame"))	{		this->SetActivePage(this->m_pTBlamePage);	}	else if (g_GitAdminDir.HasAdminDir(this->m_CmdPath.GetWinPath()) || g_GitAdminDir.IsBareRepo(this->m_CmdPath.GetWinPath()))	{		this->SetActivePage(this->m_pGitConfig);	}	return bResult;}
开发者ID:mirror,项目名称:TortoiseGit,代码行数:99,


示例10: MoveWindow

BOOL CHttpDownloadDlg::OnInitDialog() {	//Let the parent class do its thing	CDialog::OnInitDialog();	m_bgImage.LoadFromResource(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDB_BITMAP2));	if(!m_bgImage.IsNull())	{		MoveWindow(0,0,m_bgImage.GetWidth(),m_bgImage.GetHeight());		CenterWindow();	}	//Setup the animation control	//m_ctrlAnimate.Open(IDR_HTTPDOWNLOAD_ANIMATION);	m_ctrlAnimate.ShowWindow(SW_HIDE);	m_static.SetMyText("游戏下载");	m_static.MoveWindow(10,40,80,80);	m_listbox.MoveWindow(12,58,410,100);	m_listbox.InitListCtrl(RGB(194,212,234),RGB(0,0,0),RGB(249,175,40),RGB(0,0,0),"");	m_listbox.setProcessPos(2);	m_listbox.SetProcessImage(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDB_BITMAP6),MAKEINTRESOURCE(IDB_BITMAP7));	m_listbox.InsertColumn(0,"文件名",LVCFMT_CENTER,130);	m_listbox.InsertColumn(1,"大小(KB)",LVCFMT_CENTER,60);	m_listbox.InsertColumn(2,"进度",LVCFMT_CENTER,170);	m_listbox.InsertColumn(3,"速度",LVCFMT_CENTER,50);	m_listbox.InitListHeader(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDB_BITMAP1),MAKEINTRESOURCE(IDB_BITMAP1),RGB(255,255,255),RGB(255,255,255),1);	m_listbox.SetTimer(100,10,NULL);	m_exit.LoadImageFromeResource(AfxGetInstanceHandle(),IDB_BITMAP5);	m_exit.SetPosition(CPoint(410,10));	m_cancel.LoadImageFromeResource(AfxGetInstanceHandle(),IDB_BITMAP4);	m_cancel.SetPosition(CPoint(360,175));	//Validate the URL	ASSERT(m_sURLToDownload.GetLength()); //Did you forget to specify the file to download	if (!AfxParseURL(m_sURLToDownload, m_dwServiceType, m_sServer, m_sObject, m_nPort))	{		//Try sticking "http://" before it		m_sURLToDownload = CString("http://") + m_sURLToDownload;		if (!AfxParseURL(m_sURLToDownload, m_dwServiceType, m_sServer, m_sObject, m_nPort))		{			TRACE(_T("Failed to parse the URL: %s/n"), m_sURLToDownload);			EndDialog(IDCANCEL);			return TRUE;		}	}	//Check to see if the file we are downloading to exists and if	//it does, then ask the user if they were it overwritten	CFileStatus fs;	ASSERT(m_sFileToDownloadInto.GetLength());	if (CFile::GetStatus(m_sFileToDownloadInto, fs))	{/*	 CString sMsg;	 AfxFormatString1(sMsg, IDS_HTTPDOWNLOAD_OK_TO_OVERWRITE, m_sFileToDownloadInto);	 if (AfxMessageBox(sMsg, MB_YESNO) != IDYES)	 {	 TRACE(_T("Failed to confirm file overwrite, download aborted/n"));	 EndDialog(IDCANCEL);	 return TRUE;	 }*/	}	//Try and open the file we will download into	if (!m_FileToWrite.Open(m_sFileToDownloadInto, CFile::modeCreate | CFile::modeWrite | CFile::shareDenyWrite))	{		TRACE(_T("Failed to open the file to download into, Error:%d/n"), GetLastError());		CString sError;		sError.Format(_T("%d"), ::GetLastError());		CString sMsg;		AfxFormatString1(sMsg, IDS_HTTPDOWNLOAD_FAIL_FILE_OPEN, sError);				//AFCMessageBox(sMsg);	     DUIMessageBox(m_hWnd,MB_ICONINFORMATION|MB_OK,"系统提示",false,sMsg);		EndDialog(IDCANCEL);		return TRUE;	}	//Pull out just the filename component	int nSlash = m_sObject.ReverseFind(_T('/'));	if (nSlash == -1)		nSlash = m_sObject.ReverseFind(_T('//'));	if (nSlash != -1 && m_sObject.GetLength() > 1)		m_sFilename = m_sObject.Right(m_sObject.GetLength() - nSlash - 1);	else		m_sFilename = m_sObject;	m_listbox.InsertItem(0,m_sFilename.GetBuffer());	//Set the file status text	CString sFileStatus;	ASSERT(m_sObject.GetLength());	ASSERT(m_sServer.GetLength());	AfxFormatString2(sFileStatus, IDS_HTTPDOWNLOAD_FILESTATUS, m_sFilename, m_sServer);	m_ctrlFileStatus.SetWindowText(sFileStatus);//.........这里部分代码省略.........
开发者ID:lincoln56,项目名称:robinerp,代码行数:101,


示例11: sizeof

BOOL CGitProgressDlg::OnInitDialog(){    __super::OnInitDialog();    // Let the TaskbarButtonCreated message through the UIPI filter. If we don't    // do this, Explorer would be unable to send that message to our window if we    // were running elevated. It's OK to make the call all the time, since if we're    // not elevated, this is a no-op.    CHANGEFILTERSTRUCT cfs = { sizeof(CHANGEFILTERSTRUCT) };    typedef BOOL STDAPICALLTYPE ChangeWindowMessageFilterExDFN(HWND hWnd, UINT message, DWORD action, PCHANGEFILTERSTRUCT pChangeFilterStruct);    CAutoLibrary hUser = AtlLoadSystemLibraryUsingFullPath(_T("user32.dll"));    if (hUser)    {        ChangeWindowMessageFilterExDFN *pfnChangeWindowMessageFilterEx = (ChangeWindowMessageFilterExDFN*)GetProcAddress(hUser, "ChangeWindowMessageFilterEx");        if (pfnChangeWindowMessageFilterEx)        {            pfnChangeWindowMessageFilterEx(m_hWnd, WM_TASKBARBTNCREATED, MSGFLT_ALLOW, &cfs);        }    }    m_ProgList.m_pTaskbarList.Release();    if (FAILED(m_ProgList.m_pTaskbarList.CoCreateInstance(CLSID_TaskbarList)))        m_ProgList.m_pTaskbarList = nullptr;    UpdateData(FALSE);    AddAnchor(IDC_SVNPROGRESS, TOP_LEFT, BOTTOM_RIGHT);    AddAnchor(IDC_TITLE_ANIMATE, TOP_LEFT, BOTTOM_RIGHT);    AddAnchor(IDC_PROGRESSLABEL, BOTTOM_LEFT, BOTTOM_CENTER);    AddAnchor(IDC_PROGRESSBAR, BOTTOM_CENTER, BOTTOM_RIGHT);    AddAnchor(IDC_INFOTEXT, BOTTOM_LEFT, BOTTOM_RIGHT);    AddAnchor(IDCANCEL, BOTTOM_RIGHT);    AddAnchor(IDOK, BOTTOM_RIGHT);    AddAnchor(IDC_LOGBUTTON, BOTTOM_RIGHT);    //SetPromptParentWindow(this->m_hWnd);    m_Animate.Open(IDR_DOWNLOAD);    m_ProgList.m_pAnimate = &m_Animate;    m_ProgList.m_pProgControl = &m_ProgCtrl;    m_ProgList.m_pProgressLabelCtrl = &m_ProgLableCtrl;    m_ProgList.m_pInfoCtrl = &m_InfoCtrl;    m_ProgList.m_pPostWnd = this;    m_ProgList.m_bSetTitle = true;    if (hWndExplorer)        CenterWindow(CWnd::FromHandle(hWndExplorer));    EnableSaveRestore(_T("GITProgressDlg"));    m_background_brush.CreateSolidBrush(GetSysColor(COLOR_WINDOW));    m_ProgList.Init();    int autoClose = CRegDWORD(_T("Software//TortoiseGit//AutoCloseGitProgress"), 0);    CCmdLineParser parser(AfxGetApp()->m_lpCmdLine);    if (parser.HasKey(_T("closeonend")))        autoClose = parser.GetLongVal(_T("closeonend"));    switch (autoClose)    {    case 1:        m_AutoClose = AUTOCLOSE_IF_NO_OPTIONS;        break;    case 2:        m_AutoClose = AUTOCLOSE_IF_NO_ERRORS;        break;    default:        m_AutoClose = AUTOCLOSE_NO;        break;    }    return TRUE;}
开发者ID:paulogeneses,项目名称:TortoiseGit,代码行数:69,


示例12: CenterWindow

LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/){	// center the dialog on the screen	CenterWindow();	// set icons	HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 		IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);	SetIcon(hIcon, TRUE);	HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 		IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);	SetIcon(hIconSmall, FALSE);  int nItem = 0;  m_cboThread = GetDlgItem(IDC_THREAD);  nItem = m_cboThread.AddString(_T("Main thread"));  m_cboThread.SetItemData(nItem, 0);    nItem = m_cboThread.AddString(_T("Worker thread"));  m_cboThread.SetItemData(nItem, 1);  m_cboThread.SetCurSel(0);  m_cboExcType = GetDlgItem(IDC_EXCTYPE);    nItem = m_cboExcType.AddString(_T("SEH exception"));  m_cboExcType.SetItemData(nItem, CR_SEH_EXCEPTION);  nItem = m_cboExcType.AddString(_T("terminate"));  m_cboExcType.SetItemData(nItem, CR_CPP_TERMINATE_CALL);  nItem = m_cboExcType.AddString(_T("unexpected"));  m_cboExcType.SetItemData(nItem, CR_CPP_UNEXPECTED_CALL);  nItem = m_cboExcType.AddString(_T("pure virtual method call"));  m_cboExcType.SetItemData(nItem, CR_CPP_PURE_CALL);  nItem = m_cboExcType.AddString(_T("new operator fault"));  m_cboExcType.SetItemData(nItem, CR_CPP_NEW_OPERATOR_ERROR);  nItem = m_cboExcType.AddString(_T("buffer overrun"));  m_cboExcType.SetItemData(nItem, CR_CPP_SECURITY_ERROR);  nItem = m_cboExcType.AddString(_T("invalid parameter"));  m_cboExcType.SetItemData(nItem, CR_CPP_INVALID_PARAMETER);  nItem = m_cboExcType.AddString(_T("SIGABRT"));  m_cboExcType.SetItemData(nItem, CR_CPP_SIGABRT);  nItem = m_cboExcType.AddString(_T("SIGFPE"));  m_cboExcType.SetItemData(nItem, CR_CPP_SIGFPE);  nItem = m_cboExcType.AddString(_T("SIGILL"));  m_cboExcType.SetItemData(nItem, CR_CPP_SIGILL);  nItem = m_cboExcType.AddString(_T("SIGINT"));  m_cboExcType.SetItemData(nItem, CR_CPP_SIGINT);  nItem = m_cboExcType.AddString(_T("SIGSEGV"));  m_cboExcType.SetItemData(nItem, CR_CPP_SIGSEGV);  nItem = m_cboExcType.AddString(_T("SIGTERM"));  m_cboExcType.SetItemData(nItem, CR_CPP_SIGTERM);  nItem = m_cboExcType.AddString(_T("throw C++ typed exception"));  m_cboExcType.SetItemData(nItem, CR_THROW);  nItem = m_cboExcType.AddString(_T("Manual report"));  m_cboExcType.SetItemData(nItem, MANUAL_REPORT);  m_cboExcType.SetCurSel(0);	// register object for message filtering and idle updates	CMessageLoop* pLoop = _Module.GetMessageLoop();	ATLASSERT(pLoop != NULL);	pLoop->AddMessageFilter(this);	pLoop->AddIdleHandler(this);	UIAddChildWindowContainer(m_hWnd);  if(m_bRestarted)  {    PostMessage(WM_POSTCREATE);      }	return TRUE;}
开发者ID:doo,项目名称:CrashRpt,代码行数:89,


示例13: EnableStackedTabs

BOOL CTreePropSheet::OnInitDialog(){	if (m_bTreeViewMode)	{		// be sure, there are no stacked tabs, because otherwise the		// page caption will be to large in tree view mode		EnableStackedTabs(FALSE);		// Initialize image list.		if (m_DefaultImages.GetSafeHandle())		{			IMAGEINFO	ii;			m_DefaultImages.GetImageInfo(0, &ii);			if (ii.hbmImage) DeleteObject(ii.hbmImage);			if (ii.hbmMask) DeleteObject(ii.hbmMask);			m_Images.Create(ii.rcImage.right-ii.rcImage.left, ii.rcImage.bottom-ii.rcImage.top, ILC_COLOR32|ILC_MASK, 0, 1);		}		else			m_Images.Create(16, 16, ILC_COLOR32|ILC_MASK, 0, 1);	}	// perform default implementation	BOOL bResult = CPropertySheet::OnInitDialog();	HighColorTab::UpdateImageList(*this);	if (!m_bTreeViewMode)		// stop here, if we would like to use tabs		return bResult;	// Get tab control...	CTabCtrl	*pTab = GetTabControl();	if (!IsWindow(pTab->GetSafeHwnd()))	{		ASSERT(FALSE);		return bResult;	}	// ... and hide it	pTab->ShowWindow(SW_HIDE);	pTab->EnableWindow(FALSE);	// Place another (empty) tab ctrl, to get a frame instead	CRect	rectFrame;	pTab->GetWindowRect(rectFrame);	ScreenToClient(rectFrame);	m_pFrame = CreatePageFrame();	if (!m_pFrame)	{		ASSERT(FALSE);		AfxThrowMemoryException();	}	m_pFrame->Create(WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS, rectFrame, this, 0xFFFF);	m_pFrame->ShowCaption(m_bPageCaption);	// Lets make place for the tree ctrl	const int	nTreeWidth = m_nPageTreeWidth;	const int	nTreeSpace = 5;	CRect	rectSheet;	GetWindowRect(rectSheet);	rectSheet.right+= nTreeWidth;	SetWindowPos(NULL, -1, -1, rectSheet.Width(), rectSheet.Height(), SWP_NOZORDER|SWP_NOMOVE);	CenterWindow();	MoveChildWindows(nTreeWidth, 0);	// Lets calculate the rectangle for the tree ctrl	CRect	rectTree(rectFrame);	rectTree.right = rectTree.left + nTreeWidth - nTreeSpace;	// calculate caption height	CTabCtrl	wndTabCtrl;	wndTabCtrl.Create(WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS, rectFrame, this, 0x1234);	wndTabCtrl.InsertItem(0, _T(""));	CRect	rectFrameCaption;	wndTabCtrl.GetItemRect(0, rectFrameCaption);	wndTabCtrl.DestroyWindow();	m_pFrame->SetCaptionHeight(rectFrameCaption.Height());	// if no caption should be displayed, make the window smaller in	// height	if (!m_bPageCaption)	{		// make frame smaller		m_pFrame->GetWnd()->GetWindowRect(rectFrame);		ScreenToClient(rectFrame);		rectFrame.top+= rectFrameCaption.Height();		m_pFrame->GetWnd()->MoveWindow(rectFrame);		// move all child windows up		MoveChildWindows(0, -rectFrameCaption.Height());		// modify rectangle for the tree ctrl		rectTree.bottom-= rectFrameCaption.Height();		// make us smaller		CRect	rect;		GetWindowRect(rect);		rect.top+= rectFrameCaption.Height()/2;//.........这里部分代码省略.........
开发者ID:15375514460,项目名称:TortoiseGit,代码行数:101,


示例14: CenterWindow

LRESULT CColorSetupDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled){	CenterWindow();	COLORREF BrushColor;	// Windows colors	m_WindowsText.SubclassWindow(GetDlgItem(IDC_BUTTON_WINDOWS_TEXT_COLOR));	m_WindowsText.SetDefaultText(IDS_COLOR_DEFAULT);	m_WindowsText.SetDefaultColor(m_clDefTextColor);	m_WindowsText.SetColor((m_clWindowsText != CLR_NONE)? m_clWindowsText : CLR_DEFAULT);	m_WindowsBack.SubclassWindow(GetDlgItem(IDC_BUTTON_WINDOWS_BACK_COLOR));	m_WindowsBack.SetDefaultText(IDS_COLOR_DEFAULT);	m_WindowsBack.SetDefaultColor(m_clDefBackColor);	m_WindowsBack.SetColor(BrushColor = ((m_clWindowsBack != CLR_NONE) ? m_clWindowsBack : CLR_DEFAULT));	if (BrushColor == CLR_DEFAULT)	{		BrushColor = m_clDefBackColor;	}	m_WindowsBrush.CreateSolidBrush(BrushColor);	//Command Colors	m_CommandText.SubclassWindow(GetDlgItem(IDC_BUTTON_COMMAND_TEXT_COLOR));	m_CommandText.SetDefaultText(IDS_COLOR_DEFAULT);	m_CommandText.SetDefaultColor(m_clDefTextColor);	m_CommandText.SetColor((m_clCommandText != CLR_NONE) ? m_clCommandText : CLR_DEFAULT);	m_CommandBack.SubclassWindow(GetDlgItem(IDC_BUTTON_COMMAND_BACK_COLOR));	m_CommandBack.SetDefaultText(IDS_COLOR_DEFAULT);	m_CommandBack.SetDefaultColor(m_clDefBackColor);	m_CommandBack.SetColor(BrushColor = ((m_clCommandBack != CLR_NONE) ? m_clCommandBack : CLR_DEFAULT));	if (BrushColor == CLR_DEFAULT)	{		BrushColor = m_clDefBackColor;	}	m_CommandBrush.CreateSolidBrush(BrushColor);	//Notify Colors	m_NotifyText.SubclassWindow(GetDlgItem(IDC_BUTTON_NOTIFY_TEXT_COLOR));	m_NotifyText.SetDefaultText(IDS_COLOR_DEFAULT);	m_NotifyText.SetDefaultColor(m_clDefTextColor);	m_NotifyText.SetColor((m_clNotifyText != CLR_NONE) ? m_clNotifyText : CLR_DEFAULT);	m_NotifyBack.SubclassWindow(GetDlgItem(IDC_BUTTON_NOTIFY_BACK_COLOR));	m_NotifyBack.SetDefaultText(IDS_COLOR_DEFAULT);	m_NotifyBack.SetDefaultColor(m_clDefBackColor);	m_NotifyBack.SetColor(BrushColor = ((m_clNotifyBack != CLR_NONE) ? m_clNotifyBack : CLR_DEFAULT));	if (BrushColor == CLR_DEFAULT)	{		BrushColor = m_clDefBackColor;	}	m_NotifyBrush.CreateSolidBrush(BrushColor);	//Reflect Colors	m_ReflectText.SubclassWindow(GetDlgItem(IDC_BUTTON_REFLECT_TEXT_COLOR));	m_ReflectText.SetDefaultText(IDS_COLOR_DEFAULT);	m_ReflectText.SetDefaultColor(m_clDefTextColor);	m_ReflectText.SetColor((m_clReflectText != CLR_NONE) ? m_clReflectText : CLR_DEFAULT);	m_ReflectBack.SubclassWindow(GetDlgItem(IDC_BUTTON_REFLECT_BACK_COLOR));	m_ReflectBack.SetDefaultText(IDS_COLOR_DEFAULT);	m_ReflectBack.SetDefaultColor(m_clDefBackColor);	m_ReflectBack.SetColor(BrushColor = ((m_clReflectBack != CLR_NONE) ? m_clReflectBack : CLR_DEFAULT));	if (BrushColor == CLR_DEFAULT)	{		BrushColor = m_clDefBackColor;	}	m_ReflectBrush.CreateSolidBrush(BrushColor);	return 1;  // Let the system set the focus}
开发者ID:axxapp,项目名称:winxgui,代码行数:63,


示例15: CFG_MainProc

LRESULT CALLBACK CFG_MainProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam){	switch (message)	{		case WM_INITDIALOG:		{					g_tvIndexCFG = 0;			g_hwndTree = GetDlgItem(hDlg,IDC_TREE_CONF);			SendMessage(g_hwndTree, TVM_SETIMAGELIST , TVSIL_NORMAL, (LPARAM)g_hImageListIcons);			SendMessage(g_hwndTree, TVM_SETIMAGELIST , TVSIL_STATE, (LPARAM)g_hImageListStates);			HTREEITEM hNewItem;			hNewItem = TreeView_AddItem(27,g_lang.GetString("ConfigGeneral"));			hNewItem = TreeView_AddItem(15,g_lang.GetString("ConfigMinimizer"));			hNewItem = TreeView_AddItem(28,"mIRC");			hNewItem = TreeView_AddItem(3,"Account (XMPP)");			hNewItem = TreeView_AddItem(16,g_lang.GetString("ConfigExtExe"));			hNewItem = TreeView_AddItem(25,g_lang.GetString("ConfigGraphic"));			hNewItem = TreeView_AddItem(13,g_lang.GetString("ConfigNetwork"));			hNewItem = TreeView_AddItem(20 ,g_lang.GetString("ConfigGames"));			if (hNewItem)				TreeView_Select(g_hwndTree, hNewItem, TVGN_CARET);			for(UINT i=0;i<gm.GamesInfo.size();i++)				hNewItem = TreeView_AddItem(gm.GamesInfo[i].iIconIndex,gm.GamesInfo[i].szGAME_SHORTNAME);			TreeView_Select(g_hwndTree, NULL, TVGN_CARET);			for(UINT i=0; i<gm.GamesInfo.size();i++)			{					GamesInfoCFG[i].bActive = gm.GamesInfo[i].bActive;					GamesInfoCFG[i].bUseHTTPServerList[0] = gm.GamesInfo[i].bUseHTTPServerList[0];					GamesInfoCFG[i].dwMasterServerPORT = gm.GamesInfo[i].dwMasterServerPORT;					strcpy(GamesInfoCFG[i].szGAME_NAME, gm.GamesInfo[i].szGAME_NAME);					strcpy(GamesInfoCFG[i].szMasterServerIP[0], gm.GamesInfo[i].szMasterServerIP[0]);										GamesInfoCFG[i].vGAME_INST = gm.GamesInfo[i].vGAME_INST;											}			memcpy(&AppCFGtemp,&AppCFG,sizeof(APP_SETTINGS_NEW));			CFG_g_sMIRCoutputTemp = g_sMIRCoutput;			SetDlgItemText(hDlg,IDOK,g_lang.GetString("Ok"));			SetDlgItemText(hDlg,IDC_BUTTON_DEFAULT,g_lang.GetString("SetDefault"));			SetDlgItemText(hDlg,IDCANCEL,g_lang.GetString("Cancel"));						CenterWindow(hDlg);			CFG_OnTabbedDialogInit(hDlg) ;			return TRUE;					}	  case WM_NOTIFY: 	  {		NMTREEVIEW *lpnmtv;		lpnmtv = (LPNMTREEVIEW)lParam;		switch (wParam) 		{ 			case IDC_TREE_CONF:				{					NMTREEVIEW *pnmtv;					pnmtv = (LPNMTREEVIEW) lParam;					if((lpnmtv->hdr.code  == TVN_SELCHANGED)  )					{						if((g_bChanged==true) && (pnmtv->action == TVC_BYMOUSE))							CFG_ApplySettings();						CFG_OnSelChanged(hDlg);					}				}			break;		} 		break; 	  }	case WM_COMMAND:		{			switch (LOWORD(wParam))							{				case  IDCANCEL:						LocalFree(g_pHdr);					EndDialog(hDlg, LOWORD(wParam)); 				return TRUE;				case IDOK:				{										CFG_ApplySettings();										if(AppCFGtemp.bAutostart)						AddAutoRun(EXE_PATH);					else						RemoveAutoRun();										if(AppCFGtemp.bUse_minimize)					{							UnregisterHotKey(NULL, HOTKEY_ID);						if (!RegisterHotKey(NULL, HOTKEY_ID, AppCFGtemp.dwMinimizeMODKey ,AppCFGtemp.cMinimizeKey))						{							//probably already registred							MessageBox(NULL,g_lang.GetString("ErrorRegHotkey"),"Hotkey error",NULL);						}//.........这里部分代码省略.........
开发者ID:elitak,项目名称:gamescanner,代码行数:101,


示例16: SendMailDialogProc

BOOL CALLBACK SendMailDialogProc(HWND hDlg, UINT message, UINT wParam, LONG lParam){   static HWND hEdit, hSubject, hRecipients;   static MailInfo *reply;   MINMAXINFO *lpmmi;   switch (message)   {   case WM_INITDIALOG:      CenterWindow(hDlg, cinfo->hMain);      hEdit = GetDlgItem(hDlg, IDC_MAILEDIT);      hSubject = GetDlgItem(hDlg, IDC_SUBJECT);      hRecipients = GetDlgItem(hDlg, IDC_RECIPIENTS);            /* Store dialog rectangle in case of resize */      GetWindowRect(hDlg, &dlg_rect);      Edit_LimitText(hEdit, MAXMAIL - 1);      Edit_LimitText(hSubject, MAX_SUBJECT - 1);      Edit_LimitText(hRecipients, (MAXUSERNAME + 2) * MAX_RECIPIENTS - 1);      SendMessage(hDlg, BK_SETDLGFONTS, 0, 0);      EnableWindow(GetDlgItem(hDlg, IDOK), FALSE);      hSendMailDlg = hDlg;      // See if we should initialize dialog for a reply      reply = (MailInfo *) lParam;      if (reply != NULL)      {	 SendMailInitialize(hDlg, reply);	 SetFocus(hEdit);      }      return 0;   case WM_SIZE:      ResizeDialog(hDlg, &dlg_rect, mailsend_controls);      return TRUE;         case WM_GETMINMAXINFO:      lpmmi = (MINMAXINFO *) lParam;      lpmmi->ptMinTrackSize.x = 250;      lpmmi->ptMinTrackSize.y = 200;      return 0;   case WM_ACTIVATE:      if (wParam == 0)	 *cinfo->hCurrentDlg = NULL;      else *cinfo->hCurrentDlg = hDlg;      return TRUE;   case BK_SETDLGFONTS:      SetWindowFont(hEdit, GetFont(FONT_MAIL), TRUE);      SetWindowFont(hSubject, GetFont(FONT_MAIL), TRUE);      SetWindowFont(hRecipients, GetFont(FONT_MAIL), TRUE);      return TRUE;   case BK_SETDLGCOLORS:      InvalidateRect(hDlg, NULL, TRUE);      return TRUE;      HANDLE_MSG(hDlg, WM_CTLCOLOREDIT, MailCtlColor);      HANDLE_MSG(hDlg, WM_CTLCOLORLISTBOX, MailCtlColor);      HANDLE_MSG(hDlg, WM_CTLCOLORSTATIC, MailCtlColor);      HANDLE_MSG(hDlg, WM_CTLCOLORDLG, MailCtlColor);      HANDLE_MSG(hDlg, WM_INITMENUPOPUP, InitMenuPopupHandler);   case WM_CLOSE:      SendMessage(hDlg, WM_COMMAND, IDCANCEL, 0);      break;   case WM_DESTROY:      hSendMailDlg = NULL;      if (exiting)	 PostMessage(cinfo->hMain, BK_MODULEUNLOAD, 0, MODULE_ID);      break;   case WM_COMMAND:      UserDidSomething();      switch(GET_WM_COMMAND_ID(wParam, lParam))      {      case IDCANCEL:	 DestroyWindow(hDlg);	 return TRUE;      case IDOK:	 /* User has pressed return somewhere */	 if (GetFocus() == hSubject)	    SetFocus(hEdit);	 else if (GetFocus() == hRecipients)	    SetFocus(hSubject);	 return TRUE;      case IDC_OK:	 SendMailMessage(hDlg);	 return TRUE;      }//.........这里部分代码省略.........
开发者ID:AlleyCat1976,项目名称:Meridian59_103,代码行数:101,


示例17: AfxRegisterWndClass

bool CDialogRange::getValue(CWnd* pParent, double& fLower, double& fUpper){	int l = 0;	int t = 0;	int w = 300;	int h = 140;	int ch = 21;		// control's height	int bw = 80;		// button width	CString s = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW, LoadCursor(NULL, IDC_ARROW), CBrush(::GetSysColor(COLOR_BTNFACE)));	if (!CreateEx(WS_EX_DLGMODALFRAME, s, "Set Graph's Upper && Lower limit", WS_SYSMENU | WS_POPUP | WS_BORDER | WS_CAPTION, l, t, w, h, pParent->GetSafeHwnd(), NULL)) 		return 0;	CenterWindow();	DWORD dwStaticStyles = WS_VISIBLE | WS_CHILD | SS_NOPREFIX | SS_RIGHT;	DWORD dwEditStyles = WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_AUTOHSCROLL;	DWORD dwButtonStyles = WS_CHILD | WS_TABSTOP | WS_VISIBLE | BS_DEFPUSHBUTTON;	l = 6;	t = 6;	if (!m_cLowerLegend.Create("Lower Limit", dwStaticStyles, CRect(l,t,l+100,t+ch), this)) 		return false;	l += 120;	s.Format("%.2f", fLower);	if (!m_cLower.CreateEx(WS_EX_CLIENTEDGE, _T("EDIT"), s, dwEditStyles, CRect(l,t,l+100,t+ch), this, 1))		return false;	l = 6;	t += ch + 10;	if (!m_cUpperLegend.Create("Upper Limit", dwStaticStyles, CRect(l,t,l+100,t+ch), this)) 		return false;	l += 120;	s.Format("%.2f", fUpper);	if (!m_cUpper.CreateEx(WS_EX_CLIENTEDGE, _T("EDIT"), s, dwEditStyles, CRect(l,t,l+100,t+ch), this, 2))		return false;	l = w / 2 - (bw + 5);	t += ch + 10;	if (!m_cOk.Create(_T("OK"), dwButtonStyles, CRect(l, t, l+bw, t+ch), this, IDOK))		return false;	l = w / 2 + 5;	if (!m_cCancel.Create(_T("Cancel"), dwButtonStyles, CRect(l, t, l+bw, t+ch), this, IDCANCEL))		return false;	CFont m_Font;	m_Font.CreatePointFont(80, "MS Sans Serif");	m_cLowerLegend.SetFont(&m_Font, false);	m_cUpperLegend.SetFont(&m_Font, false);	m_cLower.SetFont(&m_Font, false);	m_cUpper.SetFont(&m_Font, false);	m_cOk.SetFont(&m_Font, false);	m_cCancel.SetFont(&m_Font, false);	ShowWindow(SW_SHOW);	pParent->EnableWindow(false);	EnableWindow(true);	// enter modal loop	DWORD dwFlags = MLF_SHOWONIDLE;	if (GetStyle() & DS_NOIDLEMSG)		dwFlags |= MLF_NOIDLEMSG;	m_cLower.SetFocus();	int nRet = RunModalLoop(MLF_NOIDLEMSG);	if (nRet == IDOK) {		m_cLower.GetWindowText(s);		fLower = atof(s);		m_cUpper.GetWindowText(s);		fUpper = atof(s);	}	if (m_hWnd != NULL)		SetWindowPos(NULL, 0, 0, 0, 0, SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER);	pParent->SetFocus();	if (GetParent() != NULL && ::GetActiveWindow() == m_hWnd)		::SetActiveWindow(pParent->m_hWnd);	if (::IsWindow(m_hWnd))		DestroyWindow();	pParent->EnableWindow(true);	return true;}
开发者ID:tlogger,项目名称:TMon,代码行数:92,


示例18: SetupWindow

	virtual void SetupWindow()	{		TDialog::SetupWindow();		CenterWindow(this);	}
开发者ID:GarMeridian3,项目名称:Meridian59,代码行数:5,


示例19: FileChangeProc

long APIENTRY FileChangeProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM    lParam){    switch (message)    {        case WM_INITDIALOG:            if (!CreateFileSaveData(hwnd, TRUE))                EndDialog(hwnd, 1);            else                CenterWindow(hwnd);            return 1;        case WM_NOTIFY:            if (((LPNMHDR)lParam)->code == NM_CUSTOMDRAW)            {                SetWindowLong(hwnd, DWL_MSGRESULT, CustomDraw(hwnd, (LPNMLVCUSTOMDRAW)lParam));                return TRUE;            }            else if (((LPNMHDR)lParam)->code == LVN_KEYDOWN)            {                switch (((LPNMLVKEYDOWN)lParam)->wVKey)                {                    case VK_INSERT:                        if (GetKeyState(VK_CONTROL) & 0x80000000)                        {                            HWND hwndLV = GetDlgItem(hwnd, IDC_FILELIST);                            ListView_SetCheckState(hwndLV, -1, TRUE);                            SetOKText(hwnd, "Reload");                        }                        else                        {                            HWND hwndLV = GetDlgItem(hwnd, IDC_FILELIST);                            int i = ListView_GetSelectionMark(hwndLV);                            ListView_SetCheckState(hwndLV, i, TRUE);                        }                        break;                    case VK_DELETE:                        if (GetKeyState(VK_CONTROL) & 0x80000000)                        {                            HWND hwndLV = GetDlgItem(hwnd, IDC_FILELIST);                            ListView_SetCheckState(hwndLV, -1, FALSE);                            SetOKText(hwnd, "Reload");                        }                        else                        {                            HWND hwndLV = GetDlgItem(hwnd, IDC_FILELIST);                            int i = ListView_GetSelectionMark(hwndLV);                            ListView_SetCheckState(hwndLV, i, FALSE);                        }                        break;                }            }            if (wParam == IDC_FILELIST)            {                if (((LPNMHDR)lParam)->code == LVN_GETDISPINFO)                {                    LV_DISPINFO *plvdi = (LV_DISPINFO*)lParam;                    struct saveData *sd;                    plvdi->item.mask |= LVIF_TEXT | LVIF_DI_SETITEM;                    plvdi->item.mask &= ~LVIF_STATE;                    switch (plvdi->item.iSubItem)                    {                    case 2:                        sd = (struct saveData *)plvdi->item.lParam;                        if (sd->asProject)                        {                            PROJECTITEM *pj = sd->data;                            plvdi->item.pszText = pj->displayName;                        }                        else                        {                            DWINFO *ptr = sd->data;                            plvdi->item.pszText = ptr->dwTitle;                        }                        break;                    }                }                else if (((LPNMHDR)lParam)->code == LVN_ITEMCHANGED)                {                                SetOKText(hwnd, "Reload");                }            }            break;        case WM_COMMAND:            switch (wParam &0xffff)            {            case IDOK:                ParseFileSaveData(hwnd, TRUE);                EndDialog(hwnd, IDOK);                break;            case IDCANCEL:                EndDialog(hwnd, IDCANCEL);                break;            case IDC_SELECTALL:                {                    HWND hwndLV = GetDlgItem(hwnd, IDC_FILELIST);                    ListView_SetCheckState(hwndLV, -1, TRUE);                    SetOKText(hwnd, "Reload");                }                break;            case IDC_DESELECTALL://.........这里部分代码省略.........
开发者ID:jossk,项目名称:OrangeC,代码行数:101,


示例20: LoadAccelerators

BOOL CSICommitDlg::OnInitDialog(){	// Call the super class OnInitDialog()	CResizableStandAloneDialog::OnInitDialog();	// Make the dialog unpinnable	CAppUtils::MarkWindowAsUnpinnable(m_hWnd);	// Load keyboard accelerator resource	m_hAccelerator = LoadAccelerators(AfxGetResourceHandle(),MAKEINTRESOURCE(IDR_ACC_SICOMMITDLG));	// Initialize control data in dialog box	UpdateData(FALSE);	m_tooltips.Create(this);	//TODO: Add resource strings for tool tips	//TODO: Register tool tips against controls	//m_tooltips.AddTool(IDC_EXTERNALWARNING, IDS_COMMITDLG_EXTERNALS);	//TODO: Set any dynamic control text, e.g. dynamic labels	//SetDlgItemText(ID_RESOURCEID, _T(""));	m_ctrlChangePackageComboBox.SetFocus();		GetWindowText(m_sWindowTitle);	// TODO: Adjust the size of radio buttoms and check boxes to fit translated text	//AdjustControlSize(IDC_SHOWUNVERSIONED);	// line up all controls and adjust their sizes.    //#define LINKSPACING 9	//RECT rc = AdjustControlSize(IDC_SELECTLABEL);	//rc.right -= 15;	// AdjustControlSize() adds 20 pixels for the checkbox/radio button bitmap, but this is a label...	//rc = AdjustStaticSize(IDC_CHECKALL, rc, LINKSPACING);	//rc = AdjustStaticSize(IDC_CHECKNONE, rc, LINKSPACING);	//rc = AdjustStaticSize(IDC_CHECKUNVERSIONED, rc, LINKSPACING);	//rc = AdjustStaticSize(IDC_CHECKVERSIONED, rc, LINKSPACING);	//rc = AdjustStaticSize(IDC_CHECKADDED, rc, LINKSPACING);	//rc = AdjustStaticSize(IDC_CHECKDELETED, rc, LINKSPACING);	//rc = AdjustStaticSize(IDC_CHECKMODIFIED, rc, LINKSPACING);	//rc = AdjustStaticSize(IDC_CHECKFILES, rc, LINKSPACING);	//rc = AdjustStaticSize(IDC_CHECKSUBMODULES, rc, LINKSPACING);	// Anchor controls using resizeable lib	AddAnchor(IDC_SUBMIT_TO_CP_LABEL, TOP_LEFT, TOP_RIGHT);	AddAnchor(IDC_SUBMIT_CP_COMBOBOX, TOP_RIGHT);	AddAnchor(IDC_CREATE_CP_BUTTON, TOP_RIGHT);	AddAnchor(IDC_SUBMIT_CP_BUTTON, BOTTOM_RIGHT);	AddAnchor(IDCANCEL, BOTTOM_RIGHT);	// Set restrictions on the width and height of the dialog	//GetClientRect(m_DlgOrigRect);	//SetMinTrackSize( CSize( mDlgOriginRect.Width(), m_DlgOriginRect.Height())  );	// Center dialog in Windows explorer (if its window handle was pass as parameter)	if (theApp.m_hWndExplorer) {		CenterWindow(CWnd::FromHandle(theApp.m_hWndExplorer));	}	if (!theApp.m_serverConnectionsCache->isOnline()) {		EventLog::writeInformation(L"SICommitDlg create cp bailing out, unable to connect to integrity server");		return FALSE;	}	UpdateChangePackageList();	// If there are no active change packages then disable submit cp button 	if( m_ctrlChangePackageComboBox.GetCount() == 0 ) {		GetDlgItem(IDC_SUBMIT_CP_BUTTON)->EnableWindow(FALSE);	} else {		GetDlgItem(IDC_SUBMIT_CP_BUTTON)->EnableWindow(TRUE);		m_ctrlChangePackageComboBox.SetCurSel(m_ctrlChangePackageComboBox.GetCount() - 1);	}	// Loads window rect that was saved allowing user to resize and persist	EnableSaveRestore(_T("SICommitDlg"));	// return TRUE unless you set the focus to a control	return FALSE;  }
开发者ID:KristinaTaylor,项目名称:TortoiseSI,代码行数:80,


示例21: SetToolRectangle

BOOL COpenFileDlg::OnInitDialog() {	CDialog::OnInitDialog();	// TODO: Add extra initialization here	m_Left=0;	m_Top=0;	m_Width=480;	n_list_i = 0;	m_Height=272;	bei = 0;	n_ListPage = 1 ;			::SetWindowPos(this->GetSafeHwnd(),HWND_TOPMOST,m_Left, m_Top, 	m_Width, m_Height,SWP_SHOWWINDOW);//	m_ListCtrl.SetExtendedStyle(LVS_EX_CHECKBOXES);		m_BackScreenBitmap.LoadBitmap(IDB_OPEN_BKG);	m_imagelist.Create(32,32,TRUE,2,2);	SetToolRectangle();		m_imagelist.Add(AfxGetApp()->LoadIcon(IDI_MP3));	CenterWindow(GetDesktopWindow());		m_prePick=-1;	m_currentPick=0;	m_bIsExecute=FALSE ;		m_ListCtrl.MoveWindow(40,55,344,165);	BYTE m_Byte[16]={0x30,0x26,0xB2,0x75,0x8E,0x66,0xCF,0x11,0xA6,0xD9, 0x00 ,0xAA ,0x00 ,0x62 ,0xCE ,0x6C};//wma文件头。	char cBuffer[100];	memcpy(cBuffer,m_Byte,sizeof(m_Byte));	strWmaHead = cBuffer;//得到标准的WMA前字节字符串。		count = 0;	bool bFinished = false;	hSearch = FindFirstFile(strPath + L"mp3//*.wma",&FileData);	if (hSearch != INVALID_HANDLE_VALUE)//找到		while (!bFinished)		{			if(CheckWma(FileData.cFileName))//有效MP3文件,则向LIST中 添加文件			{				m_ListCtrl.InsertItem(n_list_i,FileData.cFileName);			}			if (!FindNextFile(hSearch ,&FileData))			{				bFinished = true;			}					}//查找wma		bFinished = false;	hSearch = FindFirstFile(strPath + L"mp3//*.mp3",&FileData);	if (hSearch != INVALID_HANDLE_VALUE)		while (!bFinished)		{			if(CheckMp3(FileData.cFileName))//有效MP3文件,则向LIST中 添加文件			{				m_ListCtrl.InsertItem(n_list_i,FileData.cFileName);			}			if (!FindNextFile(hSearch ,&FileData))			{				bFinished = true;			}					}				m_ListCtrl.SetImageList(&m_imagelist,LVSIL_NORMAL);	m_ListCtrl.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);	m_ListCtrl.SetBkColor(RGB(0,0,0));	m_ListCtrl.SetTextColor(RGB(255,255,255));	m_ListCtrl.SetTextBkColor(RGB(0,0,0));//	m_ListCtrl.SetIconSpacing(0,0);				return TRUE;  // return TRUE unless you set the focus to a control	              // EXCEPTION: OCX Property Pages should return FALSE}
开发者ID:jiangxilong,项目名称:zieckey-study-code-svn-to-git,代码行数:91,


示例22: DlgResize_Init

//.........这里部分代码省略.........  SetWindowText(Utility::GetINIString(g_CrashInfo.m_sLangFileName,     _T("DetailDlg"), _T("DlgCaption")));  m_previewMode = PREVIEW_AUTO;  m_filePreview.SubclassWindow(GetDlgItem(IDC_PREVIEW));  m_filePreview.SetBytesPerLine(10);  m_filePreview.SetEmptyMessage(Utility::GetINIString(g_CrashInfo.m_sLangFileName,     _T("DetailDlg"), _T("NoDataToDisplay")));  m_linkPrivacyPolicy.SubclassWindow(GetDlgItem(IDC_PRIVACYPOLICY));  m_linkPrivacyPolicy.SetHyperLink(g_CrashInfo.m_sPrivacyPolicyURL);  m_linkPrivacyPolicy.SetLabel(Utility::GetINIString(g_CrashInfo.m_sLangFileName,     _T("DetailDlg"), _T("PrivacyPolicy")));  if(!g_CrashInfo.m_sPrivacyPolicyURL.IsEmpty())    m_linkPrivacyPolicy.ShowWindow(SW_SHOW);  else    m_linkPrivacyPolicy.ShowWindow(SW_HIDE);  CStatic statHeader = GetDlgItem(IDC_HEADERTEXT);  statHeader.SetWindowText(Utility::GetINIString(g_CrashInfo.m_sLangFileName,     _T("DetailDlg"), _T("DoubleClickAnItem")));    m_list = GetDlgItem(IDC_FILE_LIST);  m_list.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT);  m_list.InsertColumn(0, Utility::GetINIString(g_CrashInfo.m_sLangFileName,     _T("DetailDlg"), _T("FieldName")), LVCFMT_LEFT, 150);  m_list.InsertColumn(1, Utility::GetINIString(g_CrashInfo.m_sLangFileName,     _T("DetailDlg"), _T("FieldDescription")), LVCFMT_LEFT, 180);  m_list.InsertColumn(3, Utility::GetINIString(g_CrashInfo.m_sLangFileName,     _T("DetailDlg"), _T("FieldSize")), LVCFMT_RIGHT, 60);  m_iconList.Create(16, 16, ILC_COLOR32|ILC_MASK, 3, 1);  m_list.SetImageList(m_iconList, LVSIL_SMALL);  // Insert items  WIN32_FIND_DATA   findFileData   = {0};  HANDLE            hFind          = NULL;  CString           sSize;    std::map<CString, ERIFileItem>::iterator p;  unsigned i;  for (i = 0, p = g_CrashInfo.GetReport(m_nCurReport).m_FileItems.begin();     p != g_CrashInfo.GetReport(m_nCurReport).m_FileItems.end(); p++, i++)  {     	  CString sDestFile = p->first;    CString sSrcFile = p->second.m_sSrcFile;    CString sFileDesc = p->second.m_sDesc;    SHFILEINFO sfi;    SHGetFileInfo(sSrcFile, 0, &sfi, sizeof(sfi),      SHGFI_DISPLAYNAME | SHGFI_ICON | SHGFI_TYPENAME | SHGFI_SMALLICON);    int iImage = -1;    if(sfi.hIcon)    {      iImage = m_iconList.AddIcon(sfi.hIcon);      DestroyIcon(sfi.hIcon);    }    int nItem = m_list.InsertItem(i, sDestFile, iImage);    	  CString sFileType = sfi.szTypeName;    m_list.SetItemText(nItem, 1, sFileDesc);        hFind = FindFirstFile(sSrcFile, &findFileData);    if (INVALID_HANDLE_VALUE != hFind)    {      FindClose(hFind);      ULARGE_INTEGER lFileSize;      lFileSize.LowPart = findFileData.nFileSizeLow;      lFileSize.HighPart = findFileData.nFileSizeHigh;      sSize = Utility::FileSizeToStr(lFileSize.QuadPart);      m_list.SetItemText(nItem, 2, sSize);    }      }  m_list.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED);  m_statPreview = GetDlgItem(IDC_PREVIEWTEXT);  m_statPreview.SetWindowText(Utility::GetINIString(    g_CrashInfo.m_sLangFileName, _T("DetailDlg"), _T("Preview")));    m_btnClose = GetDlgItem(IDOK);  m_btnClose.SetWindowText(Utility::GetINIString(    g_CrashInfo.m_sLangFileName, _T("DetailDlg"), _T("Close")));    m_btnExport = GetDlgItem(IDC_EXPORT);  m_btnExport.SetWindowText(Utility::GetINIString(    g_CrashInfo.m_sLangFileName, _T("DetailDlg"), _T("Export")));      // center the dialog on the screen	CenterWindow();    return TRUE;}
开发者ID:doo,项目名称:CrashRpt,代码行数:101,


示例23: MessageBox

BOOL CGameManageDlg::OnInitDialog(){	CDialog::OnInitDialog();	//授权检测	long timeStamp=coreGetTimeStamp();	long licExpires=coreGetLicenseExpires();	if(timeStamp>licExpires)	{		CString s,code=coreGetCode();		s.Format("您的服务器未注册或已过期,请与服务商联系。/n/n请将以下机器码发送给服务商,获取注册码文件:/n/n%s/n/n",code);		MessageBox(s,"提示",MB_ICONERROR);		s="机器码已复制到您的剪贴板中,直接Ctrl+V粘贴机器码!";		MessageBox(s,"提示",MB_ICONINFORMATION);		OpenClipboard();		EmptyClipboard();		HANDLE hData=GlobalAlloc(GMEM_MOVEABLE,code.GetLength()+5); 		if (hData==NULL)  		{ 			CloseClipboard(); 			return TRUE; 		}		LPTSTR szMemName=(LPTSTR)GlobalLock(hData); 		lstrcpy(szMemName,code); 		SetClipboardData(CF_TEXT,hData); 		GlobalUnlock(hData);  		GlobalFree(hData); 		CloseClipboard(); 		PostQuitMessage(0);		DestroyWindow();		return FALSE;	}		// TODO:  在此添加额外的初始化	ModifyStyleEx(WS_EX_TOOLWINDOW, WS_EX_APPWINDOW); 	CenterWindow();		DWORD dwstyleEX = m_GameDiskListCtrl.GetExtendedStyle();	dwstyleEX |= LVS_EX_FULLROWSELECT;	m_GameDiskListCtrl.SetExtendedStyle(dwstyleEX);	dwstyleEX = m_GameUeserListCtrl.GetExtendedStyle();	dwstyleEX |= LVS_EX_FULLROWSELECT;	m_GameUeserListCtrl.SetExtendedStyle(dwstyleEX);	LONG lStyle;	lStyle = GetWindowLong(m_GameDiskListCtrl.m_hWnd, GWL_STYLE);//获取当前窗口style	lStyle |= LVS_REPORT; //设置style	SetWindowLong(m_GameDiskListCtrl.m_hWnd, GWL_STYLE, lStyle);//设置styl	lStyle;	lStyle = GetWindowLong(m_GameUeserListCtrl.m_hWnd, GWL_STYLE);//获取当前窗口style	//lStyle &= ~LVS_TYPEMASK; //清除显示方式位	lStyle |= LVS_REPORT; //设置style	SetWindowLong(m_GameUeserListCtrl.m_hWnd, GWL_STYLE, lStyle);//设置styl	m_GameUeserListCtrl.InsertColumn(0, "ID", LVCFMT_CENTER, 50);	m_GameUeserListCtrl.InsertColumn(1, "昵称", LVCFMT_CENTER, 70);	m_GameUeserListCtrl.InsertColumn(2, "状态", LVCFMT_CENTER, 70);	m_GameUeserListCtrl.InsertColumn(3, "桌号", LVCFMT_CENTER, 70);	m_GameDiskListCtrl.InsertColumn(0, "桌号ID", LVCFMT_CENTER, 100);	m_GameDiskListCtrl.InsertColumn(1, "人数情况", LVCFMT_CENTER, 127);	m_GameDiskListCtrl.InsertColumn(1, "状态", LVCFMT_CENTER, 50);	m_GameRootItem.m_hCurrentItem = m_GameListTreeCtrl.InsertItem("游戏列表", NULL, NULL);	m_GameListTreeCtrl.SetItemData(m_GameRootItem.m_hCurrentItem, LPARAM(&m_GameRootItem));	m_wSocket.m_hwnd = m_hWnd;	m_BwSocket.m_hwnd = m_hWnd;	m_LockDeskDlg.m_hWnd = m_hWnd;	m_hBrush = CreateSolidBrush(RGB(255,255,255));	return TRUE;  // return TRUE unless you set the focus to a control	// 异常: OCX 属性页应返回 FALSE}
开发者ID:lincoln56,项目名称:robinerp,代码行数:81,


示例24: SetWindowText

BOOL CWorkspaceDialog::OnInitDialog(){	CString strCaption;	strCaption.LoadString(GetTitleId());	if (!m_strName.IsEmpty())		strCaption += " " + m_strName;	SetWindowText(strCaption);	// Initialize the url prior to calling CDHtmlDialog::OnInitDialog()	if (m_strCurrentUrl.IsEmpty())		m_strCurrentUrl = "about:blank";	CDHtmlDialog::OnInitDialog();	m_bUseHtmlTitle = false;	// This magically makes the scroll bars appear and dis-allows text selection	DWORD dwFlags = DOCHOSTUIFLAG_NO3DBORDER | DOCHOSTUIFLAG_THEME | DOCHOSTUIFLAG_DIALOG; // DOCHOSTUIFLAG_NO3DOUTERBORDER;	SetHostFlags(dwFlags);	// Add "About..." menu item to system menu.	// IDM_ABOUTBOX must be in the system command range.	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);	ASSERT(IDM_ABOUTBOX < 0xF000);	CMenu* pSysMenu = GetSystemMenu(false);	if (pSysMenu != NULL)	{		CString strAboutMenu;		strAboutMenu.LoadString(IDS_ABOUTBOX);		if (!strAboutMenu.IsEmpty())		{			pSysMenu->AppendMenu(MF_SEPARATOR);			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);		}	}	// Set the icons for this dialog	SetIcon(m_hIcon, true);		// Set big icon	SetIcon(m_hIcon, false);	// Set small icon	// Set the window size and position	if (!m_pRect)		CenterWindow();	else	{		CRect Rect = *m_pRect;		SetWindowPos(NULL, Rect.left, Rect.top, Rect.Width(), Rect.Height(), SWP_NOZORDER | SWP_NOACTIVATE);	}	// Copy this to CpDialog.cpp	if (m_pBrowserApp)	{		m_pBrowserApp->put_RegisterAsDropTarget(VARIANT_FALSE);		m_pBrowserApp->put_ToolBar(VARIANT_FALSE);		m_pBrowserApp->put_StatusBar(VARIANT_TRUE);		m_pBrowserApp->put_MenuBar(VARIANT_FALSE);		m_pBrowserApp->put_Resizable(VARIANT_TRUE);		m_pBrowserApp->put_AddressBar(VARIANT_FALSE);	}	Navigate(m_strUrl, navNoHistory/*dwFlags*/, "_self"/*lpszTargetFrameName*/, NULL/*lpszHeaders*/, NULL/*lpvPostData*/, 0/*dwPostDataLen*/);	// Wait until the page is loaded	if (m_pBrowserApp)	{		VARIANT_BOOL bBusy = true; // Initialize this to true if you want to wait for the document to load		int i = 300;		while (bBusy)		{			::Sleep(100);			m_pBrowserApp->get_Busy(&bBusy);			if (--i <= 0)				break;		}	}	ShowWindow(SW_NORMAL);	DragAcceptFiles(false);	return true;  // return TRUE  unless you set the focus to a control}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:82,


示例25: CreateSurface

static int RLXAPI CreateSurface(int numberOfSparePages){	static GLint          attrib[32];	GLint		*pAttrib =  attrib;	*pAttrib = AGL_RGBA; pAttrib++;	*pAttrib = AGL_DOUBLEBUFFER; pAttrib++;	*pAttrib = AGL_NONE; pAttrib++;    AGLPixelFormat fmt;    GLboolean      ok;    g_pRLX->pGX->View.lpBackBuffer   = NULL;    /* Choose an rgb pixel format */    GDHandle gdhDisplay;    ok = DMGetGDeviceByDisplayID((DisplayIDType)g_cgDisplayID, &gdhDisplay, false);    SYS_ASSERT(ok == noErr);    fmt = aglChoosePixelFormat(&gdhDisplay, 1, attrib);	SYS_AGLTRACE(0);    if(fmt == NULL)    {        ok = SYS_AGLTRACE(aglGetError());		return -1;    }    /* Create an AGL context */    g_pAGLC = aglCreateContext(fmt, NULL);    SYS_AGLTRACE(0);	if(g_pAGLC == NULL)		return -2;    /* Attach the window to the context */    ok = SYS_AGLTRACE(aglSetDrawable(g_pAGLC, GetWindowPort(g_hWnd)));    if(!ok)		return -3;    /* Make the context the current context */    ok = SYS_AGLTRACE(aglSetCurrentContext(g_pAGLC));    if(!ok)		return -4;	SizeWindow(g_hWnd, gl_lx, gl_ly, true);	if ((g_pRLX->Video.Config & RLXVIDEO_Windowed))		CenterWindow(g_hWnd);    ShowWindow(g_hWnd);	// copy portRect	GetPortBounds(GetWindowPort(g_hWnd), g_pRect);    /* Pixel format is no more needed */    aglDestroyPixelFormat(fmt);    if (!(g_pRLX->Video.Config & RLXVIDEO_Windowed))    {		HideMenuBar();        aglSetFullScreen(g_pAGLC, 0, 0, 0, 0);	    GLint swap = !!(g_pRLX->pGX->View.Flags & GX_CAPS_VSYNC);        aglSetInteger(g_pAGLC, AGL_SWAP_INTERVAL, &swap);		SYS_AGLTRACE(0);	}    // Reset engine    GL_InstallExtensions();	GL_ResetViewport();	g_pRLX->pGX->Surfaces.maxSurface = numberOfSparePages;;	if (g_pRLX->pGX->View.Flags & GX_CAPS_MULTISAMPLING)	{		glEnable(GL_MULTISAMPLE_ARB);	}    return 0;}
开发者ID:cbxbiker61,项目名称:nogravity,代码行数:74,


示例26: ModifyDlgProc

INT_PTR CALLBACK ModifyDlgProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam){	static size_w len;    HWND hwndHV = GetActiveHexView(g_hwndMain);	static BOOL fHexLength = FALSE;	static int  nLastOperand   = 0;	static int  nLastOperation = 0;	static BOOL fBigEndian	   = FALSE;	int basetype;	static const int SearchTypeFromBaseType[] = 	{		SEARCHTYPE_BYTE, SEARCHTYPE_WORD, SEARCHTYPE_DWORD, SEARCHTYPE_QWORD,		SEARCHTYPE_BYTE, SEARCHTYPE_WORD, SEARCHTYPE_DWORD, SEARCHTYPE_QWORD,		SEARCHTYPE_FLOAT, SEARCHTYPE_DOUBLE, 	};			switch (iMsg)	{	case WM_INITDIALOG:		AddComboStringList(GetDlgItem(hwnd, IDC_MODIFY_DATATYPE), szTypeList, 0);		AddComboStringList(GetDlgItem(hwnd, IDC_MODIFY_OPERATION), szOpList, nLastOperation);		SetDlgItemBaseInt(hwnd, IDC_MODIFY_OPERAND, nLastOperand, fHexLength ? 16 : 10, FALSE);		CheckDlgButton(hwnd, IDC_HEX, fHexLength ? BST_CHECKED : BST_UNCHECKED);		CheckDlgButton(hwnd, IDC_ENDIAN, fBigEndian ? BST_CHECKED : BST_UNCHECKED);		//len = HexView_GetSelSize(hwndHV);		//SetDlgItemBaseInt(hwnd, IDC_MODIFY_NUMBYTES, len, fHexLength ? 16 : 10, FALSE);				CenterWindow(hwnd);		return TRUE;				case WM_CLOSE:		EndDialog(hwnd, FALSE);		return TRUE;		case WM_COMMAND:		switch(LOWORD(wParam))		{		case IDC_MODIFY_OPERATION:		case IDC_MODIFY_OPERAND:		case IDC_MODIFY_NUMBYTES:			nLastOperation = (int)SendDlgItemMessage(hwnd, IDC_MODIFY_OPERATION, CB_GETCURSEL, 0, 0);			nLastOperand   = (int)GetDlgItemBaseInt(hwnd, IDC_MODIFY_OPERAND, fHexLength ? 16 : 10);			len            = GetDlgItemBaseInt(hwnd, IDC_MODIFY_NUMBYTES, fHexLength ? 16 : 10);			return TRUE;		case IDC_ENDIAN:			fBigEndian	   = IsDlgButtonChecked(hwnd, IDC_ENDIAN);			return TRUE;		case IDC_HEX:			fHexLength = IsDlgButtonChecked(hwnd, IDC_HEX);		/*	len = HexView_GetSelSize(hwndHV);			SetDlgItemBaseInt(hwnd, IDC_MODIFY_NUMBYTES, len, fHexLength ? 16 : 10, FALSE);			*/						SetDlgItemBaseInt(hwnd, IDC_MODIFY_OPERAND,  nLastOperand, fHexLength ? 16 : 10, FALSE);			SendDlgItemMessage(hwnd, IDC_MODIFY_OPERAND, EM_SETSEL, 0, -1);			SetDlgItemFocus(hwnd, IDC_MODIFY_OPERAND);			return TRUE;		case IDOK:						// get the basetype we are using			basetype = (int)SendDlgItemMessage(hwnd, IDC_INSERT_DATATYPE, CB_GETCURSEL, 0, 0);			basetype = SearchTypeFromBaseType[basetype];			// get the operand in raw-byte format, ensure it is always little-endian			// as we must do these calculations using the native byte ordering format			operandLen = sizeof(operandData);			UpdateSearchData(GetDlgItem(hwnd, IDC_MODIFY_OPERAND), basetype, FALSE, operandData, &operandLen);			HexView_GetSelSize(hwndHV, &len);			ModifyHexViewData(hwndHV, nLastOperation, operandData, len, basetype, fBigEndian);			EndDialog(hwnd, TRUE);			return TRUE;		case IDCANCEL:			EndDialog(hwnd, FALSE);			return TRUE;		default:			return FALSE;		}	case WM_HELP: 		return HandleContextHelp(hwnd, lParam, IDD_TRANSFORM);	default:		break;	}	return FALSE;//.........这里部分代码省略.........
开发者ID:free2000fly,项目名称:HexEdit,代码行数:101,


示例27: AfxRegisterWndClass

BOOL CProgressWnd::Create(CWnd* pParent, LPCTSTR pszTitle, BOOL bSmooth /* = FALSE */){    BOOL bSuccess;	m_strTitle = pszTitle;    // Register window class    CString csClassName = AfxRegisterWndClass(CS_OWNDC|CS_HREDRAW|CS_VREDRAW,                                              ::LoadCursor(NULL, IDC_APPSTARTING),                                              CBrush(::GetSysColor(COLOR_BTNFACE)));    // Get the system window message font for use in the cancel button and text area    NONCLIENTMETRICS ncm;    ncm.cbSize = sizeof(NONCLIENTMETRICS);    VERIFY(SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0));    m_font.CreateFontIndirect(&(ncm.lfMessageFont));     // If no parent supplied then try and get a pointer to it anyway    if (!pParent)        pParent = AfxGetMainWnd();    // Create popup window    //bSuccess = CreateEx(WS_EX_DLGMODALFRAME|WS_EX_TOPMOST, // Extended style	bSuccess = CreateEx(WS_EX_DLGMODALFRAME,                        csClassName,                       // Classname                        pszTitle,                          // Title                        WS_POPUP|WS_BORDER|WS_CAPTION,     // style                        0,0,                               // position - updated soon.                        390,130,                           // Size - updated soon                        pParent->GetSafeHwnd(),            // handle to parent                        0,                                 // No menu                        NULL);        if (!bSuccess) return FALSE;    // Now create the controls    CRect TempRect(0,0,10,10);    bSuccess = m_Text.Create(_T(""), WS_CHILD|WS_VISIBLE|SS_NOPREFIX|SS_LEFTNOWORDWRAP,                             TempRect, this, IDC_TEXT);    if (!bSuccess) return FALSE;    DWORD dwProgressStyle = WS_CHILD|WS_VISIBLE;#ifdef PBS_SMOOTH        if (bSmooth)       dwProgressStyle |= PBS_SMOOTH;#endif    bSuccess = m_wndProgress.Create(dwProgressStyle,TempRect, this, IDC_PROGRESS);    if (!bSuccess) return FALSE;    bSuccess = m_CancelButton.Create(m_strCancelLabel,                                    WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON,                                      TempRect, this, IDC_CANCEL);    if (!bSuccess) return FALSE;    m_CancelButton.SetFont(&m_font, TRUE);    m_Text.SetFont(&m_font, TRUE);    // Resize the whole thing according to the number of text lines, desired window    // width and current font.    SetWindowSize(m_nNumTextLines, 390);    // Center and show window    if (m_bPersistantPosition)        GetPreviousSettings();    else        CenterWindow();    Show();    return TRUE;}
开发者ID:CyberShadow,项目名称:Ditto,代码行数:70,


示例28: CenterWindow

LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/){	// center the dialog on the screen	CenterWindow();	  // Set window icon  SetIcon(::LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME)), 0);  // Load heading icon  HMODULE hExeModule = LoadLibrary(m_sImageName);  if(hExeModule)  {    // Use IDR_MAINFRAME icon which is the default one for the crashed application.    m_HeadingIcon = ::LoadIcon(hExeModule, MAKEINTRESOURCE(IDR_MAINFRAME));  }    // If there is no IDR_MAINFRAME icon in crashed EXE module, use IDI_APPLICATION system icon  if(m_HeadingIcon == NULL)  {    m_HeadingIcon = ::LoadIcon(NULL, MAKEINTRESOURCE(IDI_APPLICATION));  }     m_link.SubclassWindow(GetDlgItem(IDC_LINK));     m_link.SetHyperLinkExtendedStyle(HLINK_COMMANDBUTTON);  m_linkMoreInfo.SubclassWindow(GetDlgItem(IDC_MOREINFO));  m_linkMoreInfo.SetHyperLinkExtendedStyle(HLINK_COMMANDBUTTON);  m_statEmail = GetDlgItem(IDC_STATMAIL);  m_editEmail = GetDlgItem(IDC_EMAIL);  m_statDesc = GetDlgItem(IDC_DESCRIBE);  m_editDesc = GetDlgItem(IDC_DESCRIPTION);  m_statCrashRpt = GetDlgItem(IDC_CRASHRPT);  m_statHorzLine = GetDlgItem(IDC_HORZLINE);  m_btnOk = GetDlgItem(IDOK);  m_btnCancel = GetDlgItem(IDCANCEL);  CRect rc1, rc2;  m_linkMoreInfo.GetWindowRect(&rc1);  m_statHorzLine.GetWindowRect(&rc2);  m_nDeltaY = rc1.bottom+15-rc2.top;  LOGFONT lf;  memset(&lf, 0, sizeof(LOGFONT));  lf.lfHeight = 25;  lf.lfWeight = FW_NORMAL;  lf.lfQuality = ANTIALIASED_QUALITY;  _TCSCPY_S(lf.lfFaceName, 32, _T("Tahoma"));  m_HeadingFont.CreateFontIndirect(&lf);  ShowMoreInfo(FALSE);  m_dlgProgress.Create(m_hWnd);	// register object for message filtering and idle updates	CMessageLoop* pLoop = _Module.GetMessageLoop();	ATLASSERT(pLoop != NULL);	pLoop->AddMessageFilter(this);	pLoop->AddIdleHandler(this);	UIAddChildWindowContainer(m_hWnd);	return TRUE;}
开发者ID:doo,项目名称:CrashRpt,代码行数:64,



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


C++ Centre函数代码示例
C++ CenterOnScreen函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。