Jump to content
PaulD

Build a Windows GUI shell in Delphi (CarPC)?

Recommended Posts

First off, I haven't done software development in a number of years, so I'm rusty. I did Delphi for years, and a touch of C#. But I'd say I'm much more proficient in Delphi, or at least I was. So, if I take on this project, I think I'd use Delphi.

 

10 years or more ago, there was a bit of a fad of using a Windows computer as a car stereo. Called a CarPC or Carputer. With cars these days now being more integrated and Double-DIN going the way of the Dodo, the CarPC fad is mostly dead. But I'm still somewhat interested in pursuing. There were a number of "front-ends" that were sold or given away. Basically, a user interface designed to launch a handful of applications such as a media player, map software, etc. It would use large buttons designed to be easy to use on a dash mounted touch-screen similar to a commercial car stereo. The thing is, almost all of these products are dead. Some of them you can still download off of SourceForge or something similar. But the ones I tried just don't seem to work on a modern OS. Or were just too buggy all along. I might try fighting a bit more with some of them. But maybe a fresh program might work better.

 

As far as building the computer itself for a CarPC, that actually is still quite doable. Micro-ITX motherboards are plentiful. And you can get computer power supplies designed to be powered by a car battery and a small enclosure for mounting in some hide-away location in the car. There are not a lot of double-din sized touchscreens that are available, but there are some. I've seen some with only 800x600 resolution. Windows 10 minimum resolution according to spec is 800x600. Windows 11 official spec says minimum resolution is 1280x720, although I found that I can set my Windows 11 computer to 800x600 and it seems to basically work.

 

I know I could build a basic app that has large buttons and you click on them and it would launch another program. But some of the more fancy features, I'm not that sure how to do. For example, if I did build such a program, I'd want it to adapt to screen resolution cleanly, so that it could be used at 800x600 or anything else and still look about the same. Not sure how best to do that.

 

I'm thinking I'd like it to at least act like it replaces the Windows Shell. Meaning that if you close the foreground program, my program would come back into the foreground automatically. My program should be the primary way to run and access programs. Though I suppose it would be difficult to actually replace the Windows shell. It would probably be best if it just sort-of acted like it does. Still, I was wondering if anyone has tried to build a light-weight GUI shell in Delphi?

 

If there happens to be some components or tool-kits that might do a lot of the heavy-lifting, that would be cool. Basically, I would need to make the screen auto-size or at least be able to handle different resolutions gracefully. Automatic bring to the foreground when apps it launches closes, and be easily configurable. Like the user should be able to move the buttons around, maybe put their own graphic background, easily configure what the buttons launch when clicked. That kind of stuff. The idea of "skinnable" was popular some days ago. That would seem to be appropriate for this type of project.

 

So, basically, any basic points are what components or tool-kits I might look into that might give me a head-start? Thanks for any help!

 

Share this post


Link to post

Replacing shell is quite common operation, back in XP days it was pretty popular ("Aston shell" IIRC). All Win-based terminals still use this "kiosk mode". However, I doubt the launcher will be the most complicated task - adaptation of apps will. So for the start I think usual explorer and shortcuts will be enough

Share this post


Link to post

Windows and Delphi must be the wrong tool for this task. There was a time when you didn't know Delphi. You learnt it. Is it so hard to imagine learning again? 

  • Like 2

Share this post


Link to post

As for replacing the shell, this looks promising:

 

https://superuser.com/questions/1016380/how-do-i-replace-the-system-shell-explorer-exe-with-another-process-in-windows

 

(Took me all of two minutes to find it.)

 

Interesting project you've got there. I'm not sure whether it is worth the effort, but of you think it would be fun, go ahead.

 

Adapting to the resolution, simply handle the appropriate messages and resize the controls accordingly. How you do that depends on the controls you use. For most it's enough to set top, left, width and height.

 

I'm not sure where any toolkits would come into play here. VCL or FMX should be enough, but that depends on the functionality you want your program to have. Just for a launcher, I don't see the need for a specialized toolkit.

 

btw: Have you checked the power requirements for such a computer? I'm not sure the normal car electric power supply can handle that.

Edited by dummzeuch

Share this post


Link to post
On 3/12/2022 at 2:08 AM, PaulD said:

Basically, a user interface designed to launch a handful of applications such as a media player, map software, etc. It would use large buttons designed to be easy to use on a dash mounted touch-screen similar to a commercial car stereo.

It would be easier to duct tape an iPad over the airbag and run the speakers thru blue tooth.

 

 

Second way. third item.

https://www.makeuseof.com/tag/projects-raspberry-pi-touchscreen-display/

 

Third way. Delphi has a location demo for phone that works and ties into google maps.

covers the map software.  25% of project would done.  Works on my present android phone.   

 

Four.

Finding screen size.

https://stackoverflow.com/questions/1424920/how-do-i-get-the-usable-coordinates-of-the-screen-in-delphi

  

to get the feel of embedded system Use the Task Manager to shut down Win Explorer.  You can restart from Task Manager using new task Explorer.

 

 

Edited by Pat Foley
Added 4
  • Haha 1

Share this post


Link to post

I had such project running for some 2 years around 2008-2010, but it didn't gain much interest from the public.

My hardware was based around one of the first Intel dual core Atom ITX based boards and had a M3-ATX power supply (this gracefully shut down the PC when you turned of the car engine. The earlier models just cut the power to the PC, which wasn't favourable).

All put into a special ITX case looking just like an external amp.

I can't remember the screen though, it was a motorized touchscreen with a blind front when closed. It opened automatically when the engine was started.

The audio output was connected to a 4 channel amp with a subwoofer and actually sounded awesome. The soundcard on the Atom board was miles ahead for what the default headunit of the car provided, and with 5.1 separated channel support.

It eventually got custom graphics from an actual designer, but he moved on to a commercial CarPC project soon after because the graphics framework couldn't compete with the smooth animations Android offered and he didn't like the speed of development (hey, it was a 1-man project in spare time). 

It was based on the Graphics32 library with -I think- the BASS audio library for playback of audio on multiple channels. 

Due to licensing of some of the external components, I'd chosen to provide it for free, although it was not opensourced.

 

It had a plugin system with a couple of plugins for interior/exterior temperature monitoring (using the USB-Temper modules), displaying USB GPS receiver data, navigation using Garmin for PCs hosted in a window locked in a specific location,

external signals (e.g. to connect steering wheel buttons), video playback, a USB FM radio receiver, ELM327 OBD-II interface, and some more stuff I can't remember.

A front/rear camera plugin was also in development (can't remember if I ever finished this one.. the available webcams were quite horrible in low-light conditions, but I think I got some acceptable results using a Microsoft VX800).

It also provided a Jukebox mode for the music playback where it tried to find music in the same genre you're currently playing.

 

Unfortunately, the website I had for this is now defunct and mp3car.com doesn't seem to be in existence anymore either.

I stopped developing it due to lack of interest from the public and the introduction of Android based headunits. The world moved on to those things, instead of Car PC's, understandably.

 

But maybe I can dig up the code for this, I'll go look for it tonight.. might be a fun project to revive, although I don't have as much time for it anymore. 

 

I did find some of the earlier screenshots of it though (before it got more professional looking graphics).

 

CMEqualizer.png

CMGMPC.png

CMLib.png

CMMainAlt.png

carma_architecture_rev6.png

CarMaPlaying.png

  • Like 2

Share this post


Link to post

The plan was to replace the explorer.exe with the main executable when it was as good as finished, or good enough for a daily driver app.

You had several shell replacements in that era doing similar things (SharpE/SharpEnvironment comes to mind, which was also developed using Delphi and is still available on sourceforge)

 

But since it was an application still in development, I think I went the easier route to be able to manage stuff on the PC itself;

e.g. put a shortcut in the autostart menu (or maybe it was the registry), scaled the form to the screen resolution, forced it to stay-on-top and removed the form borders.

This way, I'd still had access to the desktop if necessary (for trying out new updates etc).

 

Edited by jsn-079

Share this post


Link to post
16 hours ago, dummzeuch said:

As for replacing the shell, this looks promising:

 

https://superuser.com/questions/1016380/how-do-i-replace-the-system-shell-explorer-exe-with-another-process-in-windows

 

(Took me all of two minutes to find it.)

 

Interesting project you've got there. I'm not sure whether it is worth the effort, but of you think it would be fun, go ahead.

 

Adapting to the resolution, simply handle the appropriate messages and resize the controls accordingly. How you do that depends on the controls you use. For most it's enough to set top, left, width and height.

 

I'm not sure where any toolkits would come into play here. VCL or FMX should be enough, but that depends on the functionality you want your program to have. Just for a launcher, I don't see the need for a specialized toolkit.

 

btw: Have you checked the power requirements for such a computer? I'm not sure the normal car electric power supply can handle that.

 

Thanks for all the suggestions.  I'm still not sure I will go with the project. But, as far as on the hardware end, actually that part is surprisingly trivial.  First, there are computer power supplies designed for cars!  They can keep the motherboard in sleep mode when the engine is off for a period of time, but kill all power to the CPU after a certain time to prevent it from draining the battery.  Since a PC in sleep mode only uses a few watts, a car battery can drive it for many hours. I've seen these kinds of power supplies up to 250 watts, but that is way more than needed.  For example, get a relatively low power CPU.  You can get a 2-core, 4-thread ZEN3 CPU that is only 35 watts.  A 6 or 8 core CPU isn't likely needed, but even those are available for about 65 watts.  Still, cooling in a relatively enclosed space would probably make a dual core the best bet.  And get a CPU with built-in graphics.  You won't be gaming with it, so you don't need a separate graphics card.  

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×