I added another new tool to my Tiny Tools Collection: ToggleDisplay

Code: https://github.com/sgrottel/tiny-tools-collection/tree/main/ToggleDisplay
Released Binary: https://github.com/sgrottel/tiny-tools-collection/releases/tag/ToggleDisplay-v1.0

It allows you to enable, disable, and toggle a display.

Why? My computer is connected to 2-3 displays. Two computer monitors on my desk for work. And a TV on the other side of the room, e.g. to play games from my computer or to watch video files in style.

Often enough I boot the computer, and then my mouse disappears from the desktop, because I forgot the TV was configured “on” before, and the mouse moved beyond the desktop monitors. Annoying. The built-in feature “Windows-Key + P” is understandably limited to two monitors. So, I always had to press “Windows + P”, then “Further Settings”, wait for the dialog to appear, fiddle around, press apply, … you get my point.

So, I researched the net a bit on how to programmatically enable or disable a display. And there are several free tools to do that. I tried two, and both did not work. Then there is a hack with using a Windows 10 executable on Windows 11. Yeah, no. Ok. Search on!

It turns out, there is an easy API for that: ChangeDisplaySettingsEx. Some experimental code later I was able to deactivate the display, but not to (re-)activate it. Not good enough. Search on!

Some search later, turns out there is a second API, not as simple and with next to no useful documentation: SetDisplayConfig. This one seems to be the API the windows built in display configuration dialog uses. But … how. I found code by “PuFF1k” on StackOverflow (https://stackoverflow.com/a/62038912/552373) who reverse engineered the API calls of the windows dialog. I tried his code, and it works. Nice! Thank you, PuFF1k!

The core of the trick is to not provide any modeInfo data to SetDisplayConfig, and to set all sourceInfo.modeInfoIdx and targetInfo.modeInfoIdx of all paths to DISPLAYCONFIG_PATH_MODE_IDX_INVALID.

Some refactoring and some cleanup later, I have ToggleDisplay, ready to be shared with the world.

By the way, I now also included source code of some of my older tools in this Tiny Tools Collection repository:

I uses that opportunity to also update these projects to recent DotNet runtimes. I did not set up any automated build pipeline or releases. Maybe some other time.

In … April, *omg* that was a long time ago, … whatever … I wrote I’d like to re-work and extend my websites. On my wish list were bullets like user comments and RSS feeds. Long story short: I ask myself recently if I am a complete idiot. I mean … *wtf* … what I have here is pretty exactly a Blog and nothing else. Therefore I am currently looking at existing, free Blog-Engines and I will switch to one of these.

Nevertheless, as I am writing an entry here I thought I use this opportunity to update my project list:

  • MegaMol
    My huge project at work: MegaMol; That project is now in the hands of my successor. I am not doing any big changes there any more, just some minor fixes.
  • Exoworlds
    There is nothing new here. I got my ideas. They are rather complete. I simply have to do it. *sigh*
  • MILC
    “… but stay tuned.” What a joke. Whatever. Does not evolve and is problably going to get canceled.
  • Nameless Board Game
    Well, I can actually tell you something new here! In May I wrote that the rule set is making good progress. Now I got a first version (with some possible variants).You can take a look:

    KDD_Rules_2011_6.pdfKDD_Rules_2011_6.pdf Knights Double-Duel Rules (June 2011)
    Von dieser Datei ist eine neuere Version verfügbar
    [378 KB; MD5: b76e1d4489614ae95cfcf716663980ca; Mehr Info]

    Now, the problem remains, that I am not sure if the game is fair with these rules. At the moment it looks like the second player as a slight advantage (when played without the variants. I am currently checking if this is really the case.
    I also named the game “Knights Double-Duel”, because this is basically it. Both players play each with two knights similar to chess.
  • NSB
    NSB is officially dead for now.
  • Kanoneur 2
    Kanoneur 2 is also officially dead for now.
  • My Website
    Now, I am not going to say something.
  • Mr. Burns TOK
    *sigh* I don‘t know.
  • All my little Tools
    Yeah, there are some I am writing every now and then. (No mail), no plan, no goal

Here is, once again, a small tool the world does not really need.

UrlCollector.zipUrlCollector.zip UrlCollector
[158 KB; MD5: c7b75fcfbd602beec5902f8019f14ebb; Mehr Info]

The UrlCollector is a very small and simple utility. It simply checks whether the windows clipboard contains a single line of text which looks like a Web-URL. If it does, that text line is copied from the clipboard into the program window. E. g. that way you can easily collect several download links from a website for later download, without hitting “Ctrl+V” all the time. Just “Copy link location” does the job.

About two years ago I was tinkering with code for changing the resolutions of my monitors. Of course, I screwed up several times and broke the layout of the icons on my desktop. So I searched the internet for a tiny as-simple-as-it-can-get tool to store and restore the layout of my icons. I did not find any. I mean, I found hundreds, but some were to blown-up by functions I don’t want (background services automatically detecting screen resolution changes, or something like that) and some were shareware.

Shareware!

I mean … WTF?!

Don’t get me wrong. I have nothing against someone earning money with a useful and good-written software, but such a tiny little icon tool. I mean, it’s far less complex than Calc.exe of Notepad. I was really miffed and so I decided to write such a tool by my own and to give it away as freeware. Yes, freeware. Just, because I can.

Dib.1.4.16.0.zipDib.1.4.16.0.zip Desktop Icon Backup
Angeforderte Dateiversion nicht gefunden, zeige stattdessen neuste Version
[378 KB; MD5: 846a6d216e74ad0f09eae94f1f2279d7; Mehr Info]

And here it is: Desktop-Icon-Backup (DIB). Written in C# with Windows Forms and a whole bunch of P/Invoke. It only took me two or three afternoons to make it work. I am absolutely sure that somewhere out there a tool like this exists, and that I missed it, like I missed many others. Who cares? Now the world is blessed with one more freeware. Get it and have fun with it.