Listing: 1 (*# check(stack=>off, 2 index=>off, 3 range=>off, 4 overflow=>off, 5 nil_ptr=>off) *) 6 IMPLEMENTATION MODULE MWMain_d; 7 8 IMPORT Windows, WDLLMod; 9 10 CONST 11 (* String table constants *) 12 IDSNAME = 100; 13 IDSABOUT = 200; 14 IDSTITLE = 300; 15 16 (* About Dialog box resource id *) 17 ABOUTBOX = 1; 18 19 VAR 20 szAppName: ARRAY [0..9] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 21 szAbout: ARRAY [0..9] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 22 szMessage: ARRAY [0..25] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 23 MessageLength: CARDINAL; 24 25 hInst: Windows.HANDLE; ***** ^ not supported yet 26 lpprocAbout: Windows.FARPROC; ***** ^ not supported yet 27 28 (* Procedures which make up the window class. *) 29 PROCEDURE WndProc(hWnd: Windows.HWND; message: CARDINAL; wParam: CARDINAL; lParam: LONGINT ): LONGINT; ***** ^ not supported yet 30 31 VAR 32 ps: Windows.PAINTSTRUCT; ***** ^ not supported yet 33 BEGIN 34 CASE message OF 35 | Windows.WM_SYSCOMMAND: ***** ^ not supported yet ***** ^ not supported yet 36 CASE wParam OF 37 | IDSABOUT: ***** ^ not supported yet 38 Windows.DialogBox( hInst, FarADDRESS(LONGCARD(ABOUTBOX)), hWnd, lpprocAbout ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 39 ELSE 40 RETURN Windows.DefWindowProc( hWnd, message, wParam, lParam); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 41 END; 42 | Windows.WM_DESTROY: ***** ^ not supported yet ***** ^ not supported yet 43 Windows.PostQuitMessage(0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 44 | Windows.WM_PAINT: ***** ^ not supported yet ***** ^ not supported yet 45 Windows.BeginPaint(hWnd, ps); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 46 WDLLMod.MessagePaint(ps.hdc, szMessage, MessageLength); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 47 Windows.EndPaint(hWnd, ps); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 48 ELSE 49 RETURN Windows.DefWindowProc( hWnd, message, wParam, lParam); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 50 END; 51 RETURN 0; 52 END WndProc; ***** ^ not supported yet 53 54 PROCEDURE About ( hDlg : Windows.HWND; ***** ^ not supported yet 55 message : CARDINAL; 56 wParam : WORD; ***** ^ undeclared identifier 57 lParam : LONGINT ) : Windows.BOOL ; ***** ^ not supported yet 58 59 BEGIN 60 IF message = Windows.WM_COMMAND THEN ***** ^ not supported yet ***** ^ not supported yet 61 Windows.EndDialog( hDlg, CARDINAL(TRUE) ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 62 RETURN INTEGER(TRUE); ***** ^ not supported yet 63 ELSIF message = Windows.WM_INITDIALOG THEN ***** ^ not supported yet ***** ^ not supported yet 64 RETURN INTEGER(TRUE); ***** ^ not supported yet 65 ELSE 66 RETURN INTEGER(FALSE); ***** ^ not supported yet 67 END; 68 END About; ***** ^ not supported yet 69 70 71 (* This procedure called when the program is loaded for the first time *) 72 73 PROCEDURE DemoInit(hInstance: Windows.HANDLE): BOOLEAN; ***** ^ not supported yet 74 75 VAR 76 DemoClass: Windows.WNDCLASS; ***** ^ not supported yet 77 BEGIN 78 (* Load strings from resource *) 79 Windows.LoadString(hInstance, IDSNAME, szAppName, 10); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 80 Windows.LoadString(hInstance, IDSABOUT, szAbout, 10); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 81 MessageLength:=Windows.LoadString(hInstance, IDSTITLE, szMessage, 25); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 82 (* pDemoClass := Windows.PWNDCLASS(Windows.LocalAlloc( Windows.LPTR, SIZE(Windows.WNDCLASS))); *) 83 84 DemoClass.hCursor := Windows.LoadCursor(Windows.HANDLE(0), FarADDRESS(Windows.IDC_ARROW)); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 85 DemoClass.hIcon := Windows.LoadIcon(hInstance, FarADR("wdemo")); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 86 DemoClass.lpszMenuName := FarNIL; ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier 87 DemoClass.lpszClassName := Windows.LPSTR(FarADR(szAppName)); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 88 DemoClass.hbrBackground := Windows.HBRUSH(Windows.GetStockObject(Windows.WHITE_BRUSH)); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 89 DemoClass.hInstance:=hInstance; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 90 DemoClass.style := Windows.CS_HREDRAW + Windows.CS_VREDRAW; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 91 DemoClass.lpfnWndProc := FarADR(WndProc); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 92 DemoClass.cbClsExtra := 0; ***** ^ not supported yet ***** ^ not supported yet 93 DemoClass.cbWndExtra := 0; ***** ^ not supported yet ***** ^ not supported yet 94 95 IF Windows.RegisterClass(DemoClass) = 0 THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 96 RETURN FALSE; (* Initialization failed. *) 97 END; 98 RETURN TRUE; (* Success *) 99 END DemoInit; ***** ^ not supported yet 100 101 102 PROCEDURE WinMain(hInstance: Windows.HANDLE; hPrevInstance: Windows.HANDLE; lpszCmdLine: Windows.LPSTR; cmdShow: INTEGER): Windows.BOOL; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 103 104 VAR 105 msg: Windows.MSG; ***** ^ not supported yet 106 hWnd: Windows.HWND; ***** ^ not supported yet 107 hMenu: Windows.HMENU; ***** ^ not supported yet 108 BEGIN 109 IF hPrevInstance = Windows.HANDLE(0) THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 110 (* Call initialization procedure if this is the first instance *) 111 IF NOT DemoInit(hInstance) THEN ***** ^ not supported yet ***** ^ not supported yet 112 RETURN INTEGER(FALSE); ***** ^ not supported yet 113 END; 114 ELSE 115 (* Copy data from previous instance *) 116 Windows.GetInstanceData(hPrevInstance, NearADR(szAppName), 10); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 117 Windows.GetInstanceData(hPrevInstance, NearADR(szAbout), 10); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 118 Windows.GetInstanceData(hPrevInstance, NearADR(szMessage), 25); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 119 Windows.GetInstanceData(hPrevInstance, NearADR(MessageLength), SIZE(INTEGER)); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 120 END; 121 122 hWnd := Windows.CreateWindow(FarADR(szAppName), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 123 szMessage, ***** ^ not supported yet 124 Windows.WS_TILEDWINDOW , ***** ^ not supported yet ***** ^ not supported yet 125 Windows.CW_USEDEFAULT, ***** ^ not supported yet ***** ^ not supported yet 126 Windows.CW_USEDEFAULT, ***** ^ not supported yet ***** ^ not supported yet 127 Windows.CW_USEDEFAULT, ***** ^ not supported yet ***** ^ not supported yet 128 Windows.CW_USEDEFAULT, ***** ^ not supported yet ***** ^ not supported yet 129 Windows.HWND(0), (* no parent *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 130 Windows.HMENU(0), (* use class menu *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 131 hInstance, (* handle to window instance *) ***** ^ not supported yet 132 FarNIL (* no params to pass on *) ***** ^ undeclared identifier 133 ); 134 135 (* Save instance handle for DialogBox *) 136 hInst := hInstance; ***** ^ not supported yet ***** ^ not supported yet 137 lpprocAbout := Windows.MakeProcInstance( Windows.FARPROC(FarADR(About)), hInstance ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 138 139 (* Insert About *) 140 hMenu:= Windows.GetSystemMenu(hWnd, Windows.False); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 141 Windows.ChangeMenu(hMenu, 0, FarNIL, 999, Windows.MF_APPEND + Windows.MF_SEPARATOR); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 142 Windows.ChangeMenu(hMenu, 0, FarADR(szAbout), IDSABOUT, Windows.MF_APPEND + Windows.MF_STRING); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 143 144 (* Make window visible according to the way the app is activated *) 145 Windows.ShowWindow(hWnd, cmdShow); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 146 Windows.UpdateWindow(hWnd); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 147 148 (* Polling messages from event queue *) 149 WHILE (Windows.GetMessage(msg, Windows.HWND(0), 0, 0)) # 0 DO ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 150 Windows.TranslateMessage(msg); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 151 Windows.DispatchMessage(msg); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 152 END; 153 RETURN msg.wParam; ***** ^ not supported yet ***** ^ not supported yet 154 END WinMain; ***** ^ not supported yet 155 156 157 158 END MWMain_d. ***** ^ not supported yet 258 errors