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.

Redate is another tool in my growing toolbox. The idea is simple: many applications generate files, write files, update files, with exactly the same content as before. The file write date, of course, is updated. The content stays the same. Other tools, then again, us the file write date as indicate if the files have been changed. Which makes sense, right.

So, this little tool, “Redate,” stores the MD5 hashes of the files, and their original write dates. When the tool is then re-run on that list of files, it restores the original write dates for all files with unchanged MD5s. And, that’s it.

I use it for Vue.js projects, to keep the write dates of files in the dist folders. Then, a simple FTP-sync only needs to update changed files for the final deployment. This helps for projects with many unchanged assets.

You can grab source and binary releases from github.

Simple computer graphics demos are often developed as console applications. Having the console window is simply convenient for debug output. However, if we then show these demos on our stereo powerwall, the console window flashing on program start is massively disturbing. That is why I take some time and wrote a little tool. It starts the console application, hides the console window, but captures the output. This way, we can still check what happened if something does not work.

I present the HiddenConsole:

HiddenConsole.zipHiddenConsole.zip Application starter hiding the console window
[55.3 KB; MD5: 848cbd8aa901fe38be8179d65b6d2162; More Info]

And, because I can, the source is freely available:

https://bitbucket.org/sgrottel-uni/hiddenconsole

NuGet is a handy package system for Visual Studio. Originally meant for Dotnet libraries it was extended some time to support native C++ projects as well. The only catch is, that the packages need to be made especially for NuGet. There are some, but by far not all which one (I) needs for the daily work. Most problematic is that many packages do not support Visual Studio 2013. And that is even today, as Visual Studio 2015 is almost here.

So there is only one thing to do: join the fray! Well, I could stay out of it and continue to grumble about it, but let’s just keep that as plan b. So, here it is; my first NuGet package:

the AntTweakBar v1.16

(with kind support of the author)

And this will not be the last you’ve seen of me.

Today I am presenting another small tool of mine: the ShutdownPlannerGUI

ShutdownPlannerGUI.zipShutdownPlannerGUI.zip Simple GUI for planned Shutdowns of MS Windows
[188 KB; MD5: 45cb64eef13ea47e98a7dcde0773e6f1; More Info]

The basic idea is simple: it is a small GUI, slapped together in C#, around the Shutdown command-line utility. It is about the timer, specifying when the system is going to shut down. The GUI provides several text boxes to conveniently enter the time in hours, minutes and seconds. And that is it.

The ESF-funded junior research group VICCI dealt from 2012 until the end of 2014 with the development, control and integration of cyber physical systems (CPS) at the Faculty of Computer Science of the Dresden University of Technology. The scope includes smart home environments and supporting people in the ambient assisted living.

My work package for visualization and visual analysis has within the project investigated three essential aspects and corresponding solutions:

  • visual analysis of complex, multi-dimensional, multimodal, dynamic space-time data,
  • visualization in heterogeneous, mobile and distributed IT infrastructure, and
  • implementation of visualization systems and components.

Today I am writing about the visual analysis of complex space-time data.

teaser

Visual analysis serves as administrative overview of a current CPS, mainly for security reasons, as assistance during development, and the operation of the system. Particularly interesting are out-of-the-ordinary (erroneous) behavior and the formation of emergent system properties. For this a visual exploration with minimal previous assumptions is necessary. For example, certain data, like forces acting upon joints of a robot arm, be visualized more effectively by representations in geometrical context. This assumption however reduced the generality of visualization.

I thus developed a corresponding visualization of data collected by the CPS using coordinated views of continuous-time scatter plots, continuous-time parallel coordinate plots and temporal heatmaps. This application is capable of interactive real-time representation of generic multi-dimensional data and offers the means for a visual analysis. The developed system was published in the journal Computer Graphics Forum, the leading European Journal on Visualization. In the context of the evaluation, live data from our laboratory CPS war visualized, presented and discussed with a broad audience.

  • [DOI] S. Grottel, J. Heinrich, D. Weiskopf, and S. Gumhold, “Visual Analysis of Trajectories in Multi-Dimensional State Spaces,” Computer Graphics Forum, vol. 33, iss. 6, pp. 310-321, 2014.
    [Bibtex]
    @article {Grottel2014HDTraj,
      author = {Grottel, Sebastian and Heinrich, Julian and Weiskopf, Daniel and Gumhold, Stefan},
      title = {{Visual Analysis of Trajectories in Multi-Dimensional State Spaces}},
      year = {2014},
      journal = {Computer Graphics Forum},
    volume = {33},
    number = {6},
    pages = {310--321},
      doi = {10.1111/cgf.12352}
    }

DOI: 10.1111/cgf.12352

This visualization was implemented as a plugin for the MegaMol visualization system. The source code can be downloaded freely and can be used according to the enclosed License:

hdtraj.mmplugin.ziphdtraj.mmplugin.zip Multi-Dimensional Trajectory Visualization MegaMol Plugin
[99.7 KB; MD5: 0a6eaf465318b0f256ecfdf8a8b4ad50; More Info]

To compile the MegaMol system and the plugin, use the appropriate Instructions on the MegaMol website.

Once again, it is time for one of my little tools, which the world does not need (but I do). The idea is simple: think of a series of files in one directory, e.g. music files of a audio book or video files of a TV series. Every once in a while you watch/listen to one of the files and days later you do not remember, which was the last file you have seen. My tool registers to the context menu of the Windows Explorer and provides a simply way of setting a bookmark at the file in the directory. The bookmark is an empty file with the same name, additionally using an extra file name extension). The whole thing is no shell extension, but a simple, normal DotNet application which writes to the right places in the registry. Simple, not elegant, but working.

FileBookmark.zipFileBookmark.zip File Bookmark Utility
[91.2 KB; MD5: bd58a615775c9897ae82536bb678b05b; More Info]

And, just because I can, here is the source code::

FileBookmark_src.zipFileBookmark_src.zip File Bookmark Utility Source Code
[60.2 KB; MD5: 84071f778ccb81b0c39101577a3fa204; More Info]

Software should solve problems. Sometimes this is the case.

I had a problem:

I have a somewhat older convertible laptop, an ASUS Aspire 1820PT. A nice and cheap convertible of it’s time. With touch screen support for up to two fingers and with an acceptable computational power. I have upgraded it in the meantime with an SSD and I am now running Windows 8. So far so good. The problem, however, is that the tilt sensor is no longer supported by Windows 8. :-(

So I needed a solution. Hacking drivers or even writing drivers myself is not up my alley. I am an application developer. But, if something does not work automatically (anymore), we just need to make the manual use as comfortable as possible. That’s why I wrote a tiny tool: the DisplayRotator.

The idea is simple: the tool is attached to the taskbar. As soon as it is started it shows DisplayRotatorScreena simple window with four buttons for the four possible display rotation settings. Press one of these buttons and the display settings are changed accordingly. With this, I can setup my desktop orientation of my convertible with two clicks, even two tapps with my finger, and rotate the desktop aynway I like.

DisplayRotator.zipDisplayRotator.zip Display Rotation Tool
[152 KB; MD5: 07c3efddd05a98bf4d02db595b87f2fe; More Info]

And, because I can, the zip also contains the source code of the tool. It is written in C# and naturally uses the Windows API to change the display settings. Nice and easy. With the same code basis all display settings can be changes, like screen resolution and refresh rate. Even detaching or attaching monitors to the desktop is possible. Ok, the code for these functions is not in the tool, but the API calls are the same.

Maybe the tool can be of use to someone else too.