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

C++ GetDlgItem函数代码示例

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

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



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

示例1: switch

/**
 * @param hwnd - window handle.
 * @param uMsg - message identifier.
 * @param wParam - first message parameter.
 * @param lParam - second message parameter.
 */
LRESULT CALLBACK CHyperLink::HyperLinkWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	int x, y, nCtrlID;
	POINT point;
	HCURSOR hCursor;
	COLORREF rgbNewColor;
	PAINTSTRUCT ps;
	HWND hwndParent, hwndCtrl;
	LRESULT lResult;
	DWORD dwResult;
	HDC hdc;

	CHyperLink* _this  = (CHyperLink*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
	switch(uMsg)
	{
	case WM_NCHITTEST:
		return HTCLIENT;
	case WM_SETCURSOR:
		hCursor = g_pResManager->m_hArrowCursor;
		if (g_pResManager->m_hHandCursor)
		{
			dwResult = GetMessagePos();
			point.x = GET_X_LPARAM(dwResult);
			point.y = GET_Y_LPARAM(dwResult);
			ScreenToClient(hwnd, &point);
			if (_this->HitTest(point))
				hCursor = g_pResManager->m_hHandCursor;
		}
		if (hCursor)
		{
			SetCursor(hCursor);
			return TRUE;
		}
		return FALSE;
	case WM_LBUTTONDOWN:
		if (GetCapture() != hwnd)
		{
			x = GET_X_LPARAM(lParam);
			y = GET_Y_LPARAM(lParam);
			if (_this->HitTest(x, y))
			{
				_this->m_rgbCurrentColor = m_rgbRedColor;
				SetCapture(hwnd);
				if (GetFocus() == hwnd)
					InvalidateRect(hwnd, NULL, FALSE);
				else
					SetFocus(hwnd);
			}
		}
		return 0;
	case WM_MOUSEMOVE:
		if (GetCapture() == hwnd)
		{
			x = GET_X_LPARAM(lParam);
			y = GET_Y_LPARAM(lParam);
			rgbNewColor = _this->HitTest(x, y) ? m_rgbRedColor : m_rgbBlueColor;
			if (_this->m_rgbCurrentColor != rgbNewColor)
			{
				_this->m_rgbCurrentColor = rgbNewColor;
				InvalidateRect(hwnd, NULL, FALSE);
			}
		}
		return 0;
	case WM_LBUTTONUP:
		if (GetCapture() == hwnd)
		{
			ReleaseCapture();
			x = GET_X_LPARAM(lParam);
			y = GET_Y_LPARAM(lParam);
			if (_this->HitTest(x, y))
				_this->DoAction();
		}
		return 0;
	case WM_SETFOCUS:
		hwndParent = GetParent(hwnd);
		if (hwndParent)
		{
			nCtrlID = GetDlgCtrlID(hwnd);
			if (_this->m_nPrevDefButtonID < 0)
			{
				lResult = SendMessage(hwndParent, DM_GETDEFID, 0, 0);
				_this->m_nPrevDefButtonID = HIWORD(lResult) == DC_HASDEFID && LOWORD(lResult) != nCtrlID ? LOWORD(lResult) : -1;
			}
			SendMessage(hwndParent, DM_SETDEFID, nCtrlID, 0);
			if (_this->m_nPrevDefButtonID > 0)
			{
				// Sending a DM_SETDEFID message to change the default button will not always
				// remove the default state border from the first push button. In these cases,
				// the application should send a BM_SETSTYLE message to change the first push
				// button border style.
				hwndCtrl = GetDlgItem(hwndParent, _this->m_nPrevDefButtonID);
				if (SendMessage(hwndCtrl, WM_GETDLGCODE, 0, 0) & DLGC_DEFPUSHBUTTON)
					SendMessage(hwndCtrl, BM_SETSTYLE, BS_PUSHBUTTON, TRUE);
			}
//.........这里部分代码省略.........
开发者ID:GetEnvy,项目名称:Envy,代码行数:101,代码来源:HyperLink.cpp


示例2: GetDlgItem

void CFileView::OnNMRClickListFile(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
	// TODO: 在此添加控件通知处理程序代码
	CString strCurPath;
	GetDlgItem(IDC_EDIT_CURPATH)->GetWindowText(strCurPath);
	if (strCurPath.IsEmpty())
	{
		return;
	}
	CMenu fileMenu;
	fileMenu.LoadMenu(IDR_MENU_FILE);
	CMenu *pSubMenu = fileMenu.GetSubMenu(0);
    
	pSubMenu->SetMenuItemBitmaps(ID_FILE_RUN, MF_BYCOMMAND, &m_MenuBmp[0], &m_MenuBmp[0]);  //运行
	pSubMenu->SetMenuItemBitmaps(ID_FILE_FLUSH, MF_BYCOMMAND, &m_MenuBmp[1], &m_MenuBmp[1]); //刷新
	pSubMenu->SetMenuItemBitmaps(ID_FILE_COPY, MF_BYCOMMAND, &m_MenuBmp[2], &m_MenuBmp[2]);   //copy
	pSubMenu->SetMenuItemBitmaps(ID_FILE_PASTE, MF_BYCOMMAND, &m_MenuBmp[3], &m_MenuBmp[3]);   //paste
	pSubMenu->SetMenuItemBitmaps(ID_FILE_DEL, MF_BYCOMMAND, &m_MenuBmp[4], &m_MenuBmp[4]);   //删除
	pSubMenu->SetMenuItemBitmaps(ID_FILE_UPLOAD, MF_BYCOMMAND, &m_MenuBmp[5], &m_MenuBmp[5]);   //上传
	pSubMenu->SetMenuItemBitmaps(ID_FILE_DOWNLOAD, MF_BYCOMMAND, &m_MenuBmp[6], &m_MenuBmp[6]);  //下载
	pSubMenu->SetMenuItemBitmaps(ID_FILE_CREATE, MF_BYCOMMAND, &m_MenuBmp[7], &m_MenuBmp[7]);  //新建
    int nItem = pNMItemActivate->iItem;  //选中项的索引值
    if (-1 == nItem) //没有选中项
	{
		pSubMenu->EnableMenuItem(ID_FILE_RUN, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
		pSubMenu->EnableMenuItem(ID_FILE_COPY, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
		pSubMenu->EnableMenuItem(ID_FILE_DEL, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
		pSubMenu->EnableMenuItem(ID_FILE_DOWNLOAD, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
		pSubMenu->EnableMenuItem(ID_FILE_RENAME, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
		pSubMenu->EnableMenuItem(ID_FILE_ATTRIBUTE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
		if (!m_bCopy)  //能不能拷贝
		{
			pSubMenu->EnableMenuItem(ID_FILE_PASTE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);   //粘贴
		}
	}
	else
	{
		CString strType = m_listCtrl.GetItemText(nItem, 1);
		if (_T("文件夹") == strType) //选中的是文件夹
		{
			pSubMenu->EnableMenuItem(ID_FILE_RUN, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);   //运行
			pSubMenu->EnableMenuItem(ID_FILE_COPY, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);  //复制
			pSubMenu->EnableMenuItem(ID_FILE_PASTE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);  //粘贴
			pSubMenu->EnableMenuItem(ID_FILE_UPLOAD, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);  //上传
			pSubMenu->EnableMenuItem(ID_FILE_DOWNLOAD, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED); //下载
			pSubMenu->EnableMenuItem(ID_FILE_CREATE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);  //新建文件夹
			pSubMenu->EnableMenuItem(ID_FILE_ATTRIBUTE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
		}
		else //选中是文件
		{
			pSubMenu->EnableMenuItem(ID_FILE_PASTE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);  //粘贴
			pSubMenu->EnableMenuItem(ID_FILE_UPLOAD, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);  //上传
			pSubMenu->EnableMenuItem(ID_FILE_CREATE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);  //新建文件夹
		}
	}
	CPoint point;
	GetCursorPos(&point);  //获取光标位置
	pSubMenu->TrackPopupMenu(TPM_LEFTALIGN, point.x, point.y, this);
	*pResult = 0;
}
开发者ID:blackye,项目名称:remote_control,代码行数:61,代码来源:FileView.cpp


示例3: MainWndProc

/*
--------------------------------------------------------------------------
MainWndProc

This is the main procedure which processes each message.

Inputs:
  hwnd     - The handle to the parent window
  message  - Message sent from MainWndProc
  wParam   - Command from MainWndProc
  lParam   - Additional message information

Outputs:
  Used as an boolean for the current message
--------------------------------------------------------------------------
*/
int FAR PASCAL MainWndProc(HWND hwnd, WORD message, WORD wParam, LONG lParam)
{
  WORD           wTabStop;

  switch (message)
  {
    case WM_INITDIALOG:
      hWnd = hwnd;
      hWndPScroll = GetDlgItem(hWnd, IDD_PSCROLL);
      hWndCScroll = GetDlgItem(hWnd, IDD_CSCROLL);
      hWndRList   = GetDlgItem(hWnd, IDD_RLIST);
      of_course.lStructSize       = sizeof(OPENFILENAME);
      of_player.lStructSize       = sizeof(OPENFILENAME);
      of_course.hwndOwner         = hWnd;
      of_player.hwndOwner         = hWnd;
      of_course.lpstrFilter       = "Course(*.GLC)\0*.glc\0";
      of_player.lpstrFilter       = "Player(*.GLP)\0*.glp\0";
      of_course.lpstrCustomFilter = (LPSTR) NULL;
      of_player.lpstrCustomFilter = (LPSTR) NULL;
      of_course.nMaxCustFilter    = 0L;
      of_player.nMaxCustFilter    = 0L;
      of_course.nFilterIndex      = 0L;
      of_player.nFilterIndex      = 0L;
      of_course.lpstrFile         = szFileC;
      of_player.lpstrFile         = szFileP;
      of_course.nMaxFile          = sizeof(szFileC);
      of_player.nMaxFile          = sizeof(szFileP);
      of_course.lpstrFileTitle    = szFileTitleC;
      of_player.lpstrFileTitle    = szFileTitleP;
      of_course.nMaxFileTitle     = sizeof(szFileTitleC);
      of_player.nMaxFileTitle     = sizeof(szFileTitleP);
      of_course.lpstrInitialDir   = NULL;
      of_player.lpstrInitialDir   = NULL;
      of_course.nFileOffset       = 0;
      of_player.nFileOffset       = 0;
      of_course.nFileExtension    = 0;
      of_player.nFileExtension    = 0;
      of_course.lpstrDefExt       = "GLC";
      of_player.lpstrDefExt       = "GLP";
      p_index = r_index = r_last = c_index = 0;
      players.player_numb = courses.course_numb = -1;
      SetClassWord(hWnd, GCW_HICON, LoadIcon(hInst, "GOLFICON"));
      wTabStop = 4 + TAB_PIXEL_SETTING / (LOWORD(GetDialogBaseUnits()) / 4);
      SendMessage(hWndRList, LB_SETTABSTOPS, 1, (LONG) (WORD FAR *) &wTabStop);
      DoCaption(hWnd, szFileTitleP, szFileTitleC);
      return TRUE;

    case WM_INITMENU:  /* Set the menu items */
      DoMenu(wParam, &players, &courses, p_index, hWndRList);
      return TRUE;

    case WM_HSCROLL:  /* move to next or previous record */
      if (HIWORD(lParam) == hWndPScroll)
	move_player(hWnd, hWndRList, wParam, &players, &p_index, &r_index, &r_last);
      else if (HIWORD(lParam) == hWndCScroll)
	move_course(hWnd, wParam, &courses, &c_index);
      return TRUE;

    case WM_COMMAND:
      return CommandHandler(wParam, lParam);

    case WM_QUERYENDSESSION:
      if (bNeedSaveP && IDCANCEL == AskAboutSave(hWnd, szFileTitleP, PLAYER_MARKER))
	return 1;
      if (bNeedSaveC && IDCANCEL == AskAboutSave(hWnd, szFileTitleC, COURSE_MARKER))
	return 1;
      EndDialog(hWnd, NULL);
      return 0;

    case WM_CLOSE:  /* Check if file has been saved and close window */
      if (bNeedSaveP && IDCANCEL == AskAboutSave(hWnd, szFileTitleP, PLAYER_MARKER))
	return 0;
      if (bNeedSaveC && IDCANCEL == AskAboutSave(hWnd, szFileTitleC, COURSE_MARKER))
	return 0;
      EndDialog(hWnd, NULL);
      return 1;

    case WM_DESTROY:
      PostQuitMessage(0);
      return 0;

    default:
      return FALSE;
  } /* switch (message) */
//.........这里部分代码省略.........
开发者ID:morrisonbrett,项目名称:1991-golf-handicapper-for-windows-3.0,代码行数:101,代码来源:GOLF.C


示例4: decbox


//.........这里部分代码省略.........
				else if(SendDlgItemMessage(hdwnd,idc_rot,BM_GETCHECK,(WPARAM)0,(LPARAM)0))
					lastdec=decrot;
				else if(SendDlgItemMessage(hdwnd,idc_xadd,BM_GETCHECK,(WPARAM)0,(LPARAM)0))
					lastdec=decxadd;
				else
					lastdec=decnull;
				if(SendDlgItemMessage(hdwnd,idc_byte,BM_GETCHECK,(WPARAM)0,(LPARAM)0))
					lastditem=decbyte;
				else if(SendDlgItemMessage(hdwnd,idc_word,BM_GETCHECK,(WPARAM)0,(LPARAM)0))
					lastditem=decword;
				else if(SendDlgItemMessage(hdwnd,idc_dword,BM_GETCHECK,(WPARAM)0,(LPARAM)0))
					lastditem=decdword;
				else if(SendDlgItemMessage(hdwnd,idc_array,BM_GETCHECK,(WPARAM)0,(LPARAM)0))
					lastditem=decarray;
				else
					lastditem=decbyte;
				SendDlgItemMessage(hdwnd,idc_value,WM_GETTEXT,(WPARAM)18,(LPARAM)lastvalue);
				SendDlgItemMessage(hdwnd,idc_arrayseg,WM_GETTEXT,(WPARAM)18,(LPARAM)last_seg);
				SendDlgItemMessage(hdwnd,idc_arrayoffset,WM_GETTEXT,(WPARAM)18,(LPARAM)lastoffset);
				if(IsDlgButtonChecked(hdwnd,idc_applytoexe))
					patchexe=true;
				else
					patchexe=false;
				sscanf(lastvalue,"%lx",&d_val);
				sscanf(last_seg,"%lx",&d_adr.segm);
				sscanf(lastoffset,"%lx",&d_adr.offs);
				if((g_options.readonly)&&(patchexe))
				{
					patchexe=false;
					MessageBox(g_hMainWnd,"File opened readonly - unable to patch","Borg Message",MB_OK);
				}
				dec_id=decrypter.add_decrypted(blk.top,blk.bottom,lastdec,lastditem,d_val,d_adr,patchexe);
				decrypter.process_dec(dec_id);
				if(patchexe)
					decrypter.exepatch(dec_id);
				EndDialog(hdwnd,NULL);
				return true;
			case IDCANCEL:
				EndDialog(hdwnd,NULL);
				return true;
			default:
				break;
			}
		}
		break;
	case WM_INITDIALOG:
		CenterWindow(hdwnd);
		switch(lastdec)
		{
		case decxor:
			SendDlgItemMessage(hdwnd,idc_xor,BM_SETCHECK,(WPARAM)1,(LPARAM)0);
			break;
		case decmul:
			SendDlgItemMessage(hdwnd,idc_mul,BM_SETCHECK,(WPARAM)1,(LPARAM)0);
			break;
		case decadd:
			SendDlgItemMessage(hdwnd,idc_add,BM_SETCHECK,(WPARAM)1,(LPARAM)0);
			break;
		case decsub:
			SendDlgItemMessage(hdwnd,idc_sub,BM_SETCHECK,(WPARAM)1,(LPARAM)0);
			break;
		case decrot:
			SendDlgItemMessage(hdwnd,idc_rot,BM_SETCHECK,(WPARAM)1,(LPARAM)0);
			break;
		case decxadd:
			SendDlgItemMessage(hdwnd,idc_xadd,BM_SETCHECK,(WPARAM)1,(LPARAM)0);
			break;
		default:
			SendDlgItemMessage(hdwnd,idc_xor,BM_SETCHECK,(WPARAM)1,(LPARAM)0);
			break;
		}
		switch(lastditem)
		{
		case decbyte:
			SendDlgItemMessage(hdwnd,idc_byte,BM_SETCHECK,(WPARAM)1,(LPARAM)0);
			break;
		case decword:
			SendDlgItemMessage(hdwnd,idc_word,BM_SETCHECK,(WPARAM)1,(LPARAM)0);
			break;
		case decdword:
			SendDlgItemMessage(hdwnd,idc_dword,BM_SETCHECK,(WPARAM)1,(LPARAM)0);
			break;
		case decarray:
			SendDlgItemMessage(hdwnd,idc_array,BM_SETCHECK,(WPARAM)1,(LPARAM)0);
			break;
		default:
			SendDlgItemMessage(hdwnd,idc_byte,BM_SETCHECK,(WPARAM)1,(LPARAM)0);
			break;
		}
		SendDlgItemMessage(hdwnd,idc_value,WM_SETTEXT,(WPARAM)0,(LPARAM)lastvalue);
		SendDlgItemMessage(hdwnd,idc_arrayseg,WM_SETTEXT,(WPARAM)0,(LPARAM)last_seg);
		SendDlgItemMessage(hdwnd,idc_arrayoffset,WM_SETTEXT,(WPARAM)0,(LPARAM)lastoffset);
		CheckDlgButton(hdwnd,idc_applytoexe,patchexe);
		SetFocus(GetDlgItem(hdwnd,idc_value));
		return false;
	default:
		break;
	}
	return false;
}
开发者ID:avplayer,项目名称:avdbg,代码行数:101,代码来源:user_fn.cpp


示例5: while

void CMSetupDlg::ThreadFunc()
{
	
	int iCount	=	0;
	while(!m_pClient->IsConnected()){
		if(m_pClient!=NULL){
			Air::Common::NetClient::Info	info;
			info.pListener	=	this;
			info.strIP		=	"10.240.38.103";
			info.usPort		=	54322;
			if(m_pLog!=NULL){
				m_pLog->InsertString(0,L"连接服务器中");
			}
			if(m_pClient->Connect(info)){
				if(m_pLog!=NULL){
					m_pLog->InsertString(0,L"连接服务器成功");
					m_pLog->InsertString(0,L"开始下载裸客户端");
				}
				enNetType	t=	enNT_FS_Hello;
				m_pClient->Send(&t,sizeof(t));
			}
		}
		Sleep(1000);
	}
	SYSTEMTIME startTime;
	GetLocalTime(&startTime);
	CProgressCtrl* pMain	=	(CProgressCtrl*)GetDlgItem(IDC_PROGRESS_MAIN);
	CProgressCtrl* pSub		=	(CProgressCtrl*)GetDlgItem(IDC_PROGRESS_SUB);

	U32			begin=timeGetTime();
	//SetEvent(m_Event);
	//下载客户端
	while(1){
		if(m_pNakedClinet==NULL){
			break;
		}else{
			U32		end		=	timeGetTime();
			U32	usedTime	=	(end	-	begin)*0.001f;
			U32	usedHour	=	usedTime/3600;
			U32	usedMin		=	(usedTime%3600)/60;
			U32	usedSec		=	(usedTime%3600)%60;

			

			wchar_t strTime[1024];
			if(m_Complated==0){
				swprintf_s(strTime,L"0/2 已使用%02d:%02d:%02d 剩余??:??:??",usedHour,usedMin,usedSec);
			}else{
				double	needTime	=	usedTime*((double)m_Total/(double)m_Complated) - usedTime;
				U32	uiNeedTime		=	needTime;
				U32	needHour		=	uiNeedTime/3600;
				U32	needMin			=	(uiNeedTime%3600)/60;
				U32	needSec			=	(uiNeedTime%3600)%60;
				swprintf_s(strTime,L"0/2 已使用%02d:%02d:%02d 剩余%02d:%02d:%02d",usedHour,usedMin,usedSec,needHour,needMin,needSec);
			}
			//float	f	=	m_Complated
			GetDlgItem(IDC_STATIC_TIME)->SetWindowTextW(strTime);

			CProgressCtrl* pSub	=	(CProgressCtrl*)GetDlgItem(IDC_PROGRESS_SUB);
			float	fPercent	=	100*(float)m_Complated/(float)m_Total;
			pSub->SetPos((U32)fPercent);
		}
		Sleep(100);
	}
	pSub->SetPos(100);
	pMain->SetPos(25);


	//下载客户端
}
开发者ID:ingeyu,项目名称:airengine,代码行数:70,代码来源:MSetupDlg.cpp


示例6: OnADCSampleStop

void CTabSample::OnBnClickedButtonStopsample()
{
	// TODO: ÔÚ´ËÌí¼Ó¿Ø¼þ֪ͨ´¦Àí³ÌÐò´úÂë
	if (m_bStartSample == FALSE)
	{
		return;
	}
	m_bStopSample = TRUE;
	m_bStartSample = FALSE;


	CString str;
	// 发送采样结束操作命令帧
	//OnSendCmdFrame(StartSampleCmd, 0, m_uiSampleNb);

	unsigned int uiIPAim;
	for (int i=0; i<GraphViewNum; i++)
	{
		if ((m_uiSampleNb & (0x01<<i)) != 0)
		{
			uiIPAim	= 111 - 10*i;
			/*OnADCSampleStop(uiIPAim);*/
		}
	}
	OnADCSampleStop(uiIPAim);

	// 		// 关闭采样输出随机数定时器
	// 		KillTimer(1);

	// 关闭采样时间定时器
	// KillTimer(10);

	// 对选中的仪器进行数据处理
	for (int k=0; k<GraphViewNum; k++)
	{
		if (m_iSelectObject[k] == 1)
		{
			if (m_iSelectObjectNoise[k] == 0)
			{
				double davg = 0.0;
				double drms = 0.0;
				double dmax = 0.0;
				double dmin = 0.0;
				if (m_dSampleData[k].size() == 0)
				{
					continue;
				}
				davg = SampleDataAverage(m_dSampleData[k]);
				str.Format("Avg = %2.3f",davg);
				GetDlgItem(m_iMathId[k][0])->SetWindowText(str);

				drms = SampleDataRms(m_dSampleData[k]);
				str.Format("RMS = %2.3f",drms);
				GetDlgItem(m_iMathId[k][1])->SetWindowText(str);

				dmax = SampleDataMax(m_dSampleData[k]);
				str.Format("Max = %2.3f",dmax);
				GetDlgItem(m_iMathId[k][2])->SetWindowText(str);

				dmin = SampleDataMin(m_dSampleData[k]);
				str.Format("Min = %2.3f",dmin);
				GetDlgItem(m_iMathId[k][3])->SetWindowText(str);

				// 将数据处理结果加入到数组中
				m_dSampleData[k].push_back(davg);
				m_dSampleData[k].push_back(drms);
				m_dSampleData[k].push_back(dmax);
				m_dSampleData[k].push_back(dmin);
			}
		}
	}


	// 计算仪器最大的采样长度
	m_iMaxLength = OnSampleDataMaxLength(GraphViewNum, m_dSampleData);
	if (m_iMaxLength == 0)
	{
		return;
	}

	// 横向滚动条的最大和最小值
	m_uiScrollBarMax = m_iMaxLength; 
	if (m_iMaxLength > m_OScopeCtrl[0].XAxisPointNum)
	{
		m_uiScrollBarMin = m_OScopeCtrl[0].XAxisPointNum; 
	} 
	else
	{
		m_uiScrollBarMin = 0; 
	}
	CScrollBar*pSB =(CScrollBar*)GetDlgItem(IDC_SCROLLBAR_GRAPHVIEW); 
	pSB->SetScrollRange(m_uiScrollBarMin, m_uiScrollBarMax); 
	pSB->SetScrollPos(m_uiScrollBarMax, TRUE);

	// 将采样数据保存到文件中,只有设定采样时间的数据才会被保存
	if (m_dSampleTime > 0)
	{
		OnSaveToFile(MathValueIdNum, GraphViewNum, m_cSelectObjectName,m_dSampleData);
	}
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:100,代码来源:TabSample.cpp


示例7: GetLocalTime

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

	if (m_pUiWindow)
		m_pUiWindow->setWindow (m_hWnd);

	
	
	
	
	
	m_schScheduleParam.schTask.hts.enType = HTS_ONCE;
	m_schScheduleParam.schTask.hts.last.dwHighDateTime = m_schScheduleParam.schTask.hts.last.dwLowDateTime = UINT_MAX;
	m_schScheduleParam.schTask.dwFlags = SCHEDULE_ENABLED;
	SYSTEMTIME time;
	GetLocalTime (&time);
	if (++time.wHour > 23)
		time.wHour = 0;
	time.wMinute = 0;
	SystemTimeToFileTime (&time, &m_schScheduleParam.schTask.hts.next);
	m_schScheduleParam.schTask.uWaitForConfirmation = 0;

	m_btnChooseFolder.SetIcon (SICO (IDI_CHOOSEFOLDER));
	m_btnCreateGroup.SetIcon (SICO (IDI_CREATEGROUP));
	m_btnSetTime.SetIcon (SICO (IDI_SETTIME));
	m_btnOutFolderSetDefault.SetIcon (SICO (IDI_SETFOLDERDEFAULT));

	m_wndGroups.Fill ();
	m_wndGroups.SelectGroupById (_App.CreateDld_IdOfLastGrpSelected ());

	CheckDlgButton (IDC_KEEP, _App.Spider_Flags () & WPDF_KEEPFOLDERSTRUCTURE ? 
						BST_CHECKED : BST_UNCHECKED);

	CheckDlgButton (IDC_DONTSTOREPAGES, _App.Spider_Flags () & WPDF_DONTSTOREPAGES ? 
						BST_CHECKED : BST_UNCHECKED);

	CheckDlgButton (IDC_DELCOMPLETED, _App.Spider_Flags () & WPDF_DELCOMPLETEDDLDS ?
						BST_CHECKED : BST_UNCHECKED);

	CComboBox *pUrls = (CComboBox*) GetDlgItem (IDC_URL);
	int i = 0;
	for (i = 0; i < _LastUrlFiles.GetRecordCount (); i++)
		pUrls->AddString (_LastUrlFiles.GetRecord (i));

	if (m_strStartUrl.GetLength () == 0)
	{
		LPCSTR pszUrl = _ClipbrdMgr.Text ();
		if (pszUrl)
		{
			fsURL url;
			if (url.Crack (pszUrl) == IR_SUCCESS)
				m_strUrl = pszUrl;
		}
		
		if (m_strUrl.GetLength () == 0)
			m_strUrl = "http://";
	}
	else
		m_strUrl = m_strStartUrl;

	pUrls->SetWindowText (m_strUrl);

	CComboBox *pDirs = (CComboBox*) GetDlgItem (IDC_OUTFOLDER);
	for (i = 0; i < _LastFolders.GetRecordCount (); i++)
		pDirs->AddString (_LastFolders.GetRecord (i));

	GetDlgItem (IDC_URL)->SetFocus ();

	m_bOutFolderChanged = m_bGroupChanged = FALSE;

	ReadAutostart ();
	ApplyLanguage ();

	if (m_bReqTopMost)
	{
		fsSetForegroundWindow (m_hWnd);
        mfcSetTopmostWindow (this);
	}

	m_wndDepthSpin.SetRange (0, UD_MAXVAL);
	SetDlgItemInt (IDC_DEPTH, m_wpd->GetWDPS ()->iDepth);

	if (m_wndGroups.SelectGroupById (_App.NewDL_GroupId ()))
		m_bGroupChanged = TRUE;

	OnChangeGroups ();

	BuildOutFolder ();

	UpdateEnabled ();

	return TRUE;  
	              
}
开发者ID:andyTsing,项目名称:freedownload,代码行数:95,代码来源:SpiderAddPageDlg.cpp


示例8: GetCurrentDirectory

BOOL CEditMacroDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// Rebuild the macro filename
	TCHAR szCurrentDir[_MAX_PATH+1];
	GetCurrentDirectory(_MAX_PATH,szCurrentDir);
	CString strPath(szCurrentDir);
	if ( strPath[strPath.GetLength()-1] != '\\' ) {
		// The directory doesn't end with a backslash,
		// so we add one now.
		strPath += '\\';
	} // if
	ASSERT(m_strMacroName.GetLength());
	m_strFile = strPath + m_strMacroName + ".mac";

	// Load the file
	try {
		CFile fileMacro(m_strFile,CFile::modeRead|CFile::shareDenyWrite);

		// Determine the file's length
		DWORD dwSize = fileMacro.GetLength();

		// Read the file
		fileMacro.Read(m_strText.GetBuffer(dwSize),dwSize);
		m_strText.ReleaseBuffer();

		// Close it
		fileMacro.Close();
	} // try
	catch (CFileException* e) {
		// File I/O error
		CString strMsg;
		::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | 
						FORMAT_MESSAGE_FROM_SYSTEM |
						FORMAT_MESSAGE_IGNORE_INSERTS,
						NULL,
						e->m_cause,
						MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),
						strMsg.GetBuffer(_MAX_PATH),
						0,
						NULL );
		strMsg.ReleaseBuffer();
		strMsg = _T("File error reading macro file, '") + strMsg + _T("'");

		// Display the string.
		AfxMessageBox(strMsg,MB_OK|MB_ICONERROR);
		EndDialog(IDCANCEL);
	} // catch
	catch (...) {
		// Some other error...
		CString strMsg;
		::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | 
						FORMAT_MESSAGE_FROM_SYSTEM |
						FORMAT_MESSAGE_IGNORE_INSERTS,
						NULL,
						GetLastError(),
						MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),
						strMsg.GetBuffer(_MAX_PATH),
						0,
						NULL );
		strMsg.ReleaseBuffer();
		strMsg = _T("Error reading macro file, '") + strMsg + _T("'");

		// Display the string.
		AfxMessageBox(strMsg,MB_OK|MB_ICONERROR);
		EndDialog(IDCANCEL);
	} // catch

	// Set the focus to the edit control
	UpdateData(FALSE);
	CWnd* pEdit = GetDlgItem(IDC_TEXTEDIT);
	pEdit->SetFocus(); // note we set the return value to FALSE below...
	
	return FALSE; // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
	
//	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:sergedeh,项目名称:andycad,代码行数:80,代码来源:EditMacroDlg.cpp


示例9: GetDlgItemText

void CSpiderAddPageDlg::OnOK() 
{
	

	fsWPDSettings *wpds = m_wpd->GetWDPS ();

	GetDlgItemText (IDC_URL, m_strUrl);

	if (FALSE == WriteAuthorization ())
		return;

	BOOL bAddSlash;
	if (FALSE == IsOkUrl (m_strUrl, m_wpd->GetWDPS ()->strHTMLExts, &bAddSlash))
	{
		WrongURL ();
		return;
	}

	if (bAddSlash)
		m_strUrl += '/';

	CString strOutFolder;

	GetDlgItemText (IDC_OUTFOLDER, strOutFolder);

	if (FALSE == CCreateDownloadDlg::_CheckFolderName (this, IDC_OUTFOLDER))
		return;

	fsPathToGoodPath ((LPSTR)(LPCSTR)strOutFolder);

	if (strOutFolder.GetLength () == 0)
	{
		MessageBox (LS (L_ENTERFLRNAME), LS (L_INPERR), MB_ICONEXCLAMATION);
		GetDlgItem (IDC_OUTFOLDER)->SetFocus ();
		return;
	}

	_LastFolders.AddRecord (strOutFolder);
	_LastUrlFiles.AddRecord (m_strUrl);

	if (strOutFolder [strOutFolder.GetLength () - 1] != '\\' && 
		strOutFolder [strOutFolder.GetLength () - 1] != '/')
		strOutFolder += '\\';

        if (_App.NewGrp_SelectWay () == NGSW_USE_ALWAYS_SAME_GROUP_WITH_OUTFOLDER_AUTO_UPDATE)
	{
		vmsDownloadsGroupSmartPtr pGrp = _DldsGrps.FindGroup (_App.NewDL_GroupId ());
		if (pGrp != NULL) {
			pGrp->strOutFolder = strOutFolder;
			pGrp->setDirty();
			
			
			
		}
	}

	wpds->pDLGroup = m_wndGroups.GetSelectedGroup ();

	wpds->strFolderSaveTo = strOutFolder;

	wpds->iDepth = GetDlgItemInt (IDC_DEPTH);

	wpds->dwFlags = 0;

	if (IsDlgButtonChecked (IDC_KEEP) == BST_CHECKED)
		wpds->dwFlags |= WPDF_KEEPFOLDERSTRUCTURE;

	if (IsDlgButtonChecked (IDC_DONTSTOREPAGES) == BST_CHECKED)
	{
		wpds->bDownloadStyles = FALSE;
		wpds->dwFlags |= WPDF_DONTSTOREPAGES;
	}

	if (IsDlgButtonChecked (IDC_DELCOMPLETED) == BST_CHECKED)
		wpds->dwFlags |= WPDF_DELCOMPLETEDDLDS;

	if (wpds->m_ppoOwner)
		wpds->m_ppoOwner->setDirty();

	_App.Spider_Flags (wpds->dwFlags);

	m_wndGroups.RememberSelectedGroup ();
	_App.Last_Autostart (m_iAutostart);

	if (wpds->strUserName.GetLength () != 0)
	{
		fsURL url;
		url.Crack (m_strUrl);
		fsSiteInfo* site = CCreateDownloadDlg::_SavePassword (url.GetHostName (), 
			fsSchemeToNP (url.GetInternetScheme ()), wpds->strUserName, wpds->strPassword);
		if (site) 
		{
			site->pGroup = wpds->pDLGroup;
			_SitesMgr.setDirty();
			_SitesMgr.SiteUpdated (site);
		}
	}

	_App.OnDlHasBeenCreatedByUser ();
	
//.........这里部分代码省略.........
开发者ID:andyTsing,项目名称:freedownload,代码行数:101,代码来源:SpiderAddPageDlg.cpp


示例10: MessageBox

void CSpiderAddPageDlg::WrongURL()
{
	MessageBox (LS (L_CHECKURL), LS (L_INPERR), MB_ICONEXCLAMATION);
	GetDlgItem (IDC_URL)->SetFocus ();
}
开发者ID:andyTsing,项目名称:freedownload,代码行数:5,代码来源:SpiderAddPageDlg.cpp


示例11: GetDlgItem

void CSpiderAddPageDlg::OnSelchangeUrl() 
{
	CComboBox *pUrl = (CComboBox*) GetDlgItem (IDC_URL);
	pUrl->GetLBText (pUrl->GetCurSel (), m_strUrl);
	OnUrlChanged ();	
}
开发者ID:andyTsing,项目名称:freedownload,代码行数:6,代码来源:SpiderAddPageDlg.cpp


示例12: DDX_Control

void ship_flags_dlg::DoDataExchange(CDataExchange* pDX)
{
	int n;
	CString str;

	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(ship_flags_dlg)
	DDX_Control(pDX, IDC_TOGGLE_SUBSYSTEM_SCANNING, m_toggle_subsystem_scanning);
	DDX_Control(pDX, IDC_REDALERTCARRY, m_red_alert_carry);
	DDX_Control(pDX, IDC_SCANNABLE, m_scannable);
	DDX_Control(pDX, IDC_REINFORCEMENT, m_reinforcement);
	DDX_Control(pDX, IDC_PROTECT_SHIP, m_protect_ship);
	DDX_Control(pDX, IDC_BEAM_PROTECT_SHIP, m_beam_protect_ship);
	DDX_Control(pDX, IDC_FLAK_PROTECT_SHIP, m_flak_protect_ship);
	DDX_Control(pDX, IDC_LASER_PROTECT_SHIP, m_laser_protect_ship);
	DDX_Control(pDX, IDC_MISSILE_PROTECT_SHIP, m_missile_protect_ship);
	DDX_Control(pDX, IDC_NO_DYNAMIC, m_no_dynamic);
	DDX_Control(pDX, IDC_NO_ARRIVAL_MUSIC, m_no_arrival_music);
	DDX_Control(pDX, IDC_KAMIKAZE, m_kamikaze);
	DDX_Control(pDX, IDC_INVULNERABLE, m_invulnerable);
	DDX_Control(pDX, IDC_TARGETABLE_AS_BOMB, m_targetable_as_bomb);
	DDX_Control(pDX, IDC_IMMOBILE, m_immobile);
	DDX_Control(pDX, IDC_IGNORE_COUNT, m_ignore_count);
	DDX_Control(pDX, IDC_HIDDEN_FROM_SENSORS, m_hidden);
	DDX_Control(pDX, IDC_PRIMITIVE_SENSORS, m_primitive_sensors);
	DDX_Control(pDX, IDC_NO_SUBSPACE_DRIVE, m_no_subspace_drive);
	DDX_Control(pDX, IDC_AFFECTED_BY_GRAVITY, m_affected_by_gravity);
	DDX_Control(pDX, IDC_ESCORT, m_escort);
	DDX_Control(pDX, IDC_DESTROY_CHECK, m_destroy);
	DDX_Control(pDX, IDC_CARGO_KNOWN, m_cargo_known);
	DDX_Control(pDX, IDC_SPECIAL_WARPIN, m_special_warpin);	
	DDX_Control(pDX, IDC_DESTROY_SPIN, m_destroy_spin);	
	DDX_Control(pDX, IDC_DISABLE_BUILTIN_SHIP, m_disable_messages);
	DDX_Control(pDX, IDC_NO_DEATH_SCREAM, m_no_death_scream);
	DDX_Control(pDX, IDC_ALWAYS_DEATH_SCREAM, m_always_death_scream);
	DDX_Control(pDX, IDC_GUARDIAN, m_guardian);
	DDX_Control(pDX, IDC_VAPORIZE, m_vaporize);
	DDX_Control(pDX, IDC_STEALTH, m_stealth);
	DDX_Control(pDX, IDC_FRIENDLY_STEALTH_INVISIBLE, m_friendly_stealth_invisible);
	DDX_Control(pDX, IDC_NAV_CARRY, m_nav_carry);
	DDX_Control(pDX, IDC_NAV_NEEDSLINK, m_nav_needslink);
	DDX_Control(pDX, IDC_HIDE_SHIP_NAME, m_hide_ship_name);
	DDX_Control(pDX, IDC_DISABLE_ETS, m_disable_ets);
	DDX_Control(pDX, IDC_CLOAKED, m_cloaked);
	DDX_Control(pDX, IDC_NO_COLLIDE, m_no_collide);
	DDX_Control(pDX, IDC_SET_CLASS_DYNAMICALLY, m_set_class_dynamically);
	DDX_Control(pDX, IDC_SCRAMBLE_MESSAGES, m_scramble_messages);
	//}}AFX_DATA_MAP

	if (pDX->m_bSaveAndValidate) {  // get dialog control values
		GetDlgItem(IDC_DESTROY_VALUE)->GetWindowText(str);
		n = atoi(str);
		if (n < 0)
			n = 0;

		m_destroy_value.init(n);

		GetDlgItem(IDC_KDAMAGE)->GetWindowText(str);
		m_kdamage.init(atoi(str));

		//  get escort priority
		GetDlgItem(IDC_ESCORT_PRIORITY)->GetWindowText(str);
		m_escort_value.init(atoi(str));

		// get respawn priority
		if(The_mission.game_type & MISSION_TYPE_MULTI) {
			GetDlgItem(IDC_RESPAWN_PRIORITY)->GetWindowText(str);
			m_respawn_priority.init(atoi(str));
		}
	}
}
开发者ID:Admiral-MS,项目名称:fs2open.github.com,代码行数:71,代码来源:shipflagsdlg.cpp


示例13: GET_FIRST


//.........这里部分代码省略.........
		objp = GET_NEXT(objp);
	}

	CDialog::OnInitDialog();
	
	m_protect_ship.SetCheck(protect_ship);
	m_beam_protect_ship.SetCheck(beam_protect_ship);
	m_flak_protect_ship.SetCheck(flak_protect_ship);
	m_laser_protect_ship.SetCheck(laser_protect_ship);
	m_missile_protect_ship.SetCheck(missile_protect_ship);
	m_ignore_count.SetCheck(ignore_count);
	m_reinforcement.SetCheck(reinforcement);
	m_cargo_known.SetCheck(cargo_known);
	m_destroy.SetCheck(destroy_before_mission);
	m_no_arrival_music.SetCheck(no_arrival_music);
	m_escort.SetCheck(escort);
	m_invulnerable.SetCheck(invulnerable);
	m_targetable_as_bomb.SetCheck(targetable_as_bomb);
	m_immobile.SetCheck(immobile);
	m_hidden.SetCheck(hidden_from_sensors);
	m_primitive_sensors.SetCheck(primitive_sensors);
	m_no_subspace_drive.SetCheck(no_subspace_drive);
	m_affected_by_gravity.SetCheck(affected_by_gravity);
	m_toggle_subsystem_scanning.SetCheck(toggle_subsystem_scanning);
	m_scannable.SetCheck(scannable);
	m_kamikaze.SetCheck(kamikaze);
	m_no_dynamic.SetCheck(no_dynamic);
	m_red_alert_carry.SetCheck(red_alert_carry);
	m_special_warpin.SetCheck(special_warpin);
	m_disable_messages.SetCheck(disable_messages);
	m_set_class_dynamically.SetCheck(set_class_dynamically);
	m_no_death_scream.SetCheck(no_death_scream);
	m_always_death_scream.SetCheck(always_death_scream);
	m_guardian.SetCheck(guardian);
	m_vaporize.SetCheck(vaporize);
	m_stealth.SetCheck(stealth);
	m_friendly_stealth_invisible.SetCheck(friendly_stealth_invisible);
	m_nav_carry.SetCheck(nav_carry);
	m_nav_needslink.SetCheck(nav_needslink);
	m_hide_ship_name.SetCheck(hide_ship_name);
	m_disable_ets.SetCheck(no_ets);
	m_cloaked.SetCheck(cloaked);
	m_scramble_messages.SetCheck(scramble_messages);
	m_no_collide.SetCheck(no_collide);
		
	m_kdamage.setup(IDC_KDAMAGE, this);
	m_destroy_value.setup(IDC_DESTROY_VALUE, this);
	m_escort_value.setup(IDC_ESCORT_PRIORITY, this);

	if(The_mission.game_type & MISSION_TYPE_MULTI) {
		m_respawn_priority.setup(IDC_RESPAWN_PRIORITY, this);
	}
	m_destroy_spin.SetRange(0, UD_MAXVAL);

	m_destroy_value.display();
	m_kdamage.display();
	m_escort_value.display();

	if(The_mission.game_type & MISSION_TYPE_MULTI) {
		m_respawn_priority.display();
	} else {
		GetDlgItem(IDC_RESPAWN_PRIORITY)->EnableWindow(FALSE);
	}

	// flags that enable/disable according to whether this isn't a player
	GetDlgItem(IDC_REINFORCEMENT)->EnableWindow(p_enable && !ship_in_wing);
	GetDlgItem(IDC_CARGO_KNOWN)->EnableWindow(p_enable);
	GetDlgItem(IDC_DESTROY_CHECK)->EnableWindow(p_enable);
	GetDlgItem(IDC_DESTROY_VALUE)->EnableWindow(p_enable);
	GetDlgItem(IDC_DESTROY_SPIN)->EnableWindow(p_enable);
	GetDlgItem(IDC_SCANNABLE)->EnableWindow(p_enable);

	// disable the spinner and edit window if the corrsponding check box
	// is not checked!
	if (m_destroy.GetCheck() != 1) {
		GetDlgItem(IDC_DESTROY_VALUE)->EnableWindow(FALSE);
		GetDlgItem(IDC_DESTROY_SPIN)->EnableWindow(FALSE);
	}

	// disable destroy option for ship in wing
	if (ship_in_wing) {
		GetDlgItem(IDC_DESTROY_CHECK)->EnableWindow(FALSE);
		GetDlgItem(IDC_DESTROY_VALUE)->EnableWindow(FALSE);
		GetDlgItem(IDC_DESTROY_SPIN)->EnableWindow(FALSE);
	}

	// maybe disable escort priority window
	if (m_escort.GetCheck() == 1)
		GetDlgItem(IDC_ESCORT_PRIORITY)->EnableWindow(TRUE);
	else
		GetDlgItem(IDC_ESCORT_PRIORITY)->EnableWindow(FALSE);

	// maybe disable kamikaze damage window
	if (m_kamikaze.GetCheck() == 1)
		GetDlgItem(IDC_KDAMAGE)->EnableWindow(TRUE);
	else
		GetDlgItem(IDC_KDAMAGE)->EnableWindow(FALSE);

	return TRUE;
}
开发者ID:Admiral-MS,项目名称:fs2open.github.com,代码行数:101,代码来源:shipflagsdlg.cpp


示例14: init_dialog

static void init_dialog(HWND hwnd, int num)
{
    int drive_type, drive_extend_image_policy, n = 0;

    EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_TYPE_2031),
                 drive_check_type(DRIVE_TYPE_2031, num - 8));
    EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_TYPE_2040),
                 drive_check_type(DRIVE_TYPE_2040, num - 8));
    EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_TYPE_3040),
                 drive_check_type(DRIVE_TYPE_3040, num - 8));
    EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_TYPE_4040),
                 drive_check_type(DRIVE_TYPE_4040, num - 8));
    EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_TYPE_1001),
                 drive_check_type(DRIVE_TYPE_1001, num - 8));
    EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_TYPE_8050),
                 drive_check_type(DRIVE_TYPE_8050, num - 8));
    EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_TYPE_8250),
                 drive_check_type(DRIVE_TYPE_8250, num - 8));

    resources_get_int_sprintf("Drive%dType", &drive_type, num);
    resources_get_int_sprintf("Drive%dExtendImagePolicy",
                              &drive_extend_image_policy, num);

    switch (drive_type) {
      case DRIVE_TYPE_NONE:
        n = IDC_SELECT_DRIVE_TYPE_NONE;
        break;
      case DRIVE_TYPE_2031:
        n = IDC_SELECT_DRIVE_TYPE_2031;
        break;
      case DRIVE_TYPE_2040:
        n = IDC_SELECT_DRIVE_TYPE_2040;
        break;
      case DRIVE_TYPE_3040:
        n = IDC_SELECT_DRIVE_TYPE_3040;
        break;
      case DRIVE_TYPE_4040:
        n = IDC_SELECT_DRIVE_TYPE_4040;
        break;
      case DRIVE_TYPE_1001:
        n = IDC_SELECT_DRIVE_TYPE_1001;
        break;
      case DRIVE_TYPE_8050:
        n = IDC_SELECT_DRIVE_TYPE_8050;
        break;
      case DRIVE_TYPE_8250:
        n = IDC_SELECT_DRIVE_TYPE_8250;
        break;
    }

    CheckRadioButton(hwnd, IDC_SELECT_DRIVE_TYPE_2031,
                     IDC_SELECT_DRIVE_TYPE_NONE, n);

    enable_controls_for_drive_settings(hwnd, n);

    switch (drive_extend_image_policy) {
      case DRIVE_EXTEND_NEVER:
        n = IDC_SELECT_DRIVE_EXTEND_NEVER;
        break;
      case DRIVE_EXTEND_ASK:
        n = IDC_SELECT_DRIVE_EXTEND_ASK;
        break;
      case DRIVE_EXTEND_ACCESS:
        n = IDC_SELECT_DRIVE_EXTEND_ACCESS;
        break;
    }

    CheckRadioButton(hwnd, IDC_SELECT_DRIVE_EXTEND_NEVER,
                     IDC_SELECT_DRIVE_EXTEND_ACCESS, n);
}
开发者ID:martinpiper,项目名称:VICE,代码行数:70,代码来源:uidrivepetcbm2.c


示例15: DlgProcSetStatusMessage

static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch (msg) {
	case WM_INITDIALOG:
		TranslateDialogDefault(hwndDlg);
		SendDlgItemMessage(hwndDlg, IDC_STATUSMESSAGE, EM_LIMITTEXT, MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE - 1, 0);
		mir_subclassWindow(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), StatusMsgEditSubclassProc);
		return TRUE;

	case WMU_SETDATA:
	{
		SetStatusMessageData *data = (SetStatusMessageData *)malloc(sizeof(SetStatusMessageData));
		data->status = (int)wParam;
		data->proto_num = (int)lParam;

		SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)data);

		if (data->proto_num >= 0) {
			Protocol *proto = protocols->Get(data->proto_num);

			HICON hIcon = (HICON)CallProtoService(proto->name, PS_LOADICON, PLI_PROTOCOL, 0);
			if (hIcon != NULL) {
				SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
				DestroyIcon(hIcon);
			}

			TCHAR title[256];
			mir_sntprintf(title, _countof(title), TranslateT("Set my status message for %s"), proto->description);
			SetWindowText(hwndDlg, title);

			SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, proto->GetStatusMsg());
		}
		else if (data->status != 0) {
			SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_LoadProtoIcon(NULL, data->status));

			TCHAR title[256];
			mir_sntprintf(title, _countof(title), TranslateT("Set my status message for %s"), pcli->pfnGetStatusModeDescription(data->status, 0));
			SetWindowText(hwndDlg, title);

			SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, protocols->GetDefaultStatusMsg(data->status));
		}
		else {
			SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_LoadIcon(SKINICON_OTHER_MIRANDA));

			SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, protocols->GetDefaultStatusMsg());
		}

		return TRUE;
	}
	case WM_COMMAND:
		switch (wParam) {
		case IDOK:
		{
			TCHAR tmp[MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE];
			GetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, tmp, _countof(tmp));

			SetStatusMessageData *data = (SetStatusMessageData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);

			if (data->proto_num >= 0)
				protocols->Get(data->proto_num)->SetStatusMsg(tmp);
			else if (data->status == 0)
				protocols->SetStatusMsgs(tmp);
			else
				protocols->SetStatusMsgs(data->status, tmp);

			DestroyWindow(hwndDlg);
		}
		break;

		case IDCANCEL:
			DestroyWindow(hwndDlg);
			break;
		}
		break;

	case WM_CLOSE:
		DestroyWindow(hwndDlg);
		break;

	case WM_DESTROY:
		SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), GWLP_WNDPROC,
			GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), GWLP_USERDATA));
		free((SetStatusMessageData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA));
		InterlockedExchange(&status_msg_dialog_open, 0);
		break;
	}

	return FALSE;
}
开发者ID:kmdtukl,项目名称:miranda-ng,代码行数:89,代码来源:services.cpp


示例16: DlgProcSettings

INT_PTR CALLBACK DlgProcSettings(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	static TCHAR customCommand[MAX_PATH] = {0};
	static TCHAR customText[TITLE_SIZE] = {0};
	static TCHAR szKeyTemp[MAX_PATH + GUID_STRING_SIZE];

	static DWORD showMenu = 2;	//0 off, 1 on, 2 unknown
	static DWORD useMenuIcon = 1;	// 0 off, otherwise on

	HKEY settingKey;
	LONG result;
	DWORD size = 0;

	switch(uMsg)
	{
		case WM_INITDIALOG:
		{
			wsprintf(szKeyTemp, TEXT("CLSID\\%s\\Settings"), szGUID);
			result = RegOpenKeyEx(HKEY_CLASSES_ROOT, szKeyTemp, 0, KEY_READ, &settingKey);
			if (result == ERROR_SUCCESS)
			{
				size = sizeof(TCHAR)*TITLE_SIZE;
				result = RegQueryValueEx(settingKey, TEXT("Title"), NULL, NULL, (LPBYTE)(customText), &size);
				if (result != ERROR_SUCCESS)
				{
					lstrcpyn(customText, szDefaultMenutext, TITLE_SIZE);
				}

				size = sizeof(TCHAR)*MAX_PATH;
				result = RegQueryValueEx(settingKey, TEXT("Custom"), NULL, NULL, (LPBYTE)(customCommand), &size);
				if (result != ERROR_SUCCESS)
				{
					lstrcpyn(customCommand, TEXT(""), MAX_PATH);
				}

				size = sizeof(DWORD);
				result = RegQueryValueEx(settingKey, TEXT("Dynamic"), NULL, NULL, (BYTE*)(&isDynamic), &size);
				if (result != ERROR_SUCCESS)
				{
					isDynamic = 1;
				}

				size = sizeof(DWORD);
				result = RegQueryValueEx(settingKey, TEXT("ShowIcon"), NULL, NULL, (BYTE*)(&useMenuIcon), &size);
				if (result != ERROR_SUCCESS)
				{
					useMenuIcon = 1;
				}

				RegCloseKey(settingKey);
			}

			Button_SetCheck(GetDlgItem(hwndDlg, IDC_CHECK_USECONTEXT), BST_INDETERMINATE);
			Button_SetCheck(GetDlgItem(hwndDlg, IDC_CHECK_USEICON), BST_INDETERMINATE);

			Button_SetCheck(GetDlgItem(hwndDlg, IDC_CHECK_CONTEXTICON), useMenuIcon?BST_CHECKED:BST_UNCHECKED);
			Button_SetCheck(GetDlgItem(hwndDlg, IDC_CHECK_ISDYNAMIC), isDynamic?BST_CHECKED:BST_UNCHECKED);

			SetDlgItemText(hwndDlg, IDC_EDIT_MENU, customText);
			SetDlgItemText(hwndDlg, IDC_EDIT_COMMAND, customCommand);

			return TRUE;
			break;
		}

		case WM_COMMAND:
		{
			switch(LOWORD(wParam))
			{
				case IDOK:
				{
					//Store settings
					GetDlgItemText(hwndDlg, IDC_EDIT_MENU, customText, TITLE_SIZE);
					GetDlgItemText(hwndDlg, IDC_EDIT_COMMAND, customCommand, MAX_PATH);
					int textLen = lstrlen(customText);
					int commandLen = lstrlen(customCommand);

					wsprintf(szKeyTemp, TEXT("CLSID\\%s\\Settings"), szGUID);
					result = RegCreateKeyEx(HKEY_CLASSES_ROOT, szKeyTemp, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &settingKey, NULL);
					if (result == ERROR_SUCCESS)
					{
						result = RegSetValueEx(settingKey, TEXT("Title"), 0,REG_SZ, (LPBYTE)customText, (textLen+1)*sizeof(TCHAR));
						result = RegSetValueEx(settingKey, TEXT("Custom"), 0,REG_SZ, (LPBYTE)customCommand, (commandLen+1)*sizeof(TCHAR));

						result = RegSetValueEx(settingKey, TEXT("Dynamic"), 0, REG_DWORD, (LPBYTE)&isDynamic, sizeof(DWORD));
						result = RegSetValueEx(settingKey, TEXT("ShowIcon"), 0, REG_DWORD, (LPBYTE)&useMenuIcon, sizeof(DWORD));

						RegCloseKey(settingKey);
					}

					if (showMenu == 1)
					{
						result = RegCreateKeyEx(HKEY_CLASSES_ROOT, szShellExtensionKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &settingKey, NULL);
						if (result == ERROR_SUCCESS)
						{
							result = RegSetValueEx(settingKey, NULL, 0,REG_SZ, (LPBYTE)szGUID, (lstrlen(szGUID)+1)*sizeof(TCHAR));
							RegCloseKey(settingKey);
						}
					}
					else if (showMenu == 0)
//.........这里部分代码省略.........
开发者ID:ZhuZhengyi,项目名称:Notepadplusplus,代码行数:101,代码来源:NppShell.cpp


示例17: DialogProc


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetDlgItemText函数代码示例发布时间:2022-05-30
下一篇:
C++ GetDlgCtrlID函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap