246 |
|
|
247 |
GlobalUnlock (clipmem); |
GlobalUnlock (clipmem); |
248 |
SetClipboardData (CF_TEXT, clipmem); |
SetClipboardData (CF_TEXT, clipmem); |
249 |
|
GlobalFree (clipmem); |
250 |
|
|
251 |
leave: |
leave: |
252 |
CloseClipboard (); |
CloseClipboard (); |
253 |
return rc; |
return rc; |
254 |
} /* set_clip_text */ |
} |
255 |
|
|
256 |
|
|
257 |
/* Append or prepend some text to the clipboard contents. |
/* Append or prepend some text to the clipboard contents. |
543 |
} |
} |
544 |
|
|
545 |
|
|
546 |
|
/* Generate a temporary file name by using the users |
547 |
|
temp path and optionally a name @name provided by the caller. |
548 |
|
Return value: 0 on success. */ |
549 |
|
int |
550 |
|
get_temp_name (char *buf, DWORD buflen, const char *name) |
551 |
|
{ |
552 |
|
char tmp[32]; |
553 |
|
|
554 |
|
if (!name) { |
555 |
|
sprintf (tmp, "%08lX", GetTickCount ()); |
556 |
|
name = tmp; |
557 |
|
} |
558 |
|
|
559 |
|
/* in the mobile mode we use a local temp folder |
560 |
|
with the fixed name 'temp'. */ |
561 |
|
if (mobile_mode_active) { |
562 |
|
_snprintf (buf, buflen-1, "temp\\%s", name); |
563 |
|
return 0; |
564 |
|
} |
565 |
|
|
566 |
|
if (!GetTempPath (buflen - strlen (name) -2, buf)) { |
567 |
|
log_debug ("GetTempPath() failed ec=%d\n", (int)GetLastError ()); |
568 |
|
return -1; |
569 |
|
} |
570 |
|
strcat (buf, name); |
571 |
|
return 0; |
572 |
|
} |
573 |
|
|
574 |
|
|
575 |
struct reminder_hd_s { |
struct reminder_hd_s { |
576 |
int msecs; |
int msecs; |
577 |
HWND dlg; |
HWND dlg; |