diff options
-rw-r--r-- | version.h | 2 | ||||
-rw-r--r-- | win32/toneview.c | 15 |
2 files changed, 13 insertions, 4 deletions
@@ -1,6 +1,6 @@ #ifndef MYON_FMPLAYER_VERSION_H_INCLUDED #define MYON_FMPLAYER_VERSION_H_INCLUDED -#define FMPLAYER_VERSION_STR "0.1.0" +#define FMPLAYER_VERSION_STR "0.1.1" #endif // MYON_FMPLAYER_VERSION_H_INCLUDED diff --git a/win32/toneview.c b/win32/toneview.c index a0a920a..90ad24a 100644 --- a/win32/toneview.c +++ b/win32/toneview.c @@ -68,10 +68,19 @@ enum { static void on_command(HWND hwnd, int id, HWND hwnd_c, UINT code) { if (code == BN_CLICKED && ((ID_COPY0 <= id) && (id <= ID_COPY5))) { int i = id - ID_COPY0; - HGLOBAL gmem = GlobalAlloc(GMEM_MOVEABLE, FMPLAYER_TONEDATA_STR_SIZE*sizeof(wchar_t)); - if (!gmem) return; - wchar_t *buf = GlobalLock(gmem); + wchar_t buf[FMPLAYER_TONEDATA_STR_SIZE]; GetWindowText(g.tonelabel[i], buf, FMPLAYER_TONEDATA_STR_SIZE*sizeof(wchar_t)); + HGLOBAL gmem = GlobalAlloc(GMEM_MOVEABLE, (FMPLAYER_TONEDATA_STR_SIZE+10)*sizeof(wchar_t)); + if (!gmem) return; + wchar_t *gbuf = GlobalLock(gmem); + wchar_t *c = buf; + while (*c) { + if (*c == L'\n') { + *gbuf++ = L'\r'; + } + *gbuf++ = *c++; + } + *gbuf = 0; GlobalUnlock(gmem); if (!OpenClipboard(hwnd)) return; EmptyClipboard(); |