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


C++ MAKELONG函数代码示例

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


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

示例1: tab_general_init

void tab_general_init(HWND hwnd)
{
	int   i, j;
	UINT  cid = 0;
	char *source_channel_names[] = {"(Front) Left", "(Front) Right", "Center", "LFE/Subwoofer", "Rear Left", "Rear Right", "Side Left", "Side Right"};
	char *output_modes[] = {"Mono", "Stereo", "5.1 Channels", "7.1 Channels"};

	for(i=0; i<8; i++)
	{
		switch(i)
		{
		case 0: cid = combo_sc1; break;
		case 1: cid = combo_sc2; break;
		case 2: cid = combo_sc3; break;
		case 3: cid = combo_sc4; break;
		case 4: cid = combo_sc5; break;
		case 5: cid = combo_sc6; break;
		case 6: cid = combo_sc7; break;
		case 7: cid = combo_sc8; break;
		}

		for(j=0; j<8; j++)
		{
			SendDlgItemMessage(hwnd, cid, CB_INSERTSTRING, (WPARAM)-1, (LPARAM) source_channel_names[j]);
		}
	}

	for(i=0; i<4; i++)
	{
		SendDlgItemMessage(hwnd, combo_outmodes, CB_INSERTSTRING, (WPARAM)-1, (LPARAM) output_modes[i]);
	}

	SendDlgItemMessage(hwnd, sld_vol1, TBM_SETRANGE, 0, (LPARAM) MAKELONG(0, 1000));
	SendDlgItemMessage(hwnd, sld_vol2, TBM_SETRANGE, 0, (LPARAM) MAKELONG(0, 1000));
	SendDlgItemMessage(hwnd, sld_vol3, TBM_SETRANGE, 0, (LPARAM) MAKELONG(0, 1000));
	SendDlgItemMessage(hwnd, sld_vol4, TBM_SETRANGE, 0, (LPARAM) MAKELONG(0, 1000));
	SendDlgItemMessage(hwnd, sld_vol5, TBM_SETRANGE, 0, (LPARAM) MAKELONG(0, 1000));
	SendDlgItemMessage(hwnd, sld_vol6, TBM_SETRANGE, 0, (LPARAM) MAKELONG(0, 1000));
	SendDlgItemMessage(hwnd, sld_vol7, TBM_SETRANGE, 0, (LPARAM) MAKELONG(0, 1000));
	SendDlgItemMessage(hwnd, sld_vol8, TBM_SETRANGE, 0, (LPARAM) MAKELONG(0, 1000));
	SendDlgItemMessage(hwnd, slider_delay, TBM_SETRANGE, 0, (LPARAM) MAKELONG(0, 100));

	SendDlgItemMessage(hwnd, sld_vol1, TBM_SETPOS, 1, (LPARAM) (speakers.volumes.front_left   * 1000.0) );
	SendDlgItemMessage(hwnd, sld_vol2, TBM_SETPOS, 1, (LPARAM) (speakers.volumes.front_right  * 1000.0) );
	SendDlgItemMessage(hwnd, sld_vol3, TBM_SETPOS, 1, (LPARAM) (speakers.volumes.front_center * 1000.0) );
	SendDlgItemMessage(hwnd, sld_vol4, TBM_SETPOS, 1, (LPARAM) (speakers.volumes.subwoofer    * 1000.0) );
	SendDlgItemMessage(hwnd, sld_vol5, TBM_SETPOS, 1, (LPARAM) (speakers.volumes.rear_left    * 1000.0) );
	SendDlgItemMessage(hwnd, sld_vol6, TBM_SETPOS, 1, (LPARAM) (speakers.volumes.rear_right   * 1000.0) );
	SendDlgItemMessage(hwnd, sld_vol7, TBM_SETPOS, 1, (LPARAM) (speakers.volumes.side_left    * 1000.0) );
	SendDlgItemMessage(hwnd, sld_vol8, TBM_SETPOS, 1, (LPARAM) (speakers.volumes.side_right   * 1000.0) );

	SendDlgItemMessage(hwnd, slider_delay, TBM_SETPOS, 1, (LPARAM) speakers.delay.rear_delay_ms);

	SendDlgItemMessage(hwnd, combo_sc1, CB_SETCURSEL, (WPARAM)speakers.mapping.front_left  , 0);
	SendDlgItemMessage(hwnd, combo_sc2, CB_SETCURSEL, (WPARAM)speakers.mapping.front_right , 0);
	SendDlgItemMessage(hwnd, combo_sc3, CB_SETCURSEL, (WPARAM)speakers.mapping.front_center, 0);
	SendDlgItemMessage(hwnd, combo_sc4, CB_SETCURSEL, (WPARAM)speakers.mapping.subwoofer   , 0);
	SendDlgItemMessage(hwnd, combo_sc5, CB_SETCURSEL, (WPARAM)speakers.mapping.rear_left   , 0);
	SendDlgItemMessage(hwnd, combo_sc6, CB_SETCURSEL, (WPARAM)speakers.mapping.rear_right  , 0);
	SendDlgItemMessage(hwnd, combo_sc7, CB_SETCURSEL, (WPARAM)speakers.mapping.side_left   , 0);
	SendDlgItemMessage(hwnd, combo_sc8, CB_SETCURSEL, (WPARAM)speakers.mapping.side_right  , 0);
}
开发者ID:hownam,项目名称:fennec,代码行数:62,代码来源:plugin+-+dsp.c

示例2: ASSERT

BOOL CFrameWnd::ProcessHelpMsg(MSG& msg, DWORD* pContext)
{
	ASSERT(pContext != NULL);

	if (msg.message == WM_EXITHELPMODE ||
		(msg.message == WM_KEYDOWN && msg.wParam == VK_ESCAPE))
	{
		PeekMessage(&msg, NULL, msg.message, msg.message, PM_REMOVE);
		return FALSE;
	}

	CPoint point;
	if ((msg.message >= WM_MOUSEFIRST && msg.message <= WM_MOUSELAST) ||
		(msg.message >= WM_NCMOUSEFIRST && msg.message <= WM_NCMOUSELAST))
	{
		BOOL bDescendant;
		HWND hWndHit = SetHelpCapture(msg.pt, &bDescendant);
		if (hWndHit == NULL)
			return TRUE;

		if (bDescendant)
		{
			if (msg.message != WM_LBUTTONDOWN)
			{
				// Hit one of our owned windows -- eat the message.
				PeekMessage(&msg, NULL, msg.message, msg.message, PM_REMOVE);
				return TRUE;
			}
			int iHit = (int)::SendMessage(hWndHit, WM_NCHITTEST, 0,
				MAKELONG(msg.pt.x, msg.pt.y));
			if (iHit == HTMENU || iHit == HTSYSMENU)
			{
				ASSERT(::GetCapture() == m_hWnd);
				ReleaseCapture();
				// the message we peeked changes into a non-client because
				// of the release capture.
				GetMessage(&msg, NULL, WM_NCLBUTTONDOWN, WM_NCLBUTTONDOWN);
				DispatchMessage(&msg);
				GetCursorPos(&point);
				SetHelpCapture(point, NULL);
			}
			else if (iHit == HTCLIENT)
			{
				*pContext = MapClientArea(hWndHit, msg.pt);
				PeekMessage(&msg, NULL, msg.message, msg.message, PM_REMOVE);
				return FALSE;
			}
			else
			{
				*pContext = MapNonClientArea(iHit);
				PeekMessage(&msg, NULL, msg.message, msg.message, PM_REMOVE);
				return FALSE;
			}
		}
		else
		{
			// Hit one of our apps windows (or desktop) -- dispatch the message.
			PeekMessage(&msg, NULL, msg.message, msg.message, PM_REMOVE);

			// Dispatch mouse messages that hit the desktop!
			DispatchMessage(&msg);
		}
	}
	else if (msg.message == WM_SYSCOMMAND ||
			 (msg.message >= WM_KEYFIRST && msg.message <= WM_KEYLAST))
	{
		if (::GetCapture() != NULL)
		{
			ReleaseCapture();
			MSG msg;
			while (PeekMessage(&msg, NULL, WM_MOUSEFIRST,
				WM_MOUSELAST, PM_REMOVE|PM_NOYIELD));
		}
		ASSERT(PeekMessage(&msg, NULL, msg.message, msg.message, PM_NOREMOVE));
		GetMessage(&msg, NULL, msg.message, msg.message);
		if (!PreTranslateMessage(&msg))
		{
			TranslateMessage(&msg);
			if (msg.message == WM_SYSCOMMAND ||
			  (msg.message >= WM_SYSKEYFIRST && msg.message <= WM_SYSKEYLAST))
			{
				// only dispatch system keys and system commands
				ASSERT(msg.message == WM_SYSCOMMAND ||
					 (msg.message >= WM_SYSKEYFIRST &&
					  msg.message <= WM_SYSKEYLAST));
				DispatchMessage(&msg);
			}
		}
		GetCursorPos(&point);
		SetHelpCapture(point, NULL);
	}
	else
	{
		// allow all other messages to go through (capture still set)
		if (PeekMessage(&msg, NULL, msg.message, msg.message, PM_REMOVE))
			DispatchMessage(&msg);
	}

	return TRUE;
}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:100,代码来源:winfrmx.cpp

示例3: switch

INT_PTR CSetPgIntegr::PageDlgProc(HWND hDlg, UINT messg, WPARAM wParam, LPARAM lParam)
{
	static bool bSkipCbSel = FALSE;
	INT_PTR iRc = 0;

	switch (messg)
	{
	case WM_NOTIFY:
		{
			LPNMHDR phdr = (LPNMHDR)lParam;

			if (phdr->code == TTN_GETDISPINFO)
			{
				return gpSetCls->ProcessTipHelp(hDlg, messg, wParam, lParam);
			}

			break;
		}
	case WM_INITDIALOG:
		{
			bSkipCbSel = true;

			PageDlgProc(hDlg, UM_RELOAD_HERE_LIST, UM_RELOAD_HERE_LIST, 0);

			//-- moved to "ComSpec" page
			//PageDlgProc(hDlg, UM_RELOAD_AUTORUN, UM_RELOAD_AUTORUN, 0);

			// Возвращает NULL, если строка пустая
			wchar_t* pszCurInside = GetDlgItemTextPtr(hDlg, cbInsideName);
			_ASSERTE((pszCurInside==NULL) || (*pszCurInside!=0));
			wchar_t* pszCurHere   = GetDlgItemTextPtr(hDlg, cbHereName);
			_ASSERTE((pszCurHere==NULL) || (*pszCurHere!=0));

			wchar_t szIcon[MAX_PATH+32];
			_wsprintf(szIcon, SKIPLEN(countof(szIcon)) L"%s,0", gpConEmu->ms_ConEmuExe);

			if (pszCurInside)
			{
				bSkipCbSel = false;
				PageDlgProc(hDlg, WM_COMMAND, MAKELONG(cbInsideName,CBN_SELCHANGE), 0);
				bSkipCbSel = true;
			}
			else
			{
				SetDlgItemText(hDlg, cbInsideName, L"ConEmu Inside");
				SetDlgItemText(hDlg, tInsideConfig, L"shell");
				SetDlgItemText(hDlg, tInsideShell, CONEMU_HERE_POSH);
				//SetDlgItemText(hDlg, tInsideIcon, szIcon);
				SetDlgItemText(hDlg, tInsideIcon, L"powershell.exe");
				checkDlgButton(hDlg, cbInsideSyncDir, gpConEmu->mp_Inside && gpConEmu->mp_Inside->mb_InsideSynchronizeCurDir);
				SetDlgItemText(hDlg, tInsideSyncDir, L""); // Auto
			}

			if (pszCurHere)
			{
				bSkipCbSel = false;
				PageDlgProc(hDlg, WM_COMMAND, MAKELONG(cbHereName,CBN_SELCHANGE), 0);
				bSkipCbSel = true;
			}
			else
			{
				SetDlgItemText(hDlg, cbHereName, L"ConEmu Here");
				SetDlgItemText(hDlg, tHereConfig, L"");
				SetDlgItemText(hDlg, tHereShell, CONEMU_HERE_CMD);
				SetDlgItemText(hDlg, tHereIcon, szIcon);
			}

			bSkipCbSel = false;

			SafeFree(pszCurInside);
			SafeFree(pszCurHere);

		}
		break; // WM_INITDIALOG

	case WM_COMMAND:
		switch (HIWORD(wParam))
		{
		case BN_CLICKED:
			{
				WORD CB = LOWORD(wParam);

				switch (CB)
				{
				case cbInsideSyncDir:
					if (gpConEmu->mp_Inside)
					{
						gpConEmu->mp_Inside->mb_InsideSynchronizeCurDir = isChecked(hDlg, CB);
					}
					break;
				case bInsideRegister:
				case bInsideUnregister:
					ShellIntegration(hDlg, ShellIntgr_Inside, CB==bInsideRegister);
					PageDlgProc(hDlg, UM_RELOAD_HERE_LIST, UM_RELOAD_HERE_LIST, 0);
					if (CB==bInsideUnregister)
						PageDlgProc(hDlg, WM_COMMAND, MAKELONG(cbInsideName,CBN_SELCHANGE), 0);
					break;
				case bHereRegister:
				case bHereUnregister:
					ShellIntegration(hDlg, ShellIntgr_Here, CB==bHereRegister);
//.........这里部分代码省略.........
开发者ID:albert2lyu,项目名称:ConEmu,代码行数:101,代码来源:SetPgIntegr.cpp

示例4: onMSNHCommand

/* on WM_COMMAND */
void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
	PNHMapWindow data;
	RECT rt;

	data = (PNHMapWindow)GetWindowLong(hWnd, GWL_USERDATA);
	switch(wParam) {
	case MSNH_MSG_PRINT_GLYPH: 
	{
		PMSNHMsgPrintGlyph msg_data = (PMSNHMsgPrintGlyph)lParam;
		data->map[msg_data->x][msg_data->y] = msg_data->glyph;

		/* invalidate the update area */
		nhcoord2display(data, msg_data->x, msg_data->y, &rt);
		InvalidateRect(hWnd, &rt, TRUE);
	} 
	break;

	case MSNH_MSG_CLIPAROUND: 
	{
		PMSNHMsgClipAround msg_data = (PMSNHMsgClipAround)lParam;
		int x, y;
		BOOL scroll_x, scroll_y;
		int mcam = iflags.wc_scroll_margin;

		/* calculate if you should clip around */
		scroll_x =  
			!GetNHApp()->bNoHScroll &&
			( msg_data->x<(data->xPos+mcam) ||
			  msg_data->x>(data->xPos+data->xPageSize-mcam) );
		scroll_y =  
			!GetNHApp()->bNoVScroll &&
			( msg_data->y<(data->yPos+mcam) ||
			  msg_data->y>(data->yPos+data->yPageSize-mcam) );
		
		mcam += iflags.wc_scroll_amount - 1;
		/* get page size and center horizontally on x-position */
		if( scroll_x ) {
			if( data->xPageSize<=2*mcam ) {
				x = max(0, min(COLNO, msg_data->x - data->xPageSize/2));
			} else if( msg_data->x < data->xPos+data->xPageSize/2 ) {
				x = max(0, min(COLNO, msg_data->x - mcam));
			} else {
				x = max(0, min(COLNO, msg_data->x - data->xPageSize + mcam));
			}
			SendMessage( hWnd, WM_HSCROLL, (WPARAM)MAKELONG(SB_THUMBTRACK, x), (LPARAM)NULL	);
		}

		/* get page size and center vertically on y-position */
		if( scroll_y ) {
			if( data->yPageSize<=2*mcam ) {
				y = max(0, min(ROWNO, msg_data->y - data->yPageSize/2));
			} else if( msg_data->y < data->yPos+data->yPageSize/2 ) {
				y = max(0, min(ROWNO, msg_data->y - mcam));
			} else {
				y = max(0, min(ROWNO, msg_data->y - data->yPageSize + mcam));
			}
			SendMessage( hWnd, WM_VSCROLL, (WPARAM)MAKELONG(SB_THUMBTRACK, y), (LPARAM)NULL );
		}
	} 
	break;

	case MSNH_MSG_CLEAR_WINDOW: 
	{
		int i, j;
		for(i=0; i<COLNO; i++) 
			for(j=0; j<ROWNO; j++) {
			data->map[i][j] = -1;
		}
		InvalidateRect(hWnd, NULL, TRUE);
	} break;

	case MSNH_MSG_CURSOR:
	{
		PMSNHMsgCursor msg_data = (PMSNHMsgCursor)lParam;
		HDC    hdc;
		RECT   rt;

		/* move focus rectangle at the cursor postion */
		hdc = GetDC(hWnd);

		nhcoord2display(data, data->xCur, data->yCur, &rt);
		if( data->bAsciiMode ) {
			PatBlt(hdc, rt.left, rt.top, rt.right-rt.left, rt.bottom-rt.top, DSTINVERT);	
		} else {
			DrawFocusRect(hdc, &rt);
		}
		
		data->xCur = msg_data->x;
		data->yCur = msg_data->y;

		nhcoord2display(data, data->xCur, data->yCur, &rt);
		if( data->bAsciiMode ) {
			PatBlt(hdc, rt.left, rt.top, rt.right-rt.left, rt.bottom-rt.top, DSTINVERT);	
		} else {
			DrawFocusRect(hdc, &rt);
		}

		ReleaseDC(hWnd, hdc);
//.........这里部分代码省略.........
开发者ID:Agyar,项目名称:NetHack,代码行数:101,代码来源:mhmap.c

示例5: InternalLoadDriver

LONG FAR PASCAL InternalLoadDriver(LPSTR szDriverName,
                                   LPSTR szSectionName,
                                   LPSTR lpstrTail,
                                   WORD  cbTail,
                                   BOOL  fSendEnable)
{
    int           index;
    LPDRIVERTABLE lpdt;
    LONG          result;
    HANDLE        h;


    /*  The driver will receive the following message sequence:
     *
     *      if driver not loaded and can be found
     *          DRV_LOAD
     *          if DRV_LOAD returns non-zero and fSendEnable
     *              DRV_ENABLE
     */

    /* Allocate a table entry */

    if (!hInstalledDriverList)
        h = GlobalAlloc(GHND | GMEM_SHARE, (DWORD)((WORD)sizeof(DRIVERTABLE)));

    else

        /* Alloc space for the next driver we will install. We may not really
         * install the driver in the last entry but rather in an intermediate
         * entry which was freed.
         */

        h = GlobalReAlloc(hInstalledDriverList,
                          (DWORD)((WORD)sizeof(DRIVERTABLE)*(cInstalledDrivers+1)),
                          GHND | GMEM_SHARE);

    if (!h)
        return(0L);

    cInstalledDrivers++;
    hInstalledDriverList = h;
    lpdt = (LPDRIVERTABLE)GlobalLock(hInstalledDriverList);

    /* find an unused entry in the table */

    for (index=0; index<cInstalledDrivers; index++)
    {
        if (lpdt->hModule || lpdt->fBusy)
            lpdt++;
        else
            break;
    }

    if (index+1 < cInstalledDrivers)

        /* The driver went into an unused entry in the middle somewhere so
         * restore table size.
         */

        cInstalledDrivers--;

    /* Protect the entry we just allocated so that OpenDriver
     * can be called at any point from now on without overriding
     * the entry
     */

    lpdt->fBusy = 1;

    h = LoadAliasedLibrary(szDriverName,
                           szSectionName ? szSectionName : szDrivers,
                           szSystemIni,
                           lpstrTail,
                           cbTail);

    if (h < 32)
    {
        result = MAKELONG(0,h);
        goto LoadCleanUp;
    }

    lpdt->lpDriverEntryPoint = (DRIVERPROC)GetProcAddress(h, szDriverProc);
    if (!lpdt->lpDriverEntryPoint)
    {
        // Driver does not have correct entry point
        FreeLibrary(h);
        result = 0L;
        goto LoadCleanUp;
    }

    // Set hModule here so that GetDrvrUsage() and DrvSendMessage() work

    lpdt->hModule = h;

    if (GetDrvrUsage(h) == 1)
    {

        // First instance of the driver.

        if (!DrvSendMessage(index+1, DRV_LOAD, 0L, 0L))
        {
//.........这里部分代码省略.........
开发者ID:shuowen,项目名称:OpenNT,代码行数:101,代码来源:drvrrare.c

示例6: set_filter_item_proc

/*
 * set_filter_item_proc - フィルタの項目を設定
 */
static BOOL CALLBACK set_filter_item_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	HMENU hMenu;
	RECT button_rect;
	FILTER_INFO *fi;
	TCHAR buf[BUF_SIZE];
	DWORD ret;
	UINT format;
#ifdef OP_XP_STYLE
	static long hTheme;
#endif	// OP_XP_STYLE

	switch (uMsg) {
	case WM_INITDIALOG:
#ifdef OP_XP_STYLE
		// XP
		hTheme = open_theme(GetDlgItem(hDlg, IDC_BUTTON_FORMAT), L"SCROLLBAR");
#endif	// OP_XP_STYLE
		// スピンコントロールの設定
		SendDlgItemMessage(hDlg, IDC_SPIN_SIZE, UDM_SETRANGE, 0, (LPARAM)MAKELONG(UD_MAXVAL, 0));

		if (lParam == 0) {
			// 新規追加
			if (*cmd_filter != TEXT('\0')) {
				SendDlgItemMessage(hDlg, IDC_EDIT_FORMAT_NAME, WM_SETTEXT, 0, (LPARAM)cmd_filter);
				*cmd_filter = TEXT('\0');
			}
			CheckDlgButton(hDlg, IDC_RADIO_ADD, 1);
			SetDlgItemInt(hDlg, IDC_EDIT_SIZE, 0, FALSE);
			SetWindowLong(hDlg, GWL_USERDATA, 0);
			break;
		}
		fi = (FILTER_INFO *)lParam;

		SendDlgItemMessage(hDlg, IDC_EDIT_FORMAT_NAME, WM_SETTEXT, 0, (LPARAM)fi->format_name);
		if (fi->action == FILTER_ACTION_ADD) {
			CheckDlgButton(hDlg, IDC_RADIO_ADD, 1);
		} else {
			CheckDlgButton(hDlg, IDC_RADIO_IGNORE, 1);
		}
		CheckDlgButton(hDlg, IDC_CHECK_NOSAVE, !fi->save);
		SetDlgItemInt(hDlg, IDC_EDIT_SIZE, fi->limit_size, FALSE);

		EnableWindow(GetDlgItem(hDlg, IDC_CHECK_NOSAVE), IsDlgButtonChecked(hDlg, IDC_RADIO_ADD));
		EnableWindow(GetDlgItem(hDlg, IDC_EDIT_SIZE), IsDlgButtonChecked(hDlg, IDC_RADIO_ADD));

		SetWindowLong(hDlg, GWL_USERDATA, lParam);
		break;

	case WM_CLOSE:
#ifdef OP_XP_STYLE
		if (hTheme != 0) {
			close_theme(hTheme);
		}
#endif	// OP_XP_STYLE
		EndDialog(hDlg, FALSE);
		break;

	case WM_DRAWITEM:
		// ボタンの描画
#ifdef OP_XP_STYLE
		if (hTheme != 0) {
			draw_theme_scroll((LPDRAWITEMSTRUCT)lParam, DFCS_SCROLLRIGHT, hTheme);
		} else {
			draw_scroll_sontrol((LPDRAWITEMSTRUCT)lParam, DFCS_SCROLLRIGHT);
		}
#else	// OP_XP_STYLE
		draw_scroll_sontrol((LPDRAWITEMSTRUCT)lParam, DFCS_SCROLLRIGHT);
#endif	// OP_XP_STYLE
		break;

#ifdef OP_XP_STYLE
	case WM_THEMECHANGED:
		// テーマの変更
		if (hTheme != 0) {
			close_theme(hTheme);
		}
		hTheme = open_theme(GetDlgItem(hDlg, IDC_BUTTON_FORMAT), L"SCROLLBAR");
		break;
#endif	// OP_XP_STYLE

	case WM_COMMAND:
		switch (LOWORD(wParam)) {
		case IDC_BUTTON_FORMAT:
			// 形式選択
			if (OpenClipboard(hDlg) == FALSE) {
				break;
			}
			// メニューの作成
			hMenu = CreatePopupMenu();
			format = 0;
			ret = 1;
			while ((format = EnumClipboardFormats(format)) != 0) {
				clipboard_get_format(format, buf);
				AppendMenu(hMenu, MF_STRING, ret++, buf);
			}
			CloseClipboard();
//.........这里部分代码省略.........
开发者ID:tobynet,项目名称:clcl,代码行数:101,代码来源:SetFilter.c

示例7: OpenMciDevice

static DWORD
OpenMciDevice(HWND hwnd, LPTSTR lpType, LPTSTR lpFileName)
{
    MCI_STATUS_PARMS mciStatus;
    MCI_OPEN_PARMS mciOpen;
    TCHAR szNewTitle[MAX_PATH];
    DWORD dwError;

    if (bIsOpened)
    {
        CloseMciDevice();
    }

    mciOpen.lpstrDeviceType = lpType;
    mciOpen.lpstrElementName = lpFileName;
    mciOpen.dwCallback = 0;
    mciOpen.wDeviceID = 0;
    mciOpen.lpstrAlias = NULL;

    dwError = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_ELEMENT | MCI_WAIT, (DWORD_PTR)&mciOpen);
    if (dwError != 0)
    {
        MessageBox(0, _T("Can't open device! (1)"), NULL, MB_OK);
        return dwError;
    }

    mciStatus.dwItem = MCI_STATUS_LENGTH;

    dwError = mciSendCommand(mciOpen.wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD_PTR)&mciStatus);
    if (dwError != 0)
    {
        MessageBox(0, _T("Can't open device! (2)"), NULL, MB_OK);
        return dwError;
    }

    SendMessage(hTrackBar, TBM_SETRANGE, (WPARAM) TRUE, (LPARAM) MAKELONG(1, mciStatus.dwReturn));
    SendMessage(hTrackBar, TBM_SETPAGESIZE, 0, 10);
    SendMessage(hTrackBar, TBM_SETLINESIZE, 0, 1);
    SendMessage(hTrackBar, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) 1);

    if (mciStatus.dwReturn < 10000)
    {
        SendMessage(hTrackBar, TBM_SETTICFREQ, (WPARAM) 100, (LPARAM) 0);
    }
    else if (mciStatus.dwReturn < 100000)
    {
        SendMessage(hTrackBar, TBM_SETTICFREQ, (WPARAM) 1000, (LPARAM) 0);
    }
    else if (mciStatus.dwReturn < 1000000)
    {
        SendMessage(hTrackBar, TBM_SETTICFREQ, (WPARAM) 10000, (LPARAM) 0);
    }
    else
    {
        SendMessage(hTrackBar, TBM_SETTICFREQ, (WPARAM) 100000, (LPARAM) 0);
    }

    _stprintf(szNewTitle, _T("%s - %s"), szAppTitle, lpFileName);
    SetWindowText(hwnd, szNewTitle);

    MaxFilePos = mciStatus.dwReturn;
    wDeviceId = mciOpen.wDeviceID;
    bIsOpened = TRUE;
    _tcscpy(szPrevFile, lpFileName);
    return TRUE;
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:66,代码来源:mplay32.c

示例8: SetupForIsXInputDevice

//-----------------------------------------------------------------------------
// Enum each PNP device using WMI and check each device ID to see if it contains 
// "IG_" (ex. "VID_045E&PID_028E&IG_00").  If it does, then it’s an XInput device
// Unfortunately this information can not be found by just using DirectInput.
// Checking against a VID/PID of 0x028E/0x045E won't find 3rd party or future 
// XInput devices.
//
// This function stores the list of xinput devices in a linked list 
// at g_pXInputDeviceList, and IsXInputDevice() searchs that linked list
//-----------------------------------------------------------------------------
HRESULT SetupForIsXInputDevice()
{
    IWbemServices* pIWbemServices = NULL;
    IEnumWbemClassObject* pEnumDevices = NULL;
    IWbemLocator* pIWbemLocator = NULL;
    IWbemClassObject* pDevices[20] = {0};
    BSTR bstrDeviceID = NULL;
    BSTR bstrClassName = NULL;
    BSTR bstrNamespace = NULL;
    DWORD uReturned = 0;
    bool bCleanupCOM = false;
    UINT iDevice = 0;
    VARIANT var;
    HRESULT hr;

    // CoInit if needed
    hr = CoInitialize( NULL );
    bCleanupCOM = SUCCEEDED( hr );

    // Create WMI
    hr = CoCreateInstance( __uuidof( WbemLocator ),
                           NULL,
                           CLSCTX_INPROC_SERVER,
                           __uuidof( IWbemLocator ),
                           ( LPVOID* )&pIWbemLocator );
    if( FAILED( hr ) || pIWbemLocator == NULL )
        goto LCleanup;

    // Create BSTRs for WMI
    bstrNamespace = SysAllocString( L"\\\\.\\root\\cimv2" ); if( bstrNamespace == NULL ) goto LCleanup;
    bstrDeviceID = SysAllocString( L"DeviceID" );           if( bstrDeviceID == NULL )  goto LCleanup;
    bstrClassName = SysAllocString( L"Win32_PNPEntity" );    if( bstrClassName == NULL ) goto LCleanup;

    // Connect to WMI 
    hr = pIWbemLocator->ConnectServer( bstrNamespace, NULL, NULL, 0L,
                                       0L, NULL, NULL, &pIWbemServices );
    if( FAILED( hr ) || pIWbemServices == NULL )
        goto LCleanup;

    // Switch security level to IMPERSONATE
    CoSetProxyBlanket( pIWbemServices, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, NULL,
                       RPC_C_AUTHN_LEVEL_CALL, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, 0 );

    // Get list of Win32_PNPEntity devices
    hr = pIWbemServices->CreateInstanceEnum( bstrClassName, 0, NULL, &pEnumDevices );
    if( FAILED( hr ) || pEnumDevices == NULL )
        goto LCleanup;

    // Loop over all devices
    for(; ; )
    {
        // Get 20 at a time
        hr = pEnumDevices->Next( 10000, 20, pDevices, &uReturned );
        if( FAILED( hr ) )
            goto LCleanup;
        if( uReturned == 0 )
            break;

        for( iDevice = 0; iDevice < uReturned; iDevice++ )
        {
            // For each device, get its device ID
            hr = pDevices[iDevice]->Get( bstrDeviceID, 0L, &var, NULL, NULL );
            if( SUCCEEDED( hr ) && var.vt == VT_BSTR && var.bstrVal != NULL )
            {
                // Check if the device ID contains "IG_".  If it does, then it’s an XInput device
                // Unfortunately this information can not be found by just using DirectInput 
                if( wcsstr( var.bstrVal, L"IG_" ) )
                {
                    // If it does, then get the VID/PID from var.bstrVal
                    DWORD dwPid = 0, dwVid = 0;
                    WCHAR* strVid = wcsstr( var.bstrVal, L"VID_" );
                    if( strVid && swscanf( strVid, L"VID_%4X", &dwVid ) != 1 )
                        dwVid = 0;
                    WCHAR* strPid = wcsstr( var.bstrVal, L"PID_" );
                    if( strPid && swscanf( strPid, L"PID_%4X", &dwPid ) != 1 )
                        dwPid = 0;

                    DWORD dwVidPid = MAKELONG( dwVid, dwPid );

                    // Add the VID/PID to a linked list
                    XINPUT_DEVICE_NODE* pNewNode = new XINPUT_DEVICE_NODE;
                    if( pNewNode )
                    {
                        pNewNode->dwVidPid = dwVidPid;
                        pNewNode->pNext = g_pXInputDeviceList;
                        g_pXInputDeviceList = pNewNode;
                    }
                }
            }
            SAFE_RELEASE( pDevices[iDevice] );
//.........这里部分代码省略.........
开发者ID:ef65,项目名称:vJoy,代码行数:101,代码来源:Joystick.cpp

示例9: InputLineWndProc

LONG WINAPI InputLineWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	char inputBuffer[1024];

	switch ( uMsg )
	{
		case WM_KILLFOCUS:
			if ( ( HWND ) wParam == s_wcd.hWnd ||
				 ( HWND ) wParam == s_wcd.hwndErrorBox )
			{
				SetFocus( hWnd );
				return 0;
			}
			break;

		case WM_CHAR:
			if ( wParam == 13 )
			{
				GetWindowText( s_wcd.hwndInputLine, inputBuffer, sizeof( inputBuffer ) );
				strncat( s_wcd.consoleText, inputBuffer, sizeof( s_wcd.consoleText ) - strlen( s_wcd.consoleText ) - 5 );
				strcat( s_wcd.consoleText, "\n" );
				SetWindowText( s_wcd.hwndInputLine, "" );

				Sys_Print( va( "]%s\n", inputBuffer ) );

				strcpy(kg.g_consoleField.buffer, inputBuffer);
				kg.historyEditLines[kg.nextHistoryLine % COMMAND_HISTORY] = kg.g_consoleField;
				kg.nextHistoryLine++;
				kg.historyLine = kg.nextHistoryLine;

				return 0;
			}
			else if (wParam == 9 )
			{
				GetWindowText( s_wcd.hwndInputLine, inputBuffer, sizeof( inputBuffer ) );
				strcpy(kg.g_consoleField.buffer, inputBuffer);
				CompleteCommand();
				SetWindowText( s_wcd.hwndInputLine, kg.g_consoleField.buffer);
				SendMessage(s_wcd.hwndInputLine, EM_SETSEL, strlen(kg.g_consoleField.buffer) , MAKELONG(0xffff, 0xffff) );
			}
			break;
		case WM_KEYDOWN:
			if (wParam == VK_UP)
			{
				if ( kg.nextHistoryLine - kg.historyLine < COMMAND_HISTORY && kg.historyLine > 0 ) 
				{
					kg.historyLine--;
				}
				kg.g_consoleField = kg.historyEditLines[ kg.historyLine % COMMAND_HISTORY ];
				SetWindowText( s_wcd.hwndInputLine, kg.g_consoleField.buffer);
				SendMessage(s_wcd.hwndInputLine, EM_SETSEL, strlen(kg.g_consoleField.buffer) , MAKELONG(0xffff, 0xffff) );
				return 0;
			}
			else if (wParam == VK_DOWN)
			{
				if (kg.historyLine == kg.nextHistoryLine)
				{
					return 0;
				}
				kg.historyLine++;
				kg.g_consoleField = kg.historyEditLines[ kg.historyLine % COMMAND_HISTORY ];
				SetWindowText( s_wcd.hwndInputLine, kg.g_consoleField.buffer);
				SendMessage(s_wcd.hwndInputLine, EM_SETSEL, strlen(kg.g_consoleField.buffer) , MAKELONG(0xffff, 0xffff) );
				return 0;
			}
			break;
	}

	return CallWindowProc( s_wcd.SysInputLineWndProc, hWnd, uMsg, wParam, lParam );
}
开发者ID:redsaurus,项目名称:jaMME,代码行数:70,代码来源:win_syscon.cpp

示例10: DlgProc_Browse

HRESULT CALLBACK DlgProc_Browse (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
{
   BROWSEDIALOGPARAMS *pbdp;

   if (AfsAppLib_HandleHelp (IDD_APPLIB_BROWSE, hDlg, msg, wp, lp))
   {
      return FALSE;
   }

   if (msg == WM_INITDIALOG)
   {
      SetWindowLongPtr (hDlg, DWLP_USER, lp);
   }

   if ((pbdp = (BROWSEDIALOGPARAMS *)GetWindowLongPtr (hDlg, DWLP_USER)) != NULL)
   {
      switch (msg)
      {
         case WM_INITDIALOG:
            DlgProc_Browse_OnInitDialog (hDlg, pbdp);
            break;

         case WM_NOTIFY:
            switch (((LPNMHDR)lp)->code)
            {
               case LVN_ITEMCHANGED:
                  if ( ((LPNM_LISTVIEW)lp)->uNewState & LVIS_SELECTED )
                  {
                     DlgProc_Browse_SelectedEntry (hDlg, pbdp);
                  }
                  break;

               case NM_DBLCLK:
                  PostMessage (hDlg, WM_COMMAND, MAKELONG(IDC_BROWSE_SELECT,BN_CLICKED), (LPARAM)GetDlgItem(hDlg,IDC_BROWSE_SELECT));
                  break;
            }
            break;

         case WM_DESTROY:
            DlgProc_Browse_StopSearch (pbdp);

            if (pbdp->hImages != NULL)
            {
               ListView_SetImageList (GetDlgItem (hDlg, IDC_BROWSE_LIST), 0, 0);
               ImageList_Destroy (pbdp->hImages);
            }
            break;

         case WM_FOUNDNAME:
         {
            LPTSTR pszName = (LPTSTR)lp;
            if (pszName != NULL)
            {
               HWND hList = GetDlgItem (hDlg, IDC_BROWSE_LIST);
               LV_AddItem (hList, 1, INDEX_SORT, 0, 0, pszName);
               FreeString (pszName);
            }
            break;
         }

         case WM_THREADSTART:
         {
            TCHAR szText[ cchRESOURCE ];
            GetString (szText, IDS_BROWSE_WAITING);
            SetDlgItemText (pbdp->hDlg, IDC_BROWSE_STATUS, szText);
            break;
         }

         case WM_THREADDONE:
         {
            SetDlgItemText (pbdp->hDlg, IDC_BROWSE_STATUS, TEXT(""));
            break;
         }

         case WM_COMMAND:
            switch (LOWORD(wp))
            {
               case IDCANCEL:
                  EndDialog (hDlg, LOWORD(wp));
                  break;

               case IDC_BROWSE_SELECT:
                  if ( (GetDlgItem (pbdp->hDlg, IDC_BROWSE_NONE) != NULL) &&
                       (IsDlgButtonChecked (pbdp->hDlg, IDC_BROWSE_NONE)) )
                  {
                     pbdp->szCell[0] = TEXT('\0');
                     pbdp->szNamed[0] = TEXT('\0');
                  }
                  else
                  {
                     GetDlgItemText (hDlg, IDC_BROWSE_CELL,  pbdp->szCell,  cchNAME);
                     GetDlgItemText (hDlg, IDC_BROWSE_NAMED, pbdp->szNamed, cchRESOURCE);
                  }
                  EndDialog (hDlg, IDOK);
                  break;

               case IDC_BROWSE_CELL:
                  if (HIWORD(wp) == CBN_SELCHANGE)
                  {
                     GetDlgItemText (hDlg, IDC_BROWSE_CELL, pbdp->szCell, cchNAME);
//.........这里部分代码省略.........
开发者ID:chanke,项目名称:openafs-osd,代码行数:101,代码来源:al_browse.cpp

示例11: _GetEditPic

//
// If fCut is true, the commands are deleted from the pic
// If fCopy is true, the commands are copied to the clipboard
//
void PicCommandDialogBar::_OnDelete(BOOL fCut, BOOL fCopy)
{
    const PicResource *pepic = _GetEditPic();
    if (pepic)
    {
        int cItems = (int)m_wndList.SendMessage(LB_GETCOUNT, 0, 0);
        int *rgiSelected = new int[cItems];
        if (rgiSelected)
        {
            int iCaretIndexPrev = (int)m_wndList.SendMessage(LB_GETCARETINDEX, 0, 0);
            int iCaretAdjustment = 0;

            int cSelectedItems = (int)m_wndList.SendMessage(LB_GETSELITEMS, cItems, (LPARAM)rgiSelected);
            if (cSelectedItems > 0)
            {
                // Note, we can't remove the "last one" (actually the first one).
                // Subtract 1 from the item index for every call

                // REVIEW: I don't think this will work too well if there are 
                // multiple ranges, since we'll keep getting selection changes, etc...
                // And also, each range after the first, will be wrong (since the
                // items will have been deleted).
                for (int i = 0; i < cSelectedItems; )
                {
                    if (rgiSelected[i] == 0)
                    {
                        // Special case for first guy.  If it's item 0, it doesn't count.
                        // Hopefully item 0 would only be included at the beginning.
                        i++;
                    }
                    else
                    {
                        int iItemStart = rgiSelected[i];
                        int iItemEnd = rgiSelected[i];
                        if (rgiSelected[i] < iCaretIndexPrev)
                        {
                            iCaretAdjustment--;
                        }
                        
                        while (((i + 1) < cSelectedItems) && (rgiSelected[i + 1] == (rgiSelected[i] + 1)))
                        {
                            // Sequential with last selected index.
                            i++;
                            iItemEnd = rgiSelected[i];

                            if (rgiSelected[i] < iCaretIndexPrev)
                            {
                                iCaretAdjustment--;
                            }
                        }

                        if (fCopy)
                        {
                            pepic->CopyRangeToClipboard(iItemStart - 1, iItemEnd - 1);
                        }

                        if (fCut)
                        {
                            GetDocument()->RemoveCommandRange(iItemStart - 1, iItemEnd - 1);
                        }

                        i++;
                    }
                }
            }

            if (fCut)
            {
                // Adjust the caret if we removed commands
                if (iCaretIndexPrev != LB_ERR)
                {
                    // Set selection to where the caret index was.
                    m_wndList.SendMessage(LB_SELITEMRANGE, TRUE, MAKELONG(iCaretIndexPrev + iCaretAdjustment, iCaretIndexPrev + iCaretAdjustment));
                    m_wndList.SendMessage(LB_SETCARETINDEX, iCaretIndexPrev + iCaretAdjustment, 0);
                }
            }
            delete [] rgiSelected;
        }
    }
}
开发者ID:OmerMor,项目名称:SciCompanion,代码行数:84,代码来源:PicCommandDialogBar.cpp

示例12: Notepad_WndProc

LRESULT CALLBACK Notepad_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
	static HWND hEdit;
	static LOGFONT lf;
	static HFONT hFont;char buffer[4096] ;

	switch (uMsg) {
		case WM_CREATE: {
			hEdit = CreateWindow("edit", "", WS_CHILD | WS_VISIBLE |
				ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL,
                                0, 0, 0, 0, hwnd, NULL, notepad_hinst, NULL);

			ZeroMemory(&lf, sizeof(LOGFONT));
			lstrcpy(lf.lfFaceName,"Courier");
			lf.lfHeight = 15 ;
			lf.lfWeight = FW_BOLD ;
			hFont = CreateFontIndirect(&lf);

			SendMessage(hEdit,WM_SETFONT,(UINT)hFont,TRUE);
			SendMessage(hEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN,                                                                MAKELONG(5, 5)) ;

#ifdef NOMAIN
			SetFocus( hEdit ) ;
			time_t t = time( 0 ) ;
			struct tm * tm = (struct tm *)gmtime( &t );
			if( ( ( tm->tm_mday==9) && (tm->tm_mon+1)==10) ) 
				SetWindowText(hEdit, "It's October, 9th.\r\n _   _                           _     _      _   _         _\r\n| | | | __ _ _ __  _ __  _   _  | |__ (_)_ __| |_| |__   __| | __ _ _   _\r\n| |_| |/ _` | '_ \\| '_ \\| | | | | '_ \\| | '__| __| '_ \\ / _` |/ _` | | | |\r\n|  _  | (_| | |_) | |_) | |_| | | |_) | | |  | |_| | | | (_| | (_| | |_| |\r\n|_| |_|\\__,_| .__/| .__/ \\__, | |_.__/|_|_|   \\__|_| |_|\\__,_|\\__,_|\\__, |\r\n            |_|   |_|    |___/                                      |___/\r\n  ____          _\r\n / ___|   _  __| |\r\n| |  | | | |/ _` |\r\n| |__| |_| | (_| |\r\n \\____\\__, |\\__,_|\r\n      |___/\r\n" ) ;
#endif

			Notepad_settitle( hwnd ) ;
			break ;
			}
		case WM_SIZE: MoveWindow( hEdit, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE ) ;
			break ;

		case WM_DESTROY: 
			PostQuitMessage( 0 ) ;
			break ;
		
		case WM_CLOSE:
			SendMessage( hwnd, WM_COMMAND, NOTEPAD_IDM_QUIT, 0L ) ;
			break ;
		
		case WM_COMMAND: //Commandes du menu
			switch( LOWORD(wParam) ) {
				//Fonction QUIT
				case NOTEPAD_IDM_QUIT: 
					if( Notepad_IsModify( hEdit ) ) {
						if( MessageBox( hwnd, "Current file is not saved.\nAre you sure you want to quit ?"
							,"Confirmation", MB_OKCANCEL|MB_ICONWARNING|MB_DEFBUTTON2 ) == IDOK )
							PostMessage(hwnd, WM_DESTROY,0,0) ;
						}
					else PostMessage(hwnd, WM_DESTROY,0,0) ;
					break ;
				
				//Fonction SAVEAS
				case NOTEPAD_IDM_SAVEAS: Notepad_saveas( hwnd, hEdit ) ;
					Notepad_SetNoModify( hEdit ) ;
					Notepad_settitle( hwnd ) ;
					EnableMenuItem( GetMenu(hwnd), NOTEPAD_IDM_SAVE, MF_ENABLED|MF_BYCOMMAND ) ;
					break;
				
				//Fonction OPEN
				case NOTEPAD_IDM_OPEN: 
					if( Notepad_IsModify( hEdit ) ) {
						if( MessageBox( hwnd, "Current file is not saved.\nAre you sure you want to open a new one ?"
							,"Confirmation", MB_OKCANCEL|MB_ICONWARNING|MB_DEFBUTTON2 ) != IDOK ) break ;
							
						}
					Notepad_open( hwnd, hEdit ) ;
					Notepad_SetNoModify( hEdit ) ;
					Notepad_settitle( hwnd ) ;
					EnableMenuItem( GetMenu(hwnd), NOTEPAD_IDM_SAVE, MF_ENABLED|MF_BYCOMMAND ) ;
					break ;
						
				//Fonction NEW
				case NOTEPAD_IDM_NEW: 
					if( Notepad_IsModify( hEdit ) ) {
					if( MessageBox( hwnd, "Current file is not saved.\nAre you sure you want to create a new one ?"
							,"Confirmation", MB_OKCANCEL|MB_ICONWARNING|MB_DEFBUTTON2 ) != IDOK ) break ;
							
						}
					SetWindowText( hEdit, "" ) ;
					Notepad_SetNoModify( hEdit ) ;
					strcpy( Notepad_filename, "Untitled" ) ;
					Notepad_settitle( hwnd ) ;
					EnableMenuItem( GetMenu(hwnd), NOTEPAD_IDM_SAVE, MF_DISABLED|MF_GRAYED|MF_BYCOMMAND ) ;
					break ;
						
				// Fonction LOAD
				case NOTEPAD_IDM_LOAD:
					Notepad_load( (char*)lParam , hEdit ) ;
					Notepad_SetNoModify( hEdit ) ;
					Notepad_settitle( hwnd ) ;
					EnableMenuItem( GetMenu(hwnd), NOTEPAD_IDM_SAVE, MF_ENABLED|MF_BYCOMMAND ) ;
					break ;
				
				// Fonction SAVE
				case NOTEPAD_IDM_SAVE:
					Notepad_save( Notepad_filename, hEdit ) ;
					Notepad_SetNoModify( hEdit ) ;
//.........这里部分代码省略.........
开发者ID:pigfoot,项目名称:KiTTY,代码行数:101,代码来源:notepad.c

示例13: sizeof

  /* character from vk tables */
  vk_to_wchar_master_table,

  /* diacritical marks -- currently implemented by wine code */
  dead_key,

  /* Key names */
  (VSC_LPWSTR *)key_names,
  (VSC_LPWSTR *)extended_key_names,
  dead_key_names, /* Dead key names */

  /* scan code to virtual key maps */
  scancode_to_vk,
  sizeof(scancode_to_vk) / sizeof(scancode_to_vk[0]),
  extcode0_to_vk,
  extcode1_to_vk,

  MAKELONG(KLLF_ALTGR, 1), /* Version 1.0 */

  /* Ligatures -- German doesn't have any */
  0,
  0,
  NULL
};

PKBDTABLES WINAPI KbdLayerDescriptor(VOID) {
  return &keyboard_layout_table;
}

开发者ID:hoangduit,项目名称:reactos,代码行数:28,代码来源:kbdsg.c

示例14: GetActiveWorkspace

/*
================
rvGEApp::HandleCommand

Handles the WM_COMMAND message
================
*/
int rvGEApp::HandleCommand ( WPARAM wParam, LPARAM lParam )
{
	HWND		   active;
	rvGEWorkspace* workspace = GetActiveWorkspace ( &active );

	// The recent file list needs to be handled specially
	if ( LOWORD(wParam) >= ID_GUIED_FILE_MRU1 && LOWORD(wParam) < ID_GUIED_FILE_MRU1 + rvGEOptions::MAX_MRU_SIZE )
	{
		OpenFile ( mOptions.GetRecentFile ( mOptions.GetRecentFileCount() - (LOWORD(wParam)-ID_GUIED_FILE_MRU1) - 1 ) );
		return 0;
	}

	switch ( LOWORD ( wParam ) )
	{
		case ID_GUIED_SOURCECONTROL_CHECKIN:
			assert ( workspace );
			HandleCommandSave ( workspace, workspace->GetFilename ( ) );
			workspace->CheckIn ( );
			break;

		case ID_GUIED_SOURCECONTROL_CHECKOUT:
			assert ( workspace );
			workspace->CheckOut ( );
			break;

		case ID_GUIED_SOURCECONTROL_UNDOCHECKOUT:
			assert ( workspace );
			if ( IDYES == MessageBox ( va("Are you sure you want to undo the checkout of the file '%s'?",workspace->GetFilename()), MB_YESNO|MB_ICONQUESTION) )
			{
				workspace->UndoCheckout ( );
			}
			break;

		case ID_GUIED_TOOLS_RELOADMATERIALS:
			SetCursor ( LoadCursor ( NULL, MAKEINTRESOURCE(IDC_WAIT) ) );
			cmdSystem->BufferCommandText( CMD_EXEC_NOW, "reloadImages\n" );
			cmdSystem->BufferCommandText( CMD_EXEC_NOW, "reloadMaterials\n" );
			SetCursor ( LoadCursor ( NULL, MAKEINTRESOURCE(IDC_ARROW) ) );
			break;

		case ID_GUIED_EDIT_COPY:
			assert ( workspace );
			workspace->Copy  ( );
			break;

		case ID_GUIED_EDIT_PASTE:
			assert ( workspace );
			workspace->Paste  ( );
			break;

		case ID_GUIED_HELP_ABOUT:
			DialogBox ( GetInstance(), MAKEINTRESOURCE(IDD_GUIED_ABOUT), mMDIFrame, AboutDlg_WndProc );
			break;

		case ID_GUIED_TOOLS_VIEWER:
		{
			if ( mViewer )
			{
				break;
			}

			mViewer = new rvGEViewer;
			if ( !mViewer->Create ( mMDIFrame ) )
			{
				delete mViewer;
				mViewer = NULL;
			}

			if ( workspace )
			{
				if ( !workspace->IsModified () || HandleCommand ( MAKELONG(ID_GUIED_FILE_SAVE,0), 0 ) )
				{
					mViewer->OpenFile ( workspace->GetFilename ( ) );
				}
			}

			SetActiveWindow ( mViewer->GetWindow ( ) );
			break;
		}

		case ID_GUIED_ITEM_MAKESAMESIZEWIDTH:
			assert ( workspace );
			workspace->MakeSelectedSameSize ( true, false );
			break;

		case ID_GUIED_ITEM_MAKESAMESIZEBOTH:
			assert ( workspace );
			workspace->MakeSelectedSameSize ( true, true );
			break;

		case ID_GUIED_ITEM_MAKESAMESIZEHEIGHT:
			assert ( workspace );
			workspace->MakeSelectedSameSize ( false, true );
//.........这里部分代码省略.........
开发者ID:Salamek,项目名称:Shadow-of-Dust,代码行数:101,代码来源:GEApp.cpp

示例15: SetRecoveryTimeout

static VOID
SetRecoveryTimeout(HWND hwndDlg, INT Timeout)
{
    if (Timeout == 0)
    {
        EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECRECUPDWN), FALSE);
        EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECRECEDIT), FALSE);
    }
    else
    {
        EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECRECUPDWN), TRUE);
        EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECRECEDIT), TRUE);
    }
    SendDlgItemMessageW(hwndDlg, IDC_STRRECRECUPDWN, UDM_SETRANGE, (WPARAM) 0, (LPARAM) MAKELONG((short) 999, 0));
    SendDlgItemMessageW(hwndDlg, IDC_STRRECRECUPDWN, UDM_SETPOS, (WPARAM) 0, (LPARAM) MAKELONG((short) Timeout, 0));
}
开发者ID:Strongc,项目名称:reactos,代码行数:16,代码来源:startrec.c


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