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.

212 lines
5.7 KiB

  1. /*---------------------------------------------------------------------------*\
  2. | GLOBAL MODULE
  3. | This module contains global-variables for the appliciation. These were
  4. | isolate purely for maintainability of the app.
  5. |
  6. |
  7. | Copyright (c) Microsoft Corp., 1990-1993
  8. |
  9. | created: 29-Dec-92
  10. | history: 29-Dec-92 <clausgi> created with port to NT.
  11. | 19-Oct-93 <chriswil> unicode enhancements from a-dianeo.
  12. |
  13. \*---------------------------------------------------------------------------*/
  14. #include <windows.h>
  15. #include <mmsystem.h>
  16. #include <stdio.h>
  17. #include <ddeml.h>
  18. #include <commdlg.h>
  19. #include <commctrl.h>
  20. #include <shellapi.h>
  21. #include "winchat.h"
  22. #include "dialogs.h"
  23. // Send-Window Information.
  24. //
  25. HFONT hEditSndFont = NULL;
  26. HWND hwndSnd;
  27. HBRUSH hEditSndBrush;
  28. COLORREF SndColorref,SndBrushColor;
  29. LOGFONT lfSnd;
  30. RECT SndRc;
  31. // Receive-Window Information.
  32. //
  33. HFONT hEditRcvFont = NULL;
  34. HWND hwndRcv;
  35. HBRUSH hEditRcvBrush;
  36. COLORREF RcvColorref,RcvBrushColor;
  37. COLORREF PartBrushColor;
  38. LOGFONT lfRcv;
  39. RECT RcvRc;
  40. // DDEML Conversation.
  41. //
  42. DWORD idInst = 0;
  43. HSZ hszServiceName = (HSZ)0;
  44. HSZ hszConnect = (HSZ)0;
  45. HSZ hszChatTopic = (HSZ)0;
  46. HSZ hszChatShare = (HSZ)0;
  47. HSZ hszTextItem = (HSZ)0;
  48. HSZ hszConvPartner = (HSZ)0;
  49. HSZ hszConnectTest = (HSZ)0;
  50. HSZ hszLocalName = (HSZ)0;
  51. HCONV ghConv;
  52. // Misc global variables.
  53. //
  54. int dyStatus,dyButtonBar,dyBorder,cxIcon,cyIcon,cbTextLen;
  55. UINT_PTR idTimer;
  56. DWORD XactID,StrXactID;
  57. HANDLE hInst;
  58. HACCEL hAccel;
  59. HDC hMemDC;
  60. HBITMAP hOldBitmap,hPhnBitmap,hOldMemObj;
  61. HICON hPhones[3];
  62. HFONT hFontStatus,hOldFont;
  63. HBRUSH hBtnFaceBrush;
  64. HPEN hShadowPen,hHilitePen,hFramePen;
  65. UINT cf_chatdata;
  66. HWND hwndActiveEdit,hwndApp;
  67. WNETCALL WNetServerBrowseDialog;
  68. int ASeq[4] = {0,1,0,2};
  69. WORD cAnimate = 0;
  70. HANDLE hMemTextBuffer = NULL;
  71. int nConnectAttempt = 0;
  72. HWND hwndToolbar = NULL;
  73. HWND hwndStatus = NULL;
  74. // Pointer information.
  75. //
  76. WNDPROC lpfnOldEditProc;
  77. LPBYTE lpbTextBuffer;
  78. // Common-Dialog variables.
  79. //
  80. CHOOSEFONT chf;
  81. CHOOSECOLOR chc;
  82. DWORD CustColors[16];
  83. CHATSTATE ChatState;
  84. CHATDATA ChatData, ChatDataRcv;
  85. WINDOWPLACEMENT Wpl;
  86. // Global Buffers.
  87. //
  88. TCHAR szHelv [SMLRCBUF];
  89. TCHAR szAppName [SMLRCBUF];
  90. TCHAR szServiceName [SMLRCBUF];
  91. TCHAR szAlreadyConnect[BIGRCBUF];
  92. TCHAR szAbandonFirst [BIGRCBUF];
  93. TCHAR szDialing [BIGRCBUF];
  94. TCHAR szYouCaller [BIGRCBUF];
  95. TCHAR szNotCalled [BIGRCBUF];
  96. TCHAR szNotConnected [BIGRCBUF];
  97. TCHAR szConnectAbandon[BIGRCBUF];
  98. TCHAR szHangingUp [BIGRCBUF];
  99. TCHAR szHasTerminated [BIGRCBUF];
  100. TCHAR szConnectedTo [BIGRCBUF];
  101. TCHAR szConnecting [BIGRCBUF];
  102. TCHAR szIsCalling [BIGRCBUF];
  103. TCHAR szDialHelp [BIGRCBUF];
  104. TCHAR szAnswerHelp [BIGRCBUF];
  105. TCHAR szHangUpHelp [BIGRCBUF];
  106. TCHAR szNoConnect [BIGRCBUF];
  107. TCHAR szNoConnectionTo[BIGRCBUF];
  108. TCHAR szSysErr [BIGRCBUF];
  109. TCHAR szAlwaysOnTop [BIGRCBUF];
  110. TCHAR szNoNet [SZBUFSIZ];
  111. TCHAR szBuf [SZBUFSIZ]; // general purpose string buffer
  112. TCHAR szHelp [SZBUFSIZ];
  113. TCHAR szIniSection [SZBUFSIZ];
  114. TCHAR szIniKey1 [BIGRCBUF];
  115. TCHAR szIniKey2 [BIGRCBUF];
  116. TCHAR szIniRingIn [BIGRCBUF];
  117. TCHAR szIniRingOut [BIGRCBUF];
  118. TCHAR szConvPartner [UNCNLEN] = TEXT(""); // Conversation partner.
  119. TCHAR szLocalName [UNCNLEN] = TEXT(""); // Computer name.
  120. // localized strings
  121. //
  122. CONST TCHAR szChatTopic [] = TEXT("Chat");
  123. TCHAR szChatShare [] = TEXT("CHAT$");
  124. CONST TCHAR szWcRingIn [] = TEXT("RingIn");
  125. CONST TCHAR szWcRingOut [] = TEXT("RingOut");
  126. CONST TCHAR szSysIni [] = TEXT("system.ini");
  127. CONST TCHAR szVredir [] = TEXT("Network");
  128. CONST TCHAR szComputerName[] = TEXT("ComputerName");
  129. CONST TCHAR szChatText [] = TEXT("ChatText");
  130. CONST TCHAR szConnectTest [] = TEXT("___cnc3tst___");
  131. CONST TCHAR szWinChatClass[] = TEXT("WinChatWClass");
  132. CONST TCHAR szWinChatMenu [] = TEXT("WinChatMenu");
  133. CONST TCHAR szHelpFile [] = TEXT("winchat.hlp");
  134. CONST TCHAR szIni [] = TEXT("Winchat.ini");
  135. CONST TCHAR szFnt [] = TEXT("Font");
  136. CONST TCHAR szPref [] = TEXT("Preferences");
  137. CONST TCHAR szSnd [] = TEXT("Sound");
  138. CONST TCHAR szTool [] = TEXT("ToolBar");
  139. CONST TCHAR szStat [] = TEXT("StatusBar");
  140. CONST TCHAR szTop [] = TEXT("TopMost");
  141. CONST TCHAR szUseOF [] = TEXT("UseOwnFont");
  142. CONST TCHAR szSbS [] = TEXT("SideBySide");
  143. CONST TCHAR szAutoAns [] = TEXT("AutoAnswer");
  144. CONST TCHAR szBkgnd [] = TEXT("BkGnd");
  145. CONST TCHAR szNull [] = TEXT("");
  146. // This list must be NULL-terminated.
  147. //
  148. CONST UINT nIDs[] = {MH_BASE,MH_POPUPBASE,0,0};
  149. // Code for all font aspects (CODEWORK - reduce to essential?)
  150. //
  151. CONST TCHAR szHeight [] = TEXT("Height");
  152. CONST TCHAR szWeight [] = TEXT("Weight");
  153. CONST TCHAR szPitchFam [] = TEXT("PitchFam");
  154. CONST TCHAR szItalic [] = TEXT("Italic");
  155. CONST TCHAR szUnderline [] = TEXT("Underline");
  156. CONST TCHAR szStrikeOut [] = TEXT("Strikeout");
  157. CONST TCHAR szFontName [] = TEXT("Name");
  158. CONST TCHAR szWidth [] = TEXT("Width");
  159. CONST TCHAR szCharSet [] = TEXT("TCHARset");
  160. CONST TCHAR szOutPrecision[] = TEXT("OutPrecision");
  161. CONST TCHAR szClipPrec [] = TEXT("ClipPrecision");
  162. CONST TCHAR szQuality [] = TEXT("Quality");
  163. CONST TCHAR szColor [] = TEXT("Color");
  164. CONST TCHAR szPlacement [] = TEXT("Placement");
  165. CONST TCHAR szPlcFmt [] = TEXT("%d %d %d %d %d %d %d");
  166. BOOL gfDbcsEnabled;
  167. UINT WINAPI fakeFunc()
  168. {
  169. return 0;
  170. }
  171. HIMC (WINAPI* pfnImmGetContext)(HWND) = (PVOID)fakeFunc;
  172. BOOL (WINAPI* pfnImmReleaseContext)(HWND, HIMC) = (PVOID)fakeFunc;
  173. LONG (WINAPI* pfnImmGetCompositionStringW)(HIMC, DWORD, LPVOID, DWORD) = (PVOID)fakeFunc;