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

C++ GetKeyName函数代码示例

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

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



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

示例1: GetAccelKeyName

CString GetAccelKeyName(DWORD dwShift, DWORD dwKeyCode)
{
	CString strText;

	if ((dwShift & 0x2) != 0)
	{
		strText += _T("Ctrl");
	}
	if ((dwShift & 0x4) != 0)
	{
		if (!strText.IsEmpty())
			strText += _T(" + ");
		strText += _T("Alt");
	}
	if ((dwShift & 0x1) != 0)
	{
		if (!strText.IsEmpty())
			strText += _T(" + ");
		strText += _T("Shift");
	}
	
	if (dwKeyCode != VK_CONTROL && dwKeyCode != VK_MENU && dwKeyCode != VK_SHIFT)
	{
		LPCTSTR pKeyName = GetKeyName(dwKeyCode);
		if (pKeyName != NULL)
		{
			if (!strText.IsEmpty())
				strText += _T(" + ");
			
			strText += GetKeyName(dwKeyCode);
		}
	}

	return strText;
}
开发者ID:JackWangCUMT,项目名称:SuperCxHMI,代码行数:35,代码来源:PopupFrame.cpp


示例2: MyListProc

LRESULT CALLBACK MyListProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	static TCHAR szText[1024];
	switch (msg)
	{
	case WM_CHAR:
		wsprintf(szText, TEXT("WM_CHAR %c"), (TCHAR)wParam);
		SendMessage(hList, LB_ADDSTRING, 0, (LONG_PTR)szText);
		break;
	case WM_KEYDOWN:
		wsprintf(szText, TEXT("WM_KEYDOWN %s"), GetKeyName(wParam));
		SendMessage(hList, LB_ADDSTRING, 0, (LONG_PTR)szText);
		break;
	case WM_KEYUP:
		wsprintf(szText, TEXT("WM_KEYUP %s"), GetKeyName(wParam));
		SendMessage(hList, LB_ADDSTRING, 0, (LONG_PTR)szText);
		break;
	case WM_SYSKEYDOWN:
		wsprintf(szText, TEXT("WM_SYSKEYDOWN %s"), GetKeyName(wParam));
		SendMessage(hList, LB_ADDSTRING, 0, (LONG_PTR)szText);
		break;
	case WM_SYSKEYUP:
		wsprintf(szText, TEXT("WM_SYSKEYUP %s"), GetKeyName(wParam));
		SendMessage(hList, LB_ADDSTRING, 0, (LONG_PTR)szText);
		break;
	default:
		break;
	}
	return CallWindowProc(DefaultListWndProc, hWnd, msg, wParam, lParam);
}
开发者ID:kenjinote,项目名称:KeyboardEvent,代码行数:30,代码来源:Source.cpp


示例3: hsRefCnt_SafeUnRef

void plObjectInVolumeDetector::ITrigger(plKey hitter, bool entering, bool immediate)
{
    hsRefCnt_SafeUnRef(fSavedActivatorMsg);
    fSavedActivatorMsg = new plActivatorMsg;
    fSavedActivatorMsg->AddReceivers(fReceivers);

    if (fProxyKey)
        fSavedActivatorMsg->fHiteeObj = fProxyKey;
    else
        fSavedActivatorMsg->fHiteeObj = GetTarget()->GetKey();

    fSavedActivatorMsg->fHitterObj = hitter;
    fSavedActivatorMsg->SetSender(GetKey());

    if (entering)
    {
        DetectorLog("%s: Saving Entering volume - Evals=%d", GetKeyName().c_str(), fNumEvals);
        fSavedActivatorMsg->SetTriggerType(plActivatorMsg::kVolumeEnter);
        fLastEnterEval = fNumEvals;
    }
    else
    {
        DetectorLog("%s: Saving Exiting volume - Evals=%d", GetKeyName().c_str(), fNumEvals);
        fSavedActivatorMsg->SetTriggerType(plActivatorMsg::kVolumeExit);
        fLastExitEval = fNumEvals;
    }

    if (immediate)
        ISendSavedTriggerMsgs();
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:30,代码来源:plCollisionDetector.cpp


示例4: OpenSubkey

LONG CRegistryKey::OpenSubkey(REGSAM samDesired, const TCHAR *pszSubkeyName, CRegistryKey &rKey)
{
  HKEY hKey;
  LONG nError = OpenSubkey(samDesired, pszSubkeyName, hKey);

  if (nError == ERROR_SUCCESS)
  {
    const TCHAR *pszKeyName = GetKeyName();
    size_t size = _tcslen(pszKeyName) + _tcslen(pszSubkeyName) + 1;
    TCHAR *pszSubkeyFullName = new (std::nothrow) TCHAR [size];
    if (!pszSubkeyFullName)
    {
      nError = RegCloseKey(hKey);
      ASSERT(nError == ERROR_SUCCESS);
      return ERROR_OUTOFMEMORY;
    }
    _tcscpy(pszSubkeyFullName,pszKeyName);
    _tcscat(pszSubkeyFullName,pszSubkeyName);
    HRESULT hr = rKey.Init(hKey,GetKeyName(),pszSubkeyName,samDesired);
    delete[] pszSubkeyName;
    if (FAILED(hr))
    {
      nError = RegCloseKey(hKey);
      ASSERT(nError == ERROR_SUCCESS);
      if (hr == (HRESULT)E_OUTOFMEMORY)
        return ERROR_OUTOFMEMORY;
      else
        return ERROR_INTERNAL_ERROR;
    }
  }

  return nError;
}
开发者ID:GYGit,项目名称:reactos,代码行数:33,代码来源:RegistryKey.cpp


示例5: DetectorLogRed

void plCameraRegionDetector::ITrigger(plKey hitter, bool entering, bool immediate)
{
    if (fSavingSendMsg)
        DetectorLogRed("%s: Stale messages on ITrigger. This should never happen!", GetKeyName().c_str());
    if (fIsInside && entering)
        DetectorLogRed("%s: Duplicate enter! Did we miss an exit?", GetKeyName().c_str());
    else if (!fIsInside && !entering)
        DetectorLogRed("%s: Duplicate exit! Did we miss an enter?", GetKeyName().c_str());

    fSavingSendMsg = true;
    fSavedMsgEnterFlag = entering;
    if (entering)
    {
        DetectorLog("%s: Saving camera Entering volume - Evals=%d", GetKeyName().c_str(),fNumEvals);
        fLastEnterEval = fNumEvals;
    }
    else
    {
        DetectorLog("%s: Saving camera Exiting volume - Evals=%d", GetKeyName().c_str(),fNumEvals);
        fLastExitEval = fNumEvals;
    }

    if (immediate)
        ISendSavedTriggerMsgs();
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:25,代码来源:plCollisionDetector.cpp


示例6: OnInitDlg

void OnInitDlg(HWND hDlg)
{
	LoadSettings();
	UpdateData(DIRECTION, BUTTON, SPEED);
	SetNumTimeReplay(REPLAYTIME);
	Button_SetCheck(GetDlgItem(hDlg, IDC_AUTORUN), AUTORUN);

	OldEditProc = (WNDPROC)GetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITRIGHT), GWLP_WNDPROC);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITRIGHT), GWLP_WNDPROC, (LONG_PTR)NewEditProc);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITLEFT), GWLP_WNDPROC, (LONG_PTR)NewEditProc);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITUP), GWLP_WNDPROC, (LONG_PTR)NewEditProc);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITDOWN), GWLP_WNDPROC, (LONG_PTR)NewEditProc);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITLBUTTON), GWLP_WNDPROC, (LONG_PTR)NewEditProc);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITRBUTTON), GWLP_WNDPROC, (LONG_PTR)NewEditProc);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITMBUTTON), GWLP_WNDPROC, (LONG_PTR)NewEditProc);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITWUP), GWLP_WNDPROC, (LONG_PTR)NewEditProc);
	SetWindowLongPtr(GetDlgItem(hDlg, IDC_EDITWDOWN), GWLP_WNDPROC, (LONG_PTR)NewEditProc);

	TCHAR buffer[100];
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITDOWN), GetKeyName(DIRECTION[DOWN], buffer));
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITUP), GetKeyName(DIRECTION[UP], buffer));
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITLEFT), GetKeyName(DIRECTION[LEFT], buffer));
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITRIGHT), GetKeyName(DIRECTION[RIGHT], buffer));
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITLBUTTON), GetKeyName(BUTTON[LBUTTON], buffer));
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITRBUTTON), GetKeyName(BUTTON[RBUTTON], buffer));
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITMBUTTON), GetKeyName(BUTTON[MBUTTON], buffer));
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITWUP), GetKeyName(BUTTON[WHEELUP], buffer));
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITWDOWN), GetKeyName(BUTTON[WHEELDOWN], buffer));

	_itow(SPEED, buffer, 10);
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITSPEED), buffer);
	_itow(REPLAYTIME, buffer, 10);
	Edit_SetText(GetDlgItem(hDlg, IDC_EDITREPLAY), buffer);
}
开发者ID:trunghai95,项目名称:Group6_G.3_LTWin,代码行数:34,代码来源:MainApp.cpp


示例7: DetectorLog

void plObjectInVolumeDetector::ISendSavedTriggerMsgs()
{
    if (fSavedActivatorMsg)
    {
        if (fSavedActivatorMsg->fTriggerType == plActivatorMsg::kVolumeEnter)
            DetectorLog("%s: Sending Entering volume - Evals=%d", GetKeyName().c_str(), fNumEvals);
        else
            DetectorLog("%s: Sending Exiting volume - Evals=%d", GetKeyName().c_str(), fNumEvals);

        // we're saving the message to be dispatched later...
        plgDispatch::MsgSend(fSavedActivatorMsg);
    }
    fSavedActivatorMsg = nil;
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:14,代码来源:plCollisionDetector.cpp


示例8: GetKeyName

void CPreferencesKeyboard::OnSelchangeKeydlgCmdlist() 
{
	m_Combo.ResetContent();
	m_Remove.EnableWindow(false);
	m_Edit.SetWindowText("");

	int Sel = m_List.GetCurSel();

	if (Sel == LB_ERR)
		return;

	LC_KEYBOARD_COMMAND& Cmd = KeyboardShortcuts[m_List.GetItemData(Sel)];

	// Update the combo box with the shortcuts for the current selection.
	if (Cmd.Key1)
	{
		CString str;

		if (Cmd.Flags & LC_KEYMOD1_SHIFT)
			str = "Shift+";

		if (Cmd.Flags & LC_KEYMOD1_CONTROL)
			str += "Ctrl+";

		str += GetKeyName(Cmd.Key1);

		m_Combo.AddString(str);
		m_Combo.SetCurSel(0);
		m_Remove.EnableWindow(true);

		if (Cmd.Key2)
		{
			str = "";

			if (Cmd.Flags & LC_KEYMOD2_SHIFT)
				str = "Shift+";

			if (Cmd.Flags & LC_KEYMOD2_CONTROL)
				str += "Ctrl+";

			str += GetKeyName(Cmd.Key2);

			m_Combo.AddString(str);
		}
	}

	m_Edit.EnableWindow(Cmd.Key2 == 0);
	m_Assign.EnableWindow((Cmd.Key2 == 0) && m_Edit.m_Key);
}
开发者ID:ldraw-linux,项目名称:leocad,代码行数:49,代码来源:Prefpage.cpp


示例9: plProfile_Inc

// Called after the simulation has run....sends new positions to the various scene objects
// *** want to do this in response to an update message....
void plPXPhysical::SendNewLocation(bool synchTransform, bool isSynchUpdate)
{
    // we only send if:
    // - the body is active or forceUpdate is on
    // - the mass is non-zero
    // - the physical is not passive
    bool bodyActive = !fActor->isSleeping();
    bool dynamic = fActor->isDynamic();
    
    if ((bodyActive || isSynchUpdate) && dynamic)// && fInitialTransform)
    {
        plProfile_Inc(MaySendLocation);

        if (!GetProperty(plSimulationInterface::kPassive))
        {
            hsMatrix44 curl2w = fCachedLocal2World;
            // we're going to cache the transform before sending so we can recognize if it comes back
            IGetTransformGlobal(fCachedLocal2World);

            if (!CompareMatrices(curl2w, fCachedLocal2World, .0001f))
            {
                plProfile_Inc(LocationsSent);
                plProfile_BeginLap(PhysicsUpdates, GetKeyName().c_str());

                // quick peek at the translation...last time it was corrupted because we applied a non-unit quaternion
//              hsAssert(real_finite(fCachedLocal2World.fMap[0][3]) &&
//                       real_finite(fCachedLocal2World.fMap[1][3]) &&
//                       real_finite(fCachedLocal2World.fMap[2][3]), "Bad transform outgoing");

                if (fCachedLocal2World.GetTranslate().fZ < kMaxNegativeZPos)
                {
                    SimLog("Physical %s fell to %.1f (%.1f is the max).  Suppressing.", GetKeyName().c_str(), fCachedLocal2World.GetTranslate().fZ, kMaxNegativeZPos);
                    // Since this has probably been falling for a while, and thus not getting any syncs,
                    // make sure to save it's current pos so we'll know to reset it later
                    DirtySynchState(kSDLPhysical, plSynchedObject::kBCastToClients);
                    IEnable(false);
                }

                hsMatrix44 w2l;
                fCachedLocal2World.GetInverse(&w2l);
                plCorrectionMsg *pCorrMsg = new plCorrectionMsg(GetObjectKey(), fCachedLocal2World, w2l, synchTransform);
                pCorrMsg->Send();
                if (fProxyGen)
                    fProxyGen->SetTransform(fCachedLocal2World, w2l);
                plProfile_EndLap(PhysicsUpdates, GetKeyName().c_str());
            }
        }
    }
}
开发者ID:branan,项目名称:Plasma-nobink,代码行数:51,代码来源:plPXPhysical.cpp


示例10: switch

const char*
ShortcutsSpec::GetCellText(int whichColumn) const
{
	const char* temp = ""; // default
	switch(whichColumn) {
		case KEY_COLUMN_INDEX:
		{
			if ((fKey > 0) && (fKey <= 0xFF)) {
				temp = GetKeyName(fKey);
				if (temp == NULL)
					temp = "";
			} else if (fKey > 0xFF) {
				sprintf(fScratch, "#%lx", fKey);
				return fScratch;
			}
			break;
		}

		case STRING_COLUMN_INDEX:
			temp = fCommand;
			break;

		default:
			if ((whichColumn >= 0) && (whichColumn < NUM_META_COLUMNS))
				temp = sMetaMaps[whichColumn].GetNthStateDesc(
							fMetaCellStateIndex[whichColumn]);
			break;
	}
	return temp;
}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:30,代码来源:ShortcutsSpec.cpp


示例11: GetKeyName

void plResponderModifier::Trigger(plNotifyMsg *msg)
{
#if 0
    plNetClientApp::GetInstance()->DebugMsg("RM: Responder {} is triggering, num cmds={}, enabled={}, curCmd={}, t={f}\n",
        GetKeyName(), fStates[fCurState].fCmds.GetCount(),
        fEnabled, fCurCommand, hsTimer::GetSysSeconds());
#endif

    // If we're not in the middle of sending, reset and start sending commands
    if (fCurCommand == int8_t(-1) && fEnabled)
    {
        ResponderLog(ILog(plStatusLog::kGreen, "Trigger"));

        fNotifyMsgFlags = msg->GetAllBCastFlags();
        fTriggerer = msg->GetSender();
        fPlayerKey = msg->GetAvatarKey();

        ISetResponderStateFromNotify(msg);

        proCollisionEventData *cEvent = (proCollisionEventData *)msg->FindEventRecord(proEventData::kCollision);
        fEnter = (cEvent ? cEvent->fEnter : false);

        fCompletedEvents.Reset();
        fCurCommand = 0;

        DirtySynchState(kSDLResponder, 0);

        IContinueSending();
    }
    else
    {
        ResponderLog(ILog(plStatusLog::kRed, "Rejected Trigger, %s", !fEnabled ? "responder disabled" : "responder is running"));
    }
}
开发者ID:H-uru,项目名称:Plasma,代码行数:34,代码来源:plResponderModifier.cpp


示例12: CopyKeyName

BOOL CopyKeyName(HWND hWnd, HKEY hRootKey, LPCWSTR keyName)
{
    BOOL bClipboardOpened = FALSE;
    BOOL bSuccess = FALSE;
    WCHAR szBuffer[512];
    HGLOBAL hGlobal;
    LPWSTR s;

    if (!OpenClipboard(hWnd))
        goto done;
    bClipboardOpened = TRUE;

    if (!EmptyClipboard())
        goto done;

    if (!GetKeyName(szBuffer, COUNT_OF(szBuffer), hRootKey, keyName))
        goto done;

    hGlobal = GlobalAlloc(GMEM_MOVEABLE, (wcslen(szBuffer) + 1) * sizeof(WCHAR));
    if (!hGlobal)
        goto done;

    s = GlobalLock(hGlobal);
    wcscpy(s, szBuffer);
    GlobalUnlock(hGlobal);

    SetClipboardData(CF_UNICODETEXT, hGlobal);
    bSuccess = TRUE;

done:
    if (bClipboardOpened)
        CloseClipboard();
    return bSuccess;
}
开发者ID:hoangduit,项目名称:reactos,代码行数:34,代码来源:framewnd.c


示例13: plProfile_BeginTiming

void plWin32StreamingSound::IStreamUpdate()
{
    if(!fReallyPlaying)
        return;

    if(hsTimer::GetMilliSeconds() - fLastStreamingUpdate < STREAMING_UPDATE_MS) // filter out update requests so we aren't doing this more that we need to 
        return;

    plProfile_BeginTiming( StreamSndShoveTime );
    if(fDSoundBuffer)
    {
        if(fDSoundBuffer->BuffersQueued() == 0 && fDataStream->NumBytesLeft() == 0 && !fDSoundBuffer->IsLooping())
        {
            // If we are fading out it's possible that we will hit this multiple times causing this sound to try and fade out multiple times, never allowing it to actually stop
            if(!fStopping)
            {
                fStopping = true;
                Stop();
                plProfile_EndTiming( StreamSndShoveTime );
            }
            return;
        }

        if(!fDSoundBuffer->StreamingFillBuffer(fDataStream))
        {
            plStatusLog::AddLineS("audio.log", "%s Streaming buffer fill failed", GetKeyName().c_str());
        }
    }
    plProfile_EndTiming( StreamSndShoveTime );
}
开发者ID:Asteral,项目名称:Plasma,代码行数:30,代码来源:plWin32StreamingSound.cpp


示例14: path

bool wxIniConfig::Read(const wxString& szKey, wxString *pstr,
                       const wxString& szDefault) const
{
    wxConfigPathChanger path(this, szKey);
    wxString strKey = GetPrivateKeyName(path.Name());

    wxChar szBuf[1024]; // @@ should dynamically allocate memory...

    // first look in the private INI file

    // NB: the lpDefault param to GetPrivateProfileString can't be NULL
    // GetPrivateProfileString(m_strGroup, strKey, "",
    //                         szBuf, WXSIZEOF(szBuf), m_strLocalFilename);
    if ( ::wxIsEmpty((PSZ)szBuf) )
    {
      // now look in win.ini
      wxString strKey = GetKeyName(path.Name());
      // GetProfileString(m_strGroup, strKey, "", szBuf, WXSIZEOF(szBuf));
    }

    if ( ::wxIsEmpty((PSZ)szBuf) )
    {
        *pstr = szDefault;
        return false;
    }
    else
    {
        *pstr = szBuf ;
        return true;
    }
}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:31,代码来源:iniconf.cpp


示例15: EndDialog

BOOL CKeyBoardSet::OnInitDialog()
{
	CTopAceDialog::OnInitDialog();

	// TODO:  在此添加额外的初始化
	if( !m_cfg.LoadCfg() )
	{
		EndDialog( IDCANCEL );
		return FALSE;
	}

	m_cList.SetExtendedStyle( m_cList.GetExtendedStyle() | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES );

	m_cList.InsertColumn( 0 , L"功能" , LVCFMT_LEFT , 100 );
	m_cList.InsertColumn( 1 , L"按键" , LVCFMT_LEFT , 100 );
	m_cList.SetRedraw( FALSE );

	for( int i = 0 ; i < E_GO_MAX ; ++i )
	{
		if( i != m_cList.InsertItem( i , m_cfg.GetItemName( EGameOperate(i) ) ) )
		{
			EndDialog( IDCANCEL );
			return FALSE;
		}

		m_cList.SetItemData( i , (DWORD_PTR)EGameOperate(i) );
		m_cList.SetItemText( i , 1 , GetKeyName(m_cfg.GetItemMapKey( EGameOperate(i) )) );
	}

	m_cList.SetRedraw( TRUE );

	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}
开发者ID:SHIYUENING,项目名称:topace,代码行数:34,代码来源:KeyBoardSet.cpp


示例16: DetectorLogSpecial

bool plExcludeRegionModifier::MsgReceive(plMessage* msg)
{
    plExcludeRegionMsg *exclMsg = plExcludeRegionMsg::ConvertNoRef(msg);
    if (exclMsg)
    {
        if (exclMsg->GetCmd() == plExcludeRegionMsg::kClear)
        {
            DetectorLogSpecial("Clearing exclude region %s", GetKeyName().c_str());
            IMoveAvatars();
            fContainedAvatars.Reset();
            ISetPhysicalState(true);
        }
        else if (exclMsg->GetCmd() == plExcludeRegionMsg::kRelease)
        {
            DetectorLogSpecial("Releasing exclude region %s", GetKeyName().c_str());
            ISetPhysicalState(false);
        }

        GetTarget()->DirtySynchState(kSDLXRegion, exclMsg->fSynchFlags);
    
        return true;
    }

    // Avatar entering or exiting our volume.  Only the owner of the SO logs this since
    // it does all the moving at clear time.
    plCollideMsg *collideMsg = plCollideMsg::ConvertNoRef(msg);
    
    if (collideMsg)
    {
        if (collideMsg->fEntering)
        {
            //DetectorLogSpecial("Avatar enter exclude region %s",GetKeyName().c_str());
            fContainedAvatars.Append(collideMsg->fOtherKey);
        }
        else
        {
            //DetectorLogSpecial("Avatar exit exclude region %s",GetKeyName().c_str());
            int idx = fContainedAvatars.Find(collideMsg->fOtherKey);
            if (idx != fContainedAvatars.kMissingIndex)
                fContainedAvatars.Remove(idx);
        }

        return true;
    }

    return plSingleModifier::MsgReceive(msg);
}
开发者ID:MultiShard,项目名称:Plasma,代码行数:47,代码来源:plExcludeRegionModifier.cpp


示例17: GetRegistryChanges

void GetRegistryChanges(HKEY hKey) 
{ 
    TCHAR    szKey[MAX_KEY_LENGTH];  
    DWORD    cbName;                  
    DWORD    cSubKeys=0;                    
    FILETIME ftWrite;      
    DWORD    i, ret; 
	HKEY     hNewKey;
	ULARGE_INTEGER tmWrite;
	TCHAR    szName[MAX_KEY_LENGTH];
 
    // get the number of subkeys 
    ret = RegQueryInfoKey(		// WinReg.h
        hKey,                   
        NULL, NULL, NULL,               
        &cSubKeys,              
        NULL, NULL, NULL, NULL, 
		NULL, NULL, NULL);      
    
    // for each subkey, see if it changed based on its
    // last write timestamp
    for (i=0; i<cSubKeys; i++) 
    { 
        cbName = MAX_KEY_LENGTH;

        ret = RegEnumKeyEx(		// WinReg.h
					hKey, i, szKey, &cbName, 
					NULL, NULL, NULL, &ftWrite); 

        if (ret == ERROR_SUCCESS) 
        {
			tmWrite.HighPart = ftWrite.dwHighDateTime;
			tmWrite.LowPart  = ftWrite.dwLowDateTime;

            // it changed if the last write is greater than 
            // our start time
			if (tmWrite.QuadPart > g_tmStart.QuadPart)
			{
				memset(szName, 0, sizeof(szName));
				GetKeyName(hKey, szName);

				_tcscat(szName, _T("\\"));	// 문자열 추가 strcat_s
				_tcscat(szName, szKey);
				
				if (!IsWhitelisted(szName)) { 
					Output(FOREGROUND_BLUE, _T("[REGISTRY] %s\n"), szName);
				}
			}

			ret = RegOpenKeyEx(hKey, szKey, 0, KEY_READ, &hNewKey);

			if (ret == ERROR_SUCCESS) 
			{ 
				GetRegistryChanges(hNewKey);
				RegCloseKey(hNewKey);
			}
		}
    }
}
开发者ID:WanJeongPark,项目名称:Pwanda,代码行数:59,代码来源:reg.cpp


示例18: plProfile_BeginLap

void hsGMaterial::Eval(double secs, uint32_t frame)
{
    plProfile_BeginLap(MaterialAnims, GetKeyName().c_str());

    int i;
    for( i = 0; i < GetNumLayers(); i++ )
    {
        if( fLayers[i] )
            fLayers[i]->Eval(secs, frame, 0);
    }
    for( i = 0; i < GetNumPiggyBacks(); i++ )
    {
        if( fPiggyBacks[i] )
            fPiggyBacks[i]->Eval(secs, frame, 0);
    }

    plProfile_EndLap(MaterialAnims, GetKeyName().c_str());
}
开发者ID:branan,项目名称:Plasma,代码行数:18,代码来源:hsGMaterial.cpp


示例19: GetTarget

void plObjectInVolumeAndFacingDetector::ICheckForTrigger()
{
    plArmatureMod* armMod = plAvatarMgr::GetInstance()->GetLocalAvatar();
    plSceneObject* avatar = armMod ? armMod->GetTarget(0) : nil;
    plSceneObject* target = GetTarget();

    if (armMod && target)
    {
        hsVector3 playerView = avatar->GetCoordinateInterface()->GetLocalToWorld().GetAxis(hsMatrix44::kView);
        hsVector3 objView = target->GetCoordinateInterface()->GetLocalToWorld().GetAxis(hsMatrix44::kView);

        playerView.Normalize();
        objView.Normalize();

        float dot = playerView * objView;
//      hsStatusMessageF("Dot: %f Tolerance: %f", dot, fFacingTolerance);
        bool facing = dot >= fFacingTolerance;

        bool movingForward = false;
        if (fNeedWalkingForward)
        {
            // And are we walking towards it?
            plArmatureBrain* abrain =  armMod->FindBrainByClass(plAvBrainHuman::Index()); //armMod->GetCurrentBrain();
            plAvBrainHuman* brain = plAvBrainHuman::ConvertNoRef(abrain);
            if (brain && brain->IsMovingForward() && brain->fWalkingStrategy->IsOnGround())
                movingForward = true;
        }
        else
            movingForward = true;

        if (facing && movingForward && !fTriggered)
        {
            DetectorLog("%s: Trigger InVolume&Facing", GetKeyName().c_str());
            fTriggered = true;
            ISendTriggerMsg(avatar->GetKey(), true);
        }
        else if (!facing && fTriggered)
        {
            DetectorLog("%s: Untrigger InVolume&Facing", GetKeyName().c_str());
            fTriggered = false;
            ISendTriggerMsg(avatar->GetKey(), false);
        }
    }
}
开发者ID:branan,项目名称:Plasma,代码行数:44,代码来源:plCollisionDetector.cpp


示例20: SpamMsg

plPXPhysical::~plPXPhysical()
{
    SpamMsg(plSimulationMgr::Log("Destroying physical %s", GetKeyName().c_str()));

    if (fActor)
    {
        // Grab any mesh we may have (they need to be released manually)
        NxConvexMesh* convexMesh = nil;
        NxTriangleMesh* triMesh = nil;
        NxShape* shape = fActor->getShapes()[0];
        if (NxConvexShape* convexShape = shape->isConvexMesh())
            convexMesh = &convexShape->getConvexMesh();
        else if (NxTriangleMeshShape* trimeshShape = shape->isTriangleMesh())
            triMesh = &trimeshShape->getTriangleMesh();

        if (!fActor->isDynamic())
            plPXPhysicalControllerCore::RebuildCache();

        if (fActor->isDynamic() && fActor->readBodyFlag(NX_BF_KINEMATIC))
        {
            if (fGroup == plSimDefs::kGroupDynamic)
                fNumberAnimatedPhysicals--;
            else
                fNumberAnimatedActivators--;
        }

        // Release the actor
        NxScene* scene = plSimulationMgr::GetInstance()->GetScene(fWorldKey);
        scene->releaseActor(*fActor);
        fActor = nil;

        // Now that the actor is freed, release the mesh
        if (convexMesh)
            plSimulationMgr::GetInstance()->GetSDK()->releaseConvexMesh(*convexMesh);
        if (triMesh)
            plSimulationMgr::GetInstance()->GetSDK()->releaseTriangleMesh(*triMesh);

        // Release the scene, so it can be cleaned up if no one else is using it
        plSimulationMgr::GetInstance()->ReleaseScene(fWorldKey);
    }

    if (fWorldHull)
        delete [] fWorldHull;
    if (fSaveTriangles)
        delete [] fSaveTriangles;

    delete fProxyGen;

    // remove sdl modifier
    plSceneObject* sceneObj = plSceneObject::ConvertNoRef(fObjectKey->ObjectIsLoaded());
    if (sceneObj && fSDLMod)
    {
        sceneObj->RemoveModifier(fSDLMod);
    }
    delete fSDLMod;
}
开发者ID:branan,项目名称:Plasma-nobink,代码行数:56,代码来源:plPXPhysical.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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