Lurker News
Hey HN, I didn't want my Gateway 4DX2-66 from 1993 to be left out of the AI revolution, so I built an AI Assistant for Windows 3.1, based on the OpenAI API.

The most interesting parts of building this were:
- Getting TLS 1.2 and 1.3 working on Windows 3.1 so that WinGPT could directly connect to OpenAI's server without relying on a modern machine for TLS termination.
- Learning about the memory segmentation architecture on 16-bit Windows, including the difference between far and near pointers.
- Building the UI in plain C code with the Windows API and limited selection of controls in Windows 3.1.
You can check it out here and learn more about what it was like to build it: https://www.dialup.net/wingpt/

Comments (90) 29 threads

Show all comments

Showing thread 11 of 29

speedgoose3 replies#
This is great. After all these efforts, you should consider switching from ChatGPT 3.5 to ChatGPT 4.

Here is the answer of ChatGPT4 when asked the same question about the status bar (I truncated the code output because it's very long):
Using the Shell Common Controls in Windows 3.1 can be a bit tricky due to its older architecture and limited capabilities, but it's certainly doable.
However, there are a few complications to note:
1. Windows 3.1 does not natively support the status bar as a control. Status bars are part of the Common Controls library introduced in Win32, specifically, it was introduced in Windows 95 with COMCTL32.DLL. Windows 3.1 is a 16-bit environment and does not include this library.
2. If you want a status bar in a Windows 3.1 application, you'll have to draw and manage it yourself.
3. Windows 3.1 programming is largely obsolete. It can be a fun academic exercise or a necessity for maintaining legacy software, but if you're developing new software it would be much more practical to use a more modern version of Windows and its associated API.
Assuming that you still want to go ahead, here's a basic idea of how you might implement a status bar yourself:

  ```c
  #include

  #define ID_STATUS 100

  LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

  int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
      PSTR szCmdLine, int iCmdShow)
 {
  ...
vorticalbox1 reply#
not everyone has access to gpt 4 yet.
iraldir1 reply#
if you pay chat gpt plus then yes everyone has had access for quite some time now
collinvandyck76#
There's a difference between being able to access gpt4 via chat gpt plus, and being able to access gpt4 over the openai APIs.
djgl1 reply#
The Common Controls library actually became available with Windows 3.11. The Windows 3.11 SDK contains the commctrl.h header. The wfw31wh.hlp file explains how to use the controls. Windows 95 still provided a 16 bit commctrl.dll but omitted the CreateHeaderWindow function.
djgl#
Checked the installation disks. It is only available in Windows for Workgroups. The DLL already exists in WfW 3.1. It does not exist in the plain, not for Workgroups Windows version 3.11 released after WfW 3.11.