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.

121 lines
2.3 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. Precomp.h
  5. Abstract:
  6. Contains constants, function prototypes, structures, etc.
  7. used throughout the application.
  8. Notes:
  9. Unicode only.
  10. History:
  11. 05/04/2001 rparsons Created
  12. 01/11/2002 rparsons Cleaned up
  13. 02/20/2002 rparsons Implemented strsafe
  14. --*/
  15. #include <nt.h>
  16. #include <ntrtl.h>
  17. #include <nturtl.h>
  18. #include <windows.h>
  19. #include <process.h>
  20. #include <string.h>
  21. #include <commctrl.h>
  22. #include <shellapi.h>
  23. #include <strsafe.h>
  24. #include "resource.h"
  25. //
  26. // Constants used throughout the application.
  27. //
  28. #define APP_NAME L"ShimViewer"
  29. #define APP_CLASS L"SHIMVIEW"
  30. #define WRITTEN_BY L"Written by rparsons"
  31. #define PIPE_NAME L"\\\\.\\pipe\\ShimViewer"
  32. //
  33. // For our tray icon.
  34. //
  35. #define ICON_NOTIFY 10101
  36. #define WM_NOTIFYICON (WM_APP + 100)
  37. #define ARRAYSIZE(a) (sizeof(a) / sizeof(a[0]))
  38. //
  39. // Contains all the information we'll need throughout the application.
  40. //
  41. typedef struct _APPINFO {
  42. HWND hMainDlg; // main dialog handle
  43. HWND hWndList; // list view handle
  44. HINSTANCE hInstance; // main instance handle
  45. BOOL fOnTop; // flag for window position
  46. BOOL fMinimize; // flag for window placement
  47. BOOL fMonitor; // flag for monitoring messages
  48. UINT uThreadId; // receive thread identifier
  49. UINT uInstThreadId; // instance thread identifier
  50. BOOL bUsingNewShimEng; // are we using the shimeng from NT 5.2+?
  51. } APPINFO, *LPAPPINFO;
  52. INT_PTR
  53. CALLBACK
  54. MainWndProc(
  55. IN HWND hWnd,
  56. IN UINT uMsg,
  57. IN WPARAM wParam,
  58. IN LPARAM lParam
  59. );
  60. BOOL
  61. AddIconToTray(
  62. IN HWND hWnd,
  63. IN HICON hIcon,
  64. IN LPCWSTR pwszTip
  65. );
  66. BOOL
  67. RemoveFromTray(
  68. IN HWND hWnd
  69. );
  70. BOOL
  71. DisplayMenu(
  72. IN HWND hWnd
  73. );
  74. BOOL
  75. CreateReceiveThread(
  76. void
  77. );
  78. BOOL
  79. CreateDebugObjects(
  80. void
  81. );
  82. void
  83. GetSavePositionInfo(
  84. IN BOOL fSave,
  85. IN OUT POINT* lppt
  86. );
  87. void
  88. GetSaveSettings(
  89. IN BOOL fSave
  90. );
  91. int
  92. InitListViewColumn(
  93. void
  94. );
  95. int
  96. AddListViewItem(
  97. IN LPWSTR pwszItemText
  98. );