1c2c66affSColin Finck /* 2c2c66affSColin Finck * PROJECT: ReactOS Applications 3c2c66affSColin Finck * LICENSE: LGPL - See COPYING in the top level directory 4c2c66affSColin Finck * FILE: base/applications/msconfig_new/utils.c 5c2c66affSColin Finck * PURPOSE: Memory Management, Resources, ... Utility Functions 6c2c66affSColin Finck * COPYRIGHT: Copyright 2011-2012 Hermes BELUSCA - MAITO <hermes.belusca@sfr.fr> 7c2c66affSColin Finck */ 8c2c66affSColin Finck 9c2c66affSColin Finck #ifndef __UTILS_H__ 10c2c66affSColin Finck #define __UTILS_H__ 11c2c66affSColin Finck 12c2c66affSColin Finck #pragma once 13c2c66affSColin Finck 14c2c66affSColin Finck #ifdef __cplusplus 15c2c66affSColin Finck extern "C" { 16c2c66affSColin Finck #endif 17c2c66affSColin Finck 18c2c66affSColin Finck #if 0 19c2c66affSColin Finck VOID 20c2c66affSColin Finck MemInit(IN HANDLE Heap); 21c2c66affSColin Finck #endif 22c2c66affSColin Finck 23c2c66affSColin Finck BOOL 24c2c66affSColin Finck MemFree(IN PVOID lpMem); 25c2c66affSColin Finck 26c2c66affSColin Finck PVOID 27c2c66affSColin Finck MemAlloc(IN DWORD dwFlags, 28*7611cc2bSTimo Kreuzer IN SIZE_T dwBytes); 29c2c66affSColin Finck 30c2c66affSColin Finck LPWSTR 31c2c66affSColin Finck FormatDateTime(IN LPSYSTEMTIME pDateTime); 32c2c66affSColin Finck 33c2c66affSColin Finck VOID 34c2c66affSColin Finck FreeDateTime(IN LPWSTR lpszDateTime); 35c2c66affSColin Finck 36c2c66affSColin Finck LPWSTR 37c2c66affSColin Finck LoadResourceStringEx(IN HINSTANCE hInstance, 38c2c66affSColin Finck IN UINT uID, 39c2c66affSColin Finck OUT size_t* pSize OPTIONAL); 40c2c66affSColin Finck 41c2c66affSColin Finck LPWSTR 42c2c66affSColin Finck LoadConditionalResourceStringEx(IN HINSTANCE hInstance, 43c2c66affSColin Finck IN BOOL bCondition, 44c2c66affSColin Finck IN UINT uIDifTrue, 45c2c66affSColin Finck IN UINT uIDifFalse, 46c2c66affSColin Finck IN size_t* pSize OPTIONAL); 47c2c66affSColin Finck 48c2c66affSColin Finck #define LoadResourceString(hInst, uID) \ 49c2c66affSColin Finck LoadResourceStringEx((hInst), (uID), NULL) 50c2c66affSColin Finck 51c2c66affSColin Finck #define LoadConditionalResourceString(hInst, bCond, uIDifT, uIDifF) \ 52c2c66affSColin Finck LoadConditionalResourceStringEx((hInst), (bCond), (uIDifT), (uIDifF), NULL) 53c2c66affSColin Finck 54c2c66affSColin Finck DWORD 55c2c66affSColin Finck RunCommand(IN LPCWSTR lpszCommand, 56c2c66affSColin Finck IN LPCWSTR lpszParameters, 57c2c66affSColin Finck IN INT nShowCmd); 58c2c66affSColin Finck 59c2c66affSColin Finck 60c2c66affSColin Finck //////////////////// The following comes from MSDN samples /////////////////// 61c2c66affSColin Finck // https://msdn.microsoft.com/en-us/library/windows/desktop/dd162826(v=vs.85).aspx 62c2c66affSColin Finck // 63c2c66affSColin Finck 64c2c66affSColin Finck // 65c2c66affSColin Finck // Available control flags. 66c2c66affSColin Finck // 67c2c66affSColin Finck #define MONITOR_CENTER 0x0001 // center rect to monitor 68c2c66affSColin Finck #define MONITOR_CLIP 0x0000 // clip rect to monitor 69c2c66affSColin Finck #define MONITOR_WORKAREA 0x0002 // use monitor work area 70c2c66affSColin Finck #define MONITOR_AREA 0x0000 // use monitor entire area 71c2c66affSColin Finck 72c2c66affSColin Finck VOID ClipOrCenterRectToMonitor(LPRECT prc, UINT flags); 73c2c66affSColin Finck VOID ClipOrCenterWindowToMonitor(HWND hWnd, UINT flags); 74c2c66affSColin Finck //////////////////////////////////////////////////////////////////////////////// 75c2c66affSColin Finck 76c2c66affSColin Finck 77c2c66affSColin Finck BOOL IsWindowsOS(VOID); 78c2c66affSColin Finck BOOL IsPreVistaOSVersion(VOID); 79c2c66affSColin Finck 80c2c66affSColin Finck LPWSTR 81c2c66affSColin Finck GetExecutableVendor(IN LPCWSTR lpszFilename); 82c2c66affSColin Finck 83c2c66affSColin Finck #ifdef __cplusplus 84c2c66affSColin Finck } // extern "C" 85c2c66affSColin Finck #endif 86c2c66affSColin Finck 87c2c66affSColin Finck #endif // __UTILS_H__ 88c2c66affSColin Finck 89c2c66affSColin Finck /* EOF */ 90