ReactOS  0.4.14-dev-599-g2d4d3f5
Tnclip Class Reference

#include <tnclip.h>

Collaboration diagram for Tnclip:

Public Member Functions

 Tnclip (HWND Window, TNetwork &RefNetwork)
 
 ~Tnclip ()
 
void Copy (HGLOBAL clipboard_data)
 
void Paste ()
 

Private Attributes

HWND Window
 
TNetworkNetwork
 

Detailed Description

Definition at line 6 of file tnclip.h.

Constructor & Destructor Documentation

◆ Tnclip()

Tnclip::Tnclip ( HWND  Window,
TNetwork RefNetwork 
)

Definition at line 33 of file tnclip.cpp.

33  : Network(RefNetwork) {
34  Window = W;
35 }
Definition: window.c:28
struct W W
TNetwork & Network
Definition: tnclip.h:9

◆ ~Tnclip()

Tnclip::~Tnclip ( )

Definition at line 37 of file tnclip.cpp.

37  {
38 }

Member Function Documentation

◆ Copy()

void Tnclip::Copy ( HGLOBAL  clipboard_data)

Definition at line 40 of file tnclip.cpp.

40  {
41  if(!OpenClipboard(Window)) return;
42  if(!EmptyClipboard()) return;
43 
44  SetClipboardData(CF_TEXT, clipboard_data);
46 }
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
Definition: window.c:28
#define CF_TEXT
Definition: constants.h:396
BOOL WINAPI EmptyClipboard(void)
Definition: ntwrapper.h:190
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
BOOL WINAPI OpenClipboard(_In_opt_ HWND)

Referenced by TMouse::doClip().

◆ Paste()

void Tnclip::Paste ( )

Definition at line 48 of file tnclip.cpp.

48  {
49  if(!OpenClipboard(Window)) return;
50 
51  HANDLE clipboard_data = GetClipboardData(CF_TEXT);
52  LPVOID clipboard_ptr = GlobalLock(clipboard_data);
53  DWORD size = strlen((const char *)clipboard_data);
54  Network.WriteString((const char *)clipboard_ptr, size);
55  GlobalUnlock(clipboard_data);
56 
58 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
Definition: window.c:28
#define CF_TEXT
Definition: constants.h:396
int WriteString(const char *str, const int length)
Definition: tnetwork.cpp:53
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HANDLE WINAPI GetClipboardData(_In_ UINT)
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
TNetwork & Network
Definition: tnclip.h:9

Referenced by do_op(), and TMouse::doMouse().

Member Data Documentation

◆ Network

TNetwork& Tnclip::Network
private

Definition at line 9 of file tnclip.h.

Referenced by Paste().

◆ Window

HWND Tnclip::Window
private

Definition at line 8 of file tnclip.h.


The documentation for this class was generated from the following files: