Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.0 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997-2001.
  5. //
  6. // File: util.h
  7. //
  8. // Contents:
  9. //
  10. //----------------------------------------------------------------------------
  11. // Util.h
  12. extern HINSTANCE g_hInstance;
  13. #ifndef APIERR
  14. typedef DWORD APIERR; // Error code typically returned by ::GetLastError()
  15. #endif
  16. /////////////////////////////////////////////////////////////////////
  17. //
  18. // Dummy macros
  19. //
  20. #define INOUT // Parameter is both input and output
  21. #define IGNORED // Output parameter is ignored
  22. /////////////////////////////////////////////////////////////////////
  23. //
  24. // Handy macros
  25. //
  26. #define LENGTH(x) (sizeof(x)/sizeof(x[0]))
  27. #define ZeroInit(pv, cb) memset(pv, 0, cb)
  28. /////////////////////////////////////////////////////////////////////
  29. int ListView_FindString(HWND hwndListview, LPCTSTR pszTextSearch);
  30. int ListView_GetSelectedItem(HWND hwndListview);
  31. void ListView_SelectItem(HWND hwndListview, int iItem);
  32. void ListView_UnselectItem(HWND hwndListview, int iItem);
  33. void ListView_UnselectAllItems(HWND hwndListview);
  34. void ListView_SetItemImage(HWND hwndListview, int iItem, int iImage);
  35. BOOL FTrimString(INOUT TCHAR szString[]);
  36. /////////////////////////////////////////////////////////////////////
  37. INT_PTR DoDialogBox(
  38. UINT wIdDialog,
  39. HWND hwndParent,
  40. DLGPROC dlgproc,
  41. LPARAM lParam = 0);
  42. int DoMessageBox(UINT uStringId, UINT uFlags = MB_OK | MB_ICONINFORMATION);
  43. /////////////////////////////////////////////////////////////////////
  44. HKEY RegOpenOrCreateKey(HKEY hkeyRoot, const TCHAR szSubkey[]);
  45. BOOL RegWriteString(HKEY hkey, const TCHAR szKey[], const TCHAR szValue[]);
  46. BOOL RegWriteString(HKEY hkey, const TCHAR szKey[], UINT uStringId);
  47. /////////////////////////////////////////////////////////////////////
  48. HRESULT HrExtractDataAlloc(
  49. IN IDataObject * pDataObject,
  50. IN UINT cfClipboardFormat,
  51. OUT PVOID * ppavData,
  52. OUT UINT * pcbData = NULL);