foobar2000 SDK  2015-08-03
shared.h
Go to the documentation of this file.
1 #ifndef _SHARED_DLL__SHARED_H_
2 #define _SHARED_DLL__SHARED_H_
3 
4 #include "../../pfc/pfc.h"
5 
6 #include <assert.h>
7 
8 // Global flag - whether it's OK to leak static objects as they'll be released anyway by process death
9 #define FB2K_LEAK_STATIC_OBJECTS PFC_LEAK_STATIC_OBJECTS
10 
11 #include <signal.h>
12 
13 #ifndef WIN32
14 #error N/A
15 #endif
16 
17 #ifndef STRICT
18 #define STRICT
19 #endif
20 
21 #include <windows.h>
22 #include <ddeml.h>
23 #include <commctrl.h>
24 #include <uxtheme.h>
25 //#include <tmschema.h>
26 #include <vssym32.h>
27 
28 #ifndef NOTHROW
29 #ifdef _MSC_VER
30 #define NOTHROW __declspec(nothrow)
31 #else
32 #define NOTHROW
33 #endif
34 #endif
35 
36 #define SHARED_API /*NOTHROW*/ __stdcall
37 
38 #ifndef SHARED_EXPORTS
39 #define SHARED_EXPORT __declspec(dllimport) SHARED_API
40 #else
41 #define SHARED_EXPORT __declspec(dllexport) SHARED_API
42 #endif
43 
44 extern "C" {
45 
46 //SHARED_EXPORT BOOL IsUnicode();
47 #ifdef UNICODE
48 #define IsUnicode() 1
49 #else
50 #define IsUnicode() 0
51 #endif
52 
53 LRESULT SHARED_EXPORT uSendMessageText(HWND wnd,UINT msg,WPARAM wp,const char * text);
54 LRESULT SHARED_EXPORT uSendDlgItemMessageText(HWND wnd,UINT id,UINT msg,WPARAM wp,const char * text);
55 BOOL SHARED_EXPORT uGetWindowText(HWND wnd,pfc::string_base & out);
56 BOOL SHARED_EXPORT uSetWindowText(HWND wnd,const char * p_text);
57 BOOL SHARED_EXPORT uSetWindowTextEx(HWND wnd,const char * p_text,unsigned p_text_length);
58 BOOL SHARED_EXPORT uGetDlgItemText(HWND wnd,UINT id,pfc::string_base & out);
59 BOOL SHARED_EXPORT uSetDlgItemText(HWND wnd,UINT id,const char * p_text);
60 BOOL SHARED_EXPORT uSetDlgItemTextEx(HWND wnd,UINT id,const char * p_text,unsigned p_text_length);
61 BOOL SHARED_EXPORT uBrowseForFolder(HWND parent,const char * title,pfc::string_base & out);
62 BOOL SHARED_EXPORT uBrowseForFolderWithFile(HWND parent,const char * title,pfc::string_base & out,const char * p_file_to_find);
63 int SHARED_EXPORT uMessageBox(HWND wnd,const char * text,const char * caption,UINT type);
64 void SHARED_EXPORT uOutputDebugString(const char * msg);
65 BOOL SHARED_EXPORT uAppendMenu(HMENU menu,UINT flags,UINT_PTR id,const char * content);
66 BOOL SHARED_EXPORT uInsertMenu(HMENU menu,UINT position,UINT flags,UINT_PTR id,const char * content);
67 int SHARED_EXPORT uStringCompare(const char * elem1, const char * elem2);
68 int SHARED_EXPORT uCharCompare(t_uint32 p_char1,t_uint32 p_char2);
69 int SHARED_EXPORT uStringCompare_ConvertNumbers(const char * elem1,const char * elem2);
70 HINSTANCE SHARED_EXPORT uLoadLibrary(const char * name);
71 HANDLE SHARED_EXPORT uCreateEvent(LPSECURITY_ATTRIBUTES lpEventAttributes,BOOL bManualReset,BOOL bInitialState, const char * lpName);
72 HANDLE SHARED_EXPORT GetInfiniteWaitEvent();
73 DWORD SHARED_EXPORT uGetModuleFileName(HMODULE hMod,pfc::string_base & out);
74 BOOL SHARED_EXPORT uSetClipboardString(const char * ptr);
75 BOOL SHARED_EXPORT uGetClipboardString(pfc::string_base & out);
76 BOOL SHARED_EXPORT uSetClipboardRawData(UINT format,const void * ptr,t_size size);//does not empty the clipboard
77 BOOL SHARED_EXPORT uGetClassName(HWND wnd,pfc::string_base & out);
78 t_size SHARED_EXPORT uCharLength(const char * src);
79 BOOL SHARED_EXPORT uDragQueryFile(HDROP hDrop,UINT idx,pfc::string_base & out);
80 UINT SHARED_EXPORT uDragQueryFileCount(HDROP hDrop);
81 BOOL SHARED_EXPORT uGetTextExtentPoint32(HDC dc,const char * text,UINT cb,LPSIZE size);//note, cb is number of bytes, not actual unicode characters in the string (read: plain strlen() will do)
82 BOOL SHARED_EXPORT uExtTextOut(HDC dc,int x,int y,UINT flags,const RECT * rect,const char * text,UINT cb,const int * lpdx);
83 BOOL SHARED_EXPORT uTextOutColors(HDC dc,const char * src,UINT len,int x,int y,const RECT * clip,BOOL is_selected,DWORD default_color);
84 BOOL SHARED_EXPORT uTextOutColorsTabbed(HDC dc,const char * src,UINT src_len,const RECT * item,int border,const RECT * clip,BOOL selected,DWORD default_color,BOOL use_columns);
85 UINT SHARED_EXPORT uGetTextHeight(HDC dc);
86 UINT SHARED_EXPORT uGetFontHeight(HFONT font);
87 BOOL SHARED_EXPORT uChooseColor(DWORD * p_color,HWND parent,DWORD * p_custom_colors);
88 HCURSOR SHARED_EXPORT uLoadCursor(HINSTANCE hIns,const char * name);
89 HICON SHARED_EXPORT uLoadIcon(HINSTANCE hIns,const char * name);
90 HMENU SHARED_EXPORT uLoadMenu(HINSTANCE hIns,const char * name);
91 BOOL SHARED_EXPORT uGetEnvironmentVariable(const char * name,pfc::string_base & out);
92 HMODULE SHARED_EXPORT uGetModuleHandle(const char * name);
93 UINT SHARED_EXPORT uRegisterWindowMessage(const char * name);
94 BOOL SHARED_EXPORT uMoveFile(const char * src,const char * dst);
95 BOOL SHARED_EXPORT uDeleteFile(const char * fn);
96 DWORD SHARED_EXPORT uGetFileAttributes(const char * fn);
97 BOOL SHARED_EXPORT uFileExists(const char * fn);
98 BOOL SHARED_EXPORT uRemoveDirectory(const char * fn);
99 HANDLE SHARED_EXPORT uCreateFile(const char * p_path,DWORD p_access,DWORD p_sharemode,LPSECURITY_ATTRIBUTES p_security_attributes,DWORD p_createmode,DWORD p_flags,HANDLE p_template);
100 HANDLE SHARED_EXPORT uCreateFileMapping(HANDLE hFile,LPSECURITY_ATTRIBUTES lpFileMappingAttributes,DWORD flProtect,DWORD dwMaximumSizeHigh,DWORD dwMaximumSizeLow,const char * lpName);
101 BOOL SHARED_EXPORT uCreateDirectory(const char * fn,LPSECURITY_ATTRIBUTES blah);
102 HANDLE SHARED_EXPORT uCreateMutex(LPSECURITY_ATTRIBUTES blah,BOOL bInitialOwner,const char * name);
103 BOOL SHARED_EXPORT uGetLongPathName(const char * name,pfc::string_base & out);//may just fail to work on old windows versions, present on win98/win2k+
104 BOOL SHARED_EXPORT uGetFullPathName(const char * name,pfc::string_base & out);
105 BOOL SHARED_EXPORT uSearchPath(const char * path, const char * filename, const char * extension, pfc::string_base & p_out);
106 BOOL SHARED_EXPORT uFixPathCaps(const char * path,pfc::string_base & p_out);
107 //BOOL SHARED_EXPORT uFixPathCapsQuick(const char * path,pfc::string_base & p_out);
108 void SHARED_EXPORT uGetCommandLine(pfc::string_base & out);
109 BOOL SHARED_EXPORT uGetTempPath(pfc::string_base & out);
110 BOOL SHARED_EXPORT uGetTempFileName(const char * path_name,const char * prefix,UINT unique,pfc::string_base & out);
111 BOOL SHARED_EXPORT uGetOpenFileName(HWND parent,const char * p_ext_mask,unsigned def_ext_mask,const char * p_def_ext,const char * p_title,const char * p_directory,pfc::string_base & p_filename,BOOL b_save);
112 //note: uGetOpenFileName extension mask uses | as separator, not null
113 HANDLE SHARED_EXPORT uLoadImage(HINSTANCE hIns,const char * name,UINT type,int x,int y,UINT flags);
114 UINT SHARED_EXPORT uRegisterClipboardFormat(const char * name);
115 BOOL SHARED_EXPORT uGetClipboardFormatName(UINT format,pfc::string_base & out);
116 BOOL SHARED_EXPORT uFormatSystemErrorMessage(pfc::string_base & p_out,DWORD p_code);
117 
118 HANDLE SHARED_EXPORT uSortStringCreate(const char * src);
119 int SHARED_EXPORT uSortStringCompare(HANDLE string1,HANDLE string2);
120 int SHARED_EXPORT uSortStringCompareEx(HANDLE string1,HANDLE string2,DWORD flags);//flags - see win32 CompareString
121 int SHARED_EXPORT uSortPathCompare(HANDLE string1,HANDLE string2);
122 void SHARED_EXPORT uSortStringFree(HANDLE string);
123 
124 // New in 1.1.12
125 HANDLE SHARED_EXPORT CreateFileAbortable( __in LPCWSTR lpFileName,
126  __in DWORD dwDesiredAccess,
127  __in DWORD dwShareMode,
128  __in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
129  __in DWORD dwCreationDisposition,
130  __in DWORD dwFlagsAndAttributes,
131  // Template file handle NOT supported.
132  __in_opt HANDLE hAborter
133  );
134 
135 
136 int SHARED_EXPORT uCompareString(DWORD flags,const char * str1,unsigned len1,const char * str2,unsigned len2);
137 
138 class NOVTABLE uGetOpenFileNameMultiResult : public pfc::list_base_const_t<const char*>
139 {
140 public:
141  inline t_size GetCount() {return get_count();}
142  inline const char * GetFileName(t_size index) {return get_item(index);}
144 };
145 
147 
148 puGetOpenFileNameMultiResult SHARED_EXPORT uGetOpenFileNameMulti(HWND parent,const char * p_ext_mask,unsigned def_ext_mask,const char * p_def_ext,const char * p_title,const char * p_directory);
149 
150 // new in fb2k 1.1.1
151 puGetOpenFileNameMultiResult SHARED_EXPORT uBrowseForFolderEx(HWND parent,const char * title, const char * initPath);
152 puGetOpenFileNameMultiResult SHARED_EXPORT uEvalKnownFolder(const GUID& id);
153 
154 
155 class NOVTABLE uFindFile
156 {
157 protected:
159 public:
160  virtual BOOL FindNext()=0;
161  virtual const char * GetFileName()=0;
162  virtual t_uint64 GetFileSize()=0;
163  virtual DWORD GetAttributes()=0;
164  virtual FILETIME GetCreationTime()=0;
165  virtual FILETIME GetLastAccessTime()=0;
166  virtual FILETIME GetLastWriteTime()=0;
167  virtual ~uFindFile() {};
168  inline bool IsDirectory() {return (GetAttributes() & FILE_ATTRIBUTE_DIRECTORY) ? true : false;}
169 };
170 
172 
173 puFindFile SHARED_EXPORT uFindFirstFile(const char * path);
174 
175 HINSTANCE SHARED_EXPORT uShellExecute(HWND wnd,const char * oper,const char * file,const char * params,const char * dir,int cmd);
176 HWND SHARED_EXPORT uCreateStatusWindow(LONG style,const char * text,HWND parent,UINT id);
177 
178 BOOL SHARED_EXPORT uShellNotifyIcon(DWORD dwMessage,HWND wnd,UINT id,UINT callbackmsg,HICON icon,const char * tip);
179 BOOL SHARED_EXPORT uShellNotifyIconEx(DWORD dwMessage,HWND wnd,UINT id,UINT callbackmsg,HICON icon,const char * tip,const char * balloon_title,const char * balloon_msg);
180 
181 HWND SHARED_EXPORT uCreateWindowEx(DWORD dwExStyle,const char * lpClassName,const char * lpWindowName,DWORD dwStyle,int x,int y,int nWidth,int nHeight,HWND hWndParent,HMENU hMenu,HINSTANCE hInstance,LPVOID lpParam);
182 
183 BOOL SHARED_EXPORT uGetSystemDirectory(pfc::string_base & out);
184 BOOL SHARED_EXPORT uGetWindowsDirectory(pfc::string_base & out);
185 BOOL SHARED_EXPORT uSetCurrentDirectory(const char * path);
186 BOOL SHARED_EXPORT uGetCurrentDirectory(pfc::string_base & out);
187 BOOL SHARED_EXPORT uExpandEnvironmentStrings(const char * src,pfc::string_base & out);
188 BOOL SHARED_EXPORT uGetUserName(pfc::string_base & out);
189 BOOL SHARED_EXPORT uGetShortPathName(const char * src,pfc::string_base & out);
190 
191 HSZ SHARED_EXPORT uDdeCreateStringHandle(DWORD ins,const char * src);
192 BOOL SHARED_EXPORT uDdeQueryString(DWORD ins,HSZ hsz,pfc::string_base & out);
193 UINT SHARED_EXPORT uDdeInitialize(LPDWORD pidInst,PFNCALLBACK pfnCallback,DWORD afCmd,DWORD ulRes);
194 BOOL SHARED_EXPORT uDdeAccessData_Text(HDDEDATA data,pfc::string_base & out);
195 
196 HIMAGELIST SHARED_EXPORT uImageList_LoadImage(HINSTANCE hi, const char * lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags);
197 
198 #define uDdeFreeStringHandle DdeFreeStringHandle
199 #define uDdeCmpStringHandles DdeCmpStringHandles
200 #define uDdeKeepStringHandle DdeKeepStringHandle
201 #define uDdeUninitialize DdeUninitialize
202 #define uDdeNameService DdeNameService
203 #define uDdeFreeDataHandle DdeFreeDataHandle
204 
205 
206 typedef TVINSERTSTRUCTA uTVINSERTSTRUCT;
207 
208 HTREEITEM SHARED_EXPORT uTreeView_InsertItem(HWND wnd,const uTVINSERTSTRUCT * param);
209 LPARAM SHARED_EXPORT uTreeView_GetUserData(HWND wnd,HTREEITEM item);
210 bool SHARED_EXPORT uTreeView_GetText(HWND wnd,HTREEITEM item,pfc::string_base & out);
211 
212 #define uSetWindowsHookEx SetWindowsHookEx
213 #define uUnhookWindowsHookEx UnhookWindowsHookEx
214 #define uCallNextHookEx CallNextHookEx
215 
216 typedef TCITEMA uTCITEM;
217 int SHARED_EXPORT uTabCtrl_InsertItem(HWND wnd,t_size idx,const uTCITEM * item);
218 int SHARED_EXPORT uTabCtrl_SetItem(HWND wnd,t_size idx,const uTCITEM * item);
219 
220 int SHARED_EXPORT uGetKeyNameText(LONG lparam,pfc::string_base & out);
221 
222 void SHARED_EXPORT uFixAmpersandChars(const char * src,pfc::string_base & out);//for notification area icon
223 void SHARED_EXPORT uFixAmpersandChars_v2(const char * src,pfc::string_base & out);//for other controls
224 
225 //deprecated
226 t_size SHARED_EXPORT uPrintCrashInfo(LPEXCEPTION_POINTERS param,const char * extrainfo,char * out);
228 
229 void SHARED_EXPORT uPrintCrashInfo_Init(const char * name);//called only by the exe on startup
230 void SHARED_EXPORT uPrintCrashInfo_SetComponentList(const char * p_info);//called only by the exe on startup
231 void SHARED_EXPORT uPrintCrashInfo_AddEnvironmentInfo(const char * p_info);//called only by the exe on startup
232 void SHARED_EXPORT uPrintCrashInfo_SetDumpPath(const char * name);//called only by the exe on startup
233 
234 void SHARED_EXPORT uDumpCrashInfo(LPEXCEPTION_POINTERS param);
235 
236 
237 
238 void SHARED_EXPORT uPrintCrashInfo_OnEvent(const char * message, t_size length);
239 
240 BOOL SHARED_EXPORT uListBox_GetText(HWND listbox,UINT index,pfc::string_base & out);
241 
242 void SHARED_EXPORT uPrintfV(pfc::string_base & out,const char * fmt,va_list arglist);
243 static inline void uPrintf(pfc::string_base & out,const char * fmt,...) {va_list list;va_start(list,fmt);uPrintfV(out,fmt,list);va_end(list);}
244 
245 
246 class NOVTABLE uResource
247 {
248 public:
249  virtual const void * GetPointer() = 0;
250  virtual unsigned GetSize() = 0;
251  virtual ~uResource() {}
252 };
253 
255 
256 puResource SHARED_EXPORT uLoadResource(HMODULE hMod,const char * name,const char * type,WORD wLang = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL) );
257 puResource SHARED_EXPORT LoadResourceEx(HMODULE hMod,const TCHAR * name,const TCHAR * type,WORD wLang = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL) );
258 HRSRC SHARED_EXPORT uFindResource(HMODULE hMod,const char * name,const char * type,WORD wLang = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL) );
259 
260 BOOL SHARED_EXPORT uLoadString(HINSTANCE ins,UINT id,pfc::string_base & out);
261 
262 UINT SHARED_EXPORT uCharLower(UINT c);
263 UINT SHARED_EXPORT uCharUpper(UINT c);
264 
265 BOOL SHARED_EXPORT uGetMenuString(HMENU menu,UINT id,pfc::string_base & out,UINT flag);
266 BOOL SHARED_EXPORT uModifyMenu(HMENU menu,UINT id,UINT flags,UINT newitem,const char * data);
267 UINT SHARED_EXPORT uGetMenuItemType(HMENU menu,UINT position);
268 
269 
270 // New in 1.3.4
271 // Load a system library safely - forcibly look in system directories, not elsewhere.
272 HMODULE SHARED_EXPORT LoadSystemLibrary(const TCHAR * name);
273 }//extern "C"
274 
275 static inline void uAddDebugEvent(const char * msg) {uPrintCrashInfo_OnEvent(msg, strlen(msg));}
276 static inline void uAddDebugEvent(pfc::string_formatter const & msg) {uPrintCrashInfo_OnEvent(msg, msg.length());}
277 
278 inline char * uCharNext(char * src) {return src+uCharLength(src);}
279 inline const char * uCharNext(const char * src) {return src+uCharLength(src);}
280 
281 
283 {
284 public:
286  {
287  uGetWindowText(wnd,m_data);
288  }
289  string_utf8_from_window(HWND wnd,UINT id)
290  {
291  uGetDlgItemText(wnd,id,m_data);
292  }
293  inline operator const char * () const {return m_data.get_ptr();}
294  inline t_size length() const {return m_data.length();}
295  inline bool is_empty() const {return length() == 0;}
296  inline const char * get_ptr() const {return m_data.get_ptr();}
297 private:
299 };
300 
301 static pfc::string uGetWindowText(HWND wnd) {
302  pfc::string8 temp;
303  if (!uGetWindowText(wnd,temp)) return "";
304  return temp.toString();
305 }
306 static pfc::string uGetDlgItemText(HWND wnd,UINT id) {
307  pfc::string8 temp;
308  if (!uGetDlgItemText(wnd,id,temp)) return "";
309  return temp.toString();
310 }
311 
312 #define uMAKEINTRESOURCE(x) ((const char*)LOWORD(x))
313 
314 //other
315 
316 #define uIsDialogMessage IsDialogMessage
317 #define uGetMessage GetMessage
318 #define uPeekMessage PeekMessage
319 #define uDispatchMessage DispatchMessage
320 
321 #define uCallWindowProc CallWindowProc
322 #define uDefWindowProc DefWindowProc
323 #define uGetWindowLong GetWindowLong
324 #define uSetWindowLong SetWindowLong
325 
326 #define uEndDialog EndDialog
327 #define uDestroyWindow DestroyWindow
328 #define uGetDlgItem GetDlgItem
329 #define uEnableWindow EnableWindow
330 #define uGetDlgItemInt GetDlgItemInt
331 #define uSetDlgItemInt SetDlgItemInt
332 
333 #define uSendMessage SendMessage
334 #define uSendDlgItemMessage SendDlgItemMessage
335 #define uSendMessageTimeout SendMessageTimeout
336 #define uSendNotifyMessage SendNotifyMessage
337 #define uSendMessageCallback SendMessageCallback
338 #define uPostMessage PostMessage
339 #define uPostThreadMessage PostThreadMessage
340 
341 
343 {
344 public:
345  inline explicit uStringPrintf(const char * fmt,...)
346  {
347  va_list list;
348  va_start(list,fmt);
349  uPrintfV(m_data,fmt,list);
350  va_end(list);
351  }
352  inline operator const char * () const {return m_data.get_ptr();}
353  inline t_size length() const {return m_data.length();}
354  inline bool is_empty() const {return length() == 0;}
355  inline const char * get_ptr() const {return m_data.get_ptr();}
356  const char * toString() const {return get_ptr();}
357 private:
359 };
360 #pragma deprecated(uStringPrintf, uPrintf, uPrintfV)
361 
362 inline LRESULT uButton_SetCheck(HWND wnd,UINT id,bool state) {return uSendDlgItemMessage(wnd,id,BM_SETCHECK,state ? BST_CHECKED : BST_UNCHECKED,0); }
363 inline bool uButton_GetCheck(HWND wnd,UINT id) {return uSendDlgItemMessage(wnd,id,BM_GETCHECK,0,0) == BST_CHECKED;}
364 
365 
366 
367 extern "C" {
368 int SHARED_EXPORT stricmp_utf8(const char * p1,const char * p2) throw();
369 int SHARED_EXPORT stricmp_utf8_ex(const char * p1,t_size len1,const char * p2,t_size len2) throw();
370 int SHARED_EXPORT stricmp_utf8_stringtoblock(const char * p1,const char * p2,t_size p2_bytes) throw();
371 int SHARED_EXPORT stricmp_utf8_partial(const char * p1,const char * p2,t_size num = ~0) throw();
372 int SHARED_EXPORT stricmp_utf8_max(const char * p1,const char * p2,t_size p1_bytes) throw();
373 t_size SHARED_EXPORT uReplaceStringAdd(pfc::string_base & out,const char * src,t_size src_len,const char * s1,t_size len1,const char * s2,t_size len2,bool casesens);
374 t_size SHARED_EXPORT uReplaceCharAdd(pfc::string_base & out,const char * src,t_size src_len,unsigned c1,unsigned c2,bool casesens);
375 //all lengths in uReplaceString functions are optional, set to -1 if parameters is a simple null-terminated string
376 void SHARED_EXPORT uAddStringLower(pfc::string_base & out,const char * src,t_size len = ~0);
377 void SHARED_EXPORT uAddStringUpper(pfc::string_base & out,const char * src,t_size len = ~0);
378 }
379 
381 public:
382  static int compare(const char * p_string1,const char * p_string2) throw() {return stricmp_utf8(p_string1,p_string2);}
383 };
384 
385 inline void uStringLower(pfc::string_base & out,const char * src,t_size len = ~0) {out.reset();uAddStringLower(out,src,len);}
386 inline void uStringUpper(pfc::string_base & out,const char * src,t_size len = ~0) {out.reset();uAddStringUpper(out,src,len);}
387 
388 inline t_size uReplaceString(pfc::string_base & out,const char * src,t_size src_len,const char * s1,t_size len1,const char * s2,t_size len2,bool casesens)
389 {
390  out.reset();
391  return uReplaceStringAdd(out,src,src_len,s1,len1,s2,len2,casesens);
392 }
393 
394 inline t_size uReplaceChar(pfc::string_base & out,const char * src,t_size src_len,unsigned c1,unsigned c2,bool casesens)
395 {
396  out.reset();
397  return uReplaceCharAdd(out,src,src_len,c1,c2,casesens);
398 }
399 
401 {
402 public:
403  explicit string_lower(const char * ptr,t_size p_count = ~0) {uAddStringLower(m_data,ptr,p_count);}
404  inline operator const char * () const {return m_data.get_ptr();}
405  inline t_size length() const {return m_data.length();}
406  inline bool is_empty() const {return length() == 0;}
407  inline const char * get_ptr() const {return m_data.get_ptr();}
408 private:
410 };
411 
413 {
414 public:
415  explicit string_upper(const char * ptr,t_size p_count = ~0) {uAddStringUpper(m_data,ptr,p_count);}
416  inline operator const char * () const {return m_data.get_ptr();}
417  inline t_size length() const {return m_data.length();}
418  inline bool is_empty() const {return length() == 0;}
419  inline const char * get_ptr() const {return m_data.get_ptr();}
420 private:
422 };
423 
424 
425 inline BOOL uGetLongPathNameEx(const char * name,pfc::string_base & out)
426 {
427  if (uGetLongPathName(name,out)) return TRUE;
428  return uGetFullPathName(name,out);
429 }
430 
432 {
433  enum
434  {
435  m_facename_length = LF_FACESIZE*2,
436  m_height_dpi = 480,
437  };
438 
443  char m_facename[m_facename_length];
444 
445  bool operator==(const t_font_description & other) const {return g_equals(*this, other);}
446  bool operator!=(const t_font_description & other) const {return !g_equals(*this, other);}
447 
448  static bool g_equals(const t_font_description & v1, const t_font_description & v2) {
449  return v1.m_height == v2.m_height && v1.m_weight == v2.m_weight && v1.m_italic == v2.m_italic && v1.m_charset == v2.m_charset && pfc::strcmp_ex(v1.m_facename, m_facename_length, v2.m_facename, m_facename_length) == 0;
450  }
451 
452  HFONT SHARED_EXPORT create() const;
453  bool SHARED_EXPORT popup_dialog(HWND p_parent);
454  void SHARED_EXPORT from_font(HFONT p_font);
455  static t_font_description SHARED_EXPORT g_from_font(HFONT p_font);
456  static t_font_description SHARED_EXPORT g_from_logfont(LOGFONT const & lf);
457  static t_font_description SHARED_EXPORT g_from_system(int id = TMT_MENUFONT);
458 
459  template<typename t_stream,typename t_abort> void to_stream(t_stream p_stream,t_abort & p_abort) const;
460  template<typename t_stream,typename t_abort> void from_stream(t_stream p_stream,t_abort & p_abort);
461 };
462 
463 /* relevant types not yet defined here */ template<typename t_stream,typename t_abort> void t_font_description::to_stream(t_stream p_stream,t_abort & p_abort) const {
464  p_stream->write_lendian_t(m_height,p_abort);
465  p_stream->write_lendian_t(m_weight,p_abort);
466  p_stream->write_lendian_t(m_italic,p_abort);
467  p_stream->write_lendian_t(m_charset,p_abort);
468  p_stream->write_string(m_facename,PFC_TABSIZE(m_facename),p_abort);
469 }
470 
471 /* relevant types not yet defined here */ template<typename t_stream,typename t_abort> void t_font_description::from_stream(t_stream p_stream,t_abort & p_abort) {
472  p_stream->read_lendian_t(m_height,p_abort);
473  p_stream->read_lendian_t(m_weight,p_abort);
474  p_stream->read_lendian_t(m_italic,p_abort);
475  p_stream->read_lendian_t(m_charset,p_abort);
476  pfc::string8 temp;
477  p_stream->read_string(temp,p_abort);
478  strncpy_s(m_facename,temp,PFC_TABSIZE(m_facename));
479 }
480 
481 
483 {
485  bool m_in_use;
486 };
487 
488 extern "C" {
489  void SHARED_EXPORT ModalDialog_Switch(t_modal_dialog_entry & p_entry);
490  void SHARED_EXPORT ModalDialog_PokeExisting();
491  bool SHARED_EXPORT ModalDialog_CanCreateNew();
492 
493  HWND SHARED_EXPORT FindOwningPopup(HWND p_wnd);
494  void SHARED_EXPORT PokeWindow(HWND p_wnd);
495 };
496 
497 static bool ModalDialogPrologue() {
498  bool rv = ModalDialog_CanCreateNew();
499  if (!rv) ModalDialog_PokeExisting();
500  return rv;
501 }
502 
505 public:
507  inline modal_dialog_scope(HWND p_wnd) throw() : m_initialized(false) {initialize(p_wnd);}
509  inline modal_dialog_scope() throw() : m_initialized(false) {}
510  inline ~modal_dialog_scope() throw() {deinitialize();}
511 
514  inline static bool can_create() throw(){return ModalDialog_CanCreateNew();}
516  inline static void poke_existing() throw() {ModalDialog_PokeExisting();}
517 
519  void initialize(HWND p_wnd) throw()
520  {
521  if (!m_initialized)
522  {
523  m_initialized = true;
524  m_entry.m_in_use = true;
525  m_entry.m_wnd_to_poke = p_wnd;
526  ModalDialog_Switch(m_entry);
527  }
528  }
529 
530  void deinitialize() throw()
531  {
532  if (m_initialized)
533  {
534  ModalDialog_Switch(m_entry);
535  m_initialized = false;
536  }
537  }
538 
539 
540 
541 private:
542  modal_dialog_scope(const modal_dialog_scope & p_scope) {assert(0);}
543  const modal_dialog_scope & operator=(const modal_dialog_scope &) {assert(0); return *this;}
544 
546 
548 };
549 
550 
551 
552 #include "audio_math.h"
553 #include "win32_misc.h"
554 
555 #include "fb2kdebug.h"
556 
557 #if FB2K_LEAK_STATIC_OBJECTS
558 #define FB2K_STATIC_OBJECT(TYPE, NAME) static TYPE & NAME = * new TYPE;
559 #else
560 #define FB2K_STATIC_OBJECT(TYPE, NAME) static TYPE NAME;
561 #endif
562 
563 #endif //_SHARED_DLL__SHARED_H_
BOOL SHARED_EXPORT uExpandEnvironmentStrings(const char *src, pfc::string_base &out)
void SHARED_EXPORT PokeWindow(HWND p_wnd)
static void poke_existing()
Activates the top-level modal dialog existing, if one exists.
Definition: shared.h:516
BOOL SHARED_EXPORT uGetClipboardFormatName(UINT format, pfc::string_base &out)
int SHARED_EXPORT stricmp_utf8_partial(const char *p1, const char *p2, t_size num=~0)
static bool ModalDialogPrologue()
Definition: shared.h:497
bool SHARED_EXPORT ModalDialog_CanCreateNew()
BOOL SHARED_EXPORT uShellNotifyIconEx(DWORD dwMessage, HWND wnd, UINT id, UINT callbackmsg, HICON icon, const char *tip, const char *balloon_title, const char *balloon_msg)
void SHARED_EXPORT uPrintCrashInfo_AddEnvironmentInfo(const char *p_info)
BOOL SHARED_EXPORT uSetDlgItemText(HWND wnd, UINT id, const char *p_text)
BOOL SHARED_EXPORT uExtTextOut(HDC dc, int x, int y, UINT flags, const RECT *rect, const char *text, UINT cb, const int *lpdx)
uint8_t t_uint8
Definition: int_types.h:9
HANDLE SHARED_EXPORT uCreateEvent(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, const char *lpName)
HMENU SHARED_EXPORT uLoadMenu(HINSTANCE hIns, const char *name)
int SHARED_EXPORT stricmp_utf8_ex(const char *p1, t_size len1, const char *p2, t_size len2)
int SHARED_EXPORT stricmp_utf8_max(const char *p1, const char *p2, t_size p1_bytes)
char m_facename[m_facename_length]
Definition: shared.h:443
int SHARED_EXPORT uMessageBox(HWND wnd, const char *text, const char *caption, UINT type)
void to_stream(t_stream p_stream, t_abort &p_abort) const
Definition: shared.h:463
pfc::string8 m_data
Definition: shared.h:409
HANDLE SHARED_EXPORT CreateFileAbortable(__in LPCWSTR lpFileName, __in DWORD dwDesiredAccess, __in DWORD dwShareMode, __in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes, __in DWORD dwCreationDisposition, __in DWORD dwFlagsAndAttributes, __in_opt HANDLE hAborter)
HTREEITEM SHARED_EXPORT uTreeView_InsertItem(HWND wnd, const uTVINSERTSTRUCT *param)
DWORD SHARED_EXPORT uGetFileAttributes(const char *fn)
Definition: pfc.h:71
static bool can_create()
Returns whether creation of a new modal dialog is allowed (false when there&#39;s another one active)...
Definition: shared.h:514
void SHARED_EXPORT uPrintCrashInfo_SetComponentList(const char *p_info)
int SHARED_EXPORT stricmp_utf8_stringtoblock(const char *p1, const char *p2, t_size p2_bytes)
void SHARED_EXPORT uDumpCrashInfo(LPEXCEPTION_POINTERS param)
bool uButton_GetCheck(HWND wnd, UINT id)
Definition: shared.h:363
uint64_t t_uint64
Definition: int_types.h:3
virtual ~uFindFile()
Definition: shared.h:167
void SHARED_EXPORT uPrintfV(pfc::string_base &out, const char *fmt, va_list arglist)
DWORD SHARED_EXPORT uGetModuleFileName(HMODULE hMod, pfc::string_base &out)
BOOL SHARED_EXPORT uGetCurrentDirectory(pfc::string_base &out)
void initialize(HWND p_wnd)
Initializes the scope with specified window handle.
Definition: shared.h:519
BOOL SHARED_EXPORT uGetClipboardString(pfc::string_base &out)
puResource SHARED_EXPORT uLoadResource(HMODULE hMod, const char *name, const char *type, WORD wLang=MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL))
BOOL SHARED_EXPORT uGetWindowText(HWND wnd, pfc::string_base &out)
bool IsDirectory()
Definition: shared.h:168
BOOL SHARED_EXPORT uGetShortPathName(const char *src, pfc::string_base &out)
uFindFile * puFindFile
Definition: shared.h:171
The purpose of modal_dialog_scope is to help to avoid the modal dialog recursion problem. Current toplevel modal dialog handle is stored globally, so when creation of a new modal dialog is blocked, it can be activated to indicate the reason for the task being blocked.
Definition: shared.h:504
string_upper(const char *ptr, t_size p_count=~0)
Definition: shared.h:415
int SHARED_EXPORT uStringCompare_ConvertNumbers(const char *elem1, const char *elem2)
string_utf8_from_window(HWND wnd)
Definition: shared.h:285
HANDLE SHARED_EXPORT uSortStringCreate(const char *src)
void SHARED_EXPORT uOutputDebugString(const char *msg)
HMODULE SHARED_EXPORT uGetModuleHandle(const char *name)
static bool g_equals(const t_font_description &v1, const t_font_description &v2)
Definition: shared.h:448
static const GUID icon
Album-specific icon (NOT a file type icon).
Definition: album_art.h:34
BOOL SHARED_EXPORT uTextOutColors(HDC dc, const char *src, UINT len, int x, int y, const RECT *clip, BOOL is_selected, DWORD default_color)
BOOL SHARED_EXPORT uGetWindowsDirectory(pfc::string_base &out)
typedef BOOL(WINAPI *pPowerSetRequest_t)(__in HANDLE PowerRequest
HWND SHARED_EXPORT uCreateStatusWindow(LONG style, const char *text, HWND parent, UINT id)
t_size length() const
Definition: shared.h:353
BOOL SHARED_EXPORT uGetFullPathName(const char *name, pfc::string_base &out)
UINT SHARED_EXPORT uCharUpper(UINT c)
bool operator!=(const t_font_description &other) const
Definition: shared.h:446
BOOL SHARED_EXPORT uGetDlgItemText(HWND wnd, UINT id, pfc::string_base &out)
BOOL SHARED_EXPORT uBrowseForFolder(HWND parent, const char *title, pfc::string_base &out)
HMODULE SHARED_EXPORT LoadSystemLibrary(const TCHAR *name)
HANDLE SHARED_EXPORT uCreateFile(const char *p_path, DWORD p_access, DWORD p_sharemode, LPSECURITY_ATTRIBUTES p_security_attributes, DWORD p_createmode, DWORD p_flags, HANDLE p_template)
static void uPrintf(pfc::string_base &out, const char *fmt,...)
Definition: shared.h:243
static int compare(const char *p_string1, const char *p_string2)
Definition: shared.h:382
void uStringUpper(pfc::string_base &out, const char *src, t_size len=~0)
Definition: shared.h:386
void deinitialize()
Definition: shared.h:530
void SHARED_EXPORT uPrintCrashInfo_SetDumpPath(const char *name)
bool is_empty() const
Definition: shared.h:418
UINT SHARED_EXPORT uGetMenuItemType(HMENU menu, UINT position)
t_uint8 m_italic
Definition: shared.h:441
void SHARED_EXPORT uFixAmpersandChars_v2(const char *src, pfc::string_base &out)
bool is_empty() const
Definition: shared.h:406
int SHARED_EXPORT stricmp_utf8(const char *p1, const char *p2)
puFindFile SHARED_EXPORT uFindFirstFile(const char *path)
BOOL uGetLongPathNameEx(const char *name, pfc::string_base &out)
Definition: shared.h:425
BOOL SHARED_EXPORT uGetTempFileName(const char *path_name, const char *prefix, UINT unique, pfc::string_base &out)
LRESULT SHARED_EXPORT uSendMessageText(HWND wnd, UINT msg, WPARAM wp, const char *text)
t_size length() const
Definition: shared.h:417
bool is_empty() const
Definition: shared.h:295
int SHARED_EXPORT uSortStringCompareEx(HANDLE string1, HANDLE string2, DWORD flags)
int SHARED_EXPORT uGetKeyNameText(LONG lparam, pfc::string_base &out)
BOOL SHARED_EXPORT uGetOpenFileName(HWND parent, const char *p_ext_mask, unsigned def_ext_mask, const char *p_def_ext, const char *p_title, const char *p_directory, pfc::string_base &p_filename, BOOL b_save)
BOOL SHARED_EXPORT uSetClipboardString(const char *ptr)
t_size SHARED_EXPORT uReplaceStringAdd(pfc::string_base &out, const char *src, t_size src_len, const char *s1, t_size len1, const char *s2, t_size len2, bool casesens)
t_size length() const
Definition: shared.h:405
modal_dialog_scope()
This constructor leaves the scope uninitialized (you can call initialize() later with your window han...
Definition: shared.h:509
typedef HANDLE(WINAPI *pPowerCreateRequest_t)(__in void *Context)
BOOL SHARED_EXPORT uShellNotifyIcon(DWORD dwMessage, HWND wnd, UINT id, UINT callbackmsg, HICON icon, const char *tip)
const modal_dialog_scope & operator=(const modal_dialog_scope &)
Definition: shared.h:543
UINT SHARED_EXPORT uGetTextHeight(HDC dc)
BOOL SHARED_EXPORT uListBox_GetText(HWND listbox, UINT index, pfc::string_base &out)
int SHARED_EXPORT uTabCtrl_InsertItem(HWND wnd, t_size idx, const uTCITEM *item)
virtual ~uGetOpenFileNameMultiResult()
Definition: shared.h:143
BOOL SHARED_EXPORT uMoveFile(const char *src, const char *dst)
const char * get_ptr() const
Definition: shared.h:296
HICON SHARED_EXPORT uLoadIcon(HINSTANCE hIns, const char *name)
int strcmp_ex(const char *p1, t_size n1, const char *p2, t_size n2)
const char * get_ptr() const
Definition: shared.h:355
BOOL SHARED_EXPORT uSetClipboardRawData(UINT format, const void *ptr, t_size size)
int SHARED_EXPORT uStringCompare(const char *elem1, const char *elem2)
BOOL SHARED_EXPORT uCreateDirectory(const char *fn, LPSECURITY_ATTRIBUTES blah)
TVINSERTSTRUCTA uTVINSERTSTRUCT
Definition: shared.h:206
BOOL SHARED_EXPORT uGetSystemDirectory(pfc::string_base &out)
Definition: shared.h:482
HINSTANCE SHARED_EXPORT uShellExecute(HWND wnd, const char *oper, const char *file, const char *params, const char *dir, int cmd)
t_size SHARED_EXPORT uReplaceCharAdd(pfc::string_base &out, const char *src, t_size src_len, unsigned c1, unsigned c2, bool casesens)
BOOL SHARED_EXPORT uGetEnvironmentVariable(const char *name, pfc::string_base &out)
BOOL SHARED_EXPORT uTextOutColorsTabbed(HDC dc, const char *src, UINT src_len, const RECT *item, int border, const RECT *clip, BOOL selected, DWORD default_color, BOOL use_columns)
size_t t_size
Definition: int_types.h:48
BOOL SHARED_EXPORT uRemoveDirectory(const char *fn)
UINT SHARED_EXPORT uDdeInitialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd, DWORD ulRes)
UINT SHARED_EXPORT uDragQueryFileCount(HDROP hDrop)
BOOL SHARED_EXPORT uGetTextExtentPoint32(HDC dc, const char *text, UINT cb, LPSIZE size)
int SHARED_EXPORT uSortStringCompare(HANDLE string1, HANDLE string2)
virtual t_size get_count() const =0
uResource * puResource
Definition: shared.h:254
HANDLE SHARED_EXPORT uLoadImage(HINSTANCE hIns, const char *name, UINT type, int x, int y, UINT flags)
int SHARED_EXPORT uCompareString(DWORD flags, const char *str1, unsigned len1, const char *str2, unsigned len2)
pfc::string8 m_data
Definition: shared.h:421
void SHARED_EXPORT uPrintCrashInfo_OnEvent(const char *message, t_size length)
BOOL SHARED_EXPORT uDeleteFile(const char *fn)
BOOL SHARED_EXPORT uGetClassName(HWND wnd, pfc::string_base &out)
BOOL SHARED_EXPORT uSetWindowTextEx(HWND wnd, const char *p_text, unsigned p_text_length)
bool operator==(const t_font_description &other) const
Definition: shared.h:445
LRESULT SHARED_EXPORT uSendDlgItemMessageText(HWND wnd, UINT id, UINT msg, WPARAM wp, const char *text)
UINT SHARED_EXPORT uCharLower(UINT c)
t_size SHARED_EXPORT uPrintCrashInfo(LPEXCEPTION_POINTERS param, const char *extrainfo, char *out)
BOOL SHARED_EXPORT uSetWindowText(HWND wnd, const char *p_text)
BOOL SHARED_EXPORT uInsertMenu(HMENU menu, UINT position, UINT flags, UINT_PTR id, const char *content)
BOOL SHARED_EXPORT uAppendMenu(HMENU menu, UINT flags, UINT_PTR id, const char *content)
int SHARED_EXPORT uCharCompare(t_uint32 p_char1, t_uint32 p_char2)
void uStringLower(pfc::string_base &out, const char *src, t_size len=~0)
Definition: shared.h:385
HWND SHARED_EXPORT uCreateWindowEx(DWORD dwExStyle, const char *lpClassName, const char *lpWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam)
HIMAGELIST SHARED_EXPORT uImageList_LoadImage(HINSTANCE hi, const char *lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags)
bool SHARED_EXPORT uTreeView_GetText(HWND wnd, HTREEITEM item, pfc::string_base &out)
t_uint32 m_height
Definition: shared.h:439
BOOL SHARED_EXPORT uSetCurrentDirectory(const char *path)
virtual ~uResource()
Definition: shared.h:251
uStringPrintf(const char *fmt,...)
Definition: shared.h:345
BOOL SHARED_EXPORT uDragQueryFile(HDROP hDrop, UINT idx, pfc::string_base &out)
int SHARED_EXPORT uTabCtrl_SetItem(HWND wnd, t_size idx, const uTCITEM *item)
BOOL SHARED_EXPORT uSearchPath(const char *path, const char *filename, const char *extension, pfc::string_base &p_out)
int SHARED_EXPORT uSortPathCompare(HANDLE string1, HANDLE string2)
HCURSOR SHARED_EXPORT uLoadCursor(HINSTANCE hIns, const char *name)
string_utf8_from_window(HWND wnd, UINT id)
Definition: shared.h:289
void create(pfc::string_formatter &p_out, const t_entry_list &p_data)
Definition: cue_creator.cpp:44
UINT SHARED_EXPORT uGetFontHeight(HFONT font)
HINSTANCE hIns
puResource SHARED_EXPORT LoadResourceEx(HMODULE hMod, const TCHAR *name, const TCHAR *type, WORD wLang=MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL))
HRSRC SHARED_EXPORT uFindResource(HMODULE hMod, const char *name, const char *type, WORD wLang=MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL))
void SHARED_EXPORT uAddStringLower(pfc::string_base &out, const char *src, t_size len=~0)
BOOL SHARED_EXPORT uGetLongPathName(const char *name, pfc::string_base &out)
modal_dialog_scope(const modal_dialog_scope &p_scope)
Definition: shared.h:542
const char * toString() const
Definition: shared.h:356
BOOL SHARED_EXPORT uFixPathCaps(const char *path, pfc::string_base &p_out)
static void uAddDebugEvent(const char *msg)
Definition: shared.h:275
HINSTANCE SHARED_EXPORT uLoadLibrary(const char *name)
const char * toString() const
Definition: string_base.h:206
t_size length() const
Definition: shared.h:294
BOOL SHARED_EXPORT uLoadString(HINSTANCE ins, UINT id, pfc::string_base &out)
UINT SHARED_EXPORT uRegisterWindowMessage(const char *name)
HANDLE SHARED_EXPORT GetInfiniteWaitEvent()
BOOL SHARED_EXPORT uModifyMenu(HMENU menu, UINT id, UINT flags, UINT newitem, const char *data)
BOOL SHARED_EXPORT uGetUserName(pfc::string_base &out)
BOOL SHARED_EXPORT uFormatSystemErrorMessage(pfc::string_base &p_out, DWORD p_code)
BOOL SHARED_EXPORT uGetMenuString(HMENU menu, UINT id, pfc::string_base &out, UINT flag)
void SHARED_EXPORT ModalDialog_Switch(t_modal_dialog_entry &p_entry)
New EXPERIMENTAL string class, allowing efficient copies and returning from functions. Does not implement the string_base interface so you still need string8 in many cases. Safe to pass between DLLs, but since a reference is used, objects possibly created by other DLLs must be released before owning DLLs are unloaded.
Definition: stringNew.h:19
pfc::string8_fastalloc m_data
Definition: shared.h:358
t_uint8 m_charset
Definition: shared.h:442
modal_dialog_scope(HWND p_wnd)
This constructor initializes the modal dialog scope with specified dialog handle. ...
Definition: shared.h:507
uFindFile()
Definition: shared.h:158
t_size uReplaceChar(pfc::string_base &out, const char *src, t_size src_len, unsigned c1, unsigned c2, bool casesens)
Definition: shared.h:394
BOOL SHARED_EXPORT uChooseColor(DWORD *p_color, HWND parent, DWORD *p_custom_colors)
BOOL SHARED_EXPORT uSetDlgItemTextEx(HWND wnd, UINT id, const char *p_text, unsigned p_text_length)
puGetOpenFileNameMultiResult SHARED_EXPORT uGetOpenFileNameMulti(HWND parent, const char *p_ext_mask, unsigned def_ext_mask, const char *p_def_ext, const char *p_title, const char *p_directory)
void SHARED_EXPORT uSortStringFree(HANDLE string)
const char * GetFileName(t_size index)
Definition: shared.h:142
LPARAM SHARED_EXPORT uTreeView_GetUserData(HWND wnd, HTREEITEM item)
HWND SHARED_EXPORT FindOwningPopup(HWND p_wnd)
char * uCharNext(char *src)
Definition: shared.h:278
HSZ SHARED_EXPORT uDdeCreateStringHandle(DWORD ins, const char *src)
const char * get_ptr() const
Definition: shared.h:407
void SHARED_EXPORT uAddStringUpper(pfc::string_base &out, const char *src, t_size len=~0)
const char * get_ptr() const
Definition: shared.h:419
string_lower(const char *ptr, t_size p_count=~0)
Definition: shared.h:403
BOOL SHARED_EXPORT uBrowseForFolderWithFile(HWND parent, const char *title, pfc::string_base &out, const char *p_file_to_find)
pfc::string8 m_data
Definition: shared.h:298
BOOL SHARED_EXPORT uGetTempPath(pfc::string_base &out)
HANDLE SHARED_EXPORT uCreateMutex(LPSECURITY_ATTRIBUTES blah, BOOL bInitialOwner, const char *name)
t_uint32 m_weight
Definition: shared.h:440
t_size uReplaceString(pfc::string_base &out, const char *src, t_size src_len, const char *s1, t_size len1, const char *s2, t_size len2, bool casesens)
Definition: shared.h:388
t_modal_dialog_entry m_entry
Definition: shared.h:545
void SHARED_EXPORT uPrintCrashInfo_Init(const char *name)
BOOL SHARED_EXPORT uFileExists(const char *fn)
void SHARED_EXPORT ModalDialog_PokeExisting()
uGetOpenFileNameMultiResult * puGetOpenFileNameMultiResult
Definition: shared.h:146
void from_stream(t_stream p_stream, t_abort &p_abort)
Definition: shared.h:471
HANDLE SHARED_EXPORT uCreateFileMapping(HANDLE hFile, LPSECURITY_ATTRIBUTES lpFileMappingAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, const char *lpName)
bool is_empty() const
Definition: shared.h:354
void SHARED_EXPORT uFixAmpersandChars(const char *src, pfc::string_base &out)
string8_t< pfc::alloc_fast_aggressive > string8_fastalloc
Definition: string_base.h:436
t_size SHARED_EXPORT uCharLength(const char *src)
LRESULT uButton_SetCheck(HWND wnd, UINT id, bool state)
Definition: shared.h:362
T get_item(t_size n) const
Definition: list.h:16
void SHARED_EXPORT uGetCommandLine(pfc::string_base &out)
UINT SHARED_EXPORT uRegisterClipboardFormat(const char *name)
uint32_t t_uint32
Definition: int_types.h:5
TCITEMA uTCITEM
Definition: shared.h:216
t_size length() const
For compatibility with old conventions.
Definition: string_base.h:209
BOOL SHARED_EXPORT uDdeAccessData_Text(HDDEDATA data, pfc::string_base &out)
puGetOpenFileNameMultiResult SHARED_EXPORT uBrowseForFolderEx(HWND parent, const char *title, const char *initPath)
bool m_initialized
Definition: shared.h:547
puGetOpenFileNameMultiResult SHARED_EXPORT uEvalKnownFolder(const GUID &id)
BOOL SHARED_EXPORT uDdeQueryString(DWORD ins, HSZ hsz, pfc::string_base &out)