ReactOS 0.4.15-dev-7674-gc0b4db1
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}
TNetwork & Network
Definition: tnclip.h:9
#define W(I)
Definition: window.c:28

◆ ~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}
#define CF_TEXT
Definition: constants.h:396
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
BOOL WINAPI EmptyClipboard(void)
Definition: ntwrapper.h:190

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
int WriteString(const char *str, const int length)
Definition: tnetwork.cpp:53
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HANDLE WINAPI GetClipboardData(_In_ UINT)

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: