Relative Content

Tag Archive for windowswinapi

How to toggle system taskbar icons with windowsapi or any other api

my main goal is to disable the Clock icon without editing regex and restarting explorer (similarly to how the Windows Settings App achieves this). if anyone familiar with Windows API or any other api that allows this could you possibly explain the way to approach this problem?

Detect if NVIDIA GPU is suspended

I have a laptop that has a dedicated NVIDIA GPU. However, this laptop has a problem where the NVIDIA GPU sometimes exits its suspended state and starts using battery, which causes a heavy battery drain.
If the GPU is awake, you can force it to get on the “suspend” state by disabling and enabling the GPU again on Device manager. Once you do this, it gets fixed.

Cannot automatically resume Windows from “Modern Standby”

I maintain a Windows service that runs in session 0. It performs maintenance tasks at certain times in a similar way to the Windows task scheduler. If the system is asleep, it uses SetWaitableTimer() to wake-up. This has worked well for traditional sleep and hibernate for many years.

How can I know what “CreateFile()” opened?

The Win32 API function CreateFile() opens a “file” using a path, but this path can also open a volume (e.g. \.D:), or a physical drive (e.g. \.PHYSICALDRIVE2), or console handles, “changer drivers”, or even tape. This remembers UNIX, but different to UNIX, if I use GetFileSize() on a volume/drive, it fails with “The parameter is incorrect”, being necessary to use DeviceIoControl().

Windows Dialogue Box

My Windows 11 dialogue boxes suddenly changed and now the messages display odd words like “You’ll”. How do I reset to the default?