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

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

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

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

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

示例1: DlgProcGenOpts

//.........这里部分代码省略.........			int count;			PROTOACCOUNT **accs;			Proto_EnumAccounts(&count, &accs);			for (int i = 0; i < count; i++) {				if (!Proto_IsAccountEnabled(accs[i]) || CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)					continue;				item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM)accs[i]->tszAccountName);				SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETITEMDATA, item, (LPARAM)accs[i]);				if (!mir_strcmp(szPrimaryStatus, accs[i]->szModuleName))					SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETCURSEL, item, 0);			}		}		if (CB_ERR == (int)SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETCURSEL, 0, 0))			SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETCURSEL, 0, 0);		SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_BLINKTIME), 0);		SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETRANGE, 0, MAKELONG(0x3FFF, 250));		SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETPOS, 0, MAKELONG(cfg::getWord("CList", "IconFlashTime", 550), 0));		CheckDlgButton(hwndDlg, IDC_NOTRAYINFOTIPS, cfg::dat.bNoTrayTips ? 1 : 0);		CheckDlgButton(hwndDlg, IDC_APPLYLASTVIEWMODE, cfg::getByte("CList", "AutoApplyLastViewMode", 0) ? BST_CHECKED : BST_UNCHECKED);		return TRUE;	case WM_COMMAND:		if (LOWORD(wParam) == IDC_DONTCYCLE || LOWORD(wParam) == IDC_CYCLE || LOWORD(wParam) == IDC_MULTITRAY) {			Utils::enableDlgControl(hwndDlg, IDC_PRIMARYSTATUS, IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE));			Utils::enableDlgControl(hwndDlg, IDC_CYCLETIME, IsDlgButtonChecked(hwndDlg, IDC_CYCLE));			Utils::enableDlgControl(hwndDlg, IDC_CYCLETIMESPIN, IsDlgButtonChecked(hwndDlg, IDC_CYCLE));			Utils::enableDlgControl(hwndDlg, IDC_ALWAYSMULTI, IsDlgButtonChecked(hwndDlg, IDC_MULTITRAY));		}		if (LOWORD(wParam) == IDC_CYCLETIME && HIWORD(wParam) != EN_CHANGE)			break;		if (LOWORD(wParam) == IDC_PRIMARYSTATUS && HIWORD(wParam) != CBN_SELCHANGE)			break;		if (LOWORD(wParam) == IDC_CYCLETIME && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))			return 0;		if (LOWORD(wParam) == IDC_BLINKTIME && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))			return 0;		SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);		opt_gen_opts_changed = TRUE;		break;	case WM_NOTIFY:		switch (((LPNMHDR)lParam)->idFrom) {		case 0:			switch (((LPNMHDR)lParam)->code) {			case PSN_APPLY:				if (!opt_gen_opts_changed)					return TRUE;				cfg::writeByte("CList", "HideOffline", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEOFFLINE));				{					DWORD caps = CallService(MS_CLUI_GETCAPS, CLUICAPS_FLAGS1, 0);					if (caps & CLUIF_HIDEEMPTYGROUPS)						cfg::writeByte("CList", "HideEmptyGroups", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEEMPTYGROUPS));					if (caps & CLUIF_DISABLEGROUPS)						cfg::writeByte("CList", "UseGroups", (BYTE)BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DISABLEGROUPS));					if (!(caps & CLUIF_HASONTOPOPTION)) {						cfg::writeByte("CList", "OnTop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONTOP));						SetWindowPos(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);					}				}				cfg::writeByte("CList", "ConfirmDelete", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CONFIRMDELETE));				cfg::writeByte("CList", "Tray1Click", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONECLK));				cfg::writeByte("CList", "AlwaysStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYSSTATUS));				cfg::writeByte("CList", "AlwaysMulti", (BYTE)BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_ALWAYSMULTI));				cfg::writeByte("CList", "TrayIcon", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE) ? SETTING_TRAYICON_SINGLE : (IsDlgButtonChecked(hwndDlg, IDC_CYCLE) ? SETTING_TRAYICON_CYCLE : SETTING_TRAYICON_MULTI)));
开发者ID:kmdtukl,项目名称:miranda-ng,代码行数:67,


示例2: OnHotkey

bool CGUITextBox::HandleKeyboard( UINT uMsg, WPARAM wParam, LPARAM lParam ) {	if(GetFocus() && wParam==m_Hotkey){		OnHotkey();		return true;	}if(GetFocus() && m_bSelectable)	switch(uMsg){		case WM_KEYDOWN:			switch( wParam ){				case VK_UP:					PlaceCaret(m_Caretx, m_Carety-1);					if( GetKeyState( VK_SHIFT ) >= 0 )						SyncSelStart();					break;				case VK_DOWN:					PlaceCaret(m_Caretx, m_Carety+1);					if( GetKeyState( VK_SHIFT ) >= 0 )						SyncSelStart();					break;				case VK_LEFT:					if(m_Caretx==0 && m_Carety!=0)						PlaceCaret(m_Text[m_Carety-1].length(), m_Carety-1);					else						PlaceCaret(m_Caretx-1, m_Carety);					if( GetKeyState( VK_SHIFT ) >= 0 )						SyncSelStart();					break;				case VK_RIGHT:					if(m_Caretx==m_MaxCaretx && m_Carety!=m_MaxCarety)						PlaceCaret(0, m_Carety+1);					else						PlaceCaret(m_Caretx+1, m_Carety);					if( GetKeyState( VK_SHIFT ) >= 0 )						SyncSelStart();					break;			default:				break;			}			break;        case WM_CHAR:			switch( wParam ){				case VK_BACK:					if(m_Caretx==m_SelStartx && m_Carety==m_SelStarty)						DeleteTextAtCaret();					else						DeleteSelectionText();					break;				case VK_RETURN:					if(m_bEditable){						if(m_Caretx==m_SelStartx && m_Carety==m_SelStarty)						AddChar('/n');						SyncSelStart();					}					break;				case 24: // Ctrl-X Cut                case VK_CANCEL: // Ctrl-C Copy                case 22: // Ctrl-V Paste                case 26:  // Ctrl Z                case 2:   // Ctrl B                case 14:  // Ctrl N                case 19:  // Ctrl S                case 4:   // Ctrl D                case 6:   // Ctrl F                case 7:   // Ctrl G                case 10:  // Ctrl J                case 11:  // Ctrl K                case 12:  // Ctrl L                case 17:  // Ctrl Q                case 23:  // Ctrl W                case 5:   // Ctrl E                case 18:  // Ctrl R                case 20:  // Ctrl T                case 25:  // Ctrl Y                case 21:  // Ctrl U                case 9:   // Ctrl I                case 15:  // Ctrl O                case 16:  // Ctrl P                case 27:  // Ctrl [                case 29:  // Ctrl ]                case 28:  // Ctrl / 					break;				default:					if(m_bEditable){						AddChar((char)wParam);						SyncSelStart();					}			}			return true;		default:			return false;	}	return false;}
开发者ID:kumorikarasu,项目名称:KylTek,代码行数:96,


示例3: InitScreen

void InitScreen( void ){    FocusWnd = GetFocus();    RestoreMainScreen( "WDWIN" );    GUISetModalDlgs( FALSE );}
开发者ID:seyko2,项目名称:open-watcom-v2,代码行数:6,


示例4: DlgProcYahooOptsConn

/* * DlgProcYahooOpts - Connection Options Dialog */static INT_PTR CALLBACK DlgProcYahooOptsConn(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam){	DBVARIANT dbv;	CYahooProto* ppro = (CYahooProto*)GetWindowLongPtr( hwndDlg, GWLP_USERDATA );		switch ( msg ) {	case WM_INITDIALOG:		TranslateDialogDefault( hwndDlg );		ppro = ( CYahooProto* )lParam;		SetWindowLongPtr( hwndDlg, GWLP_USERDATA, lParam );		if ( !ppro->GetString( YAHOO_LOGINSERVER, &dbv )){			SetDlgItemTextA( hwndDlg, IDC_LOGINSERVER, dbv.pszVal );			DBFreeVariant( &dbv );		}		else SetDlgItemTextA( hwndDlg, IDC_LOGINSERVER, 						ppro->GetByte( "YahooJapan", 0 ) 						?  YAHOO_DEFAULT_JAPAN_LOGIN_SERVER						: YAHOO_DEFAULT_LOGIN_SERVER );		SetDlgItemInt( hwndDlg, IDC_YAHOOPORT, ppro->GetWord( NULL, YAHOO_LOGINPORT, YAHOO_DEFAULT_PORT ), FALSE );				SetButtonCheck( hwndDlg, IDC_YAHOO_JAPAN, ppro->GetByte( "YahooJapan", 0 ) );		return TRUE;	case WM_COMMAND:		switch ( LOWORD( wParam )) {		case IDC_RESETSERVER:			SetDlgItemTextA( hwndDlg, IDC_LOGINSERVER, YAHOO_DEFAULT_LOGIN_SERVER );			SetDlgItemInt(  hwndDlg, IDC_YAHOOPORT,  YAHOO_DEFAULT_PORT, FALSE );			SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);			break;				case IDC_YAHOO_JAPAN:			SetDlgItemTextA( hwndDlg, IDC_LOGINSERVER, 				(IsDlgButtonChecked(hwndDlg,IDC_YAHOO_JAPAN)==BST_CHECKED) ?					YAHOO_DEFAULT_JAPAN_LOGIN_SERVER :					YAHOO_DEFAULT_LOGIN_SERVER );				// fall through and enable apply button			SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);			break;		}    		if ( HIWORD( wParam ) == EN_CHANGE && ( HWND )lParam == GetFocus())			switch( LOWORD( wParam )) {			case IDC_LOGINSERVER:			case IDC_YAHOOPORT:							SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);			}		break;	case WM_NOTIFY:		if (((LPNMHDR)lParam)->code == PSN_APPLY )		{			BOOL	    reconnectRequired = FALSE/*, restartRequired = FALSE*/;			char	    str[128];			DBVARIANT 	dbv;			int			port;			GetDlgItemTextA( hwndDlg, IDC_LOGINSERVER, str, sizeof( str ));						if ( ppro->GetString( YAHOO_LOGINSERVER, &dbv ) || lstrcmpA( str, dbv.pszVal ))				reconnectRequired = TRUE;							if ( dbv.pszVal != NULL )				DBFreeVariant( &dbv );			ppro->SetString( YAHOO_LOGINSERVER, str );			port = GetDlgItemInt( hwndDlg, IDC_YAHOOPORT, NULL, FALSE );			if ( ppro->GetWord(NULL, YAHOO_LOGINPORT, -1) != port)				reconnectRequired = TRUE;						ppro->SetWord( NULL, YAHOO_LOGINPORT, port);			ppro->SetByte("YahooJapan", ( BYTE )IsDlgButtonChecked( hwndDlg, IDC_YAHOO_JAPAN ));			/*if ( restartRequired )				MessageBoxA( hwndDlg, Translate( "The changes you have made require you to restart Miranda IM before they take effect"), Translate("YAHOO Options"), MB_OK );			else */			if ( reconnectRequired && ppro->m_bLoggedIn )				MessageBoxA( hwndDlg, Translate( "The changes you have made require you to reconnect to the Yahoo network before they take effect"), Translate("YAHOO Options"), MB_OK );			return TRUE;		}		break;	}	return FALSE;}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:95,


示例5: DlgProcYahooOpts

/* * DlgProcYahooOpts - Account Options Dialog */static INT_PTR CALLBACK DlgProcYahooOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam){	DBVARIANT dbv;	CYahooProto* ppro = (CYahooProto*)GetWindowLongPtr( hwndDlg, GWLP_USERDATA );	switch ( msg ) {	case WM_INITDIALOG: 		TranslateDialogDefault( hwndDlg );		ppro = (CYahooProto*)lParam;		SetWindowLongPtr( hwndDlg, GWLP_USERDATA, lParam );		if ( !ppro->GetString( YAHOO_LOGINID, &dbv )) {			SetDlgItemTextA(hwndDlg,IDC_HANDLE,dbv.pszVal);			DBFreeVariant(&dbv);		}		if ( !ppro->GetString( "Nick", &dbv )) {			SetDlgItemTextA(hwndDlg,IDC_NICK,dbv.pszVal);			DBFreeVariant(&dbv);		}		if ( !ppro->GetString( YAHOO_PASSWORD, &dbv )) {			//bit of a security hole here, since it's easy to extract a password from an edit box			YAHOO_CallService( MS_DB_CRYPT_DECODESTRING, strlen( dbv.pszVal )+1, ( LPARAM )dbv.pszVal );			SetDlgItemTextA( hwndDlg, IDC_PASSWORD, dbv.pszVal );			DBFreeVariant( &dbv );		}		//SetButtonCheck( hwndDlg, IDC_DISABLE_UTF8, ppro->GetByte( "DisableUTF8", 0 )); 		SetButtonCheck( hwndDlg, IDC_USE_YAB, ppro->GetByte( "UseYAB", 1 )); 		SetButtonCheck( hwndDlg, IDC_SHOW_AVATARS, ppro->GetByte( "ShowAvatars", 1 )); 		SetButtonCheck( hwndDlg, IDC_MAIL_AUTOLOGIN, ppro->GetByte( "MailAutoLogin", 1 )); 		SetButtonCheck( hwndDlg, IDC_DISABLEYAHOOMAIL, !ppro->GetByte( "DisableYahoomail", 0 ));		SetButtonCheck( hwndDlg, IDC_SHOW_ERRORS, ppro->GetByte( "ShowErrors", 1 )); 		return TRUE;	case WM_COMMAND: 				switch ( LOWORD( wParam )) {		case IDC_NEWYAHOOACCOUNTLINK:			YAHOO_CallService( MS_UTILS_OPENURL, 1, 				ppro->GetByte( "YahooJapan", 0 ) ?					(LPARAM)"http://edit.yahoo.co.jp/config/eval_register" :					(LPARAM)"http://edit.yahoo.com/config/eval_register" );			return TRUE; 		//case IDC_DISABLE_UTF8: 		case IDC_USE_YAB:			case IDC_SHOW_AVATARS:		case IDC_MAIL_AUTOLOGIN:		case IDC_SHOW_ERRORS:		case IDC_DISABLEYAHOOMAIL:			SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);			break;		}    		if ( HIWORD( wParam ) == EN_CHANGE && ( HWND )lParam == GetFocus())			switch( LOWORD( wParam )) {			case IDC_HANDLE:						case IDC_PASSWORD:						case IDC_NICK:				SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);			}		break;	case WM_NOTIFY: 				if (((LPNMHDR)lParam)->code == (UINT) PSN_APPLY ) {			BOOL reconnectRequired = FALSE;			char str[128];			GetDlgItemTextA( hwndDlg, IDC_HANDLE, str, sizeof( str ));			dbv.pszVal = NULL;						if ( ppro->GetString( YAHOO_LOGINID, &dbv ) || lstrcmpA( str, dbv.pszVal ))				reconnectRequired = TRUE;							if ( dbv.pszVal != NULL )				DBFreeVariant( &dbv );						ppro->SetString( YAHOO_LOGINID, str );			GetDlgItemTextA( hwndDlg, IDC_PASSWORD, str, sizeof( str ));			YAHOO_CallService( MS_DB_CRYPT_ENCODESTRING, sizeof( str ),( LPARAM )str );			dbv.pszVal = NULL;			if ( ppro->GetString( YAHOO_PASSWORD, &dbv ) || lstrcmpA( str, dbv.pszVal ))				reconnectRequired = TRUE;			if ( dbv.pszVal != NULL )				DBFreeVariant( &dbv );						ppro->SetString( YAHOO_PASSWORD, str );			GetDlgItemTextA( hwndDlg, IDC_NICK, str, sizeof( str ));						//.........这里部分代码省略.........
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:101,


示例6: SetupWindowData

//.........这里部分代码省略.........    /* Set up the window proc function */#ifdef GWLP_WNDPROC    data->wndproc = (WNDPROC) GetWindowLongPtr(hwnd, GWLP_WNDPROC);    if (data->wndproc == WIN_WindowProc) {        data->wndproc = NULL;    } else {        SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) WIN_WindowProc);    }#else    data->wndproc = (WNDPROC) GetWindowLong(hwnd, GWL_WNDPROC);    if (data->wndproc == WIN_WindowProc) {        data->wndproc = NULL;    } else {        SetWindowLong(hwnd, GWL_WNDPROC, (LONG_PTR) WIN_WindowProc);    }#endif    /* Fill in the SDL window with the window data */    {        RECT rect;        if (GetClientRect(hwnd, &rect)) {            int w = rect.right;            int h = rect.bottom;            if ((window->w && window->w != w) || (window->h && window->h != h)) {                /* We tried to create a window larger than the desktop and Windows didn't allow it.  Override! */                WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE);            } else {                window->w = w;                window->h = h;            }        }    }    {        POINT point;        point.x = 0;        point.y = 0;        if (ClientToScreen(hwnd, &point)) {            window->x = point.x;            window->y = point.y;        }    }    {        DWORD style = GetWindowLong(hwnd, GWL_STYLE);        if (style & WS_VISIBLE) {            window->flags |= SDL_WINDOW_SHOWN;        } else {            window->flags &= ~SDL_WINDOW_SHOWN;        }        if (style & (WS_BORDER | WS_THICKFRAME)) {            window->flags &= ~SDL_WINDOW_BORDERLESS;        } else {            window->flags |= SDL_WINDOW_BORDERLESS;        }        if (style & WS_THICKFRAME) {            window->flags |= SDL_WINDOW_RESIZABLE;        } else {            window->flags &= ~SDL_WINDOW_RESIZABLE;        }#ifdef WS_MAXIMIZE        if (style & WS_MAXIMIZE) {            window->flags |= SDL_WINDOW_MAXIMIZED;        } else#endif        {            window->flags &= ~SDL_WINDOW_MAXIMIZED;        }#ifdef WS_MINIMIZE        if (style & WS_MINIMIZE) {            window->flags |= SDL_WINDOW_MINIMIZED;        } else#endif        {            window->flags &= ~SDL_WINDOW_MINIMIZED;        }    }    if (GetFocus() == hwnd) {        window->flags |= SDL_WINDOW_INPUT_FOCUS;        SDL_SetKeyboardFocus(data->window);        if (window->flags & SDL_WINDOW_INPUT_GRABBED) {            RECT rect;            GetClientRect(hwnd, &rect);            ClientToScreen(hwnd, (LPPOINT) & rect);            ClientToScreen(hwnd, (LPPOINT) & rect + 1);            ClipCursor(&rect);        }    }    /* Enable multi-touch */    if (videodata->RegisterTouchWindow) {        videodata->RegisterTouchWindow(hwnd, (TWF_FINETOUCH|TWF_WANTPALM));    }    /* Enable dropping files */    DragAcceptFiles(hwnd, TRUE);    /* All done! */    return 0;}
开发者ID:Qard,项目名称:SDL,代码行数:101,


示例7: DlgProcOpts_Tab1

/* *	callback function for tab 1 options page */INT_PTR CALLBACK DlgProcOpts_Tab1(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {	switch ( msg ) {	case WM_INITDIALOG:	{		//executed once, during each tab initialization during each miranda options open		mirfoxMiranda.getMirfoxData().setTab1OptionsState(MFENUM_OPTIONS_INIT);		TranslateDialogDefault(hwndDlg);		//IDC1_COMBO1		SendDlgItemMessage(hwndDlg, IDC1_COMBO1, CB_ADDSTRING, 0, (LPARAM)TranslateT("just send message"));		SendDlgItemMessage(hwndDlg, IDC1_COMBO1, CB_ADDSTRING, 0, (LPARAM)TranslateT("send message and open message window"));		SendDlgItemMessage(hwndDlg, IDC1_COMBO1, CB_ADDSTRING, 0, (LPARAM)TranslateT("show message window with pasted message"));		SendDlgItemMessage(hwndDlg, IDC1_COMBO1, CB_SETCURSEL, (int)mirfoxMiranda.getMirfoxData().leftClickSendMode - 1, 0);		//IDC1_COMBO2		SendDlgItemMessage(hwndDlg, IDC1_COMBO2, CB_ADDSTRING, 0, (LPARAM)TranslateT("just send message"));		SendDlgItemMessage(hwndDlg, IDC1_COMBO2, CB_ADDSTRING, 0, (LPARAM)TranslateT("send message and open message window"));		SendDlgItemMessage(hwndDlg, IDC1_COMBO2, CB_ADDSTRING, 0, (LPARAM)TranslateT("show message window with pasted message"));		SendDlgItemMessage(hwndDlg, IDC1_COMBO2, CB_SETCURSEL, (int)mirfoxMiranda.getMirfoxData().rightClickSendMode - 1, 0);		//IDC1_COMBO3		SendDlgItemMessage(hwndDlg, IDC1_COMBO3, CB_ADDSTRING, 0, (LPARAM)TranslateT("just send message"));		//disabled due to Firefox bug. opening other window while firefox menu is still open -> firefox crash		//SendDlgItemMessage(hwndDlg, IDC1_COMBO3, CB_ADDSTRING, 0, (LPARAM)TranslateT("send message and open message window"));		//SendDlgItemMessage(hwndDlg, IDC1_COMBO3, CB_ADDSTRING, 0, (LPARAM)TranslateT("show message window with pasted message"));		SendDlgItemMessage(hwndDlg, IDC1_COMBO3, CB_SETCURSEL, (int)mirfoxMiranda.getMirfoxData().middleClickSendMode - 1, 0);		//other options initialization		SetDlgItemText(hwndDlg, IDC1_EDIT1, mirfoxMiranda.getMirfoxData().getClientsProfilesFilterStringPtr()->c_str());		if (mirfoxMiranda.getMirfoxData().getClientsProfilesFilterCheckbox()){			CheckDlgButton(hwndDlg, IDC1_CHECK1, BST_CHECKED);			EnableWindow(GetDlgItem(hwndDlg, IDC1_EDIT1), TRUE);		} else {			CheckDlgButton(hwndDlg, IDC1_CHECK1, BST_UNCHECKED);			EnableWindow(GetDlgItem(hwndDlg, IDC1_EDIT1), FALSE);		}	  //other options initialization - end		mirfoxMiranda.getMirfoxData().setTab1OptionsState(MFENUM_OPTIONS_WORK);		return FALSE;	}	case WM_COMMAND:	{		if (mirfoxMiranda.getMirfoxData().getTab1OptionsState() != MFENUM_OPTIONS_WORK){			break; //options not inited yet		}		//if user changed some options controls, send info to miranda to activate ok button		if (			(				((HIWORD(wParam) == EN_CHANGE) && (HWND)lParam == GetFocus())	//edit control AND control from message has focus now				||				((HIWORD(wParam) == BN_CLICKED) && (HWND)lParam == GetFocus())	//button or checkbox clicked AND control from message has focus now				||				(HIWORD(wParam) == CBN_DROPDOWN)								//COMBOBOX clicked			)			&&			(				LOWORD(wParam) != IDC1_BUTTON_INVALIDATE						//invalidate button click doesn't activate [Apply] button.			)		   )		{			SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);		}		if (LOWORD(wParam) == IDC1_CHECK1){			if (IsDlgButtonChecked(hwndDlg, IDC1_CHECK1) == BST_CHECKED){				EnableWindow(GetDlgItem(hwndDlg, IDC1_EDIT1), TRUE);			} else {				EnableWindow(GetDlgItem(hwndDlg, IDC1_EDIT1), FALSE);			}		}		//if (LOWORD(wParam) == IDC1_BUTTON_INVALIDATE && HIWORD(wParam) == BN_CLICKED){			//TODO  invalidate button clicked - refresh MSM's (now this button has visable=false at .rc file)			//break;		//}		break;	}	case WM_NOTIFY:	{		//executed on each move to another options tab or after [OK]		if (mirfoxMiranda.getMirfoxData().getTab1OptionsState() != MFENUM_OPTIONS_WORK){			break; //options not inited yet		}//.........这里部分代码省略.........
开发者ID:Seldom,项目名称:miranda-ng,代码行数:101,


示例8: GHOST_ASSERT

LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){	GHOST_Event* event = 0;	bool eventHandled = false;	LRESULT lResult = 0;	GHOST_SystemWin32* system = ((GHOST_SystemWin32*)getSystem());	GHOST_ASSERT(system, "GHOST_SystemWin32::s_wndProc(): system not initialized")	if (hwnd) {		GHOST_WindowWin32* window = (GHOST_WindowWin32*)::GetWindowLong(hwnd, GWL_USERDATA);		if (window) {			switch (msg) {				// we need to check if new key layout has AltGr				case WM_INPUTLANGCHANGE:					system->handleKeyboardChange();					break;				////////////////////////////////////////////////////////////////////////				// Keyboard events, processed				////////////////////////////////////////////////////////////////////////				case WM_INPUT:				{					// check WM_INPUT from input sink when ghost window is not in the foreground					if (wParam == RIM_INPUTSINK) {						if (GetFocus() != hwnd) // WM_INPUT message not for this window							return 0;					} //else wParam == RIM_INPUT					RAWINPUT raw;					RAWINPUT* raw_ptr = &raw;					UINT rawSize = sizeof(RAWINPUT);					GetRawInputData((HRAWINPUT)lParam, RID_INPUT, raw_ptr, &rawSize, sizeof(RAWINPUTHEADER));					switch (raw.header.dwType)					{					case RIM_TYPEKEYBOARD:						event = processKeyEvent(window, raw);						if (!event) {							GHOST_PRINT("GHOST_SystemWin32::wndProc: key event ")							GHOST_PRINT(msg)							GHOST_PRINT(" key ignored/n")						}						break;					case RIM_TYPEHID:#ifdef WITH_INPUT_NDOF						if (system->processNDOF(raw))							eventHandled = true;#endif						break;					}				break;				}				////////////////////////////////////////////////////////////////////////				// Keyboard events, ignored				////////////////////////////////////////////////////////////////////////				case WM_KEYDOWN:				case WM_SYSKEYDOWN:				case WM_KEYUP:				case WM_SYSKEYUP:					/* These functions were replaced by WM_INPUT*/				case WM_CHAR:					/* The WM_CHAR message is posted to the window with the keyboard focus when					 * a WM_KEYDOWN message is translated by the TranslateMessage function. WM_CHAR					 * contains the character code of the key that was pressed.					 */				case WM_DEADCHAR:					/* The WM_DEADCHAR message is posted to the window with the keyboard focus when a					 * WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR 					 * specifies a character code generated by a dead key. A dead key is a key that 					 * generates a character, such as the umlaut (double-dot), that is combined with 					 * another character to form a composite character. For example, the umlaut-O 					 * character (
C++ GetFocusWidget函数代码示例
C++ GetFloat函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。