005
24.09.2003, 21:11 Uhr
Uwe
C/C++ Master (Administrator)
|
Hallo, Beispiel:
C++: |
BOOL CClipDlg::PreTranslateMessage(MSG* pMsg) { if(pMsg->message == WM_KEYDOWN){ if(GetFocus()==GetDlgItem(IDC_LIST)&& ::GetKeyState(VK_CONTROL)&& ::GetAsyncKeyState(0x43)<0){ CString str; char* pszClipData = (char*)::malloc(255); m_list.GetText(m_list.GetCurSel(),str); strcpy(pszClipData,str); ::OpenClipboard(NULL); ::EmptyClipboard(); HGLOBAL hClipData=::GlobalAlloc(GMEM_DDESHARE|GMEM_MOVEABLE, ::strlen(pszClipData)+1); LPVOID lpClipData=::GlobalLock(hClipData); strcpy((LPSTR)lpClipData,pszClipData); ::GlobalUnlock(hClipData); ::SetClipboardData(CF_TEXT,hClipData); ::CloseClipboard(); return true; } } return CDialog::PreTranslateMessage(pMsg); }
|
-- "Es ist schwierig, ein Programm wirklich idiotensicher zu machen, weil Idioten so genial sind."
Bis dann... Uwe |