Suljettu

TRANSLATION

THIS IS A SNIPT OF CODE FROM A VC++ PROJECT THAT MAKE IT SO CERTINE COMMANDS ARE SENT TO THE TOOLBAND OBJECT AND NOT TO EXPLORER IF THE TOOL BAND IS INFOCUS OR WHAT EVER YOU WOULD CALL IT. I HAVE A PROJECT FILE I AM ATACHING. IAM TRYING TO MAKE THIS FILE SO I CAN USE THE BACK SPACE KEY AND MY CURRENT PROJECT CANT SO I NEED THIS CODE TRANSLATED INTO VB.NET AND PUT WHERE IT NEEDS TO BE SO I CAN USE THE BACKSPACE KEY.

## Deliverables

// Because the host owns the message processing, it will get all keyboard messages // first. // 1. We want to use the ENTER key to signal that the user is done in the edit control, // so we need to watch for VK_RETURN on WM_KEYUP // 2. We also want the BACKSPACE, DELETE, END, ARROW keys to go to the edit control and // not to the standard IE interfaces. We translate/dispatch these messages ourselves. STDMETHODIMP CBandEditCtrl::TranslateAcceleratorIO(LPMSG pMsg) { int nVirtKey = (int)(pMsg->wParam); if (WM_KEYUP == pMsg->message && VK_RETURN == nVirtKey && pMsg->hwnd==m_edit2.m_hWnd) { Process(); return S_OK; } else if ( /*(WM_KEYUP == pMsg->message || WM_KEYDOWN == pMsg->message) && */ VK_BACK == nVirtKey || (VK_END <= nVirtKey && VK_LEFT >= nVirtKey) || VK_RIGHT == nVirtKey || VK_DELETE == nVirtKey || ( (GetKeyState(VK_CONTROL)&0x80) && (nVirtKey=='C' || nVirtKey=='V' || nVirtKey=='X'))) { m_auto = false; TranslateMessage(pMsg); DispatchMessage(pMsg); m_auto = true; if(WM_KEYDOWN == pMsg->message && VK_BACK == nVirtKey) { m_auto = false; } return S_OK; } else return S_FALSE; } STDMETHODIMP CBandEditCtrl::QueryInterface(REFIID riid, VOID** ppv) { *ppv=NULL; if (IID_IUnknown==riid || IID_IDropTarget==riid) *ppv=this; if (NULL!=*ppv) { ((LPUNKNOWN)*ppv)->AddRef(); return NOERROR; } return E_NOINTERFACE; } STDMETHODIMP_(ULONG) CBandEditCtrl::AddRef(void) { return ++m_cRef; } STDMETHODIMP_(ULONG) CBandEditCtrl::Release(void) { if (0!=--m_cRef) return m_cRef; delete this; return 0; } STDMETHODIMP CBandEditCtrl::DragEnter(LPDATAOBJECT pDataObj , DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect) { m_pIDataObject=NULL; CString sText; FORMATETC formatDetails; STGMEDIUM stmg; // Let's get the text from the "clipboard" [url removed, login to view] = CF_TEXT; [url removed, login to view] = DVASPECT_CONTENT; [url removed, login to view] = -1; [url removed, login to view] = NULL; [url removed, login to view] = TYMED_HGLOBAL; if (SUCCEEDED(pDataObj->GetData(&formatDetails, &stmg))) { sText = (LPSTR)GlobalLock([url removed, login to view]); GlobalUnlock([url removed, login to view]); if ([url removed, login to view] != NULL) ReleaseStgMedium(&stmg); } *pdwEffect=DROPEFFECT_COPY; m_pIDataObject=pDataObj; m_pIDataObject->AddRef(); return NOERROR; } STDMETHODIMP CBandEditCtrl::DragOver(DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect) { if (m_pIDataObject == NULL) *pdwEffect=DROPEFFECT_NONE; else *pdwEffect=DROPEFFECT_COPY; return NOERROR; } STDMETHODIMP CBandEditCtrl::DragLeave(void) { m_pIDataObject->Release(); return NOERROR; } STDMETHODIMP CBandEditCtrl::Drop(LPDATAOBJECT pDataObj, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect) { *pdwEffect=DROPEFFECT_NONE; if (m_pIDataObject == NULL) return E_FAIL; DragLeave(); FORMATETC formatDetails; STGMEDIUM stmg; // Let's get the text from the "clipboard" [url removed, login to view] = CF_TEXT; [url removed, login to view] = DVASPECT_CONTENT; [url removed, login to view] = -1; [url removed, login to view] = NULL; [url removed, login to view] = TYMED_HGLOBAL; if (SUCCEEDED(pDataObj->GetData(&formatDetails, &stmg))) { char* sClipboard = (char*)GlobalLock([url removed, login to view]); ::SetWindowTextA(m_hWnd,sClipboard); if(isGetValue(_T("RunSearchDragAutomatically"))) Process(); GlobalUnlock([url removed, login to view]); if ([url removed, login to view] != NULL) ReleaseStgMedium(&stmg); } *pdwEffect=DROPEFFECT_COPY; return NOERROR; } LRESULT CBandEditCtrl::OnTVSetFoc

## Platform

VB.NET JUST SO YOU KNOW I DONT NEED ALL THE THINGS I COPYED I DONT EVEN KNOW IF IF ALL PRETAINS. I JUST NEED THE BACKSPACE KEY TO WORK . THANKS.

Taidot: PHP

Näytä lisää: wm_keyup pmsg message vk_return nvirtkey, vc .net, platform translation, int v, infocus, hglobal, get on to translation, iam file, get translation, ppv, text message tool, null null object, cstring, visual basic clipboard, band object, php translation code, translation code, translate tool, code translation, php platform translation

Tietoa työnantajasta:
( 8 arvostelua ) United States

Projektin tunnus: #2893114