Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2025-09

Want to create a program launcher for Windows 11, suggestions please.

9 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

So I have been forced to update my laptop to Windows 11, which I have resisted for a long time. As expected there are a lot of changes that are not to my liking but can be worked around or so.

But for my productivity I have for ages used the Quick Launch Bar integrated in the bottom toolbar of my laptop. It has worked really well to collect my most often used application icons at the bottom with a 1-click launch function.

Now Microsoft has removed support for extra toolbars and I have tried to use the opensource ExplorerPatcher (find it on Github) to return the QuickLaunch toolbar, but apparently in a recent Windows build this has been blocked. :-(

After spending a lot of time moving to Win 11 and trying to configure it in some sensible way similar to what I had I have given up and here I am...

DIY solution:
------------
I would like to write a FreePascal program that implements a ribbon type window on which I can show the icons of selected programs side by side and if one is clicked the corresponding application is started.
Ideally I should be able to populate the ribbon by drag-drop of an application shortcut icon on the desktop, but I can live with having a config file where the apps are defined.

What I need is some advice as follows:
- How can I show the application icon on a form given the path to the exe file?

- How can I drag-drop an application icon onto the main form and retrieve its data to make it part of the launch list?

- How do I make the application "dock" itself to the bottom of the desktop?

I have written a good many Windows appliocations using Lazarus/FreePascal but I have never gone into these Windows internals before...

Grateful for any help!

Bo Berglund Developer in Sweden
Tomas Hajny
to Bo Berglund
Bo Berglund wrote 23 lines
So I have been forced to update my laptop to Windows 11, which I have resisted for a long time. As expected there are a lot of changes that are not to my liking but can be worked around or so. But for my productivity I have for ages used the Quick Launch Bar integrated in the bottom toolbar of my laptop. It has worked really well to collect my most often used application icons at the bottom with a 1-click launch function. Now Microsoft has removed support for extra toolbars and I have tried to use the opensource ExplorerPatcher (find it on Github) to return the QuickLaunch toolbar, but apparently in a recent Windows build this has been blocked. :-( After spending a lot of time moving to Win 11 and trying to configure it in some sensible way similar to what I had I have given up and here I am...

.
.

I cannot contribute to the part of your question directly related to FPC, but I'd suggest using an older version of ExplorerPatcher (22621.3527.65.1) and disable updates, that works even with the latest Win11 builds - at least it works for me. :-) Note that any potential further discussion about this part should go to fpc-other, because this is not related to FPC.

Tomas

Hairy Pixels
to Bo Berglund: So I have been forced to update my laptop to Windows 11, which I have resisted for a long…

On Sep 8, 2025 at 9:18:42 PM, Bo Berglund via fpc-pascal <

Show quoted text 8 lines
wrote: I have written a good many Windows appliocations using Lazarus/FreePascal but I have never gone into these Windows internals before... Grateful for any help!

I was curious so I put your question into ChatGPT and got some answers that looked interesting. I’ve barely done any Windows development so I don’t know the internals but I found ChatGPT to be really good for this kind of research.

Sorry that’s a cheap answer :)

Bo Berglund
to Hairy Pixels
Hairy Pixels wrote 16 lines
On Sep 8, 2025 at 9:18:42?PM, Bo Berglund via fpc-pascal < > wrote: > I have written a good many Windows appliocations using Lazarus/FreePascal > but I > have never gone into these Windows internals before... > > Grateful for any help! > I was curious so I put your question into ChatGPT and got some answers that looked interesting. I’ve barely done any Windows development so I don’t know the internals but I found ChatGPT to be really good for this kind of research. Sorry that’s a cheap answer :)

I too was using ChatGPT as helper during my conversion to Win11. When I discovered that the solution that resulted did not work for me and mentioned this fpc idea for a replacement it came back with a long Lazarus/Fpc suggestion. :-)

But I thought that asking here would be a safer way... Before I go further I need to make sure I have a working Lazarus/FPC installation on my Windows11 machine. In recent years I have done the bulk of my new coding on Linux platforms...

I have used FpcUpDeluxe the last times I installed on Windows and that gave me Lazarus 3.4 so I just have to find its launcher. All of my day-to-day programs were launched from the QuickLaunch toolbar Microsoft has decided to remove...

Bo Berglund Developer in Sweden
Bo Berglund
to Bo Berglund
Bo Berglund wrote 33 lines
On Mon, 8 Sep 2025 09:50:10 -0500, Hairy Pixels via fpc-pascal wrote: > On Sep 8, 2025 at 9:18:42?PM, Bo Berglund via fpc-pascal < >> wrote: > >> I have written a good many Windows appliocations using Lazarus/FreePascal >> but I >> have never gone into these Windows internals before... >> >> Grateful for any help! >> > >I was curious so I put your question into ChatGPT and got some answers that >looked interesting. I’ve barely done any Windows development so I don’t >know the internals but I found ChatGPT to be really good for this kind of >research. > >Sorry that’s a cheap answer :) I too was using ChatGPT as helper during my conversion to Win11. When I discovered that the solution that resulted did not work for me and mentioned this fpc idea for a replacement it came back with a long Lazarus/Fpc suggestion. :-) But I thought that asking here would be a safer way... Before I go further I need to make sure I have a working Lazarus/FPC installation on my Windows11 machine. In recent years I have done the bulk of my new coding on Linux platforms... I have used FpcUpDeluxe the last times I installed on Windows and that gave me Lazarus 3.4 so I just have to find its launcher. All of my day-to-day programs were launched from the QuickLaunch toolbar Microsoft has decided to remove...

So going onwards now, what happens if I have a form and there is a mouse event when one drags a shortcut icon from the Windows desktop amd drops it onto the form? Of course it must remain on the desktop too...

Say I dragged the Lazarus 3.4 icon to the form and dropped it, will there be some way to extract what it was that was dropped and then extract the built-in icon image so it could be placed on the form?
Can the application launch information also be extracted in this case (name and path to the executable and any arguments).
If so how is it done?

I want to create an image to drop onto my form which displays the actual application icon.
And it will have an on-click event handler which would launch the application on click.

So the main issues here are:
- How to extract the icon image?
- how to extract the shortcut target (path to application and any arguments needed)

If I can get that I can probably create my own application launcher similar to the now removed Windows Quick Launch Toolbar.

Of course I could create a simpler application with an ini file config where the application path is supplied there and the data extraction then becomes simnpler.
It would be nice with the drag-drop though in order to populate the launcher.

Bo Berglund Developer in Sweden
Jean SUZINEAU
to Bo Berglund

I haven't tested but I imagine you can use property AllowDropFiles on TForm to get the file paths of the shortcuts through the OnDropFiles event of TForm. They won't be removed from their source directory.

I think you can directly execute the shortcuts with ShellExecute from unit ShellAPI, no need to search the actual exe path. And it's likely that with SHGetFileInfo with flag SHGFI_ICON ( https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shgetfileinfoa ) from unit ShellAPI you can get directly an hIcon icon handle that you can use directly to display the Icon on your form.

Bo Berglund
to Bo Berglund: On Mon, 8 Sep 2025 09:50:10 -0500, Hairy Pixels via fpc-pascal I too was using ChatGPT as…
Bo Berglund wrote 13 lines
>I was curious so I put your question into ChatGPT and got some answers that >looked interesting. I’ve barely done any Windows development so I don’t >know the internals but I found ChatGPT to be really good for this kind of >research. > >Sorry that’s a cheap answer :) I too was using ChatGPT as helper during my conversion to Win11. When I discovered that the solution that resulted did not work for me and mentioned this fpc idea for a replacement it came back with a long Lazarus/Fpc suggestion. :-) But I thought that asking here would be a safer way...

So I asked ChatGPT if it could provide some advice and it did actually do that. It built a new Lazarus project so it is a start anyway.

But I am not through looking over the code it suggested, there are a number of errors caught by QuickCompile to sort out first before testing it...

Bo Berglund Developer in Sweden
Rolf Wetjen
to Bo Berglund: On Mon, 08 Sep 2025 21:46:06 +0200, Bo Berglund via fpc-pascal So going onwards now, what…

I just updated an old windows 10 deskband implementation for this to use it with Windows 11.

Its not a 100% replacement for a deskband but it's fine for me.

https://forum.lazarus.freepascal.org/index.php/topic,72243.0.html

Rolf

Bo Berglund wrote 64 lines
On Mon, 08 Sep 2025 21:46:06 +0200, Bo Berglund via fpc-pascal wrote: > On Mon, 8 Sep 2025 09:50:10 -0500, Hairy Pixels via fpc-pascal > wrote: > >> On Sep 8, 2025 at 9:18:42?PM, Bo Berglund via fpc-pascal < >> > wrote: >> >>> I have written a good many Windows appliocations using Lazarus/FreePascal >>> but I >>> have never gone into these Windows internals before... >>> >>> Grateful for any help! >>> >> I was curious so I put your question into ChatGPT and got some answers that >> looked interesting. I’ve barely done any Windows development so I don’t >> know the internals but I found ChatGPT to be really good for this kind of >> research. >> >> Sorry that’s a cheap answer :) > I too was using ChatGPT as helper during my conversion to Win11. > When I discovered that the solution that resulted did not work for me and > mentioned this fpc idea for a replacement it came back with a long Lazarus/Fpc > suggestion. :-) > > But I thought that asking here would be a safer way... > Before I go further I need to make sure I have a working Lazarus/FPC > installation on my Windows11 machine. In recent years I have done the bulk of my > new coding on Linux platforms... > > I have used FpcUpDeluxe the last times I installed on Windows and that gave me > Lazarus 3.4 so I just have to find its launcher. All of my day-to-day programs > were launched from the QuickLaunch toolbar Microsoft has decided to remove... So going onwards now, what happens if I have a form and there is a mouse event when one drags a shortcut icon from the Windows desktop amd drops it onto the form? Of course it must remain on the desktop too... Say I dragged the Lazarus 3.4 icon to the form and dropped it, will there be some way to extract what it was that was dropped and then extract the built-in icon image so it could be placed on the form? Can the application launch information also be extracted in this case (name and path to the executable and any arguments). If so how is it done? I want to create an image to drop onto my form which displays the actual application icon. And it will have an on-click event handler which would launch the application on click. So the main issues here are: - How to extract the icon image? - how to extract the shortcut target (path to application and any arguments needed) If I can get that I can probably create my own application launcher similar to the now removed Windows Quick Launch Toolbar. Of course I could create a simpler application with an ini file config where the application path is supplied there and the data extraction then becomes simnpler. It would be nice with the drag-drop though in order to populate the launcher.
Bo Berglund
to Bo Berglund: On Mon, 08 Sep 2025 21:46:06 +0200, Bo Berglund via fpc-pascal So I asked ChatGPT if it…
Bo Berglund wrote 5 lines
So I asked ChatGPT if it could provide some advice and it did actually do that. It built a new Lazarus project so it is a start anyway. But I am not through looking over the code it suggested, there are a number of errors caught by QuickCompile to sort out first before testing it...

To finish this thread up:
After a few iterations with ChatGPT I now have a fully working Lazarus project for a ribbon style application launcher that can be placed anywhere on screen (I have it at the upper edge). It works essentially like the old QuickLaunch bar did for starting my favourite apps.

It also has the ability to launch as admin if one right-click an icon (a pop-up offers Run and Run as admin).

It is a pity though that one has to go through hoops like this in order to get back functionality Microsoft rips away...

Bo Berglund Developer in Sweden