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.

254 lines
5.9 KiB

  1. #include "stdafx.h"
  2. #include "t3test.h"
  3. #include "t3testD.h"
  4. #include "calldlg.h"
  5. #include "callnot.h"
  6. #include "externs.h"
  7. #include "control.h"
  8. void
  9. CT3testDlg::CreateSelectedTerminalMenu(
  10. POINT pt,
  11. HWND hWnd
  12. )
  13. {
  14. ITTerminal * pTerminal;
  15. #ifdef ENABLE_DIGIT_DETECTION_STUFF
  16. ITDigitGenerationTerminal * pDigitGeneration;
  17. ITDigitDetectionTerminal * pDigitDetect;
  18. #endif // ENABLE_DIGIT_DETECTION_STUFF
  19. HRESULT hr;
  20. ITBasicAudioTerminal * pBasicAudio;
  21. long lval;
  22. //
  23. // get the terminal in question
  24. //
  25. if (!GetSelectedTerminal( &pTerminal ))
  26. {
  27. return;
  28. }
  29. hr = pTerminal->QueryInterface(
  30. IID_ITBasicAudioTerminal,
  31. (void **) &pBasicAudio
  32. );
  33. if ( SUCCEEDED(hr) )
  34. {
  35. pBasicAudio->get_Volume( &lval );
  36. pBasicAudio->put_Volume( lval );
  37. pBasicAudio->get_Balance( &lval );
  38. pBasicAudio->put_Balance( lval );
  39. pBasicAudio->Release();
  40. }
  41. #ifdef ENABLE_DIGIT_DETECTION_STUFF
  42. hr = pTerminal->QueryInterface(
  43. IID_ITDigitGenerationTerminal,
  44. (void **) &pDigitGeneration
  45. );
  46. if (SUCCEEDED(hr))
  47. {
  48. DoDigitGenerationTerminalMenu(hWnd, &pt);
  49. pDigitGeneration->Release();
  50. return;
  51. }
  52. hr = pTerminal->QueryInterface(
  53. IID_ITDigitDetectionTerminal,
  54. (void **) &pDigitDetect
  55. );
  56. if (SUCCEEDED(hr))
  57. {
  58. DoDigitDetectTerminalMenu(hWnd,&pt);
  59. pDigitDetect->Release();
  60. return;
  61. }
  62. #endif // ENABLE_DIGIT_DETECTION_STUFF
  63. }
  64. void CT3testDlg::DoDigitGenerationTerminalMenu(
  65. HWND hWnd,
  66. POINT * pPt
  67. )
  68. {
  69. //
  70. // create the menu
  71. //
  72. HMENU hMenu;
  73. hMenu = CreatePopupMenu();
  74. AppendMenu(
  75. hMenu,
  76. MF_ENABLED | MF_STRING,
  77. ID_MODESUPPORTED,
  78. L"Modes Supported"
  79. );
  80. AppendMenu(
  81. hMenu,
  82. MF_ENABLED | MF_STRING,
  83. ID_GENERATE,
  84. L"Generate"
  85. );
  86. // actually show menu
  87. TrackPopupMenu(
  88. hMenu,
  89. TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON,
  90. pPt->x,
  91. pPt->y,
  92. 0,
  93. hWnd,
  94. NULL
  95. );
  96. }
  97. void CT3testDlg::DoDigitDetectTerminalMenu(
  98. HWND hWnd,
  99. POINT * pPt
  100. )
  101. {
  102. //
  103. // create the menu
  104. //
  105. HMENU hMenu;
  106. hMenu = CreatePopupMenu();
  107. AppendMenu(
  108. hMenu,
  109. MF_ENABLED | MF_STRING,
  110. ID_MODESUPPORTED2,
  111. L"Modes Supported"
  112. );
  113. AppendMenu(
  114. hMenu,
  115. MF_ENABLED | MF_STRING,
  116. ID_STARTDETECT,
  117. L"Start Detection"
  118. );
  119. AppendMenu(
  120. hMenu,
  121. MF_ENABLED | MF_STRING,
  122. ID_STOPDETECT,
  123. L"Stop Detection"
  124. );
  125. // actually show menu
  126. TrackPopupMenu(
  127. hMenu,
  128. TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON,
  129. pPt->x,
  130. pPt->y,
  131. 0,
  132. hWnd,
  133. NULL
  134. );
  135. }
  136. void
  137. CT3testDlg::CreateCallMenu(
  138. POINT pt,
  139. HWND hWnd
  140. )
  141. {
  142. ITCallInfo * pCall;
  143. HMENU hMenu;
  144. //
  145. // get the call in question
  146. //
  147. if (!GetCall( &pCall ))
  148. {
  149. return;
  150. }
  151. //
  152. // create the menu
  153. //
  154. hMenu = CreatePopupMenu();
  155. AppendMenu(
  156. hMenu,
  157. MF_ENABLED | MF_STRING,
  158. ID_HANDOFF1,
  159. L"Handoff1"
  160. );
  161. AppendMenu(
  162. hMenu,
  163. MF_ENABLED | MF_STRING,
  164. ID_HANDOFF2,
  165. L"Handoff2"
  166. );
  167. AppendMenu(
  168. hMenu,
  169. MF_ENABLED | MF_STRING,
  170. ID_PARK1,
  171. L"Park1"
  172. );
  173. AppendMenu(
  174. hMenu,
  175. MF_ENABLED | MF_STRING,
  176. ID_PARK2,
  177. L"Park2"
  178. );
  179. AppendMenu(
  180. hMenu,
  181. MF_ENABLED | MF_STRING,
  182. ID_UNPARK,
  183. L"Unpark"
  184. );
  185. AppendMenu(
  186. hMenu,
  187. MF_ENABLED | MF_STRING,
  188. ID_PICKUP1,
  189. L"Pickup1"
  190. );
  191. AppendMenu(
  192. hMenu,
  193. MF_ENABLED | MF_STRING,
  194. ID_PICKUP2,
  195. L"Pickup2"
  196. );
  197. //
  198. // actually show menu
  199. //
  200. TrackPopupMenu(
  201. hMenu,
  202. TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON,
  203. pt.x,
  204. pt.y,
  205. 0,
  206. hWnd,
  207. NULL
  208. );
  209. }