two issues for borland-turbo pascal: How to create window (win31 unit?) and how to output in desktop overlay

Started by
9 comments, last by SiCrane 12 years, 2 months ago
Hi! I use the old borland pascal ('92) in win xp. Until now I compile in real mode and run with dosbox. How to use the windows mode and create a window?

Also, how to make the output to be sent in the desktop background, like winamp's avs?
Advertisement

Hi! I use the old borland pascal ('92) in win xp. Until now I compile in real mode and run with dosbox. How to use the windows mode and create a window?

Also, how to make the output to be sent in the desktop background, like winamp's avs?


Borland Pascal is for DOS, not Windows , you cannot use it to create Windows applications, If you want to make Windows applications using Pascal you need a newer compiler.
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
You are wrong, borland pascal is for windows (3.1 native). I has 3 modes, real, protected and windows app.

Hi! I use the old borland pascal ('92) in win xp.


Why? You should post this in the paleocomputing forum. :)
Not there, in the obsoletecomputing forum!:P Anyway, dont ask why I use this, just answer if you know what I am asking for!

How to use the windows mode and create a window?

You would need to link to the Windows 32-bit or 64-bit Win32 library.


Also, how to make the output to be sent in the desktop background, like winamp's avs?
[/quote]
You would need to use the 32-bit or 64-bit Windows DirectX library functionality.


You are wrong, borland pascal is for windows (3.1 native). I has 3 modes, real, protected and windows app.

Yes, but Windows has discontinued support for 16-bit applications since Windows XP.
According to this MSDN thread, you can render to the desktop by using FindWindow and FindWindowEx to grab the "Program Manager" and "FolderView" handles, and use GetDC and RedrawWindow to begin rendering and to redraw the desktop icons.

These functions are provided by the Win32 library, and can be used in any language that supports linking to C-library interfaces (consult your compiler's documentation). Whether or not this can be done in 16-bit Turbo Pascal is another question...
Well, pascal supports these functions. I found the FindWindow, check the image. But I dont know how to create windows through pascal, the initialization and such staff. Any idea?

Also, I am not sure, but are you sure that the icons and folders must be redrawned, because it seems that winamp's avs just updates only the background..
Turbo Pascal is for DOS. Windows 3.1 ran as a DOS application, which offer minimal layer of abstractions, including later (3.1 vs 3.0 IIRC) real vs. protected mode. Basically, you'd boot into DOS, then run win.com, which would do a lot of magic. I don't remember if it could run without that. Maybe the 3.1 32-bit version was standalone OS, the 16-bit and 3.0 were the old style.

It wasn't until Windows 95 that roles changed and Win 95 became the OS itself.

To develop a Windows 3.1 application, you need to run Windows 3.1 inside DosBox, if it even runs.

There is no way to break out of DosBox to host desktop - DosBox runs on any OS and is completely oblivious of Windows. There is only basic DOS support, so I have no clue if it's capable of running Win3.1 to a useful extent, let alone how interoperable it is with such applications.

But I dont know how to create windows through pascal, the initialization and such staff. Any idea?[/quote]
Win3.1 API is old.... That was before many of functional changes to structure of application, I remember that even Delphi was quite cumbersome at that time.

General approach is about the same as today, minus the MFC. One could, in theory, try digging out one of such tutorials and backporting it.
The 32-bit versions of the Windows OSs maintained backwards compatibility for running Win16 and Win32s applications until at least Vista. If you're running a 64-bit version of the OS you need to do something like run a virtual machine.

This topic is closed to new replies.

Advertisement