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

C++ GET_WM_COMMAND_ID函数代码示例

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

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



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

示例1: switch

	/*static*/
	INT_PTR CALLBACK Win32PopupDialog::Callback(HWND dialog, UINT message, WPARAM wParam, LPARAM lParam)
	{
		switch (message)
		{
			case WM_INITDIALOG:
			{
				Win32PopupDialog* popupDialog = popups[GetCurrentThreadId()];
				HWND parentWindow = (popupDialog == NULL ? NULL : popupDialog->windowHandle);
				if (parentWindow == NULL)
				{
					parentWindow = GetDesktopWindow();
				}

				RECT parentRect, dialogRect;
				GetWindowRect(parentWindow, &parentRect);
				GetWindowRect(dialog, &dialogRect);
				int x = parentRect.left + (parentRect.right - parentRect.left) / 2;
				int y = parentRect.top + (parentRect.bottom - parentRect.top) / 2;
				x -= (dialogRect.right - dialogRect.left) / 2;
				y -= (dialogRect.bottom - dialogRect.top) / 2;
				
				SetWindowPos(dialog, HWND_TOP, x, y, 0, 0, SWP_NOSIZE);

				if (popupDialog->showInputText)
				{
					if (GetDlgCtrlID((HWND) wParam) != ID_INPUT_FIELD)
					{
						HWND inputText = GetDlgItem(dialog, ID_INPUT_FIELD);
						SetFocus(inputText);
						SendMessage(inputText, EM_SETSEL,
							0, popupDialog->inputText.length());
						return FALSE;
					}
				}
				
				return TRUE;
			}
			case WM_COMMAND:
				if(GET_WM_COMMAND_ID(wParam, lParam) == IDOK)
				{
					Win32PopupDialog::HandleOKClick(dialog);
					EndDialog(dialog, 0);
				}
				else if(GET_WM_COMMAND_ID(wParam, lParam) == IDCANCEL)
				{
					EndDialog(dialog, 0);
				}
				break;
		}

		return FALSE;
	}
开发者ID:JamesHayton,项目名称:titanium_desktop,代码行数:53,代码来源:popup_dialog.cpp


示例2: switch

	/*static*/
	INT_PTR CALLBACK Win32PopupDialog::Callback(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam)
	{
		switch (iMsg)
		{
			case WM_INITDIALOG:
			{
				Win32PopupDialog* popupDialog = popups[GetCurrentThreadId()];
				HWND hwndOwner = (popupDialog == NULL ? NULL : popupDialog->windowHandle);
				if (hwndOwner == NULL)
				{
					hwndOwner = GetDesktopWindow();
				}

				RECT rcOwner;
				RECT rcDlg;
				RECT rc;
				GetWindowRect(hwndOwner, &rcOwner);
				GetWindowRect(hDlg, &rcDlg);
				CopyRect(&rc, &rcOwner);

				// Offset the owner and dialog box rectangles so that right and bottom
				// values represent the width and height, and then offset the owner again
				// to discard space taken up by the dialog box.
				OffsetRect(&rcDlg, -rcDlg.left, -rcDlg.top);
				OffsetRect(&rc, -rc.left, -rc.top);
				OffsetRect(&rc, -rcDlg.right, -rcDlg.bottom);

				SetWindowPos(hDlg,
							HWND_TOP,
							rcOwner.left + (rc.right / 2),
							rcOwner.top + (rc.bottom / 2),
							0, 0,							// Ignores size arguments.
							SWP_NOSIZE);

				return TRUE;
			}
			case WM_COMMAND:
				if(GET_WM_COMMAND_ID(wParam, lParam) == IDOK)
				{
					Win32PopupDialog::HandleOKClick(hDlg);
					EndDialog(hDlg, 0);
				}
				else if(GET_WM_COMMAND_ID(wParam, lParam) == IDCANCEL)
				{
					EndDialog(hDlg, 0);
				}
				break;
		}

		return FALSE;
	}
开发者ID:cfs051059,项目名称:titanium,代码行数:52,代码来源:popup_dialog.cpp


示例3: About

//---------------------------------------------------------------------------
// About
//
// About dialog proc
//
// RETURNS:     Per Windows convention...
//---------------------------------------------------------------------------
BOOL  APIENTRY About (HWND hDlg, WORD message, WPARAM wParam, LPARAM lParam)
{
    switch (message)
        {
        case WM_COMMAND:
            if ((GET_WM_COMMAND_ID (wParam, lParam) == IDOK) ||
                (GET_WM_COMMAND_ID (wParam, lParam) == IDCANCEL))
                {
                EndDialog(hDlg, TRUE);
                return (TRUE);
                }
            break;
    }
    return (FALSE);
    (lParam);
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:23,代码来源:generic.c


示例4: AboutDlg

/***************************** Public  Function ****************************\
*
* BOOL  APIENTRY AboutDlg(hDlg, message, wParam, lParam)
* HWND     hDlg;
* WORD message;
* WPARAM wParam;
* LONG     lParam;
*
*
* Effects: none.
*
\***************************************************************************/
BOOL  APIENTRY 
AboutDlg(
	HWND   hDlg,
	WORD   message,
	WPARAM wParam,
	LONG   lParam
	)
{
	UNREFERENCED_PARAMETER(lParam);

	switch (message) {
	case WM_INITDIALOG:
		break;

	case WM_COMMAND:
		EndDialog(hDlg, GET_WM_COMMAND_ID(wParam, lParam));
		/* idok or idcancel */
		break;

	default:
		return FALSE;
		break;
	}
	return(TRUE);
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:37,代码来源:fontchar.c


示例5: DialPassCallBackProc

static BOOL CALLBACK DialPassCallBackProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	static RASDIALPARAMS *Param;
	char Tmp[RAS_NAME_LEN+25];

	switch (message)
	{
		case WM_INITDIALOG :
			Param = (RASDIALPARAMS *)lParam;
			sprintf(Tmp, MSGJPN238, Param->szEntryName);
			SendMessage(hDlg, WM_SETTEXT, 0, (LPARAM)Tmp);
			SendDlgItemMessage(hDlg, RASPASS_USER, EM_LIMITTEXT, UNLEN, 0);
			SendDlgItemMessage(hDlg, RASPASS_PASS, EM_LIMITTEXT, PWLEN, 0);
			SendDlgItemMessage(hDlg, RASPASS_USER, WM_SETTEXT, 0, (LPARAM)Param->szUserName);
			SendDlgItemMessage(hDlg, RASPASS_PASS, WM_SETTEXT, 0, (LPARAM)Param->szPassword);
		    return(TRUE);

		case WM_COMMAND :
			switch(GET_WM_COMMAND_ID(wParam, lParam))
			{
				case IDOK :
					SendDlgItemMessage(hDlg, RASPASS_USER, WM_GETTEXT, UNLEN+1, (LPARAM)Param->szUserName);
					SendDlgItemMessage(hDlg, RASPASS_PASS, WM_GETTEXT, PWLEN+1, (LPARAM)Param->szPassword);
					EndDialog(hDlg, YES);
					break;

				case IDCANCEL :
					EndDialog(hDlg, NO);
					break;
			}
			return(TRUE);
	}
	return(FALSE);
}
开发者ID:umorigu,项目名称:ffftp-mirror,代码行数:34,代码来源:ras.c


示例6: ChessPromotionDialogProc

BOOL CALLBACK ChessPromotionDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
   UserDidSomething();
   switch (message)
   {
   case WM_INITDIALOG:
      CheckDlgButton(hDlg, IDC_QUEEN, TRUE);
      CenterWindow(hDlg, GetParent(hDlg));
      hPromoteDlg = hDlg;
      return TRUE;
      
   case WM_COMMAND:
      switch (GET_WM_COMMAND_ID(wParam, lParam))
      {
      case IDOK:
      case IDCANCEL:
	 if (IsDlgButtonChecked(hDlg, IDC_KNIGHT))
	    EndDialog(hDlg, KNIGHT);
	 else if (IsDlgButtonChecked(hDlg, IDC_BISHOP))
	    EndDialog(hDlg, BISHOP);
	 else if (IsDlgButtonChecked(hDlg, IDC_ROOK))
	    EndDialog(hDlg, ROOK);
	 else EndDialog(hDlg, QUEEN);
	 return TRUE;
      }
      break;

   case WM_DESTROY:
      hPromoteDlg = NULL;
      break;

   }
   return FALSE;
}
开发者ID:AlleyCat1976,项目名称:Meridian59_103,代码行数:34,代码来源:chess.c


示例7: windows_systemcommand_routine

long windows_systemcommand_routine ( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam )
{

	LRESULT
		lRc;

	switch ( GET_WM_COMMAND_ID ( wParam, lParam ) )
	{

		case SC_SCREENSAVE:
		{

			return ( 0 );

			break;
		}

		default:
		{

			lRc = DefWindowProc ( application_window, message, wParam, lParam );

			break;
		}
	}

	return ( lRc );
}
开发者ID:Comanche93,项目名称:eech,代码行数:28,代码来源:startup.c


示例8: DispCommand

LRESULT DispCommand(LPCMDI lpcmdi, 
                    HWND   hwnd, 
                    WPARAM wparam, 
                    LPARAM lparam)
{
    WORD    wCommand = GET_WM_COMMAND_ID(wparam, lparam);
    int     icmd = 0;

    CMD    *rgcmd = lpcmdi->rgcmd;
    int     ccmd  = lpcmdi->ccmd;

    // Message packing of wparam and lparam have changed for Win32,
    // so use the GET_WM_COMMAND macro to unpack the commnad

    for (icmd = 0; icmd < ccmd; icmd++)
    {
        if (rgcmd[icmd].wCommand == wCommand)
        {
            return rgcmd[icmd].pfncmd(hwnd,
                                      wCommand,
                                      GET_WM_COMMAND_CMD(wparam, lparam),
                                      GET_WM_COMMAND_HWND(wparam, lparam));
        }
    }

    return DispDefault(lpcmdi->edwp, hwnd, WM_COMMAND, wparam, lparam);
}
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:27,代码来源:Dispatch.c


示例9: DefWindowProc

LRESULT CALLBACK CTSFMainWnd::_WndProc( HWND hWnd, 
                                        UINT uMessage, 
                                        WPARAM wParam, 
                                        LPARAM lParam)
{
    CTSFMainWnd *pThis = (CTSFMainWnd*)GetWindowLongPtr(hWnd, THIS_POINTER_OFFSET);

    if((NULL == pThis) && (uMessage != WM_NCCREATE))
    {
        return DefWindowProc(hWnd, uMessage, wParam, lParam);
    }
    
    switch (uMessage)
    {
    case WM_NCCREATE:
        {
            LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
            pThis = (CTSFMainWnd*)(lpcs->lpCreateParams);
            SetWindowLongPtr(hWnd, THIS_POINTER_OFFSET, (LONG_PTR)pThis);

            //set the window handle
            pThis->m_hWnd = hWnd;
        }
        break;

    case WM_CREATE:
        return pThis->_OnCreate();

    case WM_SIZE:
        return pThis->_OnSize(LOWORD(lParam), HIWORD(lParam));

    case WM_DESTROY:
        return pThis->_OnDestroy();

    case WM_SETFOCUS:
        return pThis->_OnSetFocus();

    case WM_KILLFOCUS:
        return pThis->_OnKillFocus();

    case WM_ACTIVATE:
        return pThis->_OnActivate(wParam);

    case WM_INITMENUPOPUP:
        return pThis->_OnInitMenuPopup(wParam, lParam);

    case WM_COMMAND:
        return pThis->_OnCommand(   GET_WM_COMMAND_ID(wParam, lParam), 
                                    GET_WM_COMMAND_CMD(wParam, lParam), 
                                    GET_WM_COMMAND_HWND(wParam, lParam));

    case WM_NCDESTROY:
        pThis->m_hWnd = NULL;
        break;

    }

    return DefWindowProc(hWnd, uMessage, wParam, lParam);
}
开发者ID:Ippei-Murofushi,项目名称:WindowsSDK7-Samples,代码行数:59,代码来源:tsfwnd.cpp


示例10: AboutDialogProc

INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
	switch (Msg)
	{
		case WM_INITDIALOG:
		{
			char tmp[256];
			CenterWindow(hDlg);
			hBrush = CreateSolidBrush(RGB(235, 233, 237));
			HBITMAP hBmp = (HBITMAP)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_SPLASH), IMAGE_BITMAP, 0, 0, LR_SHARED);
			SendMessage(GetDlgItem(hDlg, IDC_ABOUT), STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBmp);
			hFont = CreateFont(-11, 0, 0, 0, 400, 0, 0, 0, 0, 3, 2, 1, 34, TEXT("Verdana"));
			hFontFX = CreateFont(-12, 0, 0, 0, 400, 0, 0, 0, 0, 3, 2, 1, 34, TEXT("Verdana"));
			SetWindowFont(GetDlgItem(hDlg, IDC_TEXT1), hFont, true);
			SetWindowFont(GetDlgItem(hDlg, IDC_TEXT2), hFont, true);
			SetWindowFont(GetDlgItem(hDlg, IDC_TEXT3), hFont, true);
			SetWindowFont(GetDlgItem(hDlg, IDC_TEXT4), hFont, true);
			SetWindowFont(GetDlgItem(hDlg, IDC_SICKFX), hFontFX, true);
			win_set_window_text_utf8(GetDlgItem(hDlg, IDC_BUILD), "Build time: " __DATE__" - " __TIME__"");
			snprintf(tmp, WINUI_ARRAY_LENGTH(tmp), "Version: %s", MAME_VERSION);
			win_set_window_text_utf8(GetDlgItem(hDlg, IDC_BUILDVER), tmp);
			return true;
		}

		case WM_CTLCOLORDLG:
			return (LRESULT) hBrush;

		case WM_CTLCOLORSTATIC:
		case WM_CTLCOLORBTN:
			hDC = (HDC)wParam;
			SetBkMode(hDC, TRANSPARENT);
			SetTextColor(hDC, GetSysColor(COLOR_WINDOWTEXT));

			if ((HWND)lParam == GetDlgItem(hDlg, IDC_SICKFX))
				SetTextColor(hDC, RGB(63, 72, 204));

			return (LRESULT) hBrush;

		case WM_COMMAND:
			switch (GET_WM_COMMAND_ID(wParam, lParam))
			{
				case IDOK:
				case IDCANCEL:
					DeleteObject(hFont);
					DeleteObject(hFontFX);
					DeleteObject(hBrush);
					EndDialog(hDlg, 0);
					return true;
			}

			break;
	}

	return false;
}
开发者ID:Robbbert,项目名称:store1,代码行数:55,代码来源:dialogs.cpp


示例11: DialCallBackProc

static BOOL CALLBACK DialCallBackProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	static RASDIALPARAMS *Param;
	static HRASCONN hRasConn;
	char Tmp[RAS_NAME_LEN+25];
	DWORD Sts;

	switch (message)
	{
		case WM_INITDIALOG :
			Param = (RASDIALPARAMS *)lParam;
			hWndDial = hDlg;
			hRasConn = NULL;
			sprintf(Tmp, MSGJPN223, Param->szEntryName);
			SendMessage(hDlg, WM_SETTEXT, 0, (LPARAM)Tmp);
			Sts = (*m_RasDial)(NULL, NULL, Param, 0, &RasDialFunc, &hRasConn);
			if(Sts != 0)
		        EndDialog(hDlg, NO);
		    return(TRUE);

		case WM_COMMAND :
			switch(GET_WM_COMMAND_ID(wParam, lParam))
			{
				case IDCANCEL :
					RasHangUpWait(hRasConn);
					EndDialog(hDlg, NO);
					break;
			}
			return(TRUE);

		case WM_DIAL_MSG :
			if(lParam != 0)
			{
				/* エラー発生 */
				if((*m_RasGetErrorString)((UINT)lParam, (LPTSTR)Tmp, RAS_NAME_LEN+25) != 0)
					sprintf(Tmp, MSGJPN224);
				RasHangUpWait(hRasConn);
				MessageBox(hDlg, Tmp, MSGJPN225, MB_OK | MB_ICONSTOP);
				EndDialog(hDlg, NO);
			}
			else if(wParam & RASCS_DONE)
			{
				/* 終了 */
				EndDialog(hDlg, YES);
			}
			else
			{
				/* ステータス変更 */
				MakeRasConnMsg(Param->szPhoneNumber, wParam, Tmp);
				SendDlgItemMessage(hDlg, DIAL_STATUS, WM_SETTEXT, 0, (LPARAM)Tmp);
			}
			return(TRUE);
	}
	return(FALSE);
}
开发者ID:umorigu,项目名称:ffftp-mirror,代码行数:55,代码来源:ras.c


示例12: MainDlgProc

static LRESULT CALLBACK MainDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{

    switch (uMsg)
    {
        case WM_INITDIALOG: {

			HYPCTRL hc; // can be reused for new hyperlink controls
			
			InitHypCtrl(&hc);
			hc.ulStyle	 = ulHover;
			hc.szLink	 = _T("http://smorgasbordet.com/pellesc");
			hc.szTooltip = _T("Visit Pelles C Website");
			CreateHypCtrl(hwndDlg, &hc, 10, 10, 0, 0);

			InitHypCtrl(&hc);
			hc.ulStyle	 = ulHover;
			hc.szLink	 = _T("mailto:[email protected]");
			hc.szText	 = _T("[email protected]");
			hc.szTooltip = _T("Send program author a mail");
			CreateHypCtrl(hwndDlg, &hc, 10, 30, 0, 0);
			
			InitHypCtrl(&hc);
			hc.ulStyle	  = ulHover;
			hc.bPlaySound = FALSE;
			hc.szText     = _T("Callback Test 1");
			hc.cbFn       = HypCtrlCallback;
			hc.cbID       = 1;
			CreateHypCtrl(hwndDlg, &hc, 10, 50, 0, 0);

			InitHypCtrl(&hc);
			hc.ulStyle    = ulHover;
			hc.bPlaySound = FALSE;
			hc.szText     = _T("Callback Test 2");
			hc.cbFn	      = HypCtrlCallback;
			hc.cbID       = 2;
			CreateHypCtrl(hwndDlg, &hc, 10, 70, 0, 0);

            return TRUE;
        }
        case WM_COMMAND:
            switch (GET_WM_COMMAND_ID(wParam, lParam))
            {
                case IDOK:
                    EndDialog(hwndDlg, TRUE);
                    return TRUE;
            }
            break;
        case WM_CLOSE:
            EndDialog(hwndDlg, 0);
            return TRUE;
    }
    return FALSE;
}
开发者ID:469306621,项目名称:Languages,代码行数:54,代码来源:main.c


示例13: WidthProc

/******************************************************************************
 * BOOL  APIENTRY WidthProc(hDial, message, wParam, lParam)
 *
 * purpose: dialog function for Width menu function
 *
 * params:  same as for all dialog fns.
 *
 * side effects: changes Box width variable
 *
 *****************************************************************************/
BOOL  APIENTRY 
WidthProc(
	HWND   hDial,
	WORD   message,
	WPARAM wParam,
	LONG   lParam
	)
{
	INT i;
	BOOL fOk;

	UNREFERENCED_PARAMETER(lParam);

	switch (message) {
	default:
		return FALSE;
	case WM_INITDIALOG:
		SetDlgItemInt(hDial, BOX_WIDTH, newWidth, FALSE);
		break;

	case WM_COMMAND:
		switch (GET_WM_COMMAND_ID(wParam, lParam)) {
		case IDOK:
			fChanged = TRUE;
			i = GetDlgItemInt(hDial, BOX_WIDTH, (LPBOOL)&fOk, FALSE);
			if (fOk && i < wBoxLim)
				newWidth = i;
			else
				ErrorBox(hDial, vszWidthOutOfBounds);

		case IDCANCEL:
			EndDialog(hDial, GET_WM_COMMAND_ID(wParam, lParam) != IDCANCEL);
			break;

		default:
			break;
		}
	}
	return TRUE;
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:50,代码来源:fontchar.c


示例14: MainWndProc

LRESULT CALLBACK MainWndProc( HWND hWnd,
                              UINT uMessage,
                              WPARAM wParam,
                              LPARAM lParam)
{
switch (uMessage)
   {
   case WM_CREATE:
      break;

   case WM_CLOSE:
      if(IsWindow(g_hwndPropSheet))
         DestroyWindow(g_hwndPropSheet);
      
      DestroyWindow(hWnd);
      break;
   
   case WM_DESTROY:
      PostQuitMessage(0);
      break;

   case WM_COMMAND:
      switch (GET_WM_COMMAND_ID(wParam, lParam))
         {
         case IDM_MODAL:
            DoModalPropSheet(hWnd);
            break;
            
         case IDM_MODELESS:
            g_hwndPropSheet = DoModelessPropSheet(hWnd);
            break;
            
         case IDM_WIZARD:
            DoWizardPropSheet(hWnd);
            break;
         
         case IDM_EXIT:
            PostMessage(hWnd, WM_CLOSE, 0, 0);
            break;
         
         case IDM_ABOUT:
            DialogBox(g_hInst, MAKEINTRESOURCE(IDD_ABOUT_DIALOG), hWnd, About);
            break;
         }
      return TRUE;

   default:
      break;
   }
return DefWindowProc(hWnd, uMessage, wParam, lParam);
}
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:51,代码来源:Property.c


示例15: rawDlgProc

BOOL CALLBACK rawDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
	DWORD c,d;
	switch (uMsg) {
	case WM_CLOSE:
		EndDialog(hDlg,TRUE);
		return 0;
	case WM_INITDIALOG:
		{
			char *LFpsftag;
			//char LFpsftag[500001];

			LFpsftag = malloc(strlen(infoDlgpsftag)*3+1);

			// <= includes terminating null
			for (c=0, d=0; c <= strlen(infoDlgpsftag); c++, d++) {
				LFpsftag[d]=infoDlgpsftag[c];
				if (infoDlgpsftag[c]=='\n') {
					LFpsftag[d++]='\r';
					LFpsftag[d]='\r';
					LFpsftag[d]='\n';
				}
			}
		
			SetDlgItemText(hDlg,IDC_RAWTAG,LFpsftag);
			free(LFpsftag);
			break;
		}
	case WM_COMMAND:
		switch (GET_WM_COMMAND_ID(wParam, lParam)) {
		case IDOK:
			GetDlgItemText(hDlg,IDC_RAWTAG,infoDlgpsftag,50000);

			// remove 0x0d (in PSF a newline is 0x0a)
			for (c=0,d=0; c < strlen(infoDlgpsftag); c++) {
				if (infoDlgpsftag[c] != 0x0d) {
					infoDlgpsftag[d]=infoDlgpsftag[c];
					d++;
				}
			}
			infoDlgpsftag[d]='\0';
		case IDCANCEL:
			EndDialog(hDlg,TRUE);
			break;
		}
	default:
		return 0;
	}
	return 1;
}
开发者ID:Kinglions,项目名称:modizer,代码行数:49,代码来源:main.c


示例16: ProfanityDialogProc

BOOL CALLBACK ProfanityDialogProc(HWND hDlg, UINT message, UINT wParam, LONG lParam)
{
   char term[MAXPROFANETERM+1];

   switch (message)
   {
   case WM_INITDIALOG:
      CenterWindow(hDlg, GetParent(hDlg));
      Edit_LimitText(GetDlgItem(hDlg, IDC_EDIT1), MAXPROFANETERM);
      CheckRadioButton(hDlg, IDC_RADIO1, IDC_RADIO2, IDC_RADIO1+!config.ignoreprofane);
      CheckDlgButton(hDlg, IDC_CHECK1, config.extraprofane);
      SetFocus(GetDlgItem(hDlg, IDC_RADIO1+!config.ignoreprofane));
      return FALSE; // return TRUE unless we set the focus

   case WM_COMMAND:
      switch(GET_WM_COMMAND_ID(wParam, lParam))
      {
      case IDC_BUTTON1:
	 GetDlgItemText(hDlg, IDC_EDIT1, term, sizeof(term));
	 AddProfaneTerm(term);
	 SetDlgItemText(hDlg, IDC_EDIT1, "");
	 SetFocus(GetDlgItem(hDlg, IDC_EDIT1));
	 return TRUE;

      case IDC_BUTTON2:
	 GetDlgItemText(hDlg, IDC_EDIT1, term, sizeof(term));
	 RemoveProfaneTerm(term);
	 SetDlgItemText(hDlg, IDC_EDIT1, "");
	 SetFocus(GetDlgItem(hDlg, IDC_EDIT1));
	 return TRUE;

      case IDCANCEL:
	 EndDialog(hDlg, IDCANCEL);
	 return TRUE;

      case IDOK:
	 config.ignoreprofane = IsDlgButtonChecked(hDlg, IDC_RADIO1);
	 config.extraprofane = IsDlgButtonChecked(hDlg, IDC_CHECK1);
	 RecompileAllProfaneExpressions();
	 EndDialog(hDlg, IDOK);
	 return TRUE;
      }
      break;
   }

   return FALSE;
}
开发者ID:Anonic,项目名称:Meridian59,代码行数:47,代码来源:maindlg.c


示例17: TitleDlgProc

BOOL CALLBACK TitleDlgProc(HWND   hDlg,
			   UINT   uiMsg,
			   WPARAM wParam,
			   LPARAM lParam)
{
    HDC hDc;
    PAINTSTRUCT ps;
    switch (uiMsg){
    case WM_INITDIALOG:
	hIcon = LoadImage(hInst, MAKEINTRESOURCE(MEW), IMAGE_ICON, 48, 48,
			  LR_DEFAULTSIZE);
	if (hIcon == NULL){
	    OutputLog("LoadImage fails.");
	    EndPaint(hDlg, &ps);
	    return FALSE;
	}
	break;
    case WM_PAINT:
	hDc = BeginPaint(hDlg, &ps);
	if (hDc == NULL){
	    OutputLog("BeginPaint fails.");
	    EndPaint(hDlg, &ps);
	    return FALSE;
	}
	if (DrawIconEx(hDc, 24, 64, hIcon, 48, 48, 0, NULL, DI_NORMAL) == 0){
	    OutputLog("DrawIconEx fails.");
	    EndPaint(hDlg, &ps);
	    return FALSE;
	}
	EndPaint(hDlg, &ps);
	break;
    case WM_COMMAND:
	switch (GET_WM_COMMAND_ID(wParam, lParam)){
	case IDOK:
	    EndDialog(hDlg, 1);
	    return TRUE;
	    break;
	case IDCANCEL:
	    EndDialog(hDlg, 0);
	    return TRUE;
	    break;
	}
    default:
	return FALSE;
    }
    return FALSE;
}
开发者ID:redtower,项目名称:rc,代码行数:47,代码来源:mew.c


示例18: WndProc

LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) {
  LRESULT lResult = 0;

  switch(msg){
  case WM_CREATE:
    {
      SHMENUBARINFO mbi;
      ZeroMemory(&mbi, sizeof(SHMENUBARINFO));
      mbi.cbSize = sizeof(SHMENUBARINFO);
      mbi.hwndParent = hwnd;
      mbi.nToolBarId = ID_MENU;
      mbi.hInstRes = _hAppInstance;

      if (SHCreateMenuBar(&mbi) == FALSE) {
         // Couldn't create the menu bar.  Fail creation of the window.
          return -1;
      }
    }
    break;

  case WM_COMMAND:
    switch (GET_WM_COMMAND_ID(wp, lp)) {
    case IDM_EXIT:
    case IDOK:
      _quit_now = 1;
      SendMessage(hwnd, WM_CLOSE, 0, 0);
      break;
    default:
      return DefWindowProc(hwnd, msg, wp, lp);
    }
    break;
  case WM_CLOSE:
    DestroyWindow(hwnd);
    break;

  case WM_DESTROY:
    PostQuitMessage(0);
    break;

  default:
    lResult = DefWindowProc(hwnd, msg, wp, lp);
    break;
  }
  return (lResult);
}
开发者ID:jiangxilong,项目名称:yari,代码行数:45,代码来源:Main_wince.cpp


示例19: NvGpuPanelDialogProc

static INT_PTR CALLBACK NvGpuPanelDialogProc(
    _In_ HWND hwndDlg,
    _In_ UINT uMsg,
    _In_ WPARAM wParam,
    _In_ LPARAM lParam
    )
{
    PPH_NVGPU_SYSINFO_CONTEXT context = NULL;

    if (uMsg == WM_INITDIALOG)
    {
        context = (PPH_NVGPU_SYSINFO_CONTEXT)lParam;
        SetProp(hwndDlg, L"Context", (HANDLE)context);
    }
    else
    {
        context = (PPH_NVGPU_SYSINFO_CONTEXT)GetProp(hwndDlg, L"Context");

        if (uMsg == WM_NCDESTROY)
        {
            RemoveProp(hwndDlg, L"Context");
        }
    }

    if (context == NULL)
        return FALSE;

    switch (uMsg)
    {
    case WM_COMMAND:
        {
            switch (GET_WM_COMMAND_ID(wParam, lParam))
            {
            case IDC_DETAILS:
                {
                    ShowDetailsDialog(GetParent(hwndDlg), context);
                }
                break;
            }
        }
        break;
    }

    return FALSE;
}
开发者ID:amitamitamitamit,项目名称:plugins-extra,代码行数:45,代码来源:graph.c


示例20: About

BOOL CALLBACK About(HWND hDlg, UINT message, WPARAM wPrm, LONG lPrm)
#pragma argsused hDlg message wPrm
{
  UINT which;

  switch(message) {
  case WM_INITDIALOG:
    return(TRUE);
  case WM_COMMAND:
    which = GET_WM_COMMAND_ID(wPrm, lPrm);
    if (which == IDOK || which == IDCANCEL) {
      EndDialog(hDlg, TRUE);
      return(TRUE);
    }
    break;
  }
  return(FALSE);
}
开发者ID:jhbadger,项目名称:xlispstat,代码行数:18,代码来源:lspedit.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GET_Y_LPARAM函数代码示例发布时间:2022-05-30
下一篇:
C++ GET_WHEEL_DELTA_WPARAM函数代码示例发布时间: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