FFFTPのソースコードです。
リビジョン | 642b947efc5358f232f9eeda98f7c8eb111acf1f (tree) |
---|---|
日時 | 2011-10-15 16:46:37 |
作者 | s_kawamoto <s_kawamoto@user...> |
コミッター | s_kawamoto |
Fix bugs of copying URL to clipboard.
@@ -1818,6 +1818,34 @@ END_ROUTINE | ||
1818 | 1818 | return r; |
1819 | 1819 | } |
1820 | 1820 | |
1821 | +HANDLE SetClipboardDataM(UINT uFormat, HANDLE hMem) | |
1822 | +{ | |
1823 | + HANDLE r = NULL; | |
1824 | + char* p; | |
1825 | + int Length; | |
1826 | + int BufferLength; | |
1827 | + HGLOBAL hBufferMem; | |
1828 | +START_ROUTINE | |
1829 | + if(uFormat == CF_TEXT) | |
1830 | + { | |
1831 | + p = (char*)GlobalLock(hMem); | |
1832 | + Length = (int)GlobalSize(hMem); | |
1833 | + BufferLength = MtoW(NULL, 0, p, Length); | |
1834 | + if(hBufferMem = GlobalAlloc(GMEM_MOVEABLE, sizeof(wchar_t) * BufferLength)) | |
1835 | + { | |
1836 | + MtoW((LPWSTR)GlobalLock(hBufferMem), BufferLength, p, Length); | |
1837 | + GlobalUnlock(hBufferMem); | |
1838 | + r = SetClipboardData(CF_UNICODETEXT, hBufferMem); | |
1839 | + } | |
1840 | + GlobalUnlock(hMem); | |
1841 | + GlobalFree(hMem); | |
1842 | + } | |
1843 | + else | |
1844 | + r = SetClipboardData(uFormat, hMem); | |
1845 | +END_ROUTINE | |
1846 | + return r; | |
1847 | +} | |
1848 | + | |
1821 | 1849 | int mkdirM(const char * _Path) |
1822 | 1850 | { |
1823 | 1851 | int r = 0; |
@@ -155,6 +155,9 @@ HWND CreateDialogParamM(HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndPar | ||
155 | 155 | #undef sndPlaySound |
156 | 156 | #define sndPlaySound sndPlaySoundM |
157 | 157 | BOOL sndPlaySoundM(LPCSTR pszSound, UINT fuSound); |
158 | +#undef SetClipboardData | |
159 | +#define SetClipboardData SetClipboardDataM | |
160 | +HANDLE SetClipboardDataM(UINT uFormat, HANDLE hMem); | |
158 | 161 | #undef mkdir |
159 | 162 | #define mkdir _mkdirM |
160 | 163 | int mkdirM(const char * _Path); |