mirror of
https://github.com/Xevion/easy7zip.git
synced 2026-01-31 12:24:08 -06:00
9.34
This commit is contained in:
committed by
Kornel Lesiński
parent
83f8ddcc5b
commit
f08f4dcc3c
Executable → Regular
+9
-15
@@ -6,13 +6,12 @@
|
||||
#include <winuserm.h>
|
||||
#endif
|
||||
|
||||
#include "Windows/Clipboard.h"
|
||||
#include "Windows/Defs.h"
|
||||
#include "Windows/Memory.h"
|
||||
#include "Windows/Shell.h"
|
||||
#include "Windows/Memory.h"
|
||||
#include "../Common/StringConvert.h"
|
||||
|
||||
#include "Common/StringConvert.h"
|
||||
#include "Clipboard.h"
|
||||
#include "Defs.h"
|
||||
#include "MemoryGlobal.h"
|
||||
#include "Shell.h"
|
||||
|
||||
namespace NWindows {
|
||||
|
||||
@@ -22,11 +21,6 @@ bool CClipboard::Open(HWND wndNewOwner)
|
||||
return m_Open;
|
||||
}
|
||||
|
||||
CClipboard::~CClipboard()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
bool CClipboard::Close()
|
||||
{
|
||||
if (!m_Open)
|
||||
@@ -94,7 +88,7 @@ bool ClipboardGetFileNames(UStringVector &names)
|
||||
}
|
||||
*/
|
||||
|
||||
static bool ClipboardSetData(UINT uFormat, const void *data, size_t size)
|
||||
static bool ClipboardSetData(UINT uFormat, const void *data, size_t size) throw()
|
||||
{
|
||||
NMemory::CGlobal global;
|
||||
if (!global.Alloc(GMEM_DDESHARE | GMEM_MOVEABLE, size))
|
||||
@@ -121,13 +115,13 @@ bool ClipboardSetText(HWND owner, const UString &s)
|
||||
return false;
|
||||
|
||||
bool res;
|
||||
res = ClipboardSetData(CF_UNICODETEXT, (const wchar_t *)s, (s.Length() + 1) * sizeof(wchar_t));
|
||||
res = ClipboardSetData(CF_UNICODETEXT, (const wchar_t *)s, (s.Len() + 1) * sizeof(wchar_t));
|
||||
#ifndef _UNICODE
|
||||
AString a;
|
||||
a = UnicodeStringToMultiByte(s, CP_ACP);
|
||||
res |= ClipboardSetData(CF_TEXT, (const char *)a, (a.Length() + 1) * sizeof(char));
|
||||
res |= ClipboardSetData(CF_TEXT, (const char *)a, (a.Len() + 1) * sizeof(char));
|
||||
a = UnicodeStringToMultiByte(s, CP_OEMCP);
|
||||
res |= ClipboardSetData(CF_OEMTEXT, (const char *)a, (a.Length() + 1) * sizeof(char));
|
||||
res |= ClipboardSetData(CF_OEMTEXT, (const char *)a, (a.Len() + 1) * sizeof(char));
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user