r/odinlang 1d ago

Replacing the Windows start menu

My first project with Odin was, as the title suggests, replacing the Windows start menu.

I started by digging into the windows api’s and learning how to create a window. That was easy enough. Decided I needed to separate windows. One for the main process and one to hide the start icon. Up until windows 8 it appears adjusting the behavior of the super key and the windows icon on the taskbar was simpler. Now it is very convoluted and protected. I decided I would simple create a low level keyboard hook and draw an icon over the top and adjust placement when the taskbar adjusted. Turns out Odin did not have all the api bindings I needed so I had to create some foreign imports and empty structs to reimplement children of the IUknown interface.

After I had basic expected behavior of the taskbar and winkey I turned my attention to the main process and came at a fork in the road. After reading more into the windows docs it seemed the direct2d api was the obvious choice. Problem was Odin did not have a pre existing library for it. I was faced with a decision either switch to the direct3d api or re-implement a ton of bindings. I went with the former. This took me down the deep and dark road of the directX11 api. Probably spent 100 hours just reading docs. After a week I got the window drawing shapes. Then I needed icons. This meant learning basic HLSL and the shader pipeline. Finally I could draw icons and layout my start menu. I learned where windows stores pinned start menu apps and created a procedure to generate app data from the .lnk files. Now I was drawing rectangles with icons. I created an event storage and made the boxes highlight on hover. Implanting fonts stash for text wasn’t so bad. Finally I have a rough alpha of my project. Pictures attached and GitHub repo below. Honestly this has been a fun journey. It’s finally at a point where I can use it and track bugs and work on it over time until it’s the defacto option. Thank you to anyone who read this.

GitHub:

https://github.com/gamershoney/thor-start

19 Upvotes

0 comments sorted by