uLib  User mode C/C++ extended API library for Win32 programmers.
UtilFunc.h
Go to the documentation of this file.
1 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 // Project: uLib - User mode utility library.
3 // Module: Utility functions (hence the u in uLib)
4 // Author: Copyright (c) Love Nystrom
5 // License: NNOSL (BSD descendant, see NNOSL.txt in the base directory).
6 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 
8 #ifndef __UtilFunc_h_incl__
9 #define __UtilFunc_h_incl__
10 
11 #include <uLib/Common.h>
12 
13 // The original UtilFunc.cpp had grown so large it's now split into smaller units.
14 // However, the declarations are all here, in UtilFunc.h.
15 // > UtilFunc.cpp - Some fundamentals..
16 // > IoUtil.cpp - I/O related functions.
17 // > UserUtil.cpp - User32 related functions.
18 // > GdiUtil.cpp - GDI32 related functions.
19 // > KernelUtil.cpp - Kernel32 related functions.
20 // > SecUtil.cpp - Security related functions. (See also UmLsa.cpp)
21 // > ShellUtil.cpp - Shell32 related functions.
22 
23 //+============================================================================
28 //+============================================================================
30 
32 
33 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 
39 POINT MkPoint( LONG x, LONG y );
40 POINTS MkPointS( SHORT x, SHORT y );
41 SIZE MkSize( LONG cx, LONG cy );
42 SIZES MkSizeS( SHORT cx, SHORT cy );
43 RECT MkRect( LONG L, LONG T, LONG R, LONG B );
44 RECTS MkRectS( SHORT L, SHORT T, SHORT R, SHORT B );
45 
46 #ifdef __cplusplus
47 BEGIN_EXTERN_CPP // Operator and function overloading requires C++ linkage
48 
49  POINT MkPoint( const POINTS& p );
50  POINTS MkPointS( const POINT& p );
55 
56  BEGIN_NAMESPACE( uLib ) // Point comparators
57  bool operator == ( POINT P1, POINT P2 );
58  bool operator != ( POINT P1, POINT P2 );
59  bool operator == ( POINTS P1, POINTS P2 );
60  bool operator != ( POINTS P1, POINTS P2 );
62 
64 #else
65 // In C You may use POINTSTOPOINT() and POINTTOPOINTS()
66 #endif
67 
69 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105 
108 
109 void DiffRect( PRECT Borders, LPCRECT Outer, LPCRECT Inner );
110 
113 
114 void InflateBorders( PRECT Target, LPCRECT Borders );
115 
118 
119 void AbsDiffRect( PRECT Borders, LPCRECT Outer, LPCRECT Inner );
120 
123 
124 void AbsInflateBorders( PRECT Target, LPCRECT Borders );
125 
126 //==---------------------------------------------------------------------------
127 // Some rect conversions. Returns the (modified) argument for ease of chaining.
128 //==---------------------------------------------------------------------------
129 
132 
133 LPRECT AbsToDimRect( LPRECT pRect );
134 
137 
138 LPRECT DimToAbsRect( LPRECT pRect );
139 
142 
143 LPRECT AbsToRelRect( LPRECT pRect );
144 
146 
147 LPRECT NegateRect( LPRECT pRect );
148 
153 
154 void FitRect( IN PRECT pRc, IN PRECT pBounds, OUT PRECT pOut );
155 
156 //==---------------------------------------------------------------------------
157 // Rect macros inherited from somewhere I can't remember, probably a MS sample.
158 //==---------------------------------------------------------------------------
159 
160 #ifndef RECT_WIDTH
161  #define RECT_WIDTH(r) ((r).right - (r).left)
162  #define RECT_HEIGHT(r) ((r).bottom - (r).top)
163 #endif
164 
166 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
169 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171 
174 
175 extern IMalloc* ShMalloc; // In ShellUtil.cpp
176 
181 
182 bool InitShellFunc( bool useOle DEF_(false), DWORD coFlag DEF_(COINIT_APARTMENTTHREADED) );
183 void DoneShellFunc();
184 bool ShellFuncInitialized();
185 
190 
191 PVOID ShellFreeEx( PVOID pBlk );
192 
208 
209 LPITEMIDLIST GetPathNamePIDL( CSTR Dir, ULONG* pAttrib OPTIONAL DEF_(NULL) );
210 
217 
218 bool RecycleFile( CSTR Name, bool Confirm DEF_(true), bool Single DEF_(true) );
219 
220 #ifdef __GNUC__ // MinGW is missing these SHFileOperation flags:
221  #ifndef FOF_NO_UI
222  #define FOF_NO_CONNECTED_ELEMENTS 0x2000
223  #define FOF_NORECURSION 0x1000
224  #define FOF_WANTNUKEWARNING 0x4000
225  #define FOF_NORECURSEREPARSE 0x8000
226  #define FOF_NO_UI (FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR)
227  #endif
228 #endif // __GNUC__
229 
234 
235 DWORD GetDLLVersion( CSTR FName );
236 #define PACKVERSION( maj,min ) ((DWORD)MAKELONG( min,maj ))
237 
238 
242 typedef struct _LINKDATA
243 {
244  // Mandatory members
245 
246  LPTSTR Pathname;
248 
249  // Optional members
250 
251  LPTSTR Desc;
252  LPTSTR Args;
253  LPTSTR IconPath;
254  int IconIndex;
255  LPTSTR WorkingDir;
256  int ShowCmd;
258  LPITEMIDLIST IdList;
259 }
261 
265 #define LDF_DESC 0x00000001
266 #define LDF_ARGS 0x00000002
267 #define LDF_ICON 0x00000004
268 #define LDF_WORKDIR 0x00000008
269 #define LDF_HOTKEY 0x00000010
270 #define LDF_SHOWCMD 0x00000020
271 #define LDF_PIDL 0x00000040
272 #define LDF_ALL ( \
274  LDF_DESC | LDF_ARGS | LDF_ICON | LDF_WORKDIR | LDF_HOTKEY | LDF_SHOWCMD \
275  )
276 
283 
284 HRESULT Shell_CreateLink( CSTR LinkFilePathname, IN const PLINKDATA pLink );
285 
292 
293 HRESULT Shell_ResolveLink( HWND hWnd, CSTR LinkFilePathname, OUT PLINKDATA pLink );
294 
298 
299 HRESULT ShowShareFolderUI( HWND hParent, CSTR Path );
300 
307 
308 HRESULT CreateStreamOnFile( IN CSTR FName,
309  OUT IStream** ppStrm, OPTOUT DWORD* pSize DEF_(NULL)
310  );
311 
312 #if USE_VISUALSTYLE_HACK // DeactivateActCtx is not available on Win2000
313 
317 bool EnableVisualStyles( bool Enable );
318 #endif
319 
320 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
323 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
325 
328 
329 extern UINT WM_TaskbarCreated; // In ShellUtil.cpp
330 
335 
336 void InitTaskbarSupport();
337 
341 
343  UINT Action, HWND hNfy, UINT Id, HICON hIcon, CSTR Hint, UINT cbkMsg DEF_(WM_APP)
344  );
345 #if 0 // Old name "ShellNotify" is too ambiguous and is going away...
346 #define ShellNotify( hNfy,Act,hIcon,Hint,Msg ) \
347  SetTrayIconNotification( Act,hNfy,1,hIcon,Hint,Msg )
348 #endif
349 
352 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
356 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
358 
361 
362 bool InitializeSecDesc( PSECURITY_DESCRIPTOR pSecDesc, PACL AccsList DEF_(NULL) );
363 
372 
373 bool EnableProcessPrivilege( CSTR prvName, bool Enable DEF_(true) ); // Single
374 
378 
379 bool EnableProcessPrivileges( bool Enable, CSTR prvName1, ... );
380 
384 
385 PTOKEN_PRIVILEGES AllocPrivileges( UINT Count, OPTOUT PDWORD pSize DEF_(NULL) );
387 PTOKEN_PRIVILEGES FreePrivileges( PTOKEN_PRIVILEGES pPrv );
388 
402 
403 bool EnablePrivilege(
404  HANDLE hToken, CSTR Privilege, bool Enable, OPTOUT PLUID_AND_ATTRIBUTES pSave
405  );
406 bool RestorePrivilege( HANDLE hToken, PTOKEN_PRIVILEGES pSaved );
408 
422 
423 bool EnablePrivileges(
424  IN HANDLE hToken, IN bool Enable, OPTOUT PTOKEN_PRIVILEGES* ppSave,
425  ... // NULL terminated list of privilege names
426  );
427 
431 
432 bool RestorePrivileges( HANDLE hToken, PTOKEN_PRIVILEGES pSaved, bool Dispose );
433 
434 //--->> LSA authorization et c has migrated to UmLsa.h/cpp
435 
436 //==---------------------------------------------------------------------------
437 // Under consideration: Always obtain a thread token, even if none in PEB.
438 //==---------------------------------------------------------------------------
439 
440 DECLARE_HANDLE( HTOKENEX ); // Opaque control block..
441 
446 
447 HTOKENEX OpenThreadTokenEx( HANDLE hThread, ACCESS_MASK tokenAccess );
448 
454 
456 
458 
459 HANDLE GetThreadExToken( HTOKENEX hTok );
460 
462 //+============================================================================
463 //|
466 //|
467 //+============================================================================
469 
470 #ifndef DOS_EXEPAGE_SIZE
471  #define DOS_EXEPAGE_SIZE 512
474 #endif
475 
476 UINT GlobalPurgeAtom( CSTR Name );
477 CSTR GlobalAtomName( ATOM atom );
478 CSTR LocalAtomName( ATOM atom );
479 
480 // GetCurrent[Process/Thread]Handle converts the corresponding pseudo handles
481 // to real ones. Don't forget to close them when done. See also *DuplicateHandle()*.
482 
483 HANDLE GetCurrentThreadHandle();
484 HANDLE GetCurrentProcessHandle();
485 
486 HANDLE CloseHandleEx( HANDLE H );
487 HANDLE CheckHandle( HANDLE Hnd );
488 
491 
492 bool WaitFor( HANDLE hObj, DWORD msWait );
493 
494 // Additional global heap functions (supplement the WindowsX macros)
495 // Primarily intended for the clipboard and DDE.
496 
497 ASTR GlobalAllocStrA( UINT nChr );
498 WSTR GlobalAllocStrW( UINT nChr );
499 ASTR GlobalDupStrA( ACSTR Str, bool isMz DEF_(false) );
500 WSTR GlobalDupStrW( WCSTR Str, bool isMz DEF_(false) );
501 #ifdef _UNICODE
502  #define GlobalAllocStr GlobalAllocStrW
503  #define GlobalDupStr GlobalDupStrW
504 #else
505  #define GlobalAllocStr GlobalAllocStrA
506  #define GlobalDupStr GlobalDupStrA
507 #endif
508 
511 
512 HANDLE GlobalUnlockedHandle( PVOID Ptr, PUINT pCount DEF_(NULL) );
513 
516 
517 bool IsBadReadWritePtr( const PVOID address, UINT_PTR size );
518 
542 
543 HANDLE Launch(
544  CSTR ExePath, CSTR CmdLn, CSTR StartDir DEF_(NULL),
545  int iShow DEF_(SW_SHOW), DWORD Flags DEF_(NORMAL_PRIORITY_CLASS)
546  );
547 
558 
559 HANDLE CreateCapturedProcess(
560  IN CSTR cmdLn,
561  INOUT LPSTARTUPINFO pSi,
562  IN DWORD Flags,
563  OPTOUT PHANDLE pRdHnd,
564  OPTOUT PHANDLE pWrHnd,
565  OPTOUT PHANDLE pErrHnd,
566  OPTOUT PHANDLE phThread DEF_(NULL)
567  );
568 
573 
575  OPTIN CSTR ExePath,
576  OPTIN CSTR CmdLn,
577  OPTIN CSTR EnvStr,
578  OPTIN CSTR WorkDir,
579  INOUT LPSTARTUPINFO pSI,
580  IN DWORD Flags,
581  OPTOUT PHANDLE pRdHnd,
582  OPTOUT PHANDLE pWrHnd,
583  OPTOUT PHANDLE pErrHnd,
584  OPTOUT PHANDLE phThread
585  );
586 
590 
591 HANDLE CloseCapturedProcess(
592  IN HANDLE hProc,
593  IN LPSTARTUPINFO pSi,
594  OPTIN PHANDLE pRdHnd,
595  OPTIN PHANDLE pWrHnd,
596  OPTIN PHANDLE pErrHnd
597  );
598 
609 
611  OPTIN HANDLE hProc,
612  IN LPSTARTUPINFO pSi,
613  IN PHANDLE pRdHnd,
614  IN PHANDLE pWrHnd,
615  IN PHANDLE pErrHnd,
616  IN UINT RetCode DEF_(EXIT_SUCCESS)
617  );
618 
621 
622 HMODULE GetOrLoadModule( CSTR modName ); // Might be superfluous..
623 
628 
629 HMODULE LoadProcLibrary( HANDLE hProcess, LPCSTR DllPathName, DWORD msWait DEF_(5000) );
630 
634 
635 BOOL UnloadProcLibrary( HANDLE hProcess, HMODULE hRemoteLib, DWORD msWait DEF_(5000) );
636 
637 #ifndef NO_NDK_FILES
638 
642 
643 SHORT GetProcDLLRefCount( HANDLE hProcess, WCSTR DllName ); // NtFunc, preliminary
644 
667 
668 HMODULE GetProcDLLHandle( HANDLE hProcess, WCSTR DllName ); // NtFunc, preliminary
669 
670 #endif // ndef NO_NDK_FILES
671 
672 //==---------------------------------------------------------------------------
677 
681 
682 SYSTEMTIME* SystemTimeToLocalTime( INOUT SYSTEMTIME* Time );
683 
687 
688 SYSTEMTIME* LocalTimeToSystemTime( INOUT SYSTEMTIME* Time );
689 
693 
694 FILETIME FileTimeToLocalTime( FILETIME utc );
695 
697 BEGIN_NAMESPACE( uLib ) // subgroup ftime
704 //( Placed in uLib namespace (due to their terse id's), to avoid id clashes. )
706 
708 
710 {
713 };
714 
716 
717 FILETIME Now( eTimeType Domain DEF_(LOCAL_TIME) );
718 
721 
722 FILETIME AddTime( IN FILETIME Time, SHORT Hr, SHORT Min, SHORT Sec, SHORT mSec );
723 
724 #if 1 // WIP.. Not public yet.
725 FILETIME AddFiletime( FILETIME Time, const FILETIME Add );
726 #endif
727 
730 
731 FILETIME MakeDateTime( WORD Year, WORD Month, WORD Day, WORD Hr, WORD Min, WORD Sec );
732 
733 #ifdef __cplusplus // FILETIME comparators...
734 BEGIN_EXTERN_CPP // Operator overloading requires C++ linkage
735 // Note: These are possible because C++ allow global operators for structs.
736 
737 bool operator > ( FILETIME const& A, FILETIME const& B );
738 bool operator < ( FILETIME const& A, FILETIME const& B );
739 bool operator >= ( FILETIME const& A, FILETIME const& B );
740 bool operator <= ( FILETIME const& A, FILETIME const& B );
741 bool operator == ( FILETIME const& A, FILETIME const& B );
742 bool operator != ( FILETIME const& A, FILETIME const& B );
743 
745 #endif
746 
747 extern const FILETIME NullFileTime;
748 
751 END_NAMESPACE( uLib ) // subgroup ftime
754 
755 //+-----------------------------------------------------------------------------
760 //+-----------------------------------------------------------------------------
762 
764 
765 #define DeleteEnvironmentVar( pwEnv,Name ) SetEnvironmentVar( pwEnv, Name, NULL )
766 
769 
770 bool GetEnvironmentSize( WSTR pwEnv, PUINT pSize, PUINT pUsed );
771 
804 
805 WSTR CloneEnvironment( OPTOUT PUINT pLength, OPTOUT PUINT pUsed );
806 WSTR FreeEnvironment( WSTR Env );
807 
808 #ifndef NO_WINTERNAL // UNICODE_STRING
809 
823 bool SetEnvironmentVar( OPTIO WSTR* pwEnv, IN CSTR Name, IN CSTR Value );
824 
837 
838 bool GetEnvironmentVar(
839  OPTIN WSTR pwEnv, IN CSTR Name, OUT TSTR Value, INOUT PUINT ccValBuf
840  );
841 
852 // See also DeduplicateCharSeparatedText().
855 
859 
861  OPTIO WSTR* pwEnv, IN BYTE Option, IN CSTR Name, IN CSTR Addendum, OPTIN TCHAR Sep
862  );
863 
868  };
869 #endif//ndef NO_WINTERNAL
870 
878 
879 #ifndef _UNICODE
880 UINT DeduplicatePathStr( INOUT TSTR Path );
881 #endif
882 
884 
888 
889 WORD GetTargetMachine( CSTR ExeName ); // Uses ReadNTHeaders
890 
892 
893 bool Is64BitExecutable( CSTR ExeName );
894 
896 //( Written to support GetTargetMachine. )
897 
898 bool ReadNTHeaders( CSTR ExeName, IMAGE_NT_HEADERS* Hdr, bool GetOptHdr );
899 
902 
903 WORD GetInstanceTargetMachine( HINSTANCE hInst );
904 bool Is64BitInstance( HINSTANCE hInst );
905 bool Is32BitInstance( HINSTANCE hInst );
906 
907 // Human readable machine type and subsystem strings.
908 // (Might belong in a string module, but lives here for proximity reasons.)
909 
910 CSTR GetMachineStr( WORD Machine );
911 CSTR GetSubSystemStr( WORD SubSys );
912 
914 //+============================================================================
915 //|
918 //|
919 //+============================================================================
921 
922 #ifndef SYSMET
923  #define SYSMET( Id ) GetSystemMetrics( SM_##Id )
924 #endif
925 #ifndef GWL
926  #define GWL( hwnd,Item ) GetWindowLong( hwnd, GWL_##Item )
927  #define GWLP( hwnd,Item ) GetWindowLongPtr( hwnd, GWLP_##Item )
928 #endif
929 #ifndef SYSICO
930  #define SYSICO( Id ) LoadIcon( NULL, IDI_##Id )
931  #define SYSCUR( Id ) LoadCursor( NULL, IDC_##Id )
932 #endif
933 #ifndef LOADICO // Load from global hInstance
934  #define LOADICO( Id ) LoadIcon( hInstance, CSTR( Id ))
935 #endif
936 
937 #ifndef WS_VISICHILD
938  #define WS_VISICHILD (WS_CHILD | WS_VISIBLE)
939  #define WS_SCROLL (WS_VSCROLL | WS_HSCROLL)
940 #endif
941 #ifndef CS_REDRAW
942  #define CS_REDRAW (CS_HREDRAW | CS_VREDRAW)
943 #endif
944 
945 #ifndef WM_Cut
946 #define WM_Cut( hCtl ) SendMessage( hCtl, WM_CUT, 0,0 )
947 #define WM_Copy( hCtl ) SendMessage( hCtl, WM_COPY, 0,0 )
948 #define WM_Paste( hCtl ) SendMessage( hCtl, WM_PASTE, 0,0 )
949 #define WM_Clear( hCtl ) SendMessage( hCtl, WM_CLEAR, 0,0 )
950 #endif//ndef WM_Cut
951 
952 #define SimpleBeep() MessageBeep( -1 )
953 #define GetAcceleratorCount( hacc ) CopyAcceleratorTable( (HACCEL)(hacc), NULL, 0 )
954 
957 
958 UINT DispatchMessagesFor( HWND hWnd );
959 
960 //:=-------------------------------------------------------------------------=:
963 //:=-------------------------------------------------------------------------=:
965 
969 
970 bool OpenEmptyClipboard( HWND hWnd );
971 
975 
976 typedef bool (__stdcall *PFClipFmtAction)( UINT FmtTag, PVOID UserData );
977 
980 
981 UINT EnumerateClipFormats( HWND hCBOwner, PFClipFmtAction Action, PVOID UserData );
982 
987 
988 bool PutClipHandle( HWND clipboardOwner, HANDLE hClip, UINT clipFmt );
989 
995 
996 HANDLE GetClipHandle( UINT clipFmt );
997 
1002 
1003 bool PutClipboardStringA( HWND clipboardOwner, ACSTR Text );
1004 bool PutClipboardStringW( HWND clipboardOwner, WCSTR Text );
1005 #ifdef _UNICODE
1006  #define PutClipboardString PutClipboardStringW
1007 #else
1008  #define PutClipboardString PutClipboardStringA
1009 #endif
1010 
1013 
1015 
1020 
1021 PVOID DupClipboardData( UINT clipFmt, PUINT pSize OPTOUT );
1022 
1024 //:=-------------------------------------------------------------------------=:
1028 
1029 void SetWindowFloat( HWND hWnd, int Index, float Value );
1030 void SetWindowDouble( HWND hWnd, int Index, double Value );
1031 float GetWindowFloat( HWND hWnd, int Index );
1032 double GetWindowDouble( HWND hWnd, int Index );
1033 
1034 void SetClassFloat( HWND hWnd, int gcl_Ix, float Value );
1035 void SetClassDouble( HWND hWnd, int gcl_Ix, double Value );
1036 float GetClassFloat( HWND hWnd, int gcl_Ix );
1037 double GetClassDouble( HWND hWnd, int gcl_Ix );
1038 
1040 //:=-------------------------------------------------------------------------=:
1041 // Window size
1042 
1043 UINT GetWndHeight( HWND hWnd );
1044 UINT GetWndWidth( HWND hWnd );
1045 bool GetWndSize( HWND hWnd, SIZE* pSize );
1046 bool GetWndPos( HWND hWnd, POINT* pPos );
1047 
1053 
1054 BOOL GetWindowMinimizeRect( HWND hTrayApp, RECT* pRect );
1055 
1056 // More window handling support...
1057 
1058 bool CenterWindow( HWND hWnd, HWND hOwner );
1059 
1060 void GetChildWndRect( HWND hCtrl, RECT* pRc );
1061 bool EnableChildWnd( HWND Owner, UINT Id, bool Enable );
1062 HWND GetChildWndWithId( HWND hParent, UINT ChildId );
1063 
1067 
1068 HWND SetParentWnd( HWND hWnd, HWND newParent );
1069 
1071 
1072 HWND CreateWindowIndirect( LPCREATESTRUCT pc );
1073 
1077 
1078 INT_PTR DialogBoxParamEx(
1079  HINSTANCE hInst,
1080  CSTR Template,
1081  HWND hParent,
1082  DLGPROC DlgProc,
1083  LPARAM lParam,
1084  LANGID Language
1085  );
1086 
1090 
1091 HWND CreateDialogParamEx(
1092  HINSTANCE hInst,
1093  CSTR Template,
1094  HWND hParent,
1095  DLGPROC DlgProc,
1096  LPARAM lParam,
1097  LANGID Language
1098  );
1099 
1100 #if 1 // WIP..
1101 
1105 bool GetRequiredWindowSize( HWND hWnd, IN const PSIZE pClient, OUT PSIZE pWindow );
1106 
1110 
1111 bool GetWindowClientSize( HWND hWnd, IN const PSIZE pWindow, OUT PSIZE pClient );
1112 #endif
1113 
1114 bool RefreshWnd( HWND hWnd );
1115 bool RedrawWnd( HWND hWnd, UINT Flags );
1116 bool RedrawWndRect( HWND hWnd, PRECT pRect, UINT Flags );
1117 bool RedrawWndRgn( HWND hWnd, HRGN hRgn, UINT Flags );
1118 bool MoveWnd( HWND hWnd, int X, int Y, bool Repaint );
1119 bool ResizeWnd( HWND hWnd, int W, int H, bool Repaint );
1120 
1121 #define GetWndStyle( hwnd ) GetWindowLong( hwnd, GWL_STYLE )
1122 #define SetWndStyle( hwnd,style ) SetWindowLong( hwnd, GWL_STYLE, style )
1123 #define GetWndExStyle( hwnd ) GetWindowLong( hwnd, GWL_EXSTYLE )
1124 #define SetWndExStyle( hwnd,style ) SetWindowLong( hwnd, GWL_EXSTYLE, style )
1125 
1126 #ifndef WM_GetFont
1127  #define WM_GetFont( hwnd ) (HFONT)SendMessage( hwnd, WM_GETFONT, 0,0 )
1128  #define WM_SetFont( hwnd,hfnt,rdrw ) (void)SendMessage( hwnd, WM_SETFONT, (WPARAM)hfnt, rdrw )
1129 #endif
1130 
1131 #ifndef WM_SetRedraw
1132  #define WM_SetRedraw( hwnd,on ) SendMessage( hwnd, WM_SETREDRAW, on, 0 )
1133 #endif
1134 
1137 
1138 bool __cdecl SetCaption( HWND hwnd, CSTR fmt, ... );
1139 
1142 
1143 void WINAPI SetRedraw( HWND hwnd, bool on );
1144 
1146 
1147 HICON WINAPI LoadSmallIcon( HINSTANCE hInst, CSTR Id );
1148 
1150 
1151 PVOID WINAPI LoadCustomResource(
1152  HMODULE hModule, CSTR Id, CSTR Type, UINT* pSize OPTOUT DEF_(NULL)
1153  );
1154 
1157 
1158 PVOID WINAPI LoadCustomResourceEx(
1159  HMODULE hModule, CSTR Id, CSTR Type, LANGID Language OPTIN DEF_(0),
1160  UINT* pSize OPTOUT DEF_(NULL)
1161  );
1162 
1165 
1166 IPicture* WINAPI LoadPictureResource( HMODULE hModule, CSTR Id, CSTR Type );
1167 
1170 
1171 IPicture* WINAPI LoadPictureFile( CSTR FName );
1172 
1173 //> Some WinGDI that live here due to their relation to LoadPictureResource.
1180 
1181 void WINAPI PaintPicture( IPicture* pPic,
1182  HDC hdc, int x, int y, int cx DEF_(0), int cy DEF_(0)
1183  );
1184 
1193 
1194 bool WINAPI PaintPictureEx( IPicture* pPic,
1195  HDC hdc, long x, long y, long cx DEF_(0), long cy DEF_(0),
1196  long imx DEF_(0), long imy DEF_(0), long imw DEF_(0), long imh DEF_(0),
1197  PRECT prMeta DEF_(NULL)
1198  );
1199 
1200 // Convert between HiMetric and Pixel measures.
1201 
1202 long WINAPI HiMetricToPix( long hiMetric );
1203 long WINAPI PixToHiMetric( long Pix );
1204 
1205 //:=-------------------------------------------------------------------------=:
1208 //:=-------------------------------------------------------------------------=:
1210 
1221 
1222 int __cdecl MsgBox( HWND Owner, UINT Type, CSTR Cap, CSTR Fmt, ... );
1223 
1224 #define MB_INFO MB_OK| MB_ICONINFORMATION
1225 #define MB_QUERY MB_YESNO| MB_ICONQUESTION
1226 #define MB_QUERYCANCEL MB_YESNOCANCEL| MB_ICONQUESTION
1227 #define MB_WARNING MB_OK| MB_ICONEXCLAMATION
1228 #define MB_ERROR MB_OK| MB_ICONSTOP
1229 
1230 
1250 HANDLE __cdecl AsyncMsgBox( UINT Type, PINT_PTR pResult, CSTR Title, CSTR Fmt, ... );
1251 
1289 
1290 HANDLE __cdecl AsyncMsgBoxEx(
1291  HWND Owner, UINT Flags, CSTR Title,
1292  HINSTANCE hInst, CSTR IconId, DWORD LangId,
1293  DWORD_PTR HelpId, MSGBOXCALLBACK Callback,
1294  PINT_PTR pResult,
1295  CSTR TextFmt, ...
1296  );
1297 
1299 
1300 #define CloseAsyncMsgBox( hBox ) SendMessage( hBox, WM_SYSCOMMAND, SC_CLOSE, 0 )
1301 
1303 //:=-------------------------------------------------------------------------=:
1306 //:=-------------------------------------------------------------------------=:
1308 
1309 bool IsWndClass( HWND hWnd, CSTR clsName );
1310 CSTR GetWndClassName( HWND hWnd );
1311 
1312 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1315 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1317 
1321 
1322 HMENU LoadMenuEx( HMODULE hModule, CSTR Id, LANGID Language );
1323 
1325 
1326 #define MIIM_ALL \
1327  ( MIIM_STRING | MIIM_ID | MIIM_FTYPE | MIIM_STATE \
1328  | MIIM_SUBMENU | MIIM_DATA | MIIM_BITMAP | MIIM_CHECKMARKS )
1329 
1341 
1342 HMENU AddSubMenu(
1343  HMENU hMenu, UINT Index, CSTR Text,
1344  WORD Id DEF_(0), WORD State DEF_(0), PVOID Data DEF_(NULL),
1345  HBITMAP Image DEF_(NULL)
1346  );
1347 
1359 
1360 bool AddMenuItem(
1361  HMENU hMenu, UINT Index, CSTR Text, WORD cmdId,
1362  WORD State DEF_(0), PVOID Data DEF_(NULL),
1363  HBITMAP Image DEF_(NULL)
1364  );
1365 
1366 #define AddMenuSeparator( hSubMenu ) \
1367  AddMenuItem( hSubMenu, 999, NULL, (-1), 0, NULL, NULL )
1368 
1371 
1372 int GetMenuItemIdByName( HMENU hMenu, CSTR Name );
1373 
1375 
1376 LPMENUITEMINFO GetMenuItemByName( HMENU hMenu, CSTR Name );
1377 
1379 
1380 PVOID GetMenuItemData( HMENU hMenu, UINT Id );
1381 
1383 
1384 bool SetMenuItemCheck( HMENU hMenu, UINT Id, bool Check );
1385 
1387 
1388 typedef bool (__stdcall *PFnMenuItemAction)(
1389  HMENU hMenu, MENUITEMINFO* pInfo, PVOID Ctx
1390  );
1391 
1393 
1394 UINT EnumerateMenuItems( HMENU hMenu, PFnMenuItemAction Action, PVOID Ctx );
1395 
1397 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1400 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1402 
1405 
1406 double GetWndReal( HWND hCtl );
1407 double GetDlgItemReal( HWND hDlg, UINT Id );
1408 
1411 
1412 bool SetWndReal( HWND hCtl, double Value, BYTE nDeci, CSTR Suffix DEF_(NULL) );
1413 bool SetDlgItemReal( HWND hDlg, UINT Id, double Value, BYTE nDeci, CSTR Suffix DEF_(NULL) );
1415 
1417 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1420 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1422 
1423 #define MDI_CLIENTCLASS _T("MDIClient")
1424 
1425 
1428 HWND GetMDIClient( HWND hMdiFrame );
1429 
1430 // MDI message macros, send to hMdiClient...
1431 
1432 #ifndef MDITileH // from wCore
1433 #define MDITileH( hcli ) (BOOL) SendMessage( hcli, WM_MDITILE, MDITILE_HORIZONTAL,0 )
1434 #define MDITileV( hcli ) (BOOL) SendMessage( hcli, WM_MDITILE, MDITILE_VERTICAL,0 )
1435 #define MDICascade( hcli ) (BOOL) SendMessage( hcli, WM_MDICASCADE, 0,0 )
1436 #define MDIArrangeIcons( hcli ) (void) SendMessage( hcli, WM_MDIICONARRANGE, 0,0 )
1437 #define MDIActivate( hcli,hchild ) (void) SendMessage( hcli, WM_MDIACTIVATE, (WPARAM)(hchild), 0 )
1438 #define MDIGetActive( hcli,maxed ) (HWND) SendMessage( hcli, WM_MDIGETACTIVE, 0, (LPARAM)(PBOOL)(maxed) )
1439 #define MDIDestroy( hcli,hchild ) (void) SendMessage( hcli, WM_MDIDESTROY, (WPARAM)(hchild), 0 )
1440 #endif // ndef MDITileH
1441 
1442 #define MDIActivateNext( hcli,hchild ) (void) SendMessage( hcli, WM_MDINEXT, (WPARAM)(hchild),0 )
1443 #define MDIActivatePrev( hcli,hchild ) (void) SendMessage( hcli, WM_MDINEXT, (WPARAM)(hchild),1 )
1444 
1446 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1449 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1451 
1452 bool ButtonChecked( HWND hBtn );
1453 bool ButtonCtrlChecked( HWND hDlg, UINT Id );
1454 bool CheckButton( HWND hBtn, bool Check );
1455 bool CheckButtonCtrl( HWND hDlg, UINT Id, bool Check );
1456 
1458 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1461 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1463 
1465 
1466 int __cdecl AddListString( HWND hLB, CSTR Fmt, ... );
1467 
1471 
1472 int AddListItem( HWND hLB, CSTR Text, LPARAM Data DEF_(0) );
1473 
1475 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1478 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1480 
1481 // @dt A combo has 3 window handles, one for the aggregate, and two handles
1482 // for the editor and listbox parts. Retrieve the editor and list handles.
1483 
1484 HWND GetComboEditor( HWND hCombo );
1485 HWND GetComboList( HWND hCombo );
1486 
1488 // AddComboString and AddComboItem works exactly like AddListString and AddListItem.
1489 
1490 int __cdecl AddComboString( HWND hCB, CSTR Fmt, ... );
1491 int AddComboItem( HWND hCB, CSTR Text, LPARAM Data DEF_(0) );
1492 
1494 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1497 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1499 
1506 
1507 HWND CreateStatusbar( HWND hParent, UINT Id, CSTR Text, UINT Style );
1508 
1513 
1514 bool __cdecl SetStatusParts( HWND hStat, UINT nParts, ... );
1515 
1520 
1521 bool __cdecl SetStatusWidths( HWND hStat, UINT nParts, int* Width );
1522 
1532 
1533 bool __cdecl SetStatusText( HWND hStat, UINT Part, CSTR Fmt, ... );
1534 
1535 #define SB_SetParts( hctl,npart,ppart ) (BOOL) SendMessage( hctl,SB_SETPARTS,(WPARAM)(npart),(LPARAM)(ppart) )
1536 #define SB_SetText( hctl,part,text ) (BOOL) SendMessage( hctl,SB_SETTEXT,(WPARAM)(part),(LPARAM)(text) )
1537 #define SB_SetIcon( hctl,part,hico ) (BOOL) SendMessage( hctl,SB_SETICON,(WPARAM)(part),(LPARAM)(hico) )
1538 
1540 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1543 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1545 
1546 #ifndef I_NOIMAGE
1547  #define I_NOIMAGE (I_IMAGECALLBACK-1) /* Oops.. flew past I_IMAGENONE (also -2) */
1548 #endif
1549 
1564 
1565 typedef bool (__stdcall *PFLvItemAction)( HWND hList, LPLVITEM pItem, PVOID pCtx );
1566 
1575 
1576 UINT ListView_ForEach( HWND hLv, PFLvItemAction Action, PVOID pCtx );
1577 
1579 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1582 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1584 
1587 
1588 bool GetTrackbarInfo( HWND hCtl, LPSCROLLINFO psi );
1589 bool SetTrackbarInfo( HWND hCtl, LPSCROLLINFO psi, bool Redraw );
1591 
1593 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1596 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1598 
1599 //+ ImageList_CreateMapped
1620 
1621 HIMAGELIST ImageList_CreateMapped(
1622  HINSTANCE hInst, UINT Id, LPCOLORMAP Map, UINT nMap,
1623  UINT cxImg, UINT Flags, UINT nGrow
1624  );
1625 
1627 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1630 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1632 
1633 // To display correctly with CreateWindowEx, the strings must be TEXT transmutable.
1634 // However, if using CreateToolbarEx, they must always be Unicode.
1635 
1637 
1638 #define _TBS(s) (INT_PTR)_T(s) // CreateWindowEx
1639 //#define _TBS(s) (INT_PTR)L##s // CreateToolbarEx
1640 
1650 
1651 HWND CreateToolbar(
1652  HWND hParent,
1653  UINT Id,
1654  UINT x, UINT y, UINT w,
1655  UINT h,
1656  UINT cxBtn, UINT cyBtn,
1657  HIMAGELIST hImages,
1658  LPTBBUTTON Buttons,
1659  UINT nButtons,
1660  DWORD Style,
1661  DWORD ExStyle
1662  );
1663 
1664 // Since the toolbars don't honor user specified sizing no matter what,
1665 // we might as well bloody hardcode the button size and bar height above
1666 // and reduce the parameter count... Agh :(
1667 
1668 #define TBTN_HEIGHT 22
1669 #define TBTN_WIDTH 22
1670 #define TBAR_HEIGHT 26
1671 
1672 
1678 HWND CreateStdToolbar(
1679  HWND hParent, UINT Id, UINT x, UINT y, UINT w, UINT h,
1680  UINT imgType, LPTBBUTTON Buttons, UINT nButtons, DWORD Style, DWORD ExStyle
1681  );
1682 
1684 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1687 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1691 
1692 bool TreeView_GetItemText( HWND hTree, HTREEITEM hItem, TSTR Buf, UINT BufLen );
1693 
1695 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1698 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1700 
1703 
1705 
1706 // TODO: Design a flexible/easy AddRebarBand()...
1707 // E.g: bool AddRebarBand( HWND hRebar, CSTR Title, WORD Id, HWND hChild );
1708 
1710 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1711 // Tab controls ... et c.
1712 
1713  // None so far... (You may request a new API)
1714 
1717 //+============================================================================
1718 //|
1721 //|
1722 //+============================================================================
1724 
1725 #ifndef SYSHBR
1726  #define SYSHBR(id) GetSysColorBrush( COLOR_##id )
1727  #define SYSRGB(id) GetSysColor( COLOR_##id )
1728 #endif
1729 
1730 #ifndef BKGHBR
1731  #define BKGHBR(id) (HBRUSH)( 1 + COLOR_##id )
1735 #endif
1736 
1737 #ifndef RGBA
1738  #define RGBA( R,G,B,A ) \
1739  ((COLORREF) ((BYTE)(R)|((WORD)((BYTE)(G))<<8)|(((DWORD)(BYTE)(B))<<16)|(((DWORD)(BYTE)(A))<<24)))
1740  #define GetAValue( rgba ) ((BYTE)((COLORREF)(rgba) >> 24))
1741  #define GetRGBValue( rgba ) ((COLORREF)((rgba) & 0x00FFFFFF))
1742 #endif
1743 
1744 #ifndef R4_MASKBLT
1745  #define R4_MASKBLT MAKEROP4( SRCCOPY, DSTCOPY )
1748 #endif
1749 #ifndef DSTCOPY
1750  #define DSTCOPY 0x00AA0029L // Id est: NOP
1753 #endif
1754 
1755 #ifndef VLine
1756  #define VLine( dc,x, y1,y2 ) Line( dc, x,y1, x,y2 )
1757  #define HLine( dc,y, x1,x2 ) Line( dc, x1,y, x2,y )
1758 #endif
1759 
1760 #ifndef GetSystemPalette
1761  #define GetSystemPalette() (HPALETTE)GetStockObject( DEFAULT_PALETTE )
1762 #endif
1763 #ifndef GetPaletteLength
1764  #define GetPaletteLength( hPal ) GetPaletteEntries( hPal,0,0,NULL )
1765 #endif
1766 
1768 
1769 HGDIOBJ WINAPI DeleteObjectEx( HGDIOBJ hObj );
1770 
1771 #define DeleteFontEx(h) (HFONT) DeleteObjectEx( (HFONT)h )
1772 #define DeletePenEx(h) (HPEN) DeleteObjectEx( (HPEN)h )
1773 #define DeleteBrushEx(h) (HBRUSH) DeleteObjectEx( (HBRUSH)h )
1774 #define DeleteBitmapEx(h) (HBITMAP) DeleteObjectEx( (HBITMAP)h )
1775 #define DeleteRegionEx(h) (HRGN) DeleteObjectEx( (HRGN)h )
1776 
1779 
1780 void WINAPI Line( HDC hdc, int x1, int y1, int x2, int y2 );
1781 
1793 
1794 void WINAPI DrawIsoTriangle(
1795  HDC hdc, int xOrg, int yOrg, int Radius, double Orientation
1796  );
1797 
1804 
1805 void WINAPI GetIsoTriangleVertices(
1806  POINT* Vtx, int xOrg, int yOrg, int Radius, double Orientation
1807  );
1808 
1809 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1812 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1814 
1817 
1818 COLORREF WINAPI ScaleColorRef( COLORREF color, BYTE mul, BYTE div );
1819 
1827 
1828 COLORREF WINAPI GradientColor( COLORREF c1, COLORREF c2, WORD Ix, WORD Length );
1829 
1832 
1833 COLORREF WINAPI GrayScaleColor( COLORREF rgb );
1834 
1835 //++ RGB byte order swappers
1836 
1837 #ifdef _MSC_VER
1838 //--! @ingroup bswap
1846 
1847 DWORD __cdecl _swapRGB( DWORD rgba ); // _bswap.asm
1848 
1849 //--! @ingroup bswap
1853 
1854 DWORD __cdecl _swapRGB2( DWORD rgb ); // -"-
1855 
1856 #else
1857  // Sorry; No GCC/GAS/NASM implementation, nor any C fallback yet...
1858 #endif//def _MSC_VER
1859 
1861 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1864 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1866 
1869 
1870 HFONT WINAPI CreateFontEx(
1871  CSTR Typeface, //<! Typeface name, e.g "Arnold Boecklin".
1872  int Points, //<! Font size, in typographic points (1/72" ea).
1873  int Weight, //<! Font weight, e.g. FW_BOLD.
1874  DWORD Charset DEF_(ANSI_CHARSET), //<! Character set, e.g. ANSI_CHARSET.
1875  DWORD Quality DEF_(ANTIALIASED_QUALITY) //<! Font quality, e.g. ANTIALIASED_QUALITY.
1876  );
1877 
1881 
1882 int WINAPI FontHeight( HDC hdc, int Points );
1883 int WINAPI ScreenFontHeight( WORD Points );
1884 
1886 
1887 HFONT WINAPI GetWndFont( HWND hWnd, OPTOUT LOGFONT* pLogFont );
1888 
1890 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1893 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1895 
1897 
1898 POINT WINAPI WhereXY( HDC dc );
1899 
1908 
1909 HDC WINAPI ReleaseWndDC( HDC hdc );
1910 
1911 // Desktop DC
1912 
1913 HDC WINAPI GetDesktopDC();
1914 void WINAPI ReleaseDesktopDC( HDC hDeskDC );
1915 
1920 
1921 HDC WINAPI CreateMemoryDC( UINT cx, UINT cy, OPTOUT HBITMAP* pOldBmp DEF_(NULL) );
1922 
1928 
1929 HBITMAP WINAPI DeleteMemoryDC( HDC hMemDC, OPTIN HBITMAP oldBmp DEF_(NULL) );
1930 
1932 
1933 void WINAPI GetScreenLPI( PPOINT pLpi );
1934 
1938 
1939 HGDIOBJ WINAPI GetCurrentObjectEx( HDC hdc, UINT ObjType, PVOID pObjData );
1940 
1941 #define OBJ_DIBSECTION (GDI_OBJ_LAST+1)
1943 #define GetCurrentFontEx( dc, plfont ) (HFONT) GetCurrentObjectEx( dc, OBJ_FONT, PLOGFONT(plfont) )
1944 #define GetCurrentPenEx( dc, plpen ) (HPEN) GetCurrentObjectEx( dc, OBJ_PEN, PLOGPEN(plpen) )
1945 #define GetCurrentExtPenEx( dc, pelpen ) (HPEN) GetCurrentObjectEx( dc, OBJ_EXTPEN, PEXTLOGPEN(pelpen) )
1946 #define GetCurrentBrushEx( dc, plbrsh ) (HBRUSH) GetCurrentObjectEx( dc, OBJ_BRUSH, PLOGBRUSH(plbrsh) )
1947 #define GetCurrentBitmapEx( dc, pbmap ) (HBITMAP) GetCurrentObjectEx( dc, OBJ_BITMAP, PBITMAP(pbmap) )
1948 #define GetCurrentDibSectEx( dc, pdibs ) (HBITMAP) GetCurrentObjectEx( dc, OBJ_DIBSECTION, PDIBSECTION(pdibs) )
1949 #define GetCurrentPaletteEx( dc, pwrd ) (HPALETTE) GetCurrentObjectEx( dc, OBJ_PAL, PWORD(pwrd) )
1950 #define GetCurrentColorspaceEx( dc, pcs ) (HCOLORSPACE) GetCurrentObjectEx( dc, OBJ_COLORSPACE, PLOGCOLORSPACE(pcs) )
1951 
1952 #if 0 // Sundown: DataSize used to be an argument, as in GetObject().
1953 // As of x64, unfortunately, the LOGBRUSH.lbHatch x64 HANDLE
1954 // makes sizeof(LOGBRUSH) == sizeof(LOGPEN), thus defeating the
1955 // original switch statement in the function, forcing an API change.
1956 
1957 HGDIOBJ WINAPI GetCurrentObjectEx( HDC hdc, int DataSize, PVOID pObjData );
1958 #define GetCurrentFontEx( dc, plfont ) (HFONT)GetCurrentObjectEx( dc, sizeof(LOGFONT), plfont )
1959 #define GetCurrentPenEx( dc, plpen ) (HPEN)GetCurrentObjectEx( dc, sizeof(LOGPEN), plpen )
1960 #define GetCurrentExtPenEx( dc, pelpen ) (HPEN)GetCurrentObjectEx( dc, sizeof(EXTLOGPEN), pelpen )
1961 #define GetCurrentBrushEx( dc, plbrsh ) (HBRUSH)GetCurrentObjectEx( dc, sizeof(LOGBRUSH), plbrsh )
1962 #define GetCurrentBitmapEx( dc, pbmap ) (HBITMAP)GetCurrentObjectEx( dc, sizeof(BITMAP), pbmap )
1963 #define GetCurrentDibSectEx( dc, pdibs ) (HBITMAP)GetCurrentObjectEx( dc, sizeof(DIBSECTION), pdibs )
1964 #define GetCurrentPaletteEx( dc, pwrd ) (HPALETTE)GetCurrentObjectEx( dc, sizeof(WORD), pwrd )
1965 #define GetCurrentColorspaceEx( dc, pcs ) (HCOLORSPACE)GetCurrentObjectEx( dc, sizeof(LOGCOLORSPACE), pcs )
1966 #endif
1967 
1969 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1972 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1984 
1985 HBITMAP WINAPI CreateIconBitmap(
1986  HICON hIcon, HBRUSH hbrBkg, UINT cx DEF_(0), UINT cy DEF_(0)
1987  );
1988 
1992 
1993 HBITMAP WINAPI CreateMaskBitmap( HBITMAP img, COLORREF transp );
1994 
1995 // CreateAntialiasedBitmap() ...
1996 
1998 
2000 {
2001  HDC hDC;
2002  RECT rcPaint;
2003  UINT mu;
2004  PVOID ctx;
2005 };
2006 
2009 
2010 typedef bool (__stdcall *PFnPaintBitmap)( PAINTBMPSTRUCT* p );
2011 
2018 
2019 HBITMAP WINAPI CreateAntialiasedBitmap(
2020  UINT cx, UINT cy,
2021  UINT mu,
2022  PFnPaintBitmap PaintBitmap,
2023  PVOID Ctx
2024  );
2025 
2031 
2032 bool WINAPI DrawMaskedBitmap( HDC hdc, int x, int y, HBITMAP hBmp, HBITMAP hMask );
2033 
2038 
2039 bool WINAPI DrawTransparentBitmap( // preliminary
2040  HDC hdc, int x, int y, int w, int h, HBITMAP hBmp, COLORREF cTrans
2041  );
2042 
2045 
2046 void WINAPI DrawBitmap( HDC hdc, int x, int y, HBITMAP hBmp );
2047 
2051 
2052 void WINAPI DrawBitmapEx(
2053  HDC hdc, int x, int y, int cx, int cy,
2054  HBITMAP hBmp, int imx DEF_(0), int imy DEF_(0), int imw DEF_(0), int imh DEF_(0),
2055  DWORD rasterOp DEF_(SRCCOPY)
2056  );
2057 
2059 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2062 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2064 
2065 #define VTX_OPAQUE 0x00
2066 #define VTX_TRANSPARENT 0xFF
2067 
2068 
2076 void WINAPI SetTriVertex(
2077  PTRIVERTEX pVtx, int x, int y, COLORREF cr, BYTE Alpha DEF_(VTX_OPAQUE)
2078  );
2079 
2081 void WINAPI SetTriMesh( PGRADIENT_TRIANGLE pTri, UINT Vtx1, UINT Vtx2, UINT Vtx3 );
2082 
2084 void WINAPI SetRectMesh( PGRADIENT_RECT pRect, UINT TopLeft, UINT BotRight );
2085 
2094 
2095 void WINAPI DrawGradientRect( HDC hdc, PRECT pr, COLORREF c1, COLORREF c2, UINT type );
2096 
2097 #define GRADIENT_H GRADIENT_FILL_RECT_H
2098 #define GRADIENT_V GRADIENT_FILL_RECT_V
2099 #define GRADIENT_D (GRADIENT_FILL_TRIANGLE+1)
2100 
2101 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2105 //++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2107 
2111 
2112 int WINAPI MapRegionToWindow( HRGN hRgn, HWND hWnd );
2113 
2117 
2118 RGNDATA* WINAPI AllocAndGetRegionData( IN HRGN hRgn, OPTOUT PRECT* ppRc );
2119 RGNDATA* WINAPI FreeRegionData( RGNDATA* pRgn );
2120 
2121 #if _DEBUG
2122 void WINAPI DumpRegionData( CSTR Title, HRGN hRgn );
2123 #else
2124 #define DumpRegionData(Title,hRgn)
2125 #endif
2126 
2127 // Path/Region supplements.
2128 
2130 
2131 typedef struct _gdiPathData
2132 {
2133  LPPOINT pPoint;
2134  LPBYTE pType;
2135  RECT Bounds;
2136  int nPoints;
2137 }
2139 
2149 
2150 bool WINAPI GetGdiPathData( HDC hdc, OUT PGdiPathData pData );
2151 
2153 
2154 void WINAPI FreeGdiPathData( PGdiPathData pData );
2155 
2157 
2158 bool WINAPI GetGdiPathBounds( HDC hdc, PRECT pBounds );
2159 
2180 
2181 HRGN WINAPI GetGdiPathRgn( HDC hdc, OUT RGNDATA** ppRgnData, OPTOUT RECT** ppRgnRects );
2182 
2183 #if 0 // Superfluous, use PathToRegion() and GetRgnBox() if this is all you need.
2184 HRGN WINAPI GetGdiPathRgnBounds( HDC hdc, OUT PRECT pBounds ); // see src for edification.
2187 #endif
2188 
2191 
2192 void OffsetPoints( POINT* Pts, UINT nPts, int dx, int dy );
2193 
2196 
2197 void OffsetRgnData( PRGNDATA prd, int dx, int dy );
2198 
2203 
2204 void SetIdentityMat2( MAT2* pm );
2205 
2206 //++++++++++++++++++++++++++++++++
2241 
2242 #define RR_CLIPRGN 1
2243 #define RR_METARGN 2
2244 #define RR_APIRGN 3
2245 #define RR_SYSRGN SYSRGN
2246 
2247 //++++++++++++++++++++++++++++++++
2270 
2272 
2273 #define ClearXform( pxfm ) SetXformScale( pxfm, 1.0f, 1.0f )
2274 
2276 
2277 #define AppendXform( Dst, append ) \
2278  CombineTransform( (XFORM*)(Dst), (XFORM*)(Dst), (XFORM*)(append) )
2279 
2281 
2282 #define PrependXform( Dst, prepend ) \
2283  CombineTransform( (XFORM*)(Dst), (XFORM*)(prepend), (XFORM*)(Dst) )
2284 
2288 
2289 XFORM* SetXformTranslate( XFORM* pxfm, float dx, float dy );
2290 
2294 
2295 XFORM* SetXformScale( XFORM* pxfm, float dx, float dy );
2296 
2306 
2307 XFORM* SetXformRotate( XFORM* pxfm, double angle );
2308 
2312 
2313 XFORM* SetXformShear( XFORM* pxfm, float sx, float sy );
2314 
2318 
2319 XFORM* SetXformReflect( XFORM* pxfm, bool rx, bool ry );
2320 
2323 //+============================================================================
2324 //|
2327 //|
2328 //+============================================================================
2330 
2332 
2333 #define OPEN_FILE( name,access ) \
2334  CreateFile( name, access, FILE_SHARE_READ, &DefSec, OPEN_EXISTING, 0,0 )
2335 
2340 
2341 HANDLE OpenDirectory( CSTR DirPath, DWORD Flags );
2342 
2343 // Known File/Device namespace prefixes, all (except UNC case) are 4 chars long...
2344 
2345 #define LONG_PATH_PREFIX_A "\\\\?\\"
2346 #define LONG_UNC_PREFIX_A LONG_PATH_PREFIX_A "UNC\\"
2347 #define DEVICE_NAME_PREFIX_A "\\\\.\\"
2348 #define UNPARSED_NAME_PREFIX_A "\\??\\"
2349 
2350 #define LONG_PATH_PREFIX_W L"\\\\?\\"
2351 #define LONG_UNC_PREFIX_W LONG_PATH_PREFIX_W L"UNC\\"
2352 #define DEVICE_NAME_PREFIX_W L"\\\\.\\"
2353 #define UNPARSED_NAME_PREFIX_W L"\\??\\"
2354 
2355 #ifdef _UNICODE
2356  #define LONG_PATH_PREFIX LONG_PATH_PREFIX_W
2357  #define LONG_UNC_PREFIX LONG_UNC_PREFIX_W
2358  #define DEVICE_NAME_PREFIX DEVICE_NAME_PREFIX_W
2359  #define UNPARSED_NAME_PREFIX UNPARSED_NAME_PREFIX_W
2360 #else
2361  #define LONG_PATH_PREFIX LONG_PATH_PREFIX_A
2362  #define LONG_UNC_PREFIX LONG_UNC_PREFIX_A
2363  #define DEVICE_NAME_PREFIX DEVICE_NAME_PREFIX_A
2364  #define UNPARSED_NAME_PREFIX UNPARSED_NAME_PREFIX_A
2365 #endif
2366 
2368 
2369 ACSTR SkipPathPrefixA( ACSTR PathName );
2370 WCSTR SkipPathPrefixW( WCSTR PathName );
2371 
2372 #ifdef _UNICODE
2373  #define SkipPathPrefix SkipPathPrefixW
2374 #else
2375  #define SkipPathPrefix SkipPathPrefixA
2376 #endif
2377 
2378 //-----------------------------------------------------------------------------
2379 
2380 bool FileExist( CSTR PathName );
2381 bool DirExist( CSTR PathName );
2382 
2383 bool IsDir( LPWIN32_FIND_DATA pFd );
2384 bool IsSubdirName( CSTR Dir );
2385 bool IsSubdir( LPWIN32_FIND_DATA pFd );
2386 
2387 bool IsJunctionDir( CSTR PathName );
2388 bool IsSymLink( CSTR PathName );
2389 bool IsSymLinkDir( CSTR PathName );
2390 
2393 
2394 bool IsVolumeMountPoint( CSTR PathName, TSTR VolNameBuf DEF_(NULL), UINT ccBuf DEF_(0) );
2395 
2399 
2400 bool GetWin32FileData( CSTR PathName, LPWIN32_FIND_DATA pFd );
2401 
2404 
2405 UINT64 SetFilePos( HANDLE hFile, INT64 Offset, UINT How );
2406 UINT64 GetFilePos( HANDLE hFile );
2407 
2409 #define GetFilePointer( hFile,pHiPart ) SetFilePointer( hFile, 0, (PLONG)pHiPart, FILE_CURRENT )
2410 
2411 bool Seek( HANDLE hFile, LONG Offs, DWORD How );
2412 UINT Tell( HANDLE hFile );
2413 
2414 bool IsEndOfFile( HANDLE hFile );
2415 
2416 UINT64 GetFileSize64( HANDLE hFile );
2417 UINT64 GetFileSize64Ex( CSTR FName );
2418 UINT64 GetFileSizeByName( CSTR FName );
2419 
2420 UINT PeekFile( HANDLE hFile, PVOID Buf, UINT nBytes );
2421 
2422 UINT BlockRead( HANDLE hFile, PVOID Buf, UINT nBytes );
2423 UINT BlockWrite( HANDLE hFile, PVOID Buf, UINT nBytes );
2424 
2427 
2428 BOOL WriteLine( HANDLE hFile, CSTR Buf, UINT ccBuf DEF_(0) );
2429 
2433 
2434 UINT __cdecl WriteStrA( HANDLE hFile, const char* Fmt, ... );
2435 UINT __cdecl WriteStrW( HANDLE hFile, const wchar_t* Fmt, ... );
2436 
2451 
2452 UINT ReadLineA( HANDLE hFile, char* Buffer, UINT BufLength, bool TrimCrLf );
2453 UINT ReadLineW( HANDLE hFile, wchar_t* Buffer, UINT BufLength, bool TrimCrLf );
2454 
2455 #ifdef _UNICODE
2456 #define WriteStr WriteStrW
2457 #define ReadLine ReadLineW
2458 #else
2459 #define WriteStr WriteStrA
2460 #define ReadLine ReadLineA
2461 #endif
2462 
2470 
2471 TSTR GetPathFileName( TSTR PathName );
2472 
2476 
2477 UINT GetFileNameFromHandle( HANDLE hFile, OUT TSTR Buffer, UINT BufLen );
2478 
2480 UINT GetNtDeviceName( HANDLE hObj, OUT TSTR DevNameBuf, UINT BufLen ); // WIP: Traits TBD.
2481 DWORD GetDosNameFromNtDeviceName( IN CSTR NtName, OUT TSTR DosName, UINT ccDosName ); // dito.
2483 
2487 
2488 UINT DevicePathToDosPath( IN CSTR DevPath, OUT TSTR PathBuf, UINT ccPathBuf );
2489 
2493 
2494 CSTR ChangeDirectory( CSTR Dir );
2495 
2498 
2499 CSTR DoneDirectory( CSTR prevDir );
2500 
2508 
2509 bool FindMoreFiles(
2510  HANDLE hFind, WIN32_FIND_DATA* Found,
2511  OPTIN BYTE nTries DEF_(1), OPTIN BYTE msWait DEF_(50)
2512  );
2513 
2516 
2517 HANDLE FindCloseEx( HANDLE hFind );
2518 
2527 
2528 CSTR GetTempPathName( CSTR Prefix, CSTR dotExt );
2529 
2533 
2534 ULARGE_INTEGER GetAttributeAndReparseTag( CSTR PathName );
2535 
2537 
2538 bool GetFileInformationByName( CSTR FileName, LPBY_HANDLE_FILE_INFORMATION pInfo );
2539 
2543 
2545  IN CSTR ShareName, OUT TSTR VolGuid, WORD ccGuid, OPTOUT TSTR DosDrv, WORD ccDrv
2546  );
2547 
2551 
2553  IN CSTR DevName, OUT TSTR VolGuid, WORD ccGuid, OPTOUT TSTR DosDrv, WORD ccDrv
2554  );
2555 
2571 
2572 bool CreateJunctionDir( CSTR LinkName, CSTR TargetPath, CSTR PrintName );
2573 // PONDER: bool CreateJunctionDir( CSTR LinkName, CSTR TargetPath, CSTR PrintName, bool AllowUpdate DEF_(false) );
2574 // > AllowUpdate allows update of the link target of an existing junction dir if true.
2575 // > If false, the function will fail with ERROR_FILE_EXISTS if LinkName exist.
2576 
2579 
2580 bool DeleteJunctionDir( CSTR LinkName );
2581 
2594 
2595 bool CreateSymLink( CSTR LinkName, CSTR TargetPath, CSTR PrintName );
2596 
2599 
2600 bool RemoveReparseData( CSTR PathName );
2601 
2628 
2629 INT GetReparseTarget(
2630  IN CSTR LinkName,
2631  OUT TSTR SubstPath, UINT cchSubst, OPTOUT TSTR PrintName, UINT cchPrint,
2632  OPTOUT PULARGE_INTEGER AttrTag
2633  );
2634 
2636 
2637 UINT GetHardLinkCount( CSTR FileName );
2638 
2644 
2645 bool _CreateHardLink( CSTR LinkName, CSTR TargetName ); // From my 1999 sources.
2646 
2647 #if (WINVER >= 0x0600) // FindFirstFileNameW & FindFirstStreamW requires Vista.
2648 
2651 
2652 typedef bool (__stdcall *PFnEnumHardLinks)( CSTR PathName, PVOID usrData );
2653 
2657 
2658 UINT EnumerateHardLinks(
2659  CSTR FileName,
2660  PFnEnumHardLinks Action,
2661  PVOID UserData
2662  );
2663 
2666 
2667 typedef bool (__stdcall *PFnEnumStreams)( CSTR PathName, UINT64 Size, PVOID usrData );
2668 
2720 
2721 UINT EnumerateFileStreams( CSTR FileName, PFnEnumStreams Action, PVOID usrData );
2722 
2723 // TODO: UINT GetStreamCount( CSTR FileName ); // (If possible..)
2724 
2725 #endif//(WINVER >= 0x0600)
2726 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2729 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2731 
2732 DECLARE_HANDLE( HMAPFILE );
2733 
2735 // Executable mappings are supported by Windows since XP2.
2736 // Define ALLOW_EXECUTABLE_FILEMAPPING as 0 to disallow it.
2737 #define ALLOW_EXECUTABLE_FILEMAPPING 0
2738 
2753 
2754 HMAPFILE LoadAndMapFile( CSTR FName, DWORD PageAccess, PBYTE* ppData );
2755 
2758 
2760 
2761 PVOID GetMappedFilePointer( HMAPFILE hMap );
2763 
2764 #if 1 // Holdover for the old names..
2765  #define GetMappedPointer GetMappedFilePointer
2766  #define GetMappedSize GetMappedFileSize
2767 #endif
2768 
2769 #if 0 // Under consideration, expandable mapping
2770 HMAPFILE LoadAndMapFileEx(
2771  CSTR FileName, DWORD PageAccess, PBYTE* ppData,
2772  UINT64 MaxSize DEF_(0), CSTR MapName DEF_(NULL)
2773  );
2774 #endif
2775 
2783 
2784 size_t PeekMappedFile( HMAPFILE hMapFile, PVOID Buffer, size_t cbRead );
2785 size_t ReadMappedFile( HMAPFILE hMapFile, PVOID Buffer, size_t cbRead );
2786 size_t WriteMappedFile( HMAPFILE hMapFile, PVOID Buffer, size_t cbWrite );
2787 PBYTE GetMappedFilePtr( HMAPFILE hMapFile );
2788 PBYTE SetMappedFilePtr( HMAPFILE hMapFile, INT64 Offset, UINT How );
2789 UINT64 GetMappedFilePos( HMAPFILE hMapFile );
2790 UINT64 SetMappedFilePos( HMAPFILE hMapFile, INT64 Offset, UINT How );
2791 
2797 #endif//ndef __UtilFunc_h_incl__
2798 // EOF
int __cdecl AddListString(HWND hLB, CSTR Fmt,...)
Definition: UserUtil.cpp:1303
HANDLE CloseHandleEx(HANDLE H)
Definition: KernelUtil.cpp:80
unsigned long DWORD
Definition: Common.h:414
PBYTE SetMappedFilePtr(HMAPFILE hMapFile, INT64 Offset, UINT How)
Definition: IoUtil.cpp:1338
bool EnableProcessPrivileges(bool Enable, CSTR prvName1,...)
Definition: SecUtil.cpp:46
bool ReadNTHeaders(CSTR ExeName, IMAGE_NT_HEADERS *Hdr, bool GetOptHdr)
Definition: KernelUtil.cpp:994
LPTSTR Pathname
Definition: UtilFunc.h:246
bool IsVolumeMountPoint(CSTR PathName, TSTR VolNameBuf=NULL, UINT ccBuf=0)
Definition: ReparsePnt.cpp:652
DWORD GetDLLVersion(CSTR FName)
Definition: ShellUtil.cpp:156
WORD Hotkey
Definition: UtilFunc.h:257
bool RemoveReparseData(CSTR PathName)
Definition: ReparsePnt.cpp:687
bool(__stdcall * PFnEnumHardLinks)(CSTR PathName, PVOID usrData)
Definition: UtilFunc.h:2652
bool CenterWindow(HWND hWnd, HWND hOwner)
Definition: UserUtil.cpp:563
HICON WINAPI LoadSmallIcon(HINSTANCE hInst, CSTR Id)
Definition: UserUtil.cpp:628
HANDLE CheckHandle(HANDLE Hnd)
Definition: KernelUtil.cpp:75
void SetIdentityMat2(MAT2 *pm)
Definition: GdiUtil.cpp:782
void WINAPI SetTriMesh(PGRADIENT_TRIANGLE pTri, UINT Vtx1, UINT Vtx2, UINT Vtx3)
Definition: GdiUtil.cpp:487
PTOKEN_PRIVILEGES FreePrivileges(PTOKEN_PRIVILEGES pPrv)
Definition: SecUtil.cpp:94
void InitTaskbarSupport()
Definition: ShellUtil.cpp:576
HTOKENEX CloseThreadTokenEx(HTOKENEX hToken)
Definition: SecUtil.cpp:288
bool GetWndPos(HWND hWnd, POINT *pPos)
Definition: UserUtil.cpp:537
Definition: Common.h:494
HANDLE CreateCapturedProcessEx(OPTIN CSTR ExePath, OPTIN CSTR CmdLn, OPTIN CSTR EnvStr, OPTIN CSTR WorkDir, INOUT LPSTARTUPINFO pSI, IN DWORD Flags, OPTOUT PHANDLE pRdHnd, OPTOUT PHANDLE pWrHnd, OPTOUT PHANDLE pErrHnd, OPTOUT PHANDLE phThread)
Definition: Common.h:504
bool SetMenuItemCheck(HMENU hMenu, UINT Id, bool Check)
Definition: UserUtil.cpp:694
const char * ACSTR
Definition: Common.h:345
HANDLE OpenDirectory(CSTR DirPath, DWORD Flags)
Definition: IoUtil.cpp:385
void WINAPI ReleaseDesktopDC(HDC hDeskDC)
Definition: GdiUtil.cpp:102
FILETIME AddFiletime(FILETIME Time, const FILETIME Add)
Definition: KernelUtil.cpp:595
#define END_EXTERN_CPP
Definition: Common.h:223
HIMAGELIST ImageList_CreateMapped(HINSTANCE hInst, UINT Id, LPCOLORMAP Map, UINT nMap, UINT cxImg, UINT Flags, UINT nGrow)
Definition: UserUtil.cpp:1564
bool GetEnvironmentSize(WSTR pwEnv, PUINT pSize, PUINT pUsed)
Definition: KernelUtil.cpp:714
#define CSTR
Definition: Common.h:329
bool IsBadReadWritePtr(const PVOID address, UINT_PTR size)
Definition: KernelUtil.cpp:179
HANDLE TerminateCapturedProcess(OPTIN HANDLE hProc, IN LPSTARTUPINFO pSi, IN PHANDLE pRdHnd, IN PHANDLE pWrHnd, IN PHANDLE pErrHnd, IN UINT RetCode=EXIT_SUCCESS)
int nPoints
Nr of elements in the pPoint and pType arrays.
Definition: UtilFunc.h:2136
void WINAPI FreeGdiPathData(PGdiPathData pData)
Definition: GdiUtil.cpp:707
HGDIOBJ WINAPI GetCurrentObjectEx(HDC hdc, UINT ObjType, PVOID pObjData)
Definition: GdiUtil.cpp:310
CSTR GetMachineStr(WORD Machine)
IPicture *WINAPI LoadPictureFile(CSTR FName)
Definition: UserUtil.cpp:928
HDC WINAPI CreateMemoryDC(UINT cx, UINT cy, OPTOUT HBITMAP *pOldBmp=NULL)
HGDIOBJ WINAPI DeleteObjectEx(HGDIOBJ hObj)
Definition: GdiUtil.cpp:290
unsigned short WORD
Definition: Common.h:413
bool DeleteJunctionDir(CSTR LinkName)
Definition: ReparsePnt.cpp:796
HANDLE GetCurrentThreadHandle()
Definition: KernelUtil.cpp:54
HWND CreateDialogParamEx(HINSTANCE hInst, CSTR Template, HWND hParent, DLGPROC DlgProc, LPARAM lParam, LANGID Language)
Definition: UserUtil.cpp:1077
PVOID ctx
User's context, if any.
Definition: UtilFunc.h:2004
bool GetTrackbarInfo(HWND hCtl, LPSCROLLINFO psi)
Definition: UserUtil.cpp:1519
bool WaitFor(HANDLE hObj, DWORD msWait)
Definition: KernelUtil.cpp:95
HRESULT Shell_CreateLink(CSTR LinkFilePathname, IN const PLINKDATA pLink)
XFORM * SetXformScale(XFORM *pxfm, float dx, float dy)
Definition: Xform.cpp:34
CSTR LocalAtomName(ATOM atom)
Definition: KernelUtil.cpp:43
HDC WINAPI GetDesktopDC()
Definition: GdiUtil.cpp:97
HDC WINAPI ReleaseWndDC(HDC hdc)
Definition: GdiUtil.cpp:88
XFORM * SetXformTranslate(XFORM *pxfm, float dx, float dy)
Definition: Xform.cpp:21
bool FileExist(CSTR PathName)
Definition: IoUtil.cpp:24
HWND CreateStatusbar(HWND hParent, UINT Id, CSTR Text, UINT Style)
Definition: UserUtil.cpp:1434
bool AddMenuItem(HMENU hMenu, UINT Index, CSTR Text, WORD cmdId, WORD State=0, PVOID Data=NULL, HBITMAP Image=NULL)
Definition: UserUtil.cpp:767
HWND SetParentWnd(HWND hWnd, HWND newParent)
Definition: UserUtil.cpp:1167
bool ResizeWnd(HWND hWnd, int W, int H, bool Repaint)
Definition: UserUtil.cpp:1159
HWND CreateToolbar(HWND hParent, UINT Id, UINT x, UINT y, UINT w, UINT h, UINT cxBtn, UINT cyBtn, HIMAGELIST hImages, LPTBBUTTON Buttons, UINT nButtons, DWORD Style, DWORD ExStyle)
Definition: UserUtil.cpp:1604
bool SetEnvironmentVar(OPTIO WSTR *pwEnv, IN CSTR Name, IN CSTR Value)
Definition: KernelUtil.cpp:841
WSTR CloneEnvironment(OPTOUT PUINT pLength, OPTOUT PUINT pUsed)
Definition: KernelUtil.cpp:747
SYSTEMTIME * SystemTimeToLocalTime(INOUT SYSTEMTIME *Time)
RECT MkRect(LONG L, LONG T, LONG R, LONG B)
Definition: UtilFunc.cpp:46
int WINAPI ScreenFontHeight(WORD Points)
Definition: GdiUtil.cpp:52
void InflateBorders(PRECT Target, LPCRECT Borders)
Definition: UtilFunc.cpp:158
HFONT WINAPI CreateFontEx(CSTR Typeface, int Points, int Weight, DWORD Charset=ANSI_CHARSET, DWORD Quality=ANTIALIASED_QUALITY)
Definition: GdiUtil.cpp:30
long WINAPI HiMetricToPix(long hiMetric)
Definition: UserUtil.cpp:958
LPTSTR IconPath
Definition: UtilFunc.h:253
HFONT WINAPI GetWndFont(HWND hWnd, OPTOUT LOGFONT *pLogFont)
void WINAPI DrawBitmapEx(HDC hdc, int x, int y, int cx, int cy, HBITMAP hBmp, int imx=0, int imy=0, int imw=0, int imh=0, DWORD rasterOp=SRCCOPY)
Definition: GdiUtil.cpp:398
wchar_t * WSTR
Definition: Common.h:366
HANDLE GetThreadExToken(HTOKENEX hTok)
Definition: SecUtil.cpp:238
UINT64 GetFileSize64(HANDLE hFile)
Definition: IoUtil.cpp:328
UINT EnumerateMenuItems(HMENU hMenu, PFnMenuItemAction Action, PVOID Ctx)
Definition: UserUtil.cpp:806
bool EnablePrivileges(IN HANDLE hToken, IN bool Enable, OPTOUT PTOKEN_PRIVILEGES *ppSave,...)
bool WINAPI PaintPictureEx(IPicture *pPic, HDC hdc, long x, long y, long cx=0, long cy=0, long imx=0, long imy=0, long imw=0, long imh=0, PRECT prMeta=NULL)
Definition: UserUtil.cpp:999
LPRECT DimToAbsRect(LPRECT pRect)
Definition: UtilFunc.cpp:92
#define TSTR
Definition: Common.h:328
unsigned char * PBYTE
Definition: Common.h:412
bool WINAPI GetGdiPathBounds(HDC hdc, PRECT pBounds)
Definition: GdiUtil.cpp:714
bool InitShellFunc(bool useOle=false, DWORD coFlag=COINIT_APARTMENTTHREADED)
Definition: ShellUtil.cpp:37
void SetWindowDouble(HWND hWnd, int Index, double Value)
Definition: UserUtil.cpp:191
bool GetWndSize(HWND hWnd, SIZE *pSize)
Definition: UserUtil.cpp:523
LPTSTR Desc
Definition: UtilFunc.h:251
bool GetRequiredWindowSize(HWND hWnd, IN const PSIZE pClient, OUT PSIZE pWindow)
Definition: UserUtil.cpp:1094
char * ASTR
Definition: Common.h:344
bool EnableChildWnd(HWND Owner, UINT Id, bool Enable)
Definition: UserUtil.cpp:608
LPBYTE pType
Array of type specs for each point.
Definition: UtilFunc.h:2134
UINT BlockWrite(HANDLE hFile, PVOID Buf, UINT nBytes)
Definition: IoUtil.cpp:423
ULARGE_INTEGER GetAttributeAndReparseTag(CSTR PathName)
Definition: ReparsePnt.cpp:554
BOOL WriteLine(HANDLE hFile, CSTR Buf, UINT ccBuf=0)
Definition: IoUtil.cpp:432
bool ButtonChecked(HWND hBtn)
Definition: UserUtil.cpp:1282
bool WINAPI DrawTransparentBitmap(HDC hdc, int x, int y, int w, int h, HBITMAP hBmp, COLORREF cTrans)
Definition: GdiUtil.cpp:361
#define END_NAMESPACE(name)
Definition: Common.h:225
bool IsWndClass(HWND hWnd, CSTR clsName)
Definition: UserUtil.cpp:1210
UINT PeekFile(HANDLE hFile, PVOID Buf, UINT nBytes)
Definition: IoUtil.cpp:404
bool IsSubdirName(CSTR Dir)
Definition: IoUtil.cpp:43
#define OPTOUT
Definition: Common.h:264
bool RedrawWndRgn(HWND hWnd, HRGN hRgn, UINT Flags)
Definition: UserUtil.cpp:1144
CSTR DoneDirectory(CSTR prevDir)
Definition: IoUtil.cpp:1040
FILETIME MakeDateTime(WORD Year, WORD Month, WORD Day, WORD Hr, WORD Min, WORD Sec)
Definition: KernelUtil.cpp:606
INT_PTR DialogBoxParamEx(HINSTANCE hInst, CSTR Template, HWND hParent, DLGPROC DlgProc, LPARAM lParam, LANGID Language)
Definition: UserUtil.cpp:1061
void WINAPI SetRedraw(HWND hwnd, bool on)
Definition: GdiUtil.cpp:500
bool _CreateHardLink(CSTR LinkName, CSTR TargetName)
Definition: Hardlink.cpp:122
double GetWndReal(HWND hCtl)
Definition: UserUtil.cpp:1243
LPITEMIDLIST GetPathNamePIDL(CSTR Dir, ULONG *pAttrib OPTIONAL=NULL)
CSTR GlobalAtomName(ATOM atom)
Definition: KernelUtil.cpp:36
bool __cdecl SetCaption(HWND hwnd, CSTR fmt,...)
Definition: UserUtil.cpp:284
HANDLE GetCurrentProcessHandle()
Definition: KernelUtil.cpp:62
WORD GetInstanceTargetMachine(HINSTANCE hInst)
UINT64 GetFileSize64Ex(CSTR FName)
Definition: IoUtil.cpp:336
int ShowCmd
Definition: UtilFunc.h:256
bool RedrawWndRect(HWND hWnd, PRECT pRect, UINT Flags)
Definition: UserUtil.cpp:1139
HRESULT ShowShareFolderUI(HWND hParent, CSTR Path)
Transmutable wrap for the strictly dynamic ntshrui.dll function.
Definition: ShellUtil.cpp:368
UINT WM_TaskbarCreated
Definition: ShellUtil.cpp:562
void WINAPI PaintPicture(IPicture *pPic, HDC hdc, int x, int y, int cx=0, int cy=0)
Definition: UserUtil.cpp:977
size_t PeekMappedFile(HMAPFILE hMapFile, PVOID Buffer, size_t cbRead)
Definition: IoUtil.cpp:1270
LPRECT AbsToRelRect(LPRECT pRect)
Definition: UtilFunc.cpp:98
HANDLE FindCloseEx(HANDLE hFind)
Definition: IoUtil.cpp:1072
bool InitializeSecDesc(PSECURITY_DESCRIPTOR pSecDesc, PACL AccsList=NULL)
Definition: SecUtil.cpp:18
bool SetWndReal(HWND hCtl, double Value, BYTE nDeci, CSTR Suffix=NULL)
Definition: UserUtil.cpp:1254
bool EnableProcessPrivilege(CSTR prvName, bool Enable=true)
Definition: SecUtil.cpp:28
void OffsetPoints(POINT *Pts, UINT nPts, int dx, int dy)
Definition: GdiUtil.cpp:758
WORD GetTargetMachine(CSTR ExeName)
bool IsSymLinkDir(CSTR PathName)
Definition: ReparsePnt.cpp:632
void OffsetRgnData(PRGNDATA prd, int dx, int dy)
Definition: GdiUtil.cpp:770
UINT64 GetMappedFilePos(HMAPFILE hMapFile)
Definition: IoUtil.cpp:1369
bool operator >(FILETIME const &A, FILETIME const &B)
Definition: KernelUtil.cpp:625
bool EnablePrivilege(HANDLE hToken, CSTR Privilege, bool Enable, OPTOUT PLUID_AND_ATTRIBUTES pSave)
LPMENUITEMINFO GetMenuItemByName(HMENU hMenu, CSTR Name)
Definition: UserUtil.cpp:650
HANDLE __cdecl AsyncMsgBoxEx(HWND Owner, UINT Flags, CSTR Title, HINSTANCE hInst, CSTR IconId, DWORD LangId, DWORD_PTR HelpId, MSGBOXCALLBACK Callback, PINT_PTR pResult, CSTR TextFmt,...)
Definition: UserUtil.cpp:455
PTOKEN_PRIVILEGES AllocPrivileges(UINT Count, OPTOUT PDWORD pSize=NULL)
HWND GetMDIClient(HWND hMdiFrame)
Definition: UserUtil.cpp:1269
void WINAPI SetTriVertex(PTRIVERTEX pVtx, int x, int y, COLORREF cr, BYTE Alpha=0x00)
Definition: GdiUtil.cpp:478
WSTR FreeEnvironment(WSTR Env)
Definition: KernelUtil.cpp:797
bool GetFileInformationByName(CSTR FileName, LPBY_HANDLE_FILE_INFORMATION pInfo)
Definition: IoUtil.cpp:163
int WINAPI MapRegionToWindow(HRGN hRgn, HWND hWnd)
Definition: GdiUtil.cpp:610
HANDLE GlobalUnlockedHandle(PVOID Ptr, PUINT pCount=NULL)
Definition: KernelUtil.cpp:156
UINT GlobalPurgeAtom(CSTR Name)
Definition: KernelUtil.cpp:23
SHORT GetProcDLLRefCount(HANDLE hProcess, WCSTR DllName)
Definition: KernelUtil.cpp:520
bool ShellFuncInitialized()
Definition: ShellUtil.cpp:24
HRESULT Shell_ResolveLink(HWND hWnd, CSTR LinkFilePathname, OUT PLINKDATA pLink)
UINT mu
Scaling multiplier.
Definition: UtilFunc.h:2003
HTOKENEX OpenThreadTokenEx(HANDLE hThread, ACCESS_MASK tokenAccess)
Definition: SecUtil.cpp:252
UINT64 SetMappedFilePos(HMAPFILE hMapFile, INT64 Offset, UINT How)
Definition: IoUtil.cpp:1375
COLORREF WINAPI ScaleColorRef(COLORREF color, BYTE mul, BYTE div)
Definition: GdiUtil.cpp:558
void WINAPI DrawGradientRect(HDC hdc, PRECT pr, COLORREF c1, COLORREF c2, UINT type)
Definition: GdiUtil.cpp:435
RGNDATA *WINAPI FreeRegionData(RGNDATA *pRgn)
Definition: GdiUtil.cpp:629
HANDLE HMAPFILE
Definition: UtilFunc.h:2732
const wchar_t * WCSTR
Definition: Common.h:367
WSTR GlobalAllocStrW(UINT nChr)
Definition: KernelUtil.cpp:112
CSTR DupClipboardString()
Definition: UserUtil.cpp:123
void DiffRect(PRECT Borders, LPCRECT Outer, LPCRECT Inner)
Definition: UtilFunc.cpp:141
long WINAPI PixToHiMetric(long Pix)
Definition: UserUtil.cpp:965
size_t WriteMappedFile(HMAPFILE hMapFile, PVOID Buffer, size_t cbWrite)
Definition: IoUtil.cpp:1301
int IconIndex
Definition: UtilFunc.h:254
HWND CreateWindowIndirect(LPCREATESTRUCT pc)
Definition: UserUtil.cpp:1050
PVOID WINAPI LoadCustomResource(HMODULE hModule, CSTR Id, CSTR Type, UINT *pSize OPTOUT=NULL)
UINT __cdecl WriteStrW(HANDLE hFile, const wchar_t *Fmt,...)
Definition: IoUtil.cpp:492
HMODULE GetOrLoadModule(CSTR modName)
Definition: KernelUtil.cpp:376
bool IsEndOfFile(HANDLE hFile)
Definition: IoUtil.cpp:395
UINT ReadLineW(HANDLE hFile, wchar_t *Buffer, UINT BufLength, bool TrimCrLf)
Definition: IoUtil.cpp:565
int GetMenuItemIdByName(HMENU hMenu, CSTR Name)
Definition: UserUtil.cpp:673
bool __cdecl SetStatusWidths(HWND hStat, UINT nParts, int *Width)
Definition: UserUtil.cpp:1398
SIZES MkSizeS(SHORT cx, SHORT cy)
Definition: UtilFunc.cpp:41
BOOL(WINAPI *SysImgList::Shell_GetImageLists)(HIMAGELIST *pimlLarge
PVOID WINAPI LoadCustomResourceEx(HMODULE hModule, CSTR Id, CSTR Type, LANGID Language OPTIN=0, UINT *pSize OPTOUT=NULL)
double GetClassDouble(HWND hWnd, int gcl_Ix)
Definition: UserUtil.cpp:241
void WINAPI SetRectMesh(PGRADIENT_RECT pRect, UINT TopLeft, UINT BotRight)
Definition: GdiUtil.cpp:494
bool IsSymLink(CSTR PathName)
Definition: ReparsePnt.cpp:624
struct _LINKDATA * PLINKDATA
LPPOINT pPoint
Array of points.
Definition: UtilFunc.h:2133
void WINAPI GetScreenLPI(PPOINT pLpi)
Definition: GdiUtil.cpp:141
bool operator >=(FILETIME const &A, FILETIME const &B)
Definition: KernelUtil.cpp:640
ASTR GlobalDupStrA(ACSTR Str, bool isMz=false)
Definition: KernelUtil.cpp:119
CSTR GetTempPathName(CSTR Prefix, CSTR dotExt)
Definition: IoUtil.cpp:62
COLORREF WINAPI GradientColor(COLORREF c1, COLORREF c2, WORD Ix, WORD Length)
void AbsDiffRect(PRECT Borders, LPCRECT Outer, LPCRECT Inner)
Definition: UtilFunc.cpp:150
HBITMAP WINAPI CreateMaskBitmap(HBITMAP img, COLORREF transp)
Definition: GdiUtil.cpp:193
Definition: DynArray.h:18
eModenvFlags
Definition: UtilFunc.h:865
UINT Tell(HANDLE hFile)
Definition: IoUtil.cpp:321
UINT GetNtDeviceName(HANDLE hObj, TSTR pzNTPath, UINT ccNTPath)
Definition: IoUtil.cpp:845
bool(__stdcall * PFnEnumStreams)(CSTR PathName, UINT64 Size, PVOID usrData)
Definition: UtilFunc.h:2667
UINT EnumerateClipFormats(HWND hCBOwner, PFClipFmtAction Action, PVOID UserData)
Definition: UserUtil.cpp:55
bool(__stdcall * PFnPaintBitmap)(PAINTBMPSTRUCT *p)
Definition: UtilFunc.h:2010
POINTS MkPointS(SHORT x, SHORT y)
Definition: UtilFunc.cpp:31
bool operator<=(FILETIME const &A, FILETIME const &B)
Definition: KernelUtil.cpp:644
LPITEMIDLIST IdList
Definition: UtilFunc.h:258
void WINAPI DrawBitmap(HDC hdc, int x, int y, HBITMAP hBmp)
Definition: GdiUtil.cpp:383
HRGN WINAPI GetGdiPathRgnBounds(HDC hdc, OUT PRECT pBounds)
Definition: GdiUtil.cpp:743
TSTR GetPathFileName(TSTR PathName)
Definition: IoUtil.cpp:620
UINT DispatchMessagesFor(HWND hWnd)
Definition: UserUtil.cpp:17
PVOID ShellFreeEx(PVOID pBlk)
Definition: ShellUtil.cpp:79
int __cdecl AddComboString(HWND hCB, CSTR Fmt,...)
Definition: UserUtil.cpp:1328
HWND GetChildWndWithId(HWND hParent, UINT ChildId)
Definition: UserUtil.cpp:617
bool IsDir(LPWIN32_FIND_DATA pFd)
Definition: IoUtil.cpp:38
signed __int64 INT64
Definition: Common.h:401
struct _gdiPathData * PGdiPathData
LPRECT NegateRect(LPRECT pRect)
Definition: UtilFunc.cpp:103
#define OPTIO
Definition: Common.h:265
XFORM * SetXformShear(XFORM *pxfm, float sx, float sy)
Definition: Xform.cpp:62
const FILETIME NullFileTime
Definition: KernelUtil.cpp:547
bool OpenEmptyClipboard(HWND hWnd)
Definition: UserUtil.cpp:48
unsigned __int64 UINT64
Definition: Common.h:400
WORD RebarBandInfoSize()
Definition: UserUtil.cpp:1671
bool CreateJunctionDir(CSTR LinkName, CSTR TargetPath, CSTR PrintName)
Definition: ReparsePnt.cpp:766
LPTSTR Args
Definition: UtilFunc.h:252
SIZE MkSize(LONG cx, LONG cy)
Definition: UtilFunc.cpp:36
bool PutClipboardStringW(HWND clipboardOwner, WCSTR Text)
Definition: UserUtil.cpp:117
BOOL GetWindowMinimizeRect(HWND hTrayApp, RECT *pRect)
Definition: UserUtil.cpp:549
UINT DeduplicatePathStr(INOUT TSTR Path)
UTC : GetSystemTime().
Definition: UtilFunc.h:712
PVOID DupClipboardData(UINT clipFmt, PUINT pSize OPTOUT)
Definition: UserUtil.cpp:139
PVOID GetMenuItemData(HMENU hMenu, UINT Id)
Definition: UserUtil.cpp:681
PVOID GetMappedFilePointer(HMAPFILE hMap)
Definition: IoUtil.cpp:1254
HWND GetComboEditor(HWND hCombo)
Definition: UserUtil.cpp:1218
bool RestorePrivilege(HANDLE hToken, PTOKEN_PRIVILEGES pSaved)
See EnablePrivilege(()
Definition: SecUtil.cpp:162
float GetClassFloat(HWND hWnd, int gcl_Ix)
Definition: UserUtil.cpp:222
BOOL UnloadMappedFile(HMAPFILE hMap)
Definition: IoUtil.cpp:1234
void WINAPI Line(HDC hdc, int x1, int y1, int x2, int y2)
Definition: GdiUtil.cpp:506
HMODULE GetProcDLLHandle(HANDLE hProcess, WCSTR DllName)
Definition: KernelUtil.cpp:531
ASTR GlobalAllocStrA(UINT nChr)
Definition: KernelUtil.cpp:108
GetLocalTime().
Definition: UtilFunc.h:711
double GetWindowDouble(HWND hWnd, int Index)
Definition: UserUtil.cpp:203
bool DirExist(CSTR PathName)
Definition: IoUtil.cpp:30
bool GetWindowClientSize(HWND hWnd, IN const PSIZE pWindow, OUT PSIZE pClient)
Definition: UserUtil.cpp:1109
float GetWindowFloat(HWND hWnd, int Index)
Definition: UserUtil.cpp:184
bool WINAPI GetGdiPathData(HDC hdc, OUT PGdiPathData pData)
Definition: GdiUtil.cpp:660
UINT EnumerateFileStreams(CSTR FileName, PFnEnumStreams Action, PVOID usrData)
Definition: IoUtil.cpp:1084
DWORD __cdecl _swapRGB2(DWORD rgb)
HRESULT CreateStreamOnFile(IN CSTR FName, OUT IStream **ppStrm, OPTOUT DWORD *pSize=NULL)
UINT ReadLineA(HANDLE hFile, char *Buffer, UINT BufLength, bool TrimCrLf)
Definition: IoUtil.cpp:508
bool RefreshWnd(HWND hWnd)
Definition: UserUtil.cpp:1126
HANDLE CloseCapturedProcess(IN HANDLE hProc, IN LPSTARTUPINFO pSi, OPTIN PHANDLE pRdHnd, OPTIN PHANDLE pWrHnd, OPTIN PHANDLE pErrHnd)
bool(__stdcall * PFLvItemAction)(HWND hList, LPLVITEM pItem, PVOID pCtx)
Definition: UtilFunc.h:1565
UINT BlockRead(HANDLE hFile, PVOID Buf, UINT nBytes)
Definition: IoUtil.cpp:417
bool GetEnvironmentVar(OPTIN WSTR pwEnv, IN CSTR Name, OUT TSTR Value, INOUT PUINT ccValBuf)
Definition: KernelUtil.cpp:867
LPTSTR WorkingDir
Definition: UtilFunc.h:255
#define VTX_OPAQUE
Definition: UtilFunc.h:2065
bool IsJunctionDir(CSTR PathName)
Definition: ReparsePnt.cpp:640
HWND CreateStdToolbar(HWND hParent, UINT Id, UINT x, UINT y, UINT w, UINT h, UINT imgType, LPTBBUTTON Buttons, UINT nButtons, DWORD Style, DWORD ExStyle)
Definition: UserUtil.cpp:1640
HRGN WINAPI GetGdiPathRgn(HDC hdc, OUT RGNDATA **ppRgnData, OPTOUT RECT **ppRgnRects)
Definition: GdiUtil.cpp:728
ACSTR SkipPathPrefixA(ACSTR PathName)
Definition: IoUtil.cpp:108
int __cdecl MsgBox(HWND Owner, UINT Type, CSTR Cap, CSTR Fmt,...)
Definition: UserUtil.cpp:271
void GetChildWndRect(HWND hCtrl, RECT *pRc)
Definition: UserUtil.cpp:602
DWORD Flags
Definition: UtilFunc.h:247
DWORD __cdecl _swapRGB(DWORD rgba)
RGNDATA *WINAPI AllocAndGetRegionData(IN HRGN hRgn, OPTOUT PRECT *ppRc)
bool MoveWnd(HWND hWnd, int X, int Y, bool Repaint)
Definition: UserUtil.cpp:1151
FILETIME FileTimeToLocalTime(FILETIME utc)
Definition: KernelUtil.cpp:692
HANDLE HTOKENEX
Definition: UtilFunc.h:440
INT GetReparseTarget(IN CSTR LinkName, OUT TSTR SubstPath, UINT cchSubst, OPTOUT TSTR PrintName, UINT cchPrint, OPTOUT PULARGE_INTEGER AttrTag)
CSTR GetSubSystemStr(WORD SubSys)
size_t ReadMappedFile(HMAPFILE hMapFile, PVOID Buffer, size_t cbRead)
Definition: IoUtil.cpp:1294
bool SetDlgItemReal(HWND hDlg, UINT Id, double Value, BYTE nDeci, CSTR Suffix=NULL)
Definition: UserUtil.cpp:1262
UINT GetWndHeight(HWND hWnd)
Definition: UserUtil.cpp:507
bool PutClipHandle(HWND clipboardOwner, HANDLE hClip, UINT clipFmt)
Definition: UserUtil.cpp:73
DWORD GetDosNameFromNtDeviceName(CSTR NtName, TSTR DosName, UINT ccDosName)
Definition: IoUtil.cpp:909
PDirEntry PScanDirCtx pCtx
Definition: FileDir.cpp:51
#define BEGIN_NAMESPACE(name)
Definition: Common.h:224
IPicture *WINAPI LoadPictureResource(HMODULE hModule, CSTR Id, CSTR Type)
Definition: UserUtil.cpp:900
bool GetVolumeGuidOfDevice(IN CSTR DevName, OUT TSTR VolGuid, WORD ccGuid, OPTOUT TSTR DosDrv, WORD ccDrv)
Definition: IoUtil.cpp:273
int AddComboItem(HWND hCB, CSTR Text, LPARAM Data=0)
Definition: UserUtil.cpp:1340
#define DEF_(x)
Definition: Common.h:240
RECT rcPaint
Upscaled drawing rect.
Definition: UtilFunc.h:2002
Common include; Added types, small "ubiquitous" utilities, et c.
bool GetWin32FileData(CSTR PathName, LPWIN32_FIND_DATA pFd)
Definition: IoUtil.cpp:84
void SetClassFloat(HWND hWnd, int gcl_Ix, float Value)
Definition: UserUtil.cpp:215
IMalloc * ShMalloc
Definition: ShellUtil.cpp:17
#define END_EXTERN_C
Definition: Common.h:221
bool operator<(FILETIME const &A, FILETIME const &B)
Definition: KernelUtil.cpp:630
FILETIME Now(eTimeType Domain=LOCAL_TIME)
Definition: KernelUtil.cpp:549
HMAPFILE LoadAndMapFile(CSTR FName, DWORD PageAccess, PBYTE *ppData)
Definition: IoUtil.cpp:1152
#define BEGIN_EXTERN_C
Definition: Common.h:220
bool Is32BitInstance(HINSTANCE hInst)
void WINAPI GetIsoTriangleVertices(POINT *Vtx, int xOrg, int yOrg, int Radius, double Orientation)
Definition: GdiUtil.cpp:512
bool FindMoreFiles(HANDLE hFind, WIN32_FIND_DATA *Found, OPTIN BYTE nTries=1, OPTIN BYTE msWait=50)
POINT WINAPI WhereXY(HDC dc)
Definition: GdiUtil.cpp:78
bool(__stdcall * PFnMenuItemAction)(HMENU hMenu, MENUITEMINFO *pInfo, PVOID Ctx)
Definition: UtilFunc.h:1388
COLORREF WINAPI GrayScaleColor(COLORREF rgb)
Definition: GdiUtil.cpp:596
HMODULE LoadProcLibrary(HANDLE hProcess, LPCSTR DllPathName, DWORD msWait=5000)
Definition: KernelUtil.cpp:397
HBITMAP WINAPI DeleteMemoryDC(HDC hMemDC, OPTIN HBITMAP oldBmp=NULL)
void SetClassDouble(HWND hWnd, int gcl_Ix, double Value)
Definition: UserUtil.cpp:229
FILETIME AddTime(IN FILETIME Time, SHORT Hr, SHORT Min, SHORT Sec, SHORT mSec)
bool __cdecl SetStatusText(HWND hStat, UINT Part, CSTR Fmt,...)
Definition: UserUtil.cpp:1422
void DoneShellFunc()
Definition: ShellUtil.cpp:64
eTimeType
Definition: UtilFunc.h:709
UINT64 GetMappedFileSize(HMAPFILE hMap)
Definition: IoUtil.cpp:1261
bool Is64BitInstance(HINSTANCE hInst)
bool operator==(FILETIME const &A, FILETIME const &B)
Definition: KernelUtil.cpp:635
WSTR GlobalDupStrW(WCSTR Str, bool isMz=false)
Definition: KernelUtil.cpp:142
bool GetVolumeGuidOfShare(IN CSTR ShareName, OUT TSTR VolGuid, WORD ccGuid, OPTOUT TSTR DosDrv, WORD ccDrv)
Definition: IoUtil.cpp:180
bool Is64BitExecutable(CSTR ExeName)
UINT GetHardLinkCount(CSTR FileName)
Definition: Hardlink.cpp:7
HBITMAP WINAPI CreateIconBitmap(HICON hIcon, HBRUSH hbrBkg, UINT cx=0, UINT cy=0)
Definition: GdiUtil.cpp:153
ModifyEnvironmentVar() prepends the Addendum.
Definition: UtilFunc.h:866
HDC hDC
DC to paint on.
Definition: UtilFunc.h:2001
bool CheckButtonCtrl(HWND hDlg, UINT Id, bool Check)
Definition: UserUtil.cpp:1296
int WINAPI FontHeight(HDC hdc, int Points)
Definition: GdiUtil.cpp:43
BOOL UnloadProcLibrary(HANDLE hProcess, HMODULE hRemoteLib, DWORD msWait=5000)
Definition: KernelUtil.cpp:483
UINT64 GetFilePos(HANDLE hFile)
Definition: IoUtil.cpp:299
bool(__stdcall * PFClipFmtAction)(UINT FmtTag, PVOID UserData)
Definition: UtilFunc.h:976
bool RecycleFile(CSTR Name, bool Confirm=true, bool Single=true)
Definition: ShellUtil.cpp:130
bool RestorePrivileges(HANDLE hToken, PTOKEN_PRIVILEGES pSaved, bool Dispose)
Definition: SecUtil.cpp:219
POINT MkPoint(LONG x, LONG y)
Definition: UtilFunc.cpp:26
LPRECT AbsToDimRect(LPRECT pRect)
Definition: UtilFunc.cpp:86
bool ButtonCtrlChecked(HWND hDlg, UINT Id)
Definition: UserUtil.cpp:1286
HANDLE Launch(CSTR ExePath, CSTR CmdLn, CSTR StartDir=NULL, int iShow=SW_SHOW, DWORD Flags=NORMAL_PRIORITY_CLASS)
Definition: KernelUtil.cpp:188
bool WINAPI DrawMaskedBitmap(HDC hdc, int x, int y, HBITMAP hBmp, HBITMAP hMask)
Definition: GdiUtil.cpp:343
HANDLE __cdecl AsyncMsgBox(UINT Type, PINT_PTR pResult, CSTR Title, CSTR Fmt,...)
Definition: UserUtil.cpp:430
UINT GetFileNameFromHandle(HANDLE hFile, OUT TSTR Buffer, UINT BufLen)
#define BEGIN_EXTERN_CPP
Definition: Common.h:222
HMENU AddSubMenu(HMENU hMenu, UINT Index, CSTR Text, WORD Id=0, WORD State=0, PVOID Data=NULL, HBITMAP Image=NULL)
Definition: UserUtil.cpp:718
UINT __cdecl WriteStrA(HANDLE hFile, const char *Fmt,...)
bool __cdecl SetStatusParts(HWND hStat, UINT nParts,...)
Definition: UserUtil.cpp:1377
BOOL SetTrayIconNotification(UINT Action, HWND hNfy, UINT Id, HICON hIcon, CSTR Hint, UINT cbkMsg=WM_APP)
Definition: ShellUtil.cpp:607
void WINAPI DrawIsoTriangle(HDC hdc, int xOrg, int yOrg, int Radius, double Orientation)
Definition: GdiUtil.cpp:529
HMENU LoadMenuEx(HMODULE hModule, CSTR Id, LANGID Language)
Definition: UserUtil.cpp:639
HANDLE GetClipHandle(UINT clipFmt)
Definition: UserUtil.cpp:85
UINT DevicePathToDosPath(IN CSTR DevPath, OUT TSTR PathBuf, UINT ccPathBuf)
Definition: IoUtil.cpp:1007
ModifyEnvironmentVar() appends the Addendum.
Definition: UtilFunc.h:867
CSTR GetWndClassName(HWND hWnd)
Definition: UserUtil.cpp:1232
UINT EnumerateHardLinks(CSTR FileName, PFnEnumHardLinks Action, PVOID UserData)
Definition: Hardlink.cpp:236
UINT64 GetFileSizeByName(CSTR FName)
Definition: IoUtil.cpp:354
UINT ListView_ForEach(HWND hLv, PFLvItemAction Action, PVOID pCtx)
Definition: UserUtil.cpp:1461
HBITMAP WINAPI CreateAntialiasedBitmap(UINT cx, UINT cy, UINT mu, PFnPaintBitmap PaintBitmap, PVOID Ctx)
Definition: GdiUtil.cpp:222
bool Seek(HANDLE hFile, LONG Offs, DWORD How)
Definition: IoUtil.cpp:316
HWND GetComboList(HWND hCombo)
Definition: UserUtil.cpp:1225
void AbsInflateBorders(PRECT Target, LPCRECT Borders)
Definition: UtilFunc.cpp:167
int AddListItem(HWND hLB, CSTR Text, LPARAM Data=0)
Definition: UserUtil.cpp:1315
void FitRect(IN PRECT pRc, IN PRECT pBounds, OUT PRECT pOut)
bool TreeView_GetItemText(HWND hTree, HTREEITEM hItem, TSTR Buf, UINT BufLen)
Definition: UserUtil.cpp:1493
UINT GetWndWidth(HWND hWnd)
Definition: UserUtil.cpp:515
CSTR ChangeDirectory(CSTR Dir)
Definition: IoUtil.cpp:1026
unsigned char BYTE
Definition: Common.h:412
bool SetTrackbarInfo(HWND hCtl, LPSCROLLINFO psi, bool Redraw)
Definition: UserUtil.cpp:1543
bool CheckButton(HWND hBtn, bool Check)
Definition: UserUtil.cpp:1291
void SetWindowFloat(HWND hWnd, int Index, float Value)
Definition: UserUtil.cpp:177
bool operator !=(FILETIME const &A, FILETIME const &B)
Definition: KernelUtil.cpp:648
RECT Bounds
Bounding rect for the whole path.
Definition: UtilFunc.h:2135
RECTS MkRectS(SHORT L, SHORT T, SHORT R, SHORT B)
Definition: UtilFunc.cpp:51
XFORM * SetXformRotate(XFORM *pxfm, double angle)
Definition: Xform.cpp:47
PBYTE GetMappedFilePtr(HMAPFILE hMapFile)
Definition: IoUtil.cpp:1330
UINT64 SetFilePos(HANDLE hFile, INT64 Offset, UINT How)
Definition: IoUtil.cpp:306
UINT ModifyEnvironmentVar(OPTIO WSTR *pwEnv, IN BYTE Option, IN CSTR Name, IN CSTR Addendum, OPTIN TCHAR Sep)
bool PutClipboardStringA(HWND clipboardOwner, ACSTR Text)
Definition: UserUtil.cpp:111
bool CreateSymLink(CSTR LinkName, CSTR TargetPath, CSTR PrintName)
Definition: ReparsePnt.cpp:822
double GetDlgItemReal(HWND hDlg, UINT Id)
Definition: UserUtil.cpp:1249
HANDLE CreateCapturedProcess(IN CSTR cmdLn, INOUT LPSTARTUPINFO pSi, IN DWORD Flags, OPTOUT PHANDLE pRdHnd, OPTOUT PHANDLE pWrHnd, OPTOUT PHANDLE pErrHnd, OPTOUT PHANDLE phThread=NULL)
bool RedrawWnd(HWND hWnd, UINT Flags)
Definition: UserUtil.cpp:1134
#define OPTIN
Definition: Common.h:263
unsigned long * PDWORD
Definition: Common.h:414
XFORM * SetXformReflect(XFORM *pxfm, bool rx, bool ry)
Definition: Xform.cpp:75
SYSTEMTIME * LocalTimeToSystemTime(INOUT SYSTEMTIME *Time)
bool IsSubdir(LPWIN32_FIND_DATA pFd)
Definition: IoUtil.cpp:55
#define INOUT
Definition: Common.h:262
WCSTR SkipPathPrefixW(WCSTR PathName)
Definition: IoUtil.cpp:133