Re: What is the first *Win16* source code to ever be posted to FoRK?

Gregory Alan Bolcer (gbolcer@gambetta.ICS.uci.edu)
Thu, 07 May 1998 10:33:51 -0700


This is likely to cause the downfall of civilization? I take
it this is the code that puts IE explorer on the desktop.
Show me how you can run this code without Windows.

Greg

> It's true, the FoRK FAQ does tell us what the first code posted to FoRK was.
> But, although that was code to be compiled under Windows, it was only a
> console mode app. I hereby present the first Win16 code ever posted to FoRK.
> As an added bonus, I selected the computer language mostly likely to cause
> (or at least be blamed for) the downfall of civilization.
>
> - Joe
>
> procedure division WINAPI using by value hInst
> by value hPrevInstance
> by reference lpszCmdLine
> by value nCmdShow.
> MyWinMain section.
> if hPrevInstance = 0
> move 3 to style
> set lpfnWndProc to entry "MyWndProc"
> move 0 to cbClsExtra
> move 0 to cbWndExtra
> move hInst to hInstance
> call WINAPI "__LoadIcon" using by value 0 size 2
> by value h"00007f00" size 4
> returning hIcon
> call WINAPI "__LoadCursor" using by value 0 size 2
> by value h"00007f00" size 4
> returning hCursor
> call WINAPI "__GetStockObject" using by value 0 size 2
> returning hbrBackground
> set lpszMenuName to NULL
> set lpszClassName to address of MyClassName
> call WINAPI '__RegisterClass' using WndClass
> returning tmpFlag
> if tmpFlag = 0
> exit program returning 0
> end-if
> end-if
> call WINAPI "__CreateWindow" using by reference MyClassName
> by reference "COBOL & Windows" & x"00"
> by value h"00CF0000" size 4
> by value h"8000" size 2
> by value 0 size 2
> by value h"8000" size 2
> by value 0 size 2
> by value 0 size 2
> by value 0 size 2
> by value hInst
> by value 0 size 4
> returning hWindow
> call WINAPI "__ShowWindow" using by value hWindow
> by value nCmdShow
> call WINAPI "__UpdateWindow" using by value hWindow
>
> perform until loop-end
> call WINAPI '__GetMessage' using
> by reference msg
> by value 0 size 2
> by value 0 size 2
> by value 0 size 2
> returning bool
> if boolFALSE
> set loop-end to true
> else
> call WINAPI '__TranslateMessage'
> using by reference msg
> call WINAPI '__DispatchMessage'
> using by reference msg
> end-if
> end-perform
>
> exit program returning msg-wParam
> stop run.