Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygentnclip.cpp
Go to the documentation of this file.
00001 00002 //Telnet Win32 : an ANSI telnet client. 00003 //Copyright (C) 1998 Paul Brannan 00004 //Copyright (C) 1998 I.Ioannou 00005 //Copyright (C) 1997 Brad Johnson 00006 // 00007 //This program is free software; you can redistribute it and/or 00008 //modify it under the terms of the GNU General Public License 00009 //as published by the Free Software Foundation; either version 2 00010 //of the License, or (at your option) any later version. 00011 // 00012 //This program is distributed in the hope that it will be useful, 00013 //but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 //GNU General Public License for more details. 00016 // 00017 //You should have received a copy of the GNU General Public License 00018 //along with this program; if not, write to the Free Software 00019 //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00020 // 00021 //I.Ioannou 00022 //roryt@hol.gr 00023 // 00025 00026 // TnClip.cpp 00027 // A simple class for handling clipboard functions 00028 // Written by Paul Brannan <pbranna@clemson.edu> 00029 // Last modified 7/12/98 00030 00031 #include "precomp.h" 00032 00033 Tnclip::Tnclip(HWND W, TNetwork &RefNetwork): Network(RefNetwork) { 00034 Window = W; 00035 } 00036 00037 Tnclip::~Tnclip() { 00038 } 00039 00040 void Tnclip::Copy(HGLOBAL clipboard_data) { 00041 if(!OpenClipboard(Window)) return; 00042 if(!EmptyClipboard()) return; 00043 00044 SetClipboardData(CF_TEXT, clipboard_data); 00045 CloseClipboard(); 00046 } 00047 00048 void Tnclip::Paste() { 00049 if(!OpenClipboard(Window)) return; 00050 00051 HANDLE clipboard_data = GetClipboardData(CF_TEXT); 00052 LPVOID clipboard_ptr = GlobalLock(clipboard_data); 00053 DWORD size = strlen((const char *)clipboard_data); 00054 Network.WriteString((const char *)clipboard_ptr, size); 00055 GlobalUnlock(clipboard_data); 00056 00057 CloseClipboard(); 00058 } 00059 Generated on Mon May 28 2012 04:17:14 for ReactOS by
1.7.6.1
|