Leaked source code of windows server 2003
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.

63 lines
2.0 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997-2002.
  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. /////////////////////////////////////////////////////////////////////
  28. int ListView_FindString(HWND hwndListview, PCWSTR pszTextSearch);
  29. int ListView_GetSelectedItem(HWND hwndListview);
  30. void ListView_SelectItem(HWND hwndListview, int iItem);
  31. void ListView_UnselectItem(HWND hwndListview, int iItem);
  32. void ListView_UnselectAllItems(HWND hwndListview);
  33. void ListView_SetItemImage(HWND hwndListview, int iItem, int iImage);
  34. BOOL FTrimString(INOUT WCHAR szString[]);
  35. /////////////////////////////////////////////////////////////////////
  36. INT_PTR DoDialogBox(
  37. UINT wIdDialog,
  38. HWND hwndParent,
  39. DLGPROC dlgproc,
  40. LPARAM lParam = 0);
  41. int DoMessageBox (HWND hwndParent, UINT uStringId, UINT uFlags = MB_OK | MB_ICONINFORMATION);
  42. /////////////////////////////////////////////////////////////////////
  43. HKEY RegOpenOrCreateKey(HKEY hkeyRoot, const WCHAR szSubkey[]);
  44. BOOL RegWriteString(HKEY hkey, const WCHAR szKey[], const WCHAR szValue[]);
  45. BOOL RegWriteString(HKEY hkey, const WCHAR szKey[], UINT uStringId);
  46. /////////////////////////////////////////////////////////////////////
  47. HRESULT HrExtractDataAlloc(
  48. IN IDataObject * pDataObject,
  49. IN UINT cfClipboardFormat,
  50. OUT PVOID * ppavData,
  51. OUT UINT * pcbData = NULL);