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