| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422 |
- 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
|