Lauri Kenttä lauri.kentta@gmail.com writes:
@@ -3798,6 +3789,25 @@ static void COMCTL32_ReleaseStgMedium (STGMEDIUM medium) }
/***********************************************************************
GetFormatEtc
- Get the FORMATETC used in the shell id list
- */
+static FORMATETC* GetFormatEtc(void) +{
- static FORMATETC formatetc;
- if (!formatetc.cfFormat)
- {
- formatetc.cfFormat = RegisterClipboardFormatA(CFSTR_SHELLIDLISTA);
- formatetc.ptd = 0;
- formatetc.dwAspect = DVASPECT_CONTENT;
- formatetc.lindex = -1;
- formatetc.tymed = TYMED_HGLOBAL;
- }
- return &formatetc;
+}
This looks a little risky, since the structure is passed to the application. Caching only the clipboard format should be enough.