ADMIN.H
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:11k
源码类别:

Windows编程

开发平台:

Visual C++

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. //  File Name 
  4. //      WINDSADM.H
  5. //
  6. //  Description
  7. //
  8. //  Author
  9. //      Irving De la Cruz
  10. //
  11. //  Revision: 1.7
  12. //
  13. // Written for Microsoft Windows Developer Support
  14. // Copyright (c) 1995-1996 Microsoft Corporation. All rights reserved.
  15. //
  16. #ifndef _WINDSADM_H
  17. #define _WINDSADM_H
  18. #define STRICT
  19. #include <WINDOWS.H>
  20. #include <WINDOWSX.H>
  21. #include <COMMDLG.H>
  22. #include <COMMCTRL.H>
  23. #include "WRAP3D.H"
  24. #ifdef _DEBUG
  25. #define ENABLE_DEBUG_OUTPUT     1
  26. #endif // _DEBUG
  27. #define TRACES_NO_MAPI          1
  28. #include "TRACES.H"
  29. #include "RESOURCE.H"
  30. #include <RPC.H>
  31. #include "WDSADM.H"    // Header file generated by the MIDL compiler
  32. #include "WINDSGBL.H"
  33. //  CTL3D wrapper
  34. extern "C" LPVOID g_pctl3d;
  35. #ifdef UNICODE
  36. #error WINDS Administrator: Not ready for UNICODE yet... IrvingD (9/10/95)
  37. #define RemoteAdmTerminateNotif     RemoteAdmTerminateNotifW
  38. #define RemoteAdmValidateNotif      RemoteAdmValidateNotifW
  39. #define RemoteAdmCreateMailbox      RemoteAdmCreateMailboxW
  40. #define RemoteAdmGetMailboxProps    RemoteAdmGetMailboxPropsW
  41. #define RemoteAdmSetMailboxProps    RemoteAdmSetMailboxPropsW
  42. #define RemoteAdmCreateDistList     RemoteAdmCreateDistListW
  43. #define RemoteAdmGetDLProps         RemoteAdmGetDLPropsW
  44. #define RemoteAdmSetDLProps         RemoteAdmSetDLPropsW
  45. #define ADMIN_DL_MEMBERS            ADMIN_DL_MEMBERS_W
  46. #define DLM_LIST                    DLM_LIST_W
  47. #define DLM_INFO                    DLM_INFO_W
  48. #define ADM_MAILBOX_INFO            ADM_MAILBOX_INFO_W
  49. #else
  50. #define RemoteAdmTerminateNotif     RemoteAdmTerminateNotifA
  51. #define RemoteAdmValidateNotif      RemoteAdmValidateNotifA
  52. #define RemoteAdmCreateMailbox      RemoteAdmCreateMailboxA
  53. #define RemoteAdmGetMailboxProps    RemoteAdmGetMailboxPropsA
  54. #define RemoteAdmSetMailboxProps    RemoteAdmSetMailboxPropsA
  55. #define RemoteAdmCreateDistList     RemoteAdmCreateDistListA
  56. #define RemoteAdmGetDLProps         RemoteAdmGetDLPropsA
  57. #define RemoteAdmSetDLProps         RemoteAdmSetDLPropsA
  58. #define ADMIN_DL_MEMBERS            ADMIN_DL_MEMBERS_A
  59. #define DLM_LIST                    DLM_LIST_A
  60. #define DLM_INFO                    DLM_INFO_A
  61. #define ADM_MAILBOX_INFO            ADM_MAILBOX_INFO_A
  62. #endif // UNICODE
  63. enum
  64. {
  65.     IMG_MAILABLE_OBJECTS_CLOSE  = 0,
  66.     IMG_MAILABLE_OBJECTS_OPEN,
  67.     IMG_PUBLIC_FOLDER,
  68.     IMG_USER,
  69.     IMG_FOREIGN_USER,
  70.     IMG_MAIL_GROUP,
  71.     IMG_DIST_LIST,
  72.     IMG_SERVER_PUB_FOLDER,
  73.     IMG_SERVER,
  74.     IMG_SERVER_OBJECTS,
  75.     IMG_SERVER_GATEWAY,
  76.     IMG_GATEWAY,
  77.     IMG_USER_MAILBOX,
  78.     IMG_FOLDER_CLOSE,
  79.     IMG_FOLDER_OPEN,
  80. };
  81. enum
  82. {
  83.     ICON_AUTO_REPLY     = 0,
  84.     ICON_CONSTRUCT,
  85.     ICON_DL_MEMBERS,
  86.     ICON_LABELS,
  87.     ICON_LARGE_ENVEL,
  88.     ICON_MAILBOX,
  89.     ICON_PHONE_HAND,
  90.     ICON_KEY,
  91.     ICON_PEOPLE,
  92.     ICON_DL_OWNER,
  93.     ICON_CONNECT,
  94.     ICON_TIMEUP,
  95.     ICON_WORLD,
  96.     ICON_CLIP
  97. };
  98. #define WM_WINDS_UPDATEHEADERWIDTH          (WM_USER + 100)
  99. #define WM_WINDS_REMOTE_CALL_IN_PROGRESS    (WM_USER + 101)
  100. #define WM_WINDS_REMOTE_CALL_COMPLETED      (WM_USER + 102)
  101. #define WM_WINDS_RESET_NOTIF_LINK           (WM_USER + 103)
  102. #define WM_WINDS_IMPORT_START               (WM_USER + 104)
  103. #define WM_WINDS_IMPORT_FINISHED            (WM_USER + 105)
  104. #define WM_WINDS_EXPORT_START               (WM_USER + 106)
  105. #define WM_WINDS_EXPORT_FINISHED            (WM_USER + 107)
  106. typedef enum _ITEM_TYPE
  107. {
  108.     ITEM_UNDEFINED_TYPE,
  109.     ITEM_SERVER_USER_MAILBOXES,
  110.     ITEM_SERVER_DIST_LISTS,
  111.     ITEM_SERVER_FOREIGN_MAILBOXES,
  112.     ITEM_SERVER_PUBLIC_FOLDERS,
  113.     ITEM_SERVER_GATEWAYS,
  114.     ITEM_REMOTE_SERVER,
  115.     ITEM_OBJECT_DIRECTORY
  116. } ITEM_TYPE;
  117. typedef struct _OBJECT_INFO_A
  118. {
  119.     DWORD               dwData;
  120.     WINDS_AB_OBJTYPE    Type;
  121.     MAILBOX_INFO_A      MB;
  122.     DIST_LIST_INFO_A    DL;
  123.     DLM_LIST_A *        pMembers;
  124. } OBJECT_INFO_A, *POBJECT_INFO_A;
  125. #ifdef UNICODE
  126. #define OBJECT_INFO     OBJECT_INFO_W
  127. #define POBJECT_INFO    POBJECT_INFO_W
  128. #else
  129. #define OBJECT_INFO     OBJECT_INFO_A
  130. #define POBJECT_INFO    POBJECT_INFO_A
  131. #endif // UNICODE
  132. extern "C"
  133. {
  134.     extern ITEM_TYPE g_LVItemsType;
  135.     extern HINSTANCE ghInstance;
  136.     extern HANDLE ghMemHeap;
  137.     extern HANDLE ghCancelEvent;
  138.     extern HWND ghTreeView, ghListView, ghWnd, ghStatusBar, ghToolBar;
  139.     extern BOOL gfCancel, gfRPCinProgress;
  140.     extern HFONT ghBoldFont;
  141.     extern CRITICAL_SECTION csCancel;
  142.     extern CRITICAL_SECTION csRemoteServer;
  143.     extern TCHAR g_szCurrentServer[];
  144.     extern HIMAGELIST g_hImages, g_hIconImgs;
  145.     void WINAPI AddServerToList
  146.                         (LPTSTR                     szServer,
  147.                          BOOL                       fExpandRoot);
  148.     void WINAPI CreateNewMailbox
  149.                         (HWND                       hOwnerWnd);
  150.     void WINAPI CreateNewDistList
  151.                         (HWND                       hOwnerWnd);
  152.     void WINAPI CreateNewPubFolder
  153.                         (HWND                       hOwnerWnd);
  154.     void WINAPI ShowMailboxProps
  155.                         (HWND                       hOwnerWnd,
  156.                          DWORD                      dwObjID);
  157.     void WINAPI ShowDistListProps
  158.                         (HWND                       hOwnerWnd,
  159.                          DWORD                      dwObjID);
  160.     void WINAPI DeleteServerObject
  161.                         (HWND                       hOwnerWnd,
  162.                          DWORD                      dwObjID);
  163.     void WINAPI PurgeMailboxMessages
  164.                         (HWND                       hOwnerWnd,
  165.                          DWORD                      dwObjID);
  166.     void WINAPI ErrorHandler
  167.                         (HWND                       hOwnerWnd,
  168.                          HRESULT                    hError);
  169.     void WINAPI DrawListViewItem
  170.                         (LPDRAWITEMSTRUCT           pDIS);
  171.     void WINAPI UpdateHeaderWidth
  172.                         (HWND                       hWndHeader,
  173.                          int                        iItem);
  174.     BOOL WINAPI CreateListView
  175.                         (HWND                       hOwnerWnd,
  176.                          HIMAGELIST                 hImages);
  177.     BOOL WINAPI CreateTreeView
  178.                         (HWND                       hOwnerWnd,
  179.                          HIMAGELIST                 hImages);
  180.     BOOL WINAPI CreateStatusBar
  181.                         (HWND                       hOwnerWnd);
  182.     BOOL WINAPI CreateToolBar
  183.                         (HWND                       hOwnerWnd);
  184.     BOOL WINAPI IsObjAliasValid
  185.                         (HWND                       hOwnerWnd,
  186.                          LPTSTR                     szObjAlias);
  187.     HRESULT WINAPI BindToServer
  188.                         (LPTSTR                     szServer);
  189.     HRESULT WINAPI GetServerMailboxes
  190.                         (HWND                       hOwnerWnd);
  191.     HRESULT WINAPI GetServerDistLists
  192.                         (HWND                       hOwnerWnd);
  193.     HRESULT WINAPI DownloadBulkInfo
  194.                         (HWND                       hOwnerWnd,
  195.                          HWND                       hListView,
  196.                          ITEM_TYPE                  Type);
  197.     
  198.     HCURSOR WINAPI GetAnimatedTimerCursor
  199.                         ();
  200.     BOOL WINAPI BrowseFileName
  201.                         (HWND                       hOwnerWnd,
  202.                          LPTSTR                     szFileName,
  203.                          BOOL                       fImport);
  204.     BOOL CALLBACK AboutDlgProc
  205.                         (HWND                       hDlg, 
  206.                          UINT                       message, 
  207.                          WPARAM                     wParam, 
  208.                          LPARAM                     lParam);
  209.     BOOL CALLBACK ServerConnectDlgProc
  210.                         (HWND                       hDlg, 
  211.                          UINT                       message, 
  212.                          WPARAM                     wParam, 
  213.                          LPARAM                     lParam);
  214.     BOOL CALLBACK ExportDlgProc
  215.                         (HWND                       hDlg, 
  216.                          UINT                       message, 
  217.                          WPARAM                     wParam, 
  218.                          LPARAM                     lParam);
  219.     BOOL CALLBACK ImportDlgProc
  220.                         (HWND                       hDlg, 
  221.                          UINT                       message, 
  222.                          WPARAM                     wParam, 
  223.                          LPARAM                     lParam);
  224.     BOOL CALLBACK ImportProgressDlgProc
  225.                         (HWND                       hDlg, 
  226.                          UINT                       message, 
  227.                          WPARAM                     wParam, 
  228.                          LPARAM                     lParam);
  229.     BOOL CALLBACK ExportProgressDlgProc
  230.                         (HWND                       hDlg, 
  231.                          UINT                       message, 
  232.                          WPARAM                     wParam, 
  233.                          LPARAM                     lParam);
  234.     BOOL CALLBACK RemoveServersDlgProc
  235.                         (HWND                       hDlg, 
  236.                          UINT                       message, 
  237.                          WPARAM                     wParam, 
  238.                          LPARAM                     lParam);
  239.     BOOL CALLBACK SelectUserDlgProc
  240.                         (HWND                       hDlg, 
  241.                          UINT                       message, 
  242.                          WPARAM                     wParam, 
  243.                          LPARAM                     lParam);
  244. };
  245. inline BOOL WINAPI AbortRemoteCall()
  246. {
  247.     BOOL fState;
  248.     EnterCriticalSection (&csCancel);
  249.     fState = gfCancel;
  250.     if (TRUE == gfCancel)
  251.     {
  252.         gfCancel = FALSE;
  253.     }
  254.     LeaveCriticalSection (&csCancel);
  255.     return fState;
  256. }
  257. class CNotifLink;
  258. extern CNotifLink * gpLink;
  259. DWORD WINAPI MailslotListenThreadProc (CNotifLink * pLink);
  260. class CNotifLink
  261. {
  262. public :
  263.     STDMETHODIMP StartNotification
  264.                         ();
  265.     STDMETHODIMP EndNotifications
  266.                         ();
  267.     inline HANDLE WINAPI GetListenMailslot
  268.                         () { return m_hMailSlot; }
  269. public :
  270.     CNotifLink();
  271.     ~CNotifLink();
  272. private :
  273.     HANDLE      m_hMailSlot;
  274.     ULONG       m_ulConnectionID;
  275.     TCHAR       m_szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
  276. };
  277. #endif // _WINDSADM_H
  278. // End of file for WINDSADM.H