MWMAIN_D.LST 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. Listing:
  2. 1 (*# check(stack=>off,
  3. 2 index=>off,
  4. 3 range=>off,
  5. 4 overflow=>off,
  6. 5 nil_ptr=>off) *)
  7. 6 IMPLEMENTATION MODULE MWMain_d;
  8. 7
  9. 8 IMPORT Windows, WDLLMod;
  10. 9
  11. 10 CONST
  12. 11 (* String table constants *)
  13. 12 IDSNAME = 100;
  14. 13 IDSABOUT = 200;
  15. 14 IDSTITLE = 300;
  16. 15
  17. 16 (* About Dialog box resource id *)
  18. 17 ABOUTBOX = 1;
  19. 18
  20. 19 VAR
  21. 20 szAppName: ARRAY [0..9] OF CHAR;
  22. ***** ^ not supported yet
  23. ***** ^ not supported yet
  24. 21 szAbout: ARRAY [0..9] OF CHAR;
  25. ***** ^ not supported yet
  26. ***** ^ not supported yet
  27. 22 szMessage: ARRAY [0..25] OF CHAR;
  28. ***** ^ not supported yet
  29. ***** ^ not supported yet
  30. 23 MessageLength: CARDINAL;
  31. 24
  32. 25 hInst: Windows.HANDLE;
  33. ***** ^ not supported yet
  34. 26 lpprocAbout: Windows.FARPROC;
  35. ***** ^ not supported yet
  36. 27
  37. 28 (* Procedures which make up the window class. *)
  38. 29 PROCEDURE WndProc(hWnd: Windows.HWND; message: CARDINAL; wParam: CARDINAL; lParam: LONGINT ): LONGINT;
  39. ***** ^ not supported yet
  40. 30
  41. 31 VAR
  42. 32 ps: Windows.PAINTSTRUCT;
  43. ***** ^ not supported yet
  44. 33 BEGIN
  45. 34 CASE message OF
  46. 35 | Windows.WM_SYSCOMMAND:
  47. ***** ^ not supported yet
  48. ***** ^ not supported yet
  49. 36 CASE wParam OF
  50. 37 | IDSABOUT:
  51. ***** ^ not supported yet
  52. 38 Windows.DialogBox( hInst, FarADDRESS(LONGCARD(ABOUTBOX)), hWnd, lpprocAbout );
  53. ***** ^ not supported yet
  54. ***** ^ not supported yet
  55. ***** ^ not supported yet
  56. ***** ^ undeclared identifier
  57. ***** ^ undeclared identifier
  58. ***** ^ not supported yet
  59. ***** ^ not supported yet
  60. ***** ^ not supported yet
  61. 39 ELSE
  62. 40 RETURN Windows.DefWindowProc( hWnd, message, wParam, lParam);
  63. ***** ^ not supported yet
  64. ***** ^ not supported yet
  65. ***** ^ not supported yet
  66. ***** ^ not supported yet
  67. 41 END;
  68. 42 | Windows.WM_DESTROY:
  69. ***** ^ not supported yet
  70. ***** ^ not supported yet
  71. 43 Windows.PostQuitMessage(0);
  72. ***** ^ not supported yet
  73. ***** ^ not supported yet
  74. ***** ^ not supported yet
  75. 44 | Windows.WM_PAINT:
  76. ***** ^ not supported yet
  77. ***** ^ not supported yet
  78. 45 Windows.BeginPaint(hWnd, ps);
  79. ***** ^ not supported yet
  80. ***** ^ not supported yet
  81. ***** ^ not supported yet
  82. ***** ^ not supported yet
  83. 46 WDLLMod.MessagePaint(ps.hdc, szMessage, MessageLength);
  84. ***** ^ not supported yet
  85. ***** ^ not supported yet
  86. ***** ^ not supported yet
  87. ***** ^ not supported yet
  88. ***** ^ not supported yet
  89. ***** ^ not supported yet
  90. 47 Windows.EndPaint(hWnd, ps);
  91. ***** ^ not supported yet
  92. ***** ^ not supported yet
  93. ***** ^ not supported yet
  94. ***** ^ not supported yet
  95. 48 ELSE
  96. 49 RETURN Windows.DefWindowProc( hWnd, message, wParam, lParam);
  97. ***** ^ not supported yet
  98. ***** ^ not supported yet
  99. ***** ^ not supported yet
  100. ***** ^ not supported yet
  101. 50 END;
  102. 51 RETURN 0;
  103. 52 END WndProc;
  104. ***** ^ not supported yet
  105. 53
  106. 54 PROCEDURE About ( hDlg : Windows.HWND;
  107. ***** ^ not supported yet
  108. 55 message : CARDINAL;
  109. 56 wParam : WORD;
  110. ***** ^ undeclared identifier
  111. 57 lParam : LONGINT ) : Windows.BOOL ;
  112. ***** ^ not supported yet
  113. 58
  114. 59 BEGIN
  115. 60 IF message = Windows.WM_COMMAND THEN
  116. ***** ^ not supported yet
  117. ***** ^ not supported yet
  118. 61 Windows.EndDialog( hDlg, CARDINAL(TRUE) );
  119. ***** ^ not supported yet
  120. ***** ^ not supported yet
  121. ***** ^ not supported yet
  122. ***** ^ not supported yet
  123. 62 RETURN INTEGER(TRUE);
  124. ***** ^ not supported yet
  125. 63 ELSIF message = Windows.WM_INITDIALOG THEN
  126. ***** ^ not supported yet
  127. ***** ^ not supported yet
  128. 64 RETURN INTEGER(TRUE);
  129. ***** ^ not supported yet
  130. 65 ELSE
  131. 66 RETURN INTEGER(FALSE);
  132. ***** ^ not supported yet
  133. 67 END;
  134. 68 END About;
  135. ***** ^ not supported yet
  136. 69
  137. 70
  138. 71 (* This procedure called when the program is loaded for the first time *)
  139. 72
  140. 73 PROCEDURE DemoInit(hInstance: Windows.HANDLE): BOOLEAN;
  141. ***** ^ not supported yet
  142. 74
  143. 75 VAR
  144. 76 DemoClass: Windows.WNDCLASS;
  145. ***** ^ not supported yet
  146. 77 BEGIN
  147. 78 (* Load strings from resource *)
  148. 79 Windows.LoadString(hInstance, IDSNAME, szAppName, 10);
  149. ***** ^ not supported yet
  150. ***** ^ not supported yet
  151. ***** ^ not supported yet
  152. ***** ^ not supported yet
  153. ***** ^ not supported yet
  154. 80 Windows.LoadString(hInstance, IDSABOUT, szAbout, 10);
  155. ***** ^ not supported yet
  156. ***** ^ not supported yet
  157. ***** ^ not supported yet
  158. ***** ^ not supported yet
  159. ***** ^ not supported yet
  160. 81 MessageLength:=Windows.LoadString(hInstance, IDSTITLE, szMessage, 25);
  161. ***** ^ not supported yet
  162. ***** ^ not supported yet
  163. ***** ^ not supported yet
  164. ***** ^ not supported yet
  165. ***** ^ not supported yet
  166. 82 (* pDemoClass := Windows.PWNDCLASS(Windows.LocalAlloc( Windows.LPTR, SIZE(Windows.WNDCLASS))); *)
  167. 83
  168. 84 DemoClass.hCursor := Windows.LoadCursor(Windows.HANDLE(0), FarADDRESS(Windows.IDC_ARROW));
  169. ***** ^ not supported yet
  170. ***** ^ not supported yet
  171. ***** ^ not supported yet
  172. ***** ^ not supported yet
  173. ***** ^ not supported yet
  174. ***** ^ not supported yet
  175. ***** ^ not supported yet
  176. ***** ^ undeclared identifier
  177. ***** ^ not supported yet
  178. ***** ^ not supported yet
  179. 85 DemoClass.hIcon := Windows.LoadIcon(hInstance, FarADR("wdemo"));
  180. ***** ^ not supported yet
  181. ***** ^ not supported yet
  182. ***** ^ not supported yet
  183. ***** ^ not supported yet
  184. ***** ^ not supported yet
  185. ***** ^ undeclared identifier
  186. ***** ^ not supported yet
  187. 86 DemoClass.lpszMenuName := FarNIL;
  188. ***** ^ not supported yet
  189. ***** ^ not supported yet
  190. ***** ^ undeclared identifier
  191. 87 DemoClass.lpszClassName := Windows.LPSTR(FarADR(szAppName));
  192. ***** ^ not supported yet
  193. ***** ^ not supported yet
  194. ***** ^ not supported yet
  195. ***** ^ not supported yet
  196. ***** ^ undeclared identifier
  197. ***** ^ not supported yet
  198. 88 DemoClass.hbrBackground := Windows.HBRUSH(Windows.GetStockObject(Windows.WHITE_BRUSH));
  199. ***** ^ not supported yet
  200. ***** ^ not supported yet
  201. ***** ^ not supported yet
  202. ***** ^ not supported yet
  203. ***** ^ not supported yet
  204. ***** ^ not supported yet
  205. ***** ^ not supported yet
  206. ***** ^ not supported yet
  207. 89 DemoClass.hInstance:=hInstance;
  208. ***** ^ not supported yet
  209. ***** ^ not supported yet
  210. ***** ^ not supported yet
  211. 90 DemoClass.style := Windows.CS_HREDRAW + Windows.CS_VREDRAW;
  212. ***** ^ not supported yet
  213. ***** ^ not supported yet
  214. ***** ^ not supported yet
  215. ***** ^ not supported yet
  216. ***** ^ not supported yet
  217. ***** ^ not supported yet
  218. 91 DemoClass.lpfnWndProc := FarADR(WndProc);
  219. ***** ^ not supported yet
  220. ***** ^ not supported yet
  221. ***** ^ undeclared identifier
  222. ***** ^ not supported yet
  223. 92 DemoClass.cbClsExtra := 0;
  224. ***** ^ not supported yet
  225. ***** ^ not supported yet
  226. 93 DemoClass.cbWndExtra := 0;
  227. ***** ^ not supported yet
  228. ***** ^ not supported yet
  229. 94
  230. 95 IF Windows.RegisterClass(DemoClass) = 0 THEN
  231. ***** ^ not supported yet
  232. ***** ^ not supported yet
  233. ***** ^ not supported yet
  234. 96 RETURN FALSE; (* Initialization failed. *)
  235. 97 END;
  236. 98 RETURN TRUE; (* Success *)
  237. 99 END DemoInit;
  238. ***** ^ not supported yet
  239. 100
  240. 101
  241. 102 PROCEDURE WinMain(hInstance: Windows.HANDLE; hPrevInstance: Windows.HANDLE; lpszCmdLine: Windows.LPSTR; cmdShow: INTEGER): Windows.BOOL;
  242. ***** ^ not supported yet
  243. ***** ^ not supported yet
  244. ***** ^ not supported yet
  245. ***** ^ not supported yet
  246. 103
  247. 104 VAR
  248. 105 msg: Windows.MSG;
  249. ***** ^ not supported yet
  250. 106 hWnd: Windows.HWND;
  251. ***** ^ not supported yet
  252. 107 hMenu: Windows.HMENU;
  253. ***** ^ not supported yet
  254. 108 BEGIN
  255. 109 IF hPrevInstance = Windows.HANDLE(0) THEN
  256. ***** ^ not supported yet
  257. ***** ^ not supported yet
  258. ***** ^ not supported yet
  259. ***** ^ not supported yet
  260. 110 (* Call initialization procedure if this is the first instance *)
  261. 111 IF NOT DemoInit(hInstance) THEN
  262. ***** ^ not supported yet
  263. ***** ^ not supported yet
  264. 112 RETURN INTEGER(FALSE);
  265. ***** ^ not supported yet
  266. 113 END;
  267. 114 ELSE
  268. 115 (* Copy data from previous instance *)
  269. 116 Windows.GetInstanceData(hPrevInstance, NearADR(szAppName), 10);
  270. ***** ^ not supported yet
  271. ***** ^ not supported yet
  272. ***** ^ not supported yet
  273. ***** ^ undeclared identifier
  274. ***** ^ not supported yet
  275. ***** ^ not supported yet
  276. 117 Windows.GetInstanceData(hPrevInstance, NearADR(szAbout), 10);
  277. ***** ^ not supported yet
  278. ***** ^ not supported yet
  279. ***** ^ not supported yet
  280. ***** ^ undeclared identifier
  281. ***** ^ not supported yet
  282. ***** ^ not supported yet
  283. 118 Windows.GetInstanceData(hPrevInstance, NearADR(szMessage), 25);
  284. ***** ^ not supported yet
  285. ***** ^ not supported yet
  286. ***** ^ not supported yet
  287. ***** ^ undeclared identifier
  288. ***** ^ not supported yet
  289. ***** ^ not supported yet
  290. 119 Windows.GetInstanceData(hPrevInstance, NearADR(MessageLength), SIZE(INTEGER));
  291. ***** ^ not supported yet
  292. ***** ^ not supported yet
  293. ***** ^ not supported yet
  294. ***** ^ undeclared identifier
  295. ***** ^ not supported yet
  296. ***** ^ undeclared identifier
  297. ***** ^ not supported yet
  298. 120 END;
  299. 121
  300. 122 hWnd := Windows.CreateWindow(FarADR(szAppName),
  301. ***** ^ not supported yet
  302. ***** ^ not supported yet
  303. ***** ^ not supported yet
  304. ***** ^ undeclared identifier
  305. ***** ^ not supported yet
  306. 123 szMessage,
  307. ***** ^ not supported yet
  308. 124 Windows.WS_TILEDWINDOW ,
  309. ***** ^ not supported yet
  310. ***** ^ not supported yet
  311. 125 Windows.CW_USEDEFAULT,
  312. ***** ^ not supported yet
  313. ***** ^ not supported yet
  314. 126 Windows.CW_USEDEFAULT,
  315. ***** ^ not supported yet
  316. ***** ^ not supported yet
  317. 127 Windows.CW_USEDEFAULT,
  318. ***** ^ not supported yet
  319. ***** ^ not supported yet
  320. 128 Windows.CW_USEDEFAULT,
  321. ***** ^ not supported yet
  322. ***** ^ not supported yet
  323. 129 Windows.HWND(0), (* no parent *)
  324. ***** ^ not supported yet
  325. ***** ^ not supported yet
  326. ***** ^ not supported yet
  327. 130 Windows.HMENU(0), (* use class menu *)
  328. ***** ^ not supported yet
  329. ***** ^ not supported yet
  330. ***** ^ not supported yet
  331. 131 hInstance, (* handle to window instance *)
  332. ***** ^ not supported yet
  333. 132 FarNIL (* no params to pass on *)
  334. ***** ^ undeclared identifier
  335. 133 );
  336. 134
  337. 135 (* Save instance handle for DialogBox *)
  338. 136 hInst := hInstance;
  339. ***** ^ not supported yet
  340. ***** ^ not supported yet
  341. 137 lpprocAbout := Windows.MakeProcInstance( Windows.FARPROC(FarADR(About)), hInstance );
  342. ***** ^ not supported yet
  343. ***** ^ not supported yet
  344. ***** ^ not supported yet
  345. ***** ^ not supported yet
  346. ***** ^ not supported yet
  347. ***** ^ undeclared identifier
  348. ***** ^ not supported yet
  349. ***** ^ not supported yet
  350. 138
  351. 139 (* Insert About *)
  352. 140 hMenu:= Windows.GetSystemMenu(hWnd, Windows.False);
  353. ***** ^ not supported yet
  354. ***** ^ not supported yet
  355. ***** ^ not supported yet
  356. ***** ^ not supported yet
  357. ***** ^ not supported yet
  358. ***** ^ not supported yet
  359. 141 Windows.ChangeMenu(hMenu, 0, FarNIL, 999, Windows.MF_APPEND + Windows.MF_SEPARATOR);
  360. ***** ^ not supported yet
  361. ***** ^ not supported yet
  362. ***** ^ not supported yet
  363. ***** ^ undeclared identifier
  364. ***** ^ not supported yet
  365. ***** ^ not supported yet
  366. ***** ^ not supported yet
  367. ***** ^ not supported yet
  368. 142 Windows.ChangeMenu(hMenu, 0, FarADR(szAbout), IDSABOUT, Windows.MF_APPEND + Windows.MF_STRING);
  369. ***** ^ not supported yet
  370. ***** ^ not supported yet
  371. ***** ^ not supported yet
  372. ***** ^ undeclared identifier
  373. ***** ^ not supported yet
  374. ***** ^ not supported yet
  375. ***** ^ not supported yet
  376. ***** ^ not supported yet
  377. ***** ^ not supported yet
  378. 143
  379. 144 (* Make window visible according to the way the app is activated *)
  380. 145 Windows.ShowWindow(hWnd, cmdShow);
  381. ***** ^ not supported yet
  382. ***** ^ not supported yet
  383. ***** ^ not supported yet
  384. ***** ^ not supported yet
  385. 146 Windows.UpdateWindow(hWnd);
  386. ***** ^ not supported yet
  387. ***** ^ not supported yet
  388. ***** ^ not supported yet
  389. 147
  390. 148 (* Polling messages from event queue *)
  391. 149 WHILE (Windows.GetMessage(msg, Windows.HWND(0), 0, 0)) # 0 DO
  392. ***** ^ not supported yet
  393. ***** ^ not supported yet
  394. ***** ^ not supported yet
  395. ***** ^ not supported yet
  396. ***** ^ not supported yet
  397. ***** ^ not supported yet
  398. ***** ^ not supported yet
  399. 150 Windows.TranslateMessage(msg);
  400. ***** ^ not supported yet
  401. ***** ^ not supported yet
  402. ***** ^ not supported yet
  403. 151 Windows.DispatchMessage(msg);
  404. ***** ^ not supported yet
  405. ***** ^ not supported yet
  406. ***** ^ not supported yet
  407. 152 END;
  408. 153 RETURN msg.wParam;
  409. ***** ^ not supported yet
  410. ***** ^ not supported yet
  411. 154 END WinMain;
  412. ***** ^ not supported yet
  413. 155
  414. 156
  415. 157
  416. 158 END MWMain_d.
  417. ***** ^ not supported yet
  418. 258 errors