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


C++ GetFocus函数代码示例

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


在下文中一共展示了GetFocus函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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,代码来源:clistopts.cpp

示例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,代码来源:CGUITextBox.cpp

示例3: InitScreen

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

示例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,代码来源:options.cpp

示例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,代码来源:options.cpp

示例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,代码来源:SDL_windowswindow.c

示例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,代码来源:MirandaOptions.cpp

示例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 (Ö) is generated by typing the dead key for the umlaut character, and
					 * then typing the O key.
					 */
					break;
				case WM_SYSDEADCHAR:
					/* The WM_SYSDEADCHAR message is sent to the window with the keyboard focus when 
					 * a WM_SYSKEYDOWN message is translated by the TranslateMessage function. 
					 * WM_SYSDEADCHAR specifies the character code of a system dead key - that is, 
					 * a dead key that is pressed while holding down the alt key. 
					 */
				case WM_SYSCHAR:
					/* The WM_SYSCHAR message is sent to the window with the keyboard focus when 
					 * a WM_SYSCHAR message is translated by the TranslateMessage function. 
					 * WM_SYSCHAR specifies the character code of a dead key - that is, 
					 * a dead key that is pressed while holding down the alt key.
					 * To prevent the sound, DefWindowProc must be avoided by return
					 */
					break;
				case WM_SYSCOMMAND:
					/* The WM_SYSCHAR message is sent to the window when system commands such as 
					 * maximize, minimize  or close the window are triggered. Also it is sent when ALT 
					 * button is press for menu. To prevent this we must return preventing DefWindowProc.
					 */
					if(wParam==SC_KEYMENU) return 0;
					break;
				////////////////////////////////////////////////////////////////////////
				// Tablet events, processed
				////////////////////////////////////////////////////////////////////////
//.........这里部分代码省略.........
开发者ID:faebser,项目名称:ghost,代码行数:101,代码来源:GHOST_SystemWin32.cpp

示例9: gwdraw

static void gwdraw(GUIWIN *gw, long fg, long bg, int bits, Char *text, int len)

{
    register int    i;
    GUI_WINDOW      *gwp = (GUI_WINDOW *)gw;
    COLORREF        fgc, bgc;
    HBRUSH	    hBrush, hPrevBrush;
    HPEN            hPen, hPrevPen;
    HDC		    hDC;
    HFONT           hFont;
    RECT            rect;
    int             ileft;
    int             xleft, xcenter, xright, ytop, ycenter, ybottom, radius;
    UINT	    options;

    /* Italics are slanted rightward from the bottom of the character cell.
     * We'd like for them to look slanted from the center of the characters,
     * and we can achieve that effect by shifting italic text slightly leftward.
     */
    ileft = 0;
    if ((bits & COLOR_GRAPHIC) != COLOR_GRAPHIC && (bits & COLOR_ITALIC))
        ileft = (gwp->ycsize - 3) / 6; /* just a guess */

    /* Convert fg and bg args into COLORREF values */
    fgc = (COLORREF)fg;
    bgc = (COLORREF)bg;

    /* compute the update RECT */
    rect.top = gwp->currow * gwp->ycsize;
    rect.left = gwp->curcol * gwp->xcsize + gwp->xcsize / 2;
    rect.bottom = rect.top + gwp->ycsize;
    rect.right = rect.left + gwp->xcsize * len;

    /* Get the window's DC */
    hDC = GetDC (gwp->clientHWnd);
    SetMapMode (hDC, MM_TEXT);

    /* hide caret */
    if (gwp->cursor_type != CURSOR_NONE && gwp->clientHWnd == GetFocus ())
    {
        HideCaret (gwp->clientHWnd);
        gwp->cursor_type = CURSOR_NONE;
    }

    /* graphic chars are a special case */
    if ((bits & COLOR_GRAPHIC) == COLOR_GRAPHIC)
    {
        /* Strip out the COLOR_GRAPHIC bits */
        bits &= ~COLOR_GRAPHIC;

        /* Erase the area */
#ifdef FEATURE_IMAGE
        if (normalimage && (long)bgc == colorinfo[COLOR_FONT_NORMAL].bg)
        {
            gw_erase_rect(hDC, &rect, normalimage, gwp->scrolled);
        }
        else if (idleimage && (long)bgc == colorinfo[COLOR_FONT_IDLE].bg)
        {
            gw_erase_rect(hDC, &rect, idleimage, gwp->scrolled);
        }
        else
#endif
        {
            hBrush = CreateSolidBrush (bgc);
            FillRect (hDC, &rect, hBrush);
            DeleteObject(hBrush);
        }

        /* Select the foreground color */
        hPen = CreatePen(PS_SOLID, 0, fgc);
        hPrevPen = SelectObject(hDC, hPen);

        /* Find special points in the first character cell */
        radius = gwp->xcsize / 3;
        xleft = rect.left;
        xright = xleft + gwp->xcsize;
        xcenter = (xleft + xright) / 2;
        ytop = rect.top;
        ybottom = rect.bottom;
        ycenter = (ytop + ybottom) / 2;

        /* For each graphic character... */
        for (i = 0; i < len; text++, i++)
        {
            /* Draw line segments, as appropriate for this character */
            if (strchr("123456|", *text))
            {
                MoveToEx(hDC, xcenter, ytop, NULL);
                LineTo(hDC, xcenter, ycenter);
            }
            if (strchr("456789|", *text))
            {
                MoveToEx(hDC, xcenter, ycenter, NULL);
                LineTo(hDC, xcenter, ybottom);
            }
            if (strchr("235689-", *text))
            {
                MoveToEx(hDC, xleft, ycenter, NULL);
                LineTo(hDC, xcenter, ycenter);
            }
//.........这里部分代码省略.........
开发者ID:kirkendall,项目名称:elvis,代码行数:101,代码来源:guiwin.c

示例10: UpdateNotifyOptsProc

INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
	char str[20];

	switch (msg) {
	case WM_INITDIALOG:
		TranslateDialogDefault(hwndDlg);
		CheckDlgButton(hwndDlg, IDC_UPDATEONSTARTUP, (int)UpdateOnStartup);
		CheckDlgButton(hwndDlg, IDC_ONLYONCEADAY, (int)OnlyOnceADay);
		EnableWindow(GetDlgItem(hwndDlg, IDC_ONLYONCEADAY), UpdateOnStartup);
		CheckDlgButton(hwndDlg, IDC_UPDATEONPERIOD, (int)UpdateOnPeriod);
		EnableWindow(GetDlgItem(hwndDlg, IDC_PERIOD), UpdateOnPeriod);
		EnableWindow(GetDlgItem(hwndDlg, IDC_PERIODSPIN), UpdateOnPeriod);
		EnableWindow(GetDlgItem(hwndDlg, IDC_PERIODMEASURE), UpdateOnPeriod);

		SendDlgItemMessage(hwndDlg, IDC_PERIODSPIN, UDM_SETRANGE, 0, MAKELONG(99, 1));
		SendDlgItemMessage(hwndDlg, IDC_PERIODSPIN, UDM_SETPOS, 0, (LPARAM)Period);

		Edit_LimitText(GetDlgItem(hwndDlg, IDC_PERIOD), 2);
		mir_subclassWindow(GetDlgItem(hwndDlg, IDC_PERIOD), MyEditProc);

		ComboBox_InsertString(GetDlgItem(hwndDlg, IDC_PERIODMEASURE), 0, TranslateT("hours"));
		ComboBox_InsertString(GetDlgItem(hwndDlg, IDC_PERIODMEASURE), 1, TranslateT("days"));
		ComboBox_SetCurSel(GetDlgItem(hwndDlg, IDC_PERIODMEASURE), PeriodMeasure);

		CheckDlgButton(hwndDlg, IDC_REMINDER, (int)Reminder);
		if ( ServiceExists(MS_POPUP_ADDPOPUPT)) {
			ShowWindow(GetDlgItem(hwndDlg, IDC_NOTIFY2), SW_HIDE);
			ShowWindow(GetDlgItem(hwndDlg, IDC_MSG_BOXES2), SW_HIDE);
			ShowWindow(GetDlgItem(hwndDlg, IDC_ERRORS2), SW_HIDE);
			ShowWindow(GetDlgItem(hwndDlg, IDC_INFO_MESSAGES2), SW_HIDE);
			ShowWindow(GetDlgItem(hwndDlg, IDC_PROGR_DLG2), SW_HIDE);
		}
		else {
			for (int i = 1; i < POPUPS; i++) {
				mir_snprintf(str, SIZEOF(str), "Popups%dM", i);
				CheckDlgButton(hwndDlg, (i+1029), (db_get_b(NULL, MODNAME, str, DEFAULT_MESSAGE_ENABLED)) ? BST_CHECKED: BST_UNCHECKED);
			}
		}
		return TRUE;

	case WM_COMMAND:
		switch (LOWORD(wParam)) {
		case IDC_UPDATEONSTARTUP:
			SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
			EnableWindow(GetDlgItem(hwndDlg, IDC_ONLYONCEADAY), IsDlgButtonChecked(hwndDlg, IDC_UPDATEONSTARTUP));
			break;

		case IDC_ONLYONCEADAY:
			SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
			break;

		case IDC_UPDATEONPERIOD:
			{
				BOOL value = IsDlgButtonChecked(hwndDlg, IDC_UPDATEONPERIOD);
				EnableWindow(GetDlgItem(hwndDlg, IDC_PERIOD), value);
				EnableWindow(GetDlgItem(hwndDlg, IDC_PERIODSPIN), value);
				EnableWindow(GetDlgItem(hwndDlg, IDC_PERIODMEASURE), value);
				SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
			}
			break;

		case IDC_PERIODMEASURE:
			if (HIWORD(wParam) == CBN_SELCHANGE)
				SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
			break;

		case IDC_REMINDER:
			SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
			break;

		case IDC_LINK_HOTKEY:
			{
				OPENOPTIONSDIALOG ood = { sizeof(ood) };
				ood.pszGroup = "Customize";
				ood.pszPage = "Hotkeys";
				Options_Open(&ood);
			} 
			return true;

		case IDC_MSG_BOXES2:
		case IDC_ERRORS2:
		case IDC_INFO_MESSAGES2:
		case IDC_PROGR_DLG2:
			if ((HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == EN_CHANGE) && (HWND)lParam == GetFocus())
				SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
			break;
		}
		break;

	case WM_NOTIFY:
		{
			NMHDR *hdr = (NMHDR *)lParam;
			if(hdr && hdr->code == UDN_DELTAPOS)
				SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);

			if (hdr && hdr->code == PSN_APPLY) {
				UpdateOnStartup = IsDlgButtonChecked(hwndDlg, IDC_UPDATEONSTARTUP);
				OnlyOnceADay = IsDlgButtonChecked(hwndDlg, IDC_ONLYONCEADAY);

//.........这里部分代码省略.........
开发者ID:0xmono,项目名称:miranda-ng,代码行数:101,代码来源:Options.cpp

示例11: JabberAddBookmarkDlgProc

static INT_PTR CALLBACK JabberAddBookmarkDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
	JabberAddBookmarkDlgParam* param = (JabberAddBookmarkDlgParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);

	TCHAR text[512];
	JABBER_LIST_ITEM *item;

	switch (msg) {
	case WM_INITDIALOG:
		param = (JabberAddBookmarkDlgParam*)lParam;
		SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);

		param->ppro->m_hwndJabberAddBookmark = hwndDlg;
		TranslateDialogDefault(hwndDlg);
		if (item = param->m_item) {
			if (!lstrcmp(item->type, _T("conference"))) {
				if (!_tcschr(item->jid, _T('@'))) {	  //no room name - consider it is transport
					SendDlgItemMessage(hwndDlg, IDC_AGENT_RADIO, BM_SETCHECK, BST_CHECKED, 0);
					EnableWindow(GetDlgItem(hwndDlg, IDC_NICK), FALSE);
					EnableWindow(GetDlgItem(hwndDlg, IDC_PASSWORD), FALSE);
				}
				else SendDlgItemMessage(hwndDlg, IDC_ROOM_RADIO, BM_SETCHECK, BST_CHECKED, 0);
			}
			else {
				SendDlgItemMessage(hwndDlg, IDC_URL_RADIO, BM_SETCHECK, BST_CHECKED, 0);
				EnableWindow(GetDlgItem(hwndDlg, IDC_NICK), FALSE);
				EnableWindow(GetDlgItem(hwndDlg, IDC_PASSWORD), FALSE);
				SendDlgItemMessage(hwndDlg, IDC_CHECK_BM_AUTOJOIN, BM_SETCHECK, BST_UNCHECKED, 0);
				EnableWindow(GetDlgItem(hwndDlg, IDC_CHECK_BM_AUTOJOIN), FALSE);
			}

			EnableWindow(GetDlgItem(hwndDlg, IDC_ROOM_RADIO), FALSE);
			EnableWindow(GetDlgItem(hwndDlg, IDC_URL_RADIO), FALSE);
			EnableWindow(GetDlgItem(hwndDlg, IDC_AGENT_RADIO), FALSE);
			EnableWindow(GetDlgItem(hwndDlg, IDC_CHECK_BM_AUTOJOIN), FALSE);

			if (item->jid) SetDlgItemText(hwndDlg, IDC_ROOM_JID, item->jid);
			if (item->name) SetDlgItemText(hwndDlg, IDC_NAME, item->name);
			if (item->nick) SetDlgItemText(hwndDlg, IDC_NICK, item->nick);
			if (item->password) SetDlgItemText(hwndDlg, IDC_PASSWORD, item->password);
			if (item->bAutoJoin) SendDlgItemMessage(hwndDlg, IDC_CHECK_BM_AUTOJOIN, BM_SETCHECK, BST_CHECKED, 0);
			if (SendDlgItemMessage(hwndDlg, IDC_ROOM_RADIO, BM_GETCHECK,0, 0) == BST_CHECKED)
				EnableWindow(GetDlgItem(hwndDlg, IDC_CHECK_BM_AUTOJOIN), TRUE);
		}
		else {
			EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE);
			SendDlgItemMessage(hwndDlg, IDC_ROOM_RADIO, BM_SETCHECK, BST_CHECKED, 0);
		}
		return TRUE;

	case WM_COMMAND:
		switch (HIWORD(wParam)) {
		case BN_CLICKED:
			switch (LOWORD (wParam)) {
			case IDC_ROOM_RADIO:
				EnableWindow(GetDlgItem(hwndDlg, IDC_NICK), TRUE);
				EnableWindow(GetDlgItem(hwndDlg, IDC_PASSWORD), TRUE);
				EnableWindow(GetDlgItem(hwndDlg, IDC_CHECK_BM_AUTOJOIN), TRUE);
				break;
			case IDC_AGENT_RADIO:
			case IDC_URL_RADIO:
				EnableWindow(GetDlgItem(hwndDlg, IDC_NICK), FALSE);
				EnableWindow(GetDlgItem(hwndDlg, IDC_PASSWORD), FALSE);
				SendDlgItemMessage(hwndDlg, IDC_CHECK_BM_AUTOJOIN, BM_SETCHECK, BST_UNCHECKED, 0);
				EnableWindow(GetDlgItem(hwndDlg, IDC_CHECK_BM_AUTOJOIN), FALSE);
				break;
			}
		}

		switch (LOWORD(wParam)) {
		case IDC_ROOM_JID:
			if ((HWND)lParam==GetFocus() && HIWORD(wParam)==EN_CHANGE)
				EnableWindow(GetDlgItem(hwndDlg, IDOK), GetDlgItemText(hwndDlg, IDC_ROOM_JID, text, SIZEOF(text)));
			break;

		case IDOK:
			{
				GetDlgItemText(hwndDlg, IDC_ROOM_JID, text, SIZEOF(text));
				TCHAR *roomJID = NEWTSTR_ALLOCA(text);

				if (param->m_item)
					param->ppro->ListRemove(LIST_BOOKMARK, param->m_item->jid);

				item = param->ppro->ListAdd(LIST_BOOKMARK, roomJID);

				if (SendDlgItemMessage(hwndDlg, IDC_URL_RADIO, BM_GETCHECK,0, 0) == BST_CHECKED)
					replaceStrT(item->type, _T("url"));
				else
					replaceStrT(item->type, _T("conference"));

				GetDlgItemText(hwndDlg, IDC_NICK, text, SIZEOF(text));
				replaceStrT(item->nick, text);

				GetDlgItemText(hwndDlg, IDC_PASSWORD, text, SIZEOF(text));
				replaceStrT(item->password, text);

				GetDlgItemText(hwndDlg, IDC_NAME, text, SIZEOF(text));
				replaceStrT(item->name, (text[0] == 0) ? roomJID : text);

				item->bAutoJoin = (SendDlgItemMessage(hwndDlg, IDC_CHECK_BM_AUTOJOIN, BM_GETCHECK,0, 0) == BST_CHECKED);
//.........这里部分代码省略.........
开发者ID:0xmono,项目名称:miranda-ng,代码行数:101,代码来源:jabber_bookmarks.cpp

示例12: DlgPopupOpts


//.........这里部分代码省略.........
			}
			break;

		case IDC_USEPOPUPCOLORS:
			if (HIWORD(wParam) == BN_CLICKED) {
				//Use Popup colors
				MyOptions.DefColors = byCOLOR_POPUP;
				BOOL bEnableOthers = FALSE;
				for (i = 0; i < POPUPS; i++) {
					EnableWindow(GetDlgItem(hdlg, (i+42071)), bEnableOthers); //Background
					EnableWindow(GetDlgItem(hdlg, (i+41071)), bEnableOthers); //Text
				}
				SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0);
			}
			break;

		case IDC_PREVIEW: 
			Title = TranslateT("Pack Updater");
			Text = TranslateT("Test");
			for (int i = 0; i < POPUPS; i++) {
				if ((!IsDlgButtonChecked(hdlg, (i+40071))) || (!IsWindowEnabled(GetDlgItem(hdlg, (i+40071)))))
					continue;
				show_popup(0, Title, Text, i, 0);
			}
			break;

		case IDC_TIMEOUT_VALUE:
		case IDC_MSG_BOXES:
		case IDC_ERRORS:
			if (!IsDlgButtonChecked(hdlg, IDC_ERRORS))
				EnableWindow(GetDlgItem(hdlg, IDC_ERRORS_MSG), TRUE);
			else
				EnableWindow(GetDlgItem(hdlg, IDC_ERRORS_MSG), FALSE);
			if ((HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == EN_CHANGE) && (HWND)lParam == GetFocus())
				SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0);
			break;

		case IDC_INFO_MESSAGES:
			if (!IsDlgButtonChecked(hdlg, IDC_INFO_MESSAGES))
				EnableWindow(GetDlgItem(hdlg, IDC_INFO_MESSAGES_MSG), TRUE);
			else
				EnableWindow(GetDlgItem(hdlg, IDC_INFO_MESSAGES_MSG), FALSE);
			if ((HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == EN_CHANGE) && (HWND)lParam == GetFocus())
				SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0);
			break;

		case IDC_PROGR_DLG:
			if (!IsDlgButtonChecked(hdlg, IDC_PROGR_DLG))
				EnableWindow(GetDlgItem(hdlg, IDC_PROGR_DLG_MSG), TRUE);
			else
				EnableWindow(GetDlgItem(hdlg, IDC_PROGR_DLG_MSG), FALSE);
			if ((HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == EN_CHANGE) && (HWND)lParam == GetFocus())
				SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0);
			break;

		case IDC_MSG_BOXES_MSG:
		case IDC_ERRORS_MSG:
		case IDC_INFO_MESSAGES_MSG:
		case IDC_PROGR_DLG_MSG:
			if ((HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == EN_CHANGE) && (HWND)lParam == GetFocus())
				SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0);
			break;
		}
		break;

	case WM_NOTIFY: 
开发者ID:0xmono,项目名称:miranda-ng,代码行数:67,代码来源:Options.cpp

示例13: NewStatusBarWndProc


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

	case WM_PAINT:
		if (cfg::shutDown || arStatusItems.getCount() == 0)
			return 0;

		if (cfg::dat.bSkinnedStatusBar) {
			PAINTSTRUCT ps;
			HDC hdc = BeginPaint(hwnd, &ps);
			HDC hdcMem = CreateCompatibleDC(hdc);
			RECT rcClient, rcWindow;
			DRAWITEMSTRUCT dis = {0};
			BYTE windowStyle = cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT);
			LONG b_offset = cfg::dat.bClipBorder + (windowStyle == SETTING_WINDOWSTYLE_NOBORDER ? 2 : (windowStyle == SETTING_WINDOWSTYLE_THINBORDER ? 1 : 0));

			GetClientRect(hwnd, &rcClient);
			GetWindowRect(hwnd, &rcWindow);
			pt.x = rcWindow.left;
			pt.y = rcWindow.top;
			ScreenToClient(pcli->hwndContactList, &pt);

			HBITMAP hbmMem = CreateCompatibleBitmap(hdc, rcClient.right, rcClient.bottom);
			HBITMAP hbmOld = reinterpret_cast<HBITMAP>(SelectObject(hdcMem, hbmMem));
			SetBkMode(hdcMem, TRANSPARENT);
			HFONT hOldFont = reinterpret_cast<HFONT>(SelectObject(hdcMem, GetStockObject(DEFAULT_GUI_FONT)));
			BitBlt(hdcMem, 0, 0, rcClient.right, rcClient.bottom, cfg::dat.hdcBg, pt.x, pt.y, SRCCOPY);
			StatusItems_t *item = arStatusItems[ID_EXTBKSTATUSBAR - ID_STATUS_OFFLINE];
			if (!item->IGNORED) {
				RECT rc = rcClient;
				rc.left += item->MARGIN_LEFT;
				rc.right -= item->MARGIN_RIGHT;
				rc.top += item->MARGIN_TOP;
				rc.bottom -= item->MARGIN_BOTTOM;
				DrawAlpha(hdcMem, &rc, item->COLOR, item->ALPHA, item->COLOR2, item->COLOR2_TRANSPARENT, item->GRADIENT,
					item->CORNER, item->BORDERSTYLE, item->imageItem);
				SetTextColor(hdcMem, item->TEXTCOLOR);
			}
			else
				SetTextColor(hdcMem, GetSysColor(COLOR_BTNTEXT));

			dis.hwndItem = hwnd;
			dis.hDC = hdcMem;
			dis.CtlType = 0;
			int nParts = SendMessage(hwnd, SB_GETPARTS, 0, 0);
			for (int i = 0; i < nParts; i++) {
				SendMessage(hwnd, SB_GETRECT, i, (LPARAM)&dis.rcItem);
				OffsetRect(&dis.rcItem, 0, -b_offset);
				dis.itemData = SendMessage(hwnd, SB_GETTEXTA, i, 0);
				SendMessage(pcli->hwndContactList, WM_DRAWITEM, 0, (LPARAM)&dis);
			}
			BitBlt(hdc, 0, 0, rcClient.right, rcClient.bottom, hdcMem, 0, 0, SRCCOPY);
			if (hOldFont)
				SelectObject(hdcMem, hOldFont);
			SelectObject(hdcMem, hbmOld);
			DeleteObject(hbmMem);
			DeleteDC(hdcMem);
			EndPaint(hwnd, &ps);
			return 0;
		}
		break;

	case WM_TIMER:
		if (wParam == TIMERID_HOVER) {
			KillTimer(hwnd, TIMERID_HOVER);

			GetCursorPos(&pt);
			if (pt.x == ptMouse.x && pt.y == ptMouse.y) {
				ScreenToClient(hwnd, &pt);
				int nParts = SendMessage(hwnd, SB_GETPARTS, 0, 0);
				for (int i = 0; i < nParts; i++) {
					RECT rc;
					SendMessage(hwnd, SB_GETRECT, i, (LPARAM)&rc);
					if (PtInRect(&rc,pt)) {
						ProtocolData *PD = (ProtocolData *)SendMessageA(hwnd, SB_GETTEXTA, i, 0);
						if (PD == NULL)
							continue;

						if (NotifyEventHooks(hStatusBarShowToolTipEvent, (WPARAM)PD->RealName, 0) > 0) // a plugin handled this event
							tooltip_active = TRUE;
						else if (cfg::getDword("mToolTip", "ShowStatusTip", 0)) {
							WORD wStatus = (WORD)CallProtoService(PD->RealName, PS_GETSTATUS, 0, 0);
							BYTE isLocked = cfg::getByte(PD->RealName, "LockMainStatus", 0);

							TCHAR szTipText[256];
							mir_sntprintf(szTipText, SIZEOF(szTipText), _T("<b>%s</b>: %s%s"),
								PD->RealName, pcli->pfnGetStatusModeDescription(wStatus, 0), isLocked ? _T("  (LOCKED)") : _T(""));

							CLCINFOTIP ti = { sizeof(ti) };
							ti.isTreeFocused = (GetFocus() == pcli->hwndContactList);
							CallService("mToolTip/ShowTipW", (WPARAM)szTipText, (LPARAM)&ti);
						}
						break;
					}
				}
			}
		}
		break;
	}

	return mir_callNextSubclass(hwnd, NewStatusBarWndProc, msg, wParam, lParam);
}
开发者ID:biddyweb,项目名称:miranda-ng,代码行数:101,代码来源:statusbar.cpp

示例14: TalkPrjWndProc

static LRESULT CALLBACK
TalkPrjWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{     
	switch (Msg)
	{
	case WM_CREATE:
		ClearKeyBuffer();
		PostMessage(hWnd,  WM_SETTIMER, 2000, 0);	
		break;		
		
	case WM_SETTIMER:
		SetTimer(hWnd, TIMER_PRJ, wParam, NULL);
		break;

	case WM_PAINT:
		if (GetFocus() == hWnd)
		{
			if (ST_UK_DELAY ==  g_TalkInfo.unlock.dwUnLockState)
			{
				TalkUlkWndPaint(hWnd, Msg, wParam, lParam);
			}
			else
			{
	//			TalkWndPaint(hWnd, Msg, wParam, lParam);
				TalkPrjWndPaint(hWnd, Msg, wParam, lParam);
			}
		}
		
		break;
		
	case WM_CHAR:
		if (GetFocus() != hWnd) 
		{
			SendMessage(GetFocus(),  WM_CHAR, wParam, 0l);
			return;			
		}
		wParam =  KeyBoardMap(wParam);
		if (wParam == KEY_RETURN)
		{
			if(ST_CO_TALKING == g_TalkInfo.talking.dwTalkState
				|| ST_CO_WAIT_PICKUP == g_TalkInfo.talking.dwTalkState
				|| ST_CI_TALKING == g_TalkInfo.talking.dwTalkState)
			{		
				SendGMHangupCmd2Talking();
			}			
			else if(ST_ORIGINAL == g_TalkInfo.talking.dwTalkState)
			{
				memset(g_KeyInputBuffer, 0, KEY_BUF_LEN);
				g_KeyInputBufferLen = 0;
				PostMessage(hWnd,  WM_CLOSE, 0, 0);
			}

		}
		
		else if ((wParam >= KEY_NUM_0) && (wParam <= KEY_NUM_9)) 
		{						
			ResetTimer(hWnd, TIMER_PRJ, 2000, NULL);
			if (g_KeyInputBufferLen < KEY_BUF_LEN)
			{
				g_KeyInputBuffer[g_KeyInputBufferLen++] = (UCHAR)wParam;
			}
			else
			{
				g_KeyInputBufferLen		=	0;
				g_KeyInputBuffer[g_KeyInputBufferLen++] = (UCHAR)wParam;
			}
		}
		
		PostMessage(hWnd,  WM_PAINT, 0, 0);		
		break;
		
	case WM_TIMER:
		TalkPrjTimerProc(hWnd, Msg, wParam, lParam);
		break;

	case WM_REFRESHPARENT_WND:
		SetFocus(hWnd);
		PostMessage(hWnd,  WM_PAINT, 0, 0);
		break;
		
	case WM_DESTROY:
		KillTimer(hWnd, TIMER_PRJ);
//		PostMessage(GetParent(hWnd),  WM_REFRESHPARENT_WND, 0, 0);
		g_hWNDTalk = NULL;
//		SendMessage(GetFocus(),  WM_REFRESHPARENT_WND, 0, 0);		
		break;
		
	default:
//		if (WM_CLOSE == Msg) 
//		{
//			RemoveOneWnd(hWnd);
//		}
//		return DefWindowProc(hWnd, Msg, wParam, lParam);
		
		DefWindowProc(hWnd, Msg, wParam, lParam);
		
		if (WM_CLOSE == Msg) 
		{
			RemoveOneWnd(hWnd);
		}
//.........这里部分代码省略.........
开发者ID:SkyChen2012,项目名称:GMApp,代码行数:101,代码来源:TalkPrjWnd.c

示例15: GetClientRect

void CHistoryCombo::OnMouseMove(UINT nFlags, CPoint point)
{
	CRect rectClient;
	GetClientRect(&rectClient);
	int nComboButtonWidth = ::GetSystemMetrics(SM_CXHTHUMB) + 2;
	rectClient.right = rectClient.right - nComboButtonWidth;

	if (rectClient.PtInRect(point))
	{
		ClientToScreen(&rectClient);

		CString strText = GetString();
		m_ToolInfo.lpszText = (LPTSTR)(LPCTSTR)strText;

		HDC hDC = ::GetDC(m_hWnd);

		CFont *pFont = GetFont();
		HFONT hOldFont = (HFONT) ::SelectObject(hDC, (HFONT) *pFont);

		SIZE size;
		::GetTextExtentPoint32(hDC, strText, strText.GetLength(), &size);
		::SelectObject(hDC, hOldFont);
		::ReleaseDC(m_hWnd, hDC);

		if (size.cx > (rectClient.Width() - 6))
		{
			rectClient.left += 1;
			rectClient.top += 3;

			COLORREF rgbText = ::GetSysColor(COLOR_WINDOWTEXT);
			COLORREF rgbBackground = ::GetSysColor(COLOR_WINDOW);

			CWnd *pWnd = GetFocus();
			if (pWnd)
			{
				if (pWnd->m_hWnd == m_hWnd)
				{
					rgbText = ::GetSysColor(COLOR_HIGHLIGHTTEXT);
					rgbBackground = ::GetSysColor(COLOR_HIGHLIGHT);
				}
			}

			if (!m_ttShown)
			{
				::SendMessage(m_hWndToolTip, TTM_SETTIPBKCOLOR, rgbBackground, 0);
				::SendMessage(m_hWndToolTip, TTM_SETTIPTEXTCOLOR, rgbText, 0);
				::SendMessage(m_hWndToolTip, TTM_UPDATETIPTEXT, 0, (LPARAM) &m_ToolInfo);
				::SendMessage(m_hWndToolTip, TTM_TRACKPOSITION, 0, (LPARAM)MAKELONG(rectClient.left, rectClient.top));
				::SendMessage(m_hWndToolTip, TTM_TRACKACTIVATE, TRUE, (LPARAM)(LPTOOLINFO) &m_ToolInfo);
				SetTimer(1, 80, NULL);
				SetTimer(2, 2000, NULL);
				m_ttShown = TRUE;
			}
		}
		else
		{
			::SendMessage(m_hWndToolTip, TTM_TRACKACTIVATE, FALSE, (LPARAM)(LPTOOLINFO) &m_ToolInfo);
			m_ttShown = FALSE;
		}
	}
	else
	{
		::SendMessage(m_hWndToolTip, TTM_TRACKACTIVATE, FALSE, (LPARAM)(LPTOOLINFO) &m_ToolInfo);
		m_ttShown = FALSE;
	}

	CComboBoxEx::OnMouseMove(nFlags, point);
}
开发者ID:murank,项目名称:TortoiseGitMod,代码行数:68,代码来源:HistoryCombo.cpp


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