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.

1116 lines
36 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Copyright 1997 Microsoft Corporation. All Rights Reserved.
  4. //
  5. // Contents: IMsgrObject interface
  6. //
  7. //----------------------------------------------------------------------------
  8. #ifdef __MKTYPLIB__
  9. #define VARIANT_BOOL boolean
  10. #else // __MKTYPLIB__
  11. cpp_quote("//+-------------------------------------------------------------------------")
  12. cpp_quote("//")
  13. cpp_quote("// Microsoft Windows")
  14. cpp_quote("// Copyright 1997 Microsoft Corporation. All Rights Reserved.")
  15. cpp_quote("//")
  16. cpp_quote("// File: mdisp.h")
  17. cpp_quote("//")
  18. cpp_quote("//--------------------------------------------------------------------------")
  19. import "objidl.idl";
  20. import "oleidl.idl";
  21. import "oaidl.idl";
  22. #endif // __MKTYPLIB__
  23. #include "mdispid.h"
  24. #define MSGR_S(e) (0x01000300 + (e))
  25. #define MSGR_E(e) (0x81000300 + (e))
  26. #define MSGR_E_OE(e) (0x81000300 + (e))
  27. #define E_FAIL 0x80004005
  28. #define S_OK 0
  29. //////////////////////////////////////////////////////////////////////////////////
  30. // GUID usage:
  31. // {218CB450-20B6-11d2-8E17-0000F803A446}-{218CB45F-20B6-11d2-8E17-0000F803A446}
  32. //--------------------------------------------------------------------------
  33. // Type Library
  34. [
  35. uuid(218CB45F-20B6-11d2-8E17-0000F803A446), // LIBID_Messenger
  36. version(1.0),
  37. helpstring("Messenger Type Library")
  38. ]
  39. library Messenger
  40. {
  41. importlib("stdole2.tlb");
  42. interface IMsgrObject;
  43. interface IMsgrUser;
  44. interface IMsgrUsers;
  45. interface IMsgrIMSession;
  46. interface IMsgrIMSessions;
  47. interface IMessengerApp;
  48. interface IMessengerIMWindow;
  49. interface IMessengerIMWindows;
  50. interface IMsgrOE;
  51. interface IMsgrUserOE;
  52. interface IMsgrUsersOE;
  53. #define DISPID_VALUE 0
  54. #define DISPID_NEWENUM -4
  55. typedef enum
  56. {
  57. MSTATEOE_UNKNOWN = 0x0000,
  58. MSTATEOE_OFFLINE = 0x0001,
  59. MSTATEOE_ONLINE = 0x0002,
  60. MSTATEOE_INVISIBLE = 0x0006,
  61. MSTATEOE_BUSY = 0x000A,
  62. MSTATEOE_BE_RIGHT_BACK = 0x000E,
  63. MSTATEOE_IDLE = 0x0012,
  64. MSTATEOE_AWAY = 0x0022,
  65. MSTATEOE_ON_THE_PHONE = 0x0032,
  66. MSTATEOE_OUT_TO_LUNCH = 0x0042,
  67. MSTATEOE_LOCAL_FINDING_SERVER = 0x0100,
  68. MSTATEOE_LOCAL_CONNECTING_TO_SERVER = 0x0200,
  69. MSTATEOE_LOCAL_SYNCHRONIZING_WITH_SERVER = 0x0300,
  70. MSTATEOE_LOCAL_DISCONNECTING_FROM_SERVER = 0x0400,
  71. }
  72. MSTATEOE;
  73. typedef enum
  74. {
  75. MSGR_E_OE_CONNECT = MSGR_E_OE(0x0001),
  76. MSGR_E_OE_INVALID_SERVER_NAME = MSGR_E_OE(0x0002),
  77. MSGR_E_OE_INVALID_PASSWORD = MSGR_E_OE(0x0003),
  78. MSGR_E_OE_ALREADY_LOGGED_ON = MSGR_E_OE(0x0004),
  79. MSGR_E_OE_SERVER_VERSION = MSGR_E_OE(0x0005),
  80. MSGR_E_OE_LOGON_TIMEOUT = MSGR_E_OE(0x0006),
  81. MSGR_E_OE_LIST_FULL = MSGR_E_OE(0x0007),
  82. MSGR_E_OE_AI_REJECT = MSGR_E_OE(0x0008),
  83. MSGR_E_OE_AI_REJECT_NOT_INST = MSGR_E_OE(0x0009),
  84. MSGR_E_OE_USER_NOT_FOUND = MSGR_E_OE(0x000A),
  85. MSGR_E_OE_ALREADY_IN_LIST = MSGR_E_OE(0x000B),
  86. MSGR_E_OE_DISCONNECTED = MSGR_E_OE(0x000C),
  87. MSGR_E_OE_UNEXPECTED = MSGR_E_OE(0x000D),
  88. MSGR_E_OE_SERVER_TOO_BUSY = MSGR_E_OE(0x000E),
  89. MSGR_E_OE_INVALID_AUTH_PACKAGES = MSGR_E_OE(0x000F),
  90. MSGR_E_OE_NEWER_CLIENT_AVAILABLE = MSGR_E_OE(0x0010),
  91. MSGR_E_OE_AI_TIMEOUT = MSGR_E_OE(0x0011),
  92. MSGR_E_OE_CANCEL = MSGR_E_OE(0x0012),
  93. MSGR_E_OE_TOO_MANY_MATCHES = MSGR_E_OE(0x0013),
  94. MSGR_E_OE_SERVER_UNAVAILABLE = MSGR_E_OE(0x0014),
  95. MSGR_E_OE_LOGON_UI_ACTIVE = MSGR_E_OE(0x0015),
  96. MSGR_E_OE_OPTION_UI_ACTIVE = MSGR_E_OE(0x0016),
  97. MSGR_E_OE_CONTACT_UI_ACTIVE = MSGR_E_OE(0x0017),
  98. MSGR_E_OE_FAIL = E_FAIL,
  99. MSGR_S_OE_OK = S_OK,
  100. }
  101. MSGR_OE_Constants;
  102. typedef enum
  103. {
  104. MSTATE_UNKNOWN = 0x0000,
  105. MSTATE_OFFLINE = 0x0001,
  106. MSTATE_ONLINE = 0x0002,
  107. MSTATE_INVISIBLE = 0x0006,
  108. MSTATE_BUSY = 0x000A,
  109. MSTATE_BE_RIGHT_BACK = 0x000E,
  110. MSTATE_IDLE = 0x0012,
  111. MSTATE_AWAY = 0x0022,
  112. MSTATE_ON_THE_PHONE = 0x0032,
  113. MSTATE_OUT_TO_LUNCH = 0x0042,
  114. MSTATE_LOCAL_FINDING_SERVER = 0x0100,
  115. MSTATE_LOCAL_CONNECTING_TO_SERVER = 0x0200,
  116. MSTATE_LOCAL_SYNCHRONIZING_WITH_SERVER = 0x0300,
  117. MSTATE_LOCAL_DISCONNECTING_FROM_SERVER = 0x0400,
  118. }
  119. MSTATE;
  120. typedef enum
  121. {
  122. MPROMPT_YES_IF_NOT_ALLOWED_OR_BLOCKED = 0,
  123. MPROMPT_NO_ADD_TO_ALLOW = 1,
  124. }
  125. MPROMPT;
  126. typedef enum
  127. {
  128. MMSGPRIVACY_BLOCK_LIST_EXCLUDED = 0,
  129. MMSGPRIVACY_ALLOW_LIST_ONLY = 1,
  130. }
  131. MMSGPRIVACY;
  132. typedef enum
  133. {
  134. MUPDATECHOICE_OPTIONAL = 0,
  135. MUPDATECHOICE_MANDATORY = 1,
  136. }
  137. MUPDATECHOICE;
  138. typedef enum
  139. {
  140. MURLTYPE_CHANGE_PASSWORD = 0,
  141. MURLTYPE_CHANGE_INFO = 1,
  142. MURLTYPE_COMPOSE_EMAIL = 2,
  143. MURLTYPE_GO_TO_EMAIL_INBOX = 3,
  144. MURLTYPE_GO_TO_EMAIL_FOLDERS = 4,
  145. MURLTYPE_READ_EMAIL_MESSAGE = 5,
  146. }
  147. MURLTYPE;
  148. typedef enum
  149. {
  150. MLIST_CONTACT = 0,
  151. MLIST_ALLOW = 1,
  152. MLIST_BLOCK = 2,
  153. MLIST_REVERSE = 3,
  154. }
  155. MLIST;
  156. typedef enum
  157. {
  158. MMSGTYPE_NO_RESULT = 0,
  159. MMSGTYPE_ERRORS_ONLY = 1,
  160. MMSGTYPE_ALL_RESULTS = 2,
  161. }
  162. MMSGTYPE;
  163. typedef enum
  164. {
  165. MSGR_E_CONNECT = MSGR_E(0x0001),
  166. MSGR_E_INVALID_SERVER_NAME = MSGR_E(0x0002),
  167. MSGR_E_INVALID_PASSWORD = MSGR_E(0x0003),
  168. MSGR_E_ALREADY_LOGGED_ON = MSGR_E(0x0004),
  169. MSGR_E_SERVER_VERSION = MSGR_E(0x0005),
  170. MSGR_E_LOGON_TIMEOUT = MSGR_E(0x0006),
  171. MSGR_E_LIST_FULL = MSGR_E(0x0007),
  172. MSGR_E_AI_REJECT = MSGR_E(0x0008),
  173. MSGR_E_AI_REJECT_NOT_INST = MSGR_E(0x0009),
  174. MSGR_E_USER_NOT_FOUND = MSGR_E(0x000A),
  175. MSGR_E_ALREADY_IN_LIST = MSGR_E(0x000B),
  176. MSGR_E_DISCONNECTED = MSGR_E(0x000C),
  177. MSGR_E_UNEXPECTED = MSGR_E(0x000D),
  178. MSGR_E_SERVER_TOO_BUSY = MSGR_E(0x000E),
  179. MSGR_E_INVALID_AUTH_PACKAGES = MSGR_E(0x000F),
  180. MSGR_E_NEWER_CLIENT_AVAILABLE = MSGR_E(0x0010),
  181. MSGR_E_AI_TIMEOUT = MSGR_E(0x0011),
  182. MSGR_E_CANCEL = MSGR_E(0x0012),
  183. MSGR_E_TOO_MANY_MATCHES = MSGR_E(0x0013),
  184. MSGR_E_SERVER_UNAVAILABLE = MSGR_E(0x0014),
  185. MSGR_E_LOGON_UI_ACTIVE = MSGR_E(0x0015),
  186. MSGR_E_OPTION_UI_ACTIVE = MSGR_E(0x0016),
  187. MSGR_E_CONTACT_UI_ACTIVE = MSGR_E(0x0017),
  188. MSGR_E_FAIL = E_FAIL,
  189. MSGR_S_OK = S_OK,
  190. }
  191. MSGRConstants;
  192. typedef enum
  193. {
  194. SSTATE_DISCONNECTED = 0,
  195. SSTATE_CONNECTING = 1,
  196. SSTATE_CONNECTED = 2,
  197. SSTATE_DISCONNECTING = 3,
  198. }
  199. SSTATE;
  200. typedef enum
  201. {
  202. [helpstring("Proxy State")] MLOPT_PROXY_STATE = 0,
  203. [helpstring("Proxy Type")] MLOPT_PROXY_TYPE = 1,
  204. [helpstring("SOCKS4 Proxy Server")] MLOPT_SOCKS4_SERVER = 2,
  205. [helpstring("SOCKS5 Proxy Server")] MLOPT_SOCKS5_SERVER = 3,
  206. [helpstring("HTTPS Proxy Server")] MLOPT_HTTPS_SERVER = 4,
  207. [helpstring("SOCKS4 Port")] MLOPT_SOCKS4_PORT = 5,
  208. [helpstring("SOCKS5 Port")] MLOPT_SOCKS5_PORT = 6,
  209. [helpstring("HTTPS Port")] MLOPT_HTTPS_PORT = 7,
  210. [helpstring("SOCKS5 Username")] MLOPT_SOCKS5_USERNAME = 8,
  211. [helpstring("SOCKS5 Password")] MLOPT_SOCKS5_PASSWORD = 9,
  212. [helpstring("Server Name")] MLOPT_SERVER_NAME = 10,
  213. [helpstring("Enable Idle Detect")] MLOPT_ENABLE_IDLE_DETECT = 11,
  214. [helpstring("Idle Threshold")] MLOPT_IDLE_THRESHOLD = 12,
  215. [helpstring("Idle Detectable")] MLOPT_IDLE_DETECTABLE = 13,
  216. [helpstring("ScreenSaver Detectable")] MLOPT_SS_DETECTABLE = 14,
  217. }
  218. MLOCALOPTION;
  219. typedef enum
  220. {
  221. MLOPT_MAX_PROXY_STRING = 255,
  222. MLOPT_MAX_PORT_NUMBER = 65535,
  223. }
  224. MLOCALOPTION_LIMITS;
  225. typedef enum
  226. {
  227. [helpstring("Proxy Type: No proxy")] MPROXYTYPE_NO_PROXY = 0,
  228. [helpstring("Proxy Type: SOCKS 4")] MPROXYTYPE_SOCKS4 = 1,
  229. [helpstring("Proxy Type: SOCKS 5")] MPROXYTYPE_SOCKS5 = 2,
  230. [helpstring("Proxy Type: HTTPS")] MPROXYTYPE_HTTPS = 3,
  231. }
  232. MPROXYTYPE;
  233. typedef enum
  234. {
  235. MOPTDLG_GENERAL_PAGE = 0,
  236. MOPTDLG_PRIVACY_PAGE = 1,
  237. MOPTDLG_CONNECTION_PAGE = 2
  238. }
  239. MOPTDLGPAGE;
  240. //--------------------------------------------------------------------------
  241. // IMsgrObject Interface
  242. [
  243. uuid(218CB451-20B6-11d2-8E17-0000F803A446), // IID_IMsgrObject
  244. helpstring("Messenger Object Interface"),
  245. helpcontext(0x0000),
  246. dual,
  247. oleautomation
  248. ]
  249. interface IMsgrObject : IDispatch
  250. {
  251. [id(100), helpstring("Creates a user object."), helpcontext(0x0000)]
  252. HRESULT CreateUser(
  253. [in] BSTR bstrLogonName,
  254. [out, retval] IMsgrUser** ppUser);
  255. [id(104), helpstring("Initiates a logon."), helpcontext(0x0000)]
  256. HRESULT Logon(
  257. [in] BSTR bstrUser,
  258. [in] BSTR bstrPassword);
  259. [id(105), helpstring("Initiates a logoff."), helpcontext(0x0000)]
  260. HRESULT Logoff();
  261. [propget, helpstring("Returns a list."), helpcontext(0x0000)]
  262. HRESULT List(
  263. [in] MLIST mList,
  264. [out, retval] IMsgrUsers** ppUsers);
  265. [propget, helpstring("Logon name."), helpcontext(0x0000)]
  266. HRESULT LocalLogonName(
  267. [out, retval] BSTR* pbstrName);
  268. [propget, helpstring("Friendly name."), helpcontext(0x0000)]
  269. HRESULT LocalFriendlyName(
  270. [out, retval] BSTR* pbstrName);
  271. [propput, helpstring("Local state."), helpcontext(0x0000)]
  272. HRESULT LocalState(
  273. [in] MSTATE mState);
  274. [propget]
  275. HRESULT LocalState(
  276. [out, retval] MSTATE* pmState);
  277. [propput, helpstring("Message privacy setting."), helpcontext(0x0000)]
  278. HRESULT MessagePrivacy(
  279. [in] MMSGPRIVACY mmpSetting);
  280. [propget]
  281. HRESULT MessagePrivacy(
  282. [out, retval] MMSGPRIVACY* pmmpSetting);
  283. [propput, helpstring("Prompt setting."), helpcontext(0x0000)]
  284. HRESULT Prompt(
  285. [in] MPROMPT mpSetting);
  286. [propget]
  287. HRESULT Prompt(
  288. [out, retval] MPROMPT* pmpSetting);
  289. [id(108), helpstring("Invites another user to use an application."), helpcontext(0x0000)]
  290. HRESULT SendAppInvite(
  291. [in] IMsgrUser* pUser,
  292. [in] LONG lCookie,
  293. [in] BSTR bstrAppGUID,
  294. [in] BSTR bstrAppName,
  295. [in] BSTR bstrAppURL,
  296. [in] MMSGTYPE mmtType,
  297. [out] LONG* plCookie);
  298. [id(109), helpstring("Accepts an invitation to use an application."), helpcontext(0x0000)]
  299. HRESULT SendAppInviteAccept(
  300. [in] IMsgrUser* pUser,
  301. [in] LONG lCookie,
  302. [in] MMSGTYPE mmtType,
  303. [out] LONG* plCookie);
  304. [id(110), helpstring("Cancels an invitation to use an application."), helpcontext(0x0000)]
  305. HRESULT SendAppInviteCancel(
  306. [in] IMsgrUser* pUser,
  307. [in] LONG lCookie,
  308. [in] LONG hrReason,
  309. [in] MMSGTYPE mmtType,
  310. [out] LONG* plCookie);
  311. [propput, helpstring("Local options."), helpcontext(0x0000)]
  312. HRESULT LocalOption(
  313. [in] MLOCALOPTION option,
  314. [in] VARIANT vSetting);
  315. [propget]
  316. HRESULT LocalOption(
  317. [in] MLOCALOPTION option,
  318. [out, retval] VARIANT* pvSetting);
  319. [id(111), helpstring("Finds a user."), helpcontext(0x0000)]
  320. HRESULT FindUser(
  321. [in] BSTR bstrFirstName,
  322. [in] BSTR bstrLastName,
  323. [in] BSTR bstrCity,
  324. [in] BSTR bstrState,
  325. [in] BSTR bstrCountry,
  326. [out] LONG* plCookie);
  327. [id(112), helpstring("Sends invitation mail."), helpcontext(0x0000)]
  328. HRESULT SendInviteMail(
  329. [in] BSTR bstrEmailAddress,
  330. [in] LONG lFindCookie,
  331. [in] LONG lFindIndex,
  332. [out] LONG* plCookie);
  333. [id(113), helpstring("Requests a URL."), helpcontext(0x0000)]
  334. HRESULT RequestURL(
  335. [in] MURLTYPE muType,
  336. [in] BSTR bstrAdditionalInfo,
  337. [out] LONG* plCookie);
  338. [propget, helpstring("Returns a list of IM sessions"), helpcontext(0x0000)]
  339. HRESULT IMSessions(
  340. [out, retval] IMsgrIMSessions** ppIMSessions);
  341. [id(114), helpstring("Creates a new IM session."), helpcontext(0x0000)]
  342. HRESULT CreateIMSession(
  343. [in] VARIANT vUser,
  344. [out, retval] IMsgrIMSession** ppIMSession);
  345. [id(115), helpstring("Accepts a session request."), helpcontext(0x0000)]
  346. HRESULT SessionRequestAccept(
  347. [in] IMsgrIMSession* pIMsgrIMSession,
  348. [in] long hrReason);
  349. [id(116), helpstring("Cancels a session request."), helpcontext(0x0000)]
  350. HRESULT SessionRequestCancel(
  351. [in] IMsgrIMSession* pIMsgrIMSession,
  352. [in] long hrReason);
  353. }
  354. //--------------------------------------------------------------------------
  355. // DMsgrObjectEvents Interface
  356. [
  357. uuid(218CB452-20B6-11d2-8E17-0000F803A446), // DIID_DMsgrObjectEvents
  358. helpstring("Messenger Events Interface"),
  359. helpcontext(0x0000),
  360. hidden
  361. ]
  362. dispinterface DMsgrObjectEvents
  363. {
  364. properties:
  365. methods:
  366. [id(DISPID_ONLOGONRESULT), helpstring("Logon attempt complete."), helpcontext(0x0000)]
  367. void OnLogonResult(
  368. [in] long hr);
  369. [id(DISPID_ONLOGOFF), helpstring("Logoff complete."), helpcontext(0x0000)]
  370. void OnLogoff();
  371. [id(DISPID_ONLISTADDRESULT), helpstring("Result from list add request."), helpcontext(0x0000)]
  372. void OnListAddResult(
  373. [in] long hr,
  374. [in] MLIST mList,
  375. [in] IMsgrUser* pUser);
  376. [id(DISPID_ONLISTREMOVERESULT), helpstring("Result from list remove request."), helpcontext(0x0000)]
  377. void OnListRemoveResult(
  378. [in] long hr,
  379. [in] MLIST mList,
  380. [in] IMsgrUser* pUser);
  381. [id(DISPID_ONMESSAGEPRIVACYCHANGERESULT), helpstring("Result from message privacy setting change request."), helpcontext(0x0000)]
  382. void OnMessagePrivacyChangeResult(
  383. [in] long hr,
  384. [in] MMSGPRIVACY mmpSetting);
  385. [id(DISPID_ONPROMPTCHANGERESULT), helpstring("Result from prompt setting change request."), helpcontext(0x0000)]
  386. void OnPromptChangeResult(
  387. [in] long hr,
  388. [in] MPROMPT mpSetting);
  389. [id(DISPID_ONUSERFRIENDLYNAMECHANGERESULT), helpstring("Result from name change request."), helpcontext(0x0000)]
  390. void OnUserFriendlyNameChangeResult(
  391. [in] long hr,
  392. [in] IMsgrUser* pUser,
  393. [in] BSTR bstrPrevFriendlyName);
  394. [id(DISPID_ONUSERSTATECHANGED), helpstring("User state changed."), helpcontext(0x0000)]
  395. void OnUserStateChanged(
  396. [in] IMsgrUser* pUser,
  397. [in] MSTATE mPrevState);
  398. [id(DISPID_ONTEXTRECEIVED), helpstring("Text message received."), helpcontext(0x0000)]
  399. void OnTextReceived(
  400. [in] IMsgrIMSession* pIMSession,
  401. [in] IMsgrUser* pSourceUser,
  402. [in] BSTR bstrMsgHeader,
  403. [in] BSTR bstrMsgText,
  404. [in, out] VARIANT_BOOL* pfEnableDefault);
  405. [id(DISPID_ONLOCALSTATECHANGERESULT), helpstring("Result from local state request."), helpcontext(0x0000)]
  406. void OnLocalStateChangeResult(
  407. [in] long hr,
  408. [in] MSTATE mLocalState);
  409. [id(DISPID_ONAPPINVITERECEIVED), helpstring("Application invitation received."), helpcontext(0x0000)]
  410. void OnAppInviteReceived(
  411. [in] IMsgrUser* pUser,
  412. [in] long lCookie,
  413. [in] BSTR bstrAppGUID,
  414. [in] BSTR bstrAppName,
  415. [in] BSTR bstrAppURL,
  416. [in, out] VARIANT_BOOL* pfEnableDefault);
  417. [id(DISPID_ONAPPINVITEACCEPTED), helpstring("Application invitation accepted."), helpcontext(0x0000)]
  418. void OnAppInviteAccepted(
  419. [in] IMsgrUser* pUser,
  420. [in] long lCookie,
  421. [in] BSTR bstrIPAddress,
  422. [in, out] VARIANT_BOOL* pfEnableDefault);
  423. [id(DISPID_ONAPPINVITECANCELLED), helpstring("Application invitation cancelled."), helpcontext(0x0000)]
  424. void OnAppInviteCancelled(
  425. [in] IMsgrUser* pUser,
  426. [in] long lCookie,
  427. [in] long hrReason,
  428. [in, out] VARIANT_BOOL* pfEnableDefault);
  429. [id(DISPID_ONSENDRESULT), helpstring("Result from send request."), helpcontext(0x0000)]
  430. void OnSendResult(
  431. [in] long hr,
  432. [in] long lCookie);
  433. [id(DISPID_ONNEWERCLIENTAVAILABLE), helpstring("Newer client is available."), helpcontext(0x0000)]
  434. void OnNewerClientAvailable(
  435. [in] BSTR bstrDownloadUrl,
  436. [in] MUPDATECHOICE mUpdateChoice);
  437. [id(DISPID_ONFINDRESULT), helpstring("Result from find request."), helpcontext(0x0000)]
  438. void OnFindResult(
  439. [in] long hr,
  440. [in] long lCookie,
  441. [in] long lFindIndex,
  442. [in] long lTotalResults,
  443. [in] BSTR bstrFirstName,
  444. [in] BSTR bstrLastName,
  445. [in] BSTR bstrCity,
  446. [in] BSTR bstrState,
  447. [in] BSTR bstrCountry);
  448. [id(DISPID_ONINVITEMAILRESULT), helpstring("Result from SendInviteMail request."), helpcontext(0x0000)]
  449. void OnInviteMailResult(
  450. [in] long hr,
  451. [in] long lCookie);
  452. [id(DISPID_ONREQUESTURLRESULT), helpstring("Result from URL request."), helpcontext(0x0000)]
  453. void OnRequestURLResult(
  454. [in] long hr,
  455. [in] long lCookie,
  456. [in] MURLTYPE muType,
  457. [in] BSTR bstrURL);
  458. [id(DISPID_ONSESSIONSTATECHANGE), helpstring("Session state changed."), helpcontext(0x0000)]
  459. void OnSessionStateChange(
  460. [in] IMsgrIMsession* pIMSession,
  461. [in] SSTATE sPrevState);
  462. [id(DISPID_ONUSERJOIN), helpstring("User joined a session."), helpcontext(0x0000)]
  463. void OnUserJoin(
  464. [in] IMsgrUser* pIMsgrUser,
  465. [in] IMsgrIMSession* pIMSession);
  466. [id(DISPID_ONUSERLEAVE), helpstring("User left a session."), helpcontext(0x0000)]
  467. void OnUserLeave(
  468. [in] IMsgrUser* pIMsgrUser,
  469. [in] IMsgrIMSession* pIMSession);
  470. [id(DISPID_ONNEWSESSIONREQUEST), helpstring("Request for a new session."), helpcontext(0x0000)]
  471. void OnNewSessionRequest(
  472. [in] IMsgrUser* pRequestUser,
  473. [in] IMsgrIMSession* pIMSession,
  474. [in, out] VARIANT_BOOL* pfEnableDefault);
  475. [id(DISPID_ONINVITEUSER), helpstring("Invite user result."), helpcontext(0x0000)]
  476. void OnInviteUser(
  477. [in] IMsgrUser* pIMsgrUser,
  478. [in] IMsgrIMSession* pIMSession,
  479. [in] long hr);
  480. }
  481. //--------------------------------------------------------------------------
  482. // IMsgrUser Interface
  483. [
  484. uuid(218CB453-20B6-11d2-8E17-0000F803A446), // IID_IMsgrUser
  485. helpstring("Messenger User Interface"),
  486. helpcontext(0x0000),
  487. dual,
  488. oleautomation
  489. ]
  490. interface IMsgrUser : IDispatch
  491. {
  492. [propput, helpstring("Friendly Name of the user."), helpcontext(0x0000)]
  493. HRESULT FriendlyName(
  494. [in] BSTR bstrFriendlyName);
  495. [propget]
  496. HRESULT FriendlyName(
  497. [out, retval] BSTR* pbstrFriendlyName);
  498. [propget, helpstring("State of the user."), helpcontext(0x0000)]
  499. HRESULT State(
  500. [out, retval] MSTATE* pmState);
  501. [propget, helpstring("Logon Name of the user."), helpcontext(0x0000)]
  502. HRESULT LogonName(
  503. [out, retval] BSTR* pbstrLogonName);
  504. [id(101), helpstring("Send message to this user"), helpcontext(0x0000)]
  505. HRESULT SendText(
  506. [in] BSTR bstrMsgHeader,
  507. [in] BSTR bstrMsgText,
  508. [in] MMSGTYPE mmtType,
  509. [out] LONG* plCookie);
  510. }
  511. //--------------------------------------------------------------------------
  512. // IMsgrUsers Interface
  513. [
  514. uuid(218CB454-20B6-11d2-8E17-0000F803A446), // IID_IMsgrUsers
  515. helpstring("Messenger Users Collection Interface"),
  516. helpcontext(0x0000),
  517. dual,
  518. oleautomation
  519. ]
  520. interface IMsgrUsers : IDispatch
  521. {
  522. [propget, helpstring("Number of users."), helpcontext(0x0000)]
  523. HRESULT Count(
  524. [out, retval] long* pcUsers);
  525. [id(DISPID_VALUE), helpstring("Retrieves a specific user by index."), helpcontext(0x0000)]
  526. HRESULT Item(
  527. [in] long Index,
  528. [out, retval] IMsgrUser** ppUser);
  529. [id(100), helpstring("Adds a user object to the collection."), helpcontext(0x0000)]
  530. HRESULT Add(
  531. [in] IMsgrUser* pUser);
  532. [id(101), helpstring("Removes a user object from the collection."), helpcontext(0x0000)]
  533. HRESULT Remove(
  534. [in] IMsgrUser* pUser);
  535. [propget, restricted, id(DISPID_NEWENUM), helpstring("Enumerates the users."), helpcontext(0x0000)]
  536. HRESULT _NewEnum(
  537. [out, retval] IUnknown **ppUnknown);
  538. }
  539. //--------------------------------------------------------------------------
  540. // IMsgrIMSession Interface
  541. [
  542. uuid(82e11592-20f5-11d2-91ad-0000f81fefc9), // IID_IMsgrIMSession
  543. helpstring("Messenger IM Session Interface"),
  544. helpcontext(0x0000),
  545. dual,
  546. oleautomation
  547. ]
  548. interface IMsgrIMSession : IDispatch
  549. {
  550. [propget, helpstring("Returns a collection object of current recipients in the IM Session."), helpcontext(0x0000)]
  551. HRESULT Members(
  552. [out, retval] IMsgrUsers** ppUsers);
  553. [propget, helpstring("Session state."), helpcontext(0x0000)]
  554. HRESULT State(
  555. [out, retval] SSTATE* psState);
  556. [propget, helpstring("Returns a collection object of current invitees."), helpcontext(0x0000)]
  557. HRESULT Invitees(
  558. [out, retval] IMsgrUsers** ppUsers);
  559. [id(100), helpstring("Leaves IM session.")]
  560. HRESULT LeaveSession();
  561. [id(101), helpstring("Invites a new user to the session.")]
  562. HRESULT InviteUser(
  563. [in] VARIANT vUser);
  564. [id(102), helpstring("Sends a text message."), helpcontext(0x0000)]
  565. HRESULT SendText(
  566. [in] BSTR bstrMsgHeader,
  567. [in] BSTR bstrMsgText,
  568. [in] MMSGTYPE mmtType,
  569. [out] LONG* plCookie);
  570. }
  571. //--------------------------------------------------------------------------
  572. // IMsgrIMSessions Interface
  573. [
  574. uuid(6fd143e6-20a5-11d2-91ad-0000f81fefc9), // IID_IMsgrIMSessions
  575. helpstring("Messenger IM Sessions Collection Interface"),
  576. helpcontext(0x0000),
  577. dual,
  578. oleautomation
  579. ]
  580. interface IMsgrIMSessions : IDispatch
  581. {
  582. [propget, helpstring("Number of IM Sessions."), helpcontext(0x0000)]
  583. HRESULT Count(
  584. [out, retval] long* pcSessions);
  585. [id(DISPID_VALUE), helpstring("Retrieves a specific IM Session by index."), helpcontext(0x0000)]
  586. HRESULT Item(
  587. [in] long Index,
  588. [out, retval] IMsgrIMSession** ppIMSession);
  589. [propget, restricted, id(DISPID_NEWENUM), helpstring("Enumerates the IM Session."), helpcontext(0x0000)]
  590. HRESULT _NewEnum(
  591. [out, retval] IUnknown **ppUnknown);
  592. }
  593. //--------------------------------------------------------------------------
  594. // IMessengerApp Interface
  595. [
  596. uuid(3656FE3E-16A6-11d2-B49D-00C04FB90376), // IID_IMessengerApp
  597. helpstring("Messenger Application Interface"),
  598. helpcontext(0x0000),
  599. dual,
  600. oleautomation
  601. ]
  602. interface IMessengerApp : IDispatch
  603. {
  604. [propget, helpstring("Returns the application automation object."), helpcontext(0x0000)]
  605. HRESULT Application(
  606. [out, retval] IDispatch** ppDisp);
  607. [propget, helpstring("Returns the automation object of the container/parent if one exists or this automation object."), helpcontext(0x0000)]
  608. HRESULT Parent(
  609. [out, retval] IDispatch** ppDisp);
  610. [id(100), helpstring("Exits application."), helpcontext(0x0000)]
  611. HRESULT Quit();
  612. [propget, helpstring("Returns name of the application."), helpcontext(0x0000)]
  613. HRESULT Name(
  614. [out, retval] BSTR* pbstrName);
  615. [propget, helpstring("Returns file specification of the application, including path."), helpcontext(0x0000)]
  616. HRESULT FullName(
  617. [out, retval] BSTR* pbstrFullName);
  618. [propget, helpstring("Returns the path to the application."), helpcontext(0x0000)]
  619. HRESULT Path(
  620. [out, retval] BSTR* pbstrPath);
  621. // do we need success/failure result/event or use OnLogonResult event?
  622. [id(200), helpstring("Initiates Logon dialog."), helpcontext(0x0000)]
  623. HRESULT LaunchLogonUI();
  624. [id(201), helpstring("Initiates Options dialog."), helpcontext(0x0000)]
  625. HRESULT LaunchOptionsUI(
  626. [in] MOPTDLGPAGE mOptDlgPage);
  627. // do we need success/failure result/event or use OnListAddResult event
  628. [id(202), helpstring("Initiates Add Contact dialog."), helpcontext(0x0000)]
  629. HRESULT LaunchAddContactUI(
  630. [in] BSTR bstrEMail);
  631. [id(203), helpstring("Initiates Find Contact Dialog."), helpcontext(0x0000)]
  632. HRESULT LaunchFindContactUI(
  633. [in] BSTR bstrFirstName,
  634. [in] BSTR bstrLastName,
  635. [in, optional] VARIANT vbstrCity,
  636. [in, optional] VARIANT vbstrState,
  637. [in, optional] VARIANT vbstrCountry);
  638. [id(210), helpstring("Initiates IM Window."), helpcontext(0x0000)]
  639. HRESULT LaunchIMUI(
  640. [in] VARIANT vUser,
  641. [out, retval] IMessengerIMWindow** ppIMWindow);
  642. [propget, helpstring("Collection of current IM Windows."), helpcontext(0x0000)]
  643. HRESULT IMWindows(
  644. [out, retval] IMessengerIMWindows** ppIMWindows);
  645. [propget, helpstring("ToolBar visibility."), helpcontext(0x0000)]
  646. HRESULT ToolBar(
  647. [out, retval] VARIANT_BOOL* pBoolToolBar);
  648. [propput]
  649. HRESULT ToolBar(
  650. [in] VARIANT_BOOL BoolToolBar);
  651. [propget, helpstring("StatusBar visibility."), helpcontext(0x0000)]
  652. HRESULT StatusBar(
  653. [out, retval] VARIANT_BOOL* pBoolStatusBar);
  654. [propput]
  655. HRESULT StatusBar(
  656. [in] VARIANT_BOOL BoolStatusBar);
  657. [propget, helpstring("Text of StatusBar."), helpcontext(0x0000)]
  658. HRESULT StatusText(
  659. [out, retval] BSTR *pbstrStatusText);
  660. [propput]
  661. HRESULT StatusText(
  662. [in] BSTR bstrStatusText);
  663. [propget, helpstring("Returns the Handle of the Application window."), helpcontext(0x0000)]
  664. HRESULT HWND(
  665. [out, retval] long *phWnd);
  666. [propget, helpstring("The horizontal position (pixels) of the Application window relative to the screen."), helpcontext(0x0000)]
  667. HRESULT Left(
  668. [out, retval] long *plLeft);
  669. [propput]
  670. HRESULT Left(
  671. [in] long lLeft);
  672. [propget, helpstring("The vertical position (pixels) of the Application window relative to the screen."), helpcontext(0x0000)]
  673. HRESULT Top(
  674. [out, retval] long *plTop);
  675. [propput]
  676. HRESULT Top(
  677. [in] long lTop);
  678. [propget, helpstring("The horizontal dimension (pixels) of the Application window."), helpcontext(0x0000)]
  679. HRESULT Width(
  680. [out, retval] long *plWidth);
  681. [propput]
  682. HRESULT Width(
  683. [in] long lWidth);
  684. [propget, helpstring("The vertical dimension (pixels) of the Application window."), helpcontext(0x0000)]
  685. HRESULT Height(
  686. [out, retval] long *plHeight);
  687. [propput]
  688. HRESULT Height(
  689. [in] long lHeight);
  690. [propget, helpstring("Visibility of the application."), helpcontext(0x0000)]
  691. HRESULT Visible(
  692. [out, retval] VARIANT_BOOL* pBoolVisible);
  693. [propput]
  694. HRESULT Visible(
  695. [in] VARIANT_BOOL BoolVisible);
  696. [id(222), helpstring("Initiates a Logon without UI if connected to the network and user saved the password."), helpcontext(0x0000)]
  697. HRESULT AutoLogon();
  698. }
  699. //--------------------------------------------------------------------------
  700. // IMessengerIMWindow Interface
  701. [
  702. uuid(35EDD1CD-1A8C-11d2-B49D-00C04FB90376), // IID_IMessengerIMWindow
  703. helpstring("Messenger IM Window Interface"),
  704. helpcontext(0x0000),
  705. dual,
  706. oleautomation
  707. ]
  708. interface IMessengerIMWindow : IDispatch
  709. {
  710. [propget, helpstring("Returns the application automation object if accessible, this automation object otherwise."), helpcontext(0x0000)]
  711. HRESULT Application(
  712. [out, retval] IDispatch** ppDisp);
  713. [propget, helpstring("Returns the automation object of the container/parent if one exists or this automation object."), helpcontext(0x0000)]
  714. HRESULT Parent(
  715. [out, retval] IDispatch** ppDisp);
  716. [propget, helpstring("Returns the IMSession Object associated with this window."), helpcontext(0x0000)]
  717. HRESULT IMSession(
  718. [out, retval] IMsgrIMSession** ppIMSession);
  719. [propget, helpstring("Current history in the window."), helpcontext(0x0000)]
  720. HRESULT History(
  721. [out, retval] BSTR* pbstrHistory);
  722. [id(300), helpstring("Sends a text message through the IM window."), helpcontext(0x0000)]
  723. HRESULT SendText(
  724. [in] BSTR bstrSendText);
  725. [id(301), helpstring("Closes the IM window."), helpcontext(0x0000)]
  726. HRESULT Close();
  727. [propget, helpstring("ToolBar visibility."), helpcontext(0x0000)]
  728. HRESULT ToolBar(
  729. [out, retval] VARIANT_BOOL* pBoolToolBar);
  730. [propput]
  731. HRESULT ToolBar(
  732. [in] VARIANT_BOOL BoolToolBar);
  733. [propget, helpstring("StatusBar visibility."), helpcontext(0x0000)]
  734. HRESULT StatusBar(
  735. [out, retval] VARIANT_BOOL* pBoolStatusBar);
  736. [propput]
  737. HRESULT StatusBar(
  738. [in] VARIANT_BOOL BoolStatusBar);
  739. [propget, helpstring("Text of StatusBar."), helpcontext(0x0000)]
  740. HRESULT StatusText(
  741. [out, retval] BSTR *pbstrStatusText);
  742. [propput]
  743. HRESULT StatusText(
  744. [in] BSTR bstrStatusText);
  745. [propget, helpstring("Returns the Handle of the IM window."), helpcontext(0x0000)]
  746. HRESULT HWND(
  747. [out, retval] long *phWnd);
  748. [propget, helpstring("The horizontal position (pixels) of the IM window relative to the screen."), helpcontext(0x0000)]
  749. HRESULT Left(
  750. [out, retval] long *plLeft);
  751. [propput]
  752. HRESULT Left(
  753. [in] long lLeft);
  754. [propget, helpstring("The vertical position (pixels) of the IM window relative to the screen."), helpcontext(0x0000)]
  755. HRESULT Top(
  756. [out, retval] long *plTop);
  757. [propput]
  758. HRESULT Top(
  759. [in] long lTop);
  760. [propget, helpstring("The horizontal dimension (pixels) of the IM window."), helpcontext(0x0000)]
  761. HRESULT Width(
  762. [out, retval] long *plWidth);
  763. [propput]
  764. HRESULT Width(
  765. [in] long lWidth);
  766. [propget, helpstring("The vertical dimension (pixels) of the IM window."), helpcontext(0x0000)]
  767. HRESULT Height(
  768. [out, retval] long *plHeight);
  769. [propput]
  770. HRESULT Height(
  771. [in] long lHeight);
  772. [propget, helpstring("Visibility of the window."), helpcontext(0x0000)]
  773. HRESULT Visible(
  774. [out, retval] VARIANT_BOOL* pBoolVisible);
  775. [propput]
  776. HRESULT Visible(
  777. [in] VARIANT_BOOL BoolVisible);
  778. }
  779. //--------------------------------------------------------------------------
  780. // IMessengerIMWindows Interface
  781. [
  782. uuid(35EDD1CC-1A8C-11d2-B49D-00C04FB90376), // IID_IMessengerIMWindows
  783. helpstring("Messenger IM Windows Collection Interface"),
  784. helpcontext(0x0000),
  785. dual,
  786. oleautomation
  787. ]
  788. interface IMessengerIMWindows : IDispatch
  789. {
  790. [propget, helpstring("Number of IM Windows."), helpcontext(0x0000)]
  791. HRESULT Count(
  792. [out, retval] long* pcWindows);
  793. [id(DISPID_VALUE), helpstring("Retrieves a specific IM Window by index."), helpcontext(0x0000)]
  794. HRESULT Item(
  795. [in] long Index,
  796. [out, retval] IMessengerIMWindow** ppIMWindow);
  797. [propget, restricted, id(DISPID_NEWENUM), helpstring("Enumerates the IM Windows."), helpcontext(0x0000)]
  798. HRESULT _NewEnum(
  799. [out, retval] IUnknown **ppUnknown);
  800. }
  801. //--------------------------------------------------------------------------
  802. // IMsgrOE Interface
  803. [
  804. uuid(59EC0340-7506-11d2-B05F-00C04F7F89FE), // IID_IMsgrOE
  805. helpstring("Messenger Object for OE Private Interface"),
  806. hidden,
  807. oleautomation
  808. ]
  809. interface IMsgrOE : IUnknown
  810. {
  811. [id(100), helpstring("Creates a user object for OE.")]
  812. HRESULT CreateUser([in] BSTR bstrLogonName,
  813. [out, retval] IMsgrUserOE** ppUserOE);
  814. [id(105), helpstring("Initiates a logoff.")]
  815. HRESULT Logoff();
  816. [propget, helpstring("Returns the Contact list for OE.")]
  817. HRESULT ContactList([out, retval] IMsgrUsersOE** ppUsersOE);
  818. [propget, helpstring("Logon name.")]
  819. HRESULT LocalLogonName([out, retval] BSTR* pbstrName);
  820. [propput, helpstring("Local state.")]
  821. HRESULT LocalState([in] MSTATEOE mStateOE);
  822. [propget]
  823. HRESULT LocalState([out, retval] MSTATEOE* pmStateOE);
  824. [id(222), helpstring("Initiates a Logon without UI if connected to the network and user saved the password.")]
  825. HRESULT AutoLogon();
  826. // do we need success/failure result/event or use OnLogonResult event?
  827. [id(200), helpstring("Initiates Logon dialog.")]
  828. HRESULT LaunchLogonUI();
  829. [id(201), helpstring("Initiates Options dialog.")]
  830. HRESULT LaunchOptionsUI();
  831. // do we need success/failure result/event or use OnListAddResult event
  832. [id(202), helpstring("Initiates Add Contact dialog.")]
  833. HRESULT LaunchAddContactUI([in] BSTR bstrEMail);
  834. [id(210), helpstring("Initiates IM Window.")]
  835. HRESULT LaunchIMUI([in] VARIANT vUser);
  836. [id(501), helpstring("Establishes a connection between the IMsgrObjectOE and the client's sink")]
  837. HRESULT AdviseOE([in] IUnknown *pUnk, //Pointer to the client's DMsgrObjectOEEvents sink
  838. [out] long *plCookie); //Pointer to the connection point identifier used
  839. // by Unadvise
  840. [id(502), helpstring("Terminates a connection between the IMsgrObjectOE and the client's sink")]
  841. HRESULT UnadviseOE([in] long lCookie); //Connection token
  842. }
  843. //--------------------------------------------------------------------------
  844. // DMsgrOEEvents Interface
  845. [
  846. uuid(59EC0341-7506-11d2-B05F-00C04F7F89FE), // DIID_DMsgrOEEvents
  847. helpstring("Messenger Events for OE Private Interface"),
  848. hidden
  849. ]
  850. dispinterface DMsgrOEEvents
  851. {
  852. properties:
  853. methods:
  854. [id(DISPID_ONLOGONRESULT), helpstring("Logon attempt complete.")]
  855. void OnLogonResult([in] long hr);
  856. [id(DISPID_ONLOGOFF), helpstring("Logoff complete.")]
  857. void OnLogoff();
  858. [id(DISPID_ONLISTADDRESULT), helpstring("Result from list add request.")]
  859. void OnContactListAddResult([in] long hr,
  860. [in] IMsgrUserOE* pUserOE);
  861. [id(DISPID_ONLISTREMOVERESULT), helpstring("Result from list remove request.")]
  862. void OnContactListRemoveResult([in] long hr,
  863. [in] IMsgrUserOE* pUserOE);
  864. [id(DISPID_ONUSERFRIENDLYNAMECHANGERESULT), helpstring("Result from name change request.")]
  865. void OnUserFriendlyNameChangeResult([in] long hr,
  866. [in] IMsgrUserOE* pUserOE,
  867. [in] BSTR bstrPrevFriendlyName);
  868. [id(DISPID_ONUSERSTATECHANGED), helpstring("User state changed.")]
  869. void OnUserStateChanged([in] IMsgrUserOE* pUserOE,
  870. [in] MSTATEOE mPrevStateOE);
  871. [id(DISPID_ONLOCALSTATECHANGERESULT), helpstring("Result from local state request.")]
  872. void OnLocalStateChangeResult([in] long hr,
  873. [in] MSTATEOE mLocalStateOE);
  874. }
  875. //--------------------------------------------------------------------------
  876. // IMsgrUserOE Interface
  877. [
  878. uuid(59EC0342-7506-11d2-B05F-00C04F7F89FE), // IID_IMsgrUserOE
  879. helpstring("Messenger User for OE Private Interface"),
  880. hidden,
  881. oleautomation
  882. ]
  883. interface IMsgrUserOE : IUnknown
  884. {
  885. [propget]
  886. HRESULT FriendlyName([out, retval] BSTR* pbstrFriendlyName);
  887. [propget, helpstring("State of the user.")]
  888. HRESULT State([out, retval] MSTATEOE* pmStateOE);
  889. [propget, helpstring("Logon Name of the user.")]
  890. HRESULT LogonName([out, retval] BSTR* pbstrLogonName);
  891. }
  892. //--------------------------------------------------------------------------
  893. // IMsgrUsersOE Interface
  894. [
  895. uuid(59EC0343-7506-11d2-B05F-00C04F7F89FE), // IID_IMsgrUsersOE
  896. helpstring("Messenger Users Collection for OE private Interface"),
  897. hidden,
  898. oleautomation
  899. ]
  900. interface IMsgrUsersOE : IUnknown
  901. {
  902. [propget, helpstring("Number of users.")]
  903. HRESULT Count([out, retval] long* pcUsers);
  904. [id(DISPID_VALUE), helpstring("Retrieves a specific user by index.")]
  905. HRESULT Item([in] long Index,
  906. [out, retval] IMsgrUserOE** ppUserOE);
  907. [id(100), helpstring("Adds a user object to the collection.")]
  908. HRESULT Add([in] IMsgrUserOE* pUserOE);
  909. [id(101), helpstring("Removes a user object from the collection.")]
  910. HRESULT Remove([in] IMsgrUserOE* pUserOE);
  911. [propget, restricted, id(DISPID_NEWENUM), helpstring("Enumerates the users.")]
  912. HRESULT _NewEnum([out, retval] IUnknown **ppUnknown);
  913. }
  914. [
  915. uuid(FB7199AA-79BF-11d2-8D94-0000F875C541), // CLSID_MsgrObject
  916. helpstring("Messenger Object")
  917. ]
  918. coclass MsgrObject
  919. {
  920. [default] interface IMsgrObject;
  921. [default, source] dispinterface DMsgrObjectEvents;
  922. };
  923. [
  924. uuid(FB7199AB-79BF-11d2-8D94-0000F875C541), // CLSID_MessengerApp
  925. helpstring("Messenger Application"),
  926. appobject
  927. ]
  928. coclass MessengerApp
  929. {
  930. [default] interface IMessengerApp;
  931. interface IMsgrOE;
  932. };
  933. };