summaryrefslogtreecommitdiff
path: root/utils/hlmv/sys_win.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /utils/hlmv/sys_win.cpp
downloadarchived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz
archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip
Diffstat (limited to 'utils/hlmv/sys_win.cpp')
-rw-r--r--utils/hlmv/sys_win.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/utils/hlmv/sys_win.cpp b/utils/hlmv/sys_win.cpp
new file mode 100644
index 0000000..aa7510f
--- /dev/null
+++ b/utils/hlmv/sys_win.cpp
@@ -0,0 +1,37 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: abstract system dependent functions
+//
+// $NoKeywords: $
+//=============================================================================//
+#include "sys.h"
+#include <windows.h>
+#include "tier1/strtools.h"
+
+
+void Sys_CopyStringToClipboard( const char *pOut )
+{
+ if ( !pOut || !OpenClipboard( NULL ) )
+ {
+ return;
+ }
+ // Remove the current Clipboard contents
+ if( !EmptyClipboard() )
+ {
+ return;
+ }
+ HGLOBAL clipbuffer;
+ char *buffer;
+ EmptyClipboard();
+
+ int len = Q_strlen(pOut)+1;
+ clipbuffer = GlobalAlloc(GMEM_DDESHARE, len );
+ buffer = (char*)GlobalLock( clipbuffer );
+ Q_strncpy( buffer, pOut, len );
+ GlobalUnlock( clipbuffer );
+
+ SetClipboardData( CF_TEXT,clipbuffer );
+
+ CloseClipboard();
+}
+