Obtaining current linked lane count for USB 3.2 Gen 2x2(20Gb/s) device using Windows APIs
How can I obtain the current linked lane count for a USB 3.2 Gen 2x2 device using Windows APIs? I have successfully obtained USB 3.2 Gen 2(10Gb/s) current linked one lane information using IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX_V2 from…
Why max_align_t not defined in stddef.h in Windows SDK 10.0.20348.0 C17 (/std:c17)
#include <stdio.h> #include <stddef.h> int main(void) { printf("%d\n", _Alignof(max_align_t)); ```} This C code, Error: E0020, C2061, in Visual Studio Community 2019 16.11.17, Windows SDK 10.0.20348.0, C17 or C11 The same error…
C++ Win32 fullscreen windows cause the taskbar, which is set to auto-hide, to not rise properly.
When a window is displayed full screen (or takes up the whole screen), the taskbar can't be raised (the user has set the auto-hide taskbar option), I don't want this window to cause this problem, is it possible to set up this window in C++ so that the…
How to change drive letters (was: Can I use Visual C to program system tools)
I need to be able to write a tool that can change the drive letter in my application. When I insert a usb hard drive the program recognises the volume it should be with the drive letter in [] brackets in the label. When I insert the usb drive sometimes…
How Can I track the Last DPI which is sent by WM_DPICHANGED in WPF?
I want to scale my WPF application according to available screen DPI. I know there Per Monitor DPI aware available but that are completely different what I want to achieve. I want to disable scaling for my WPF application even if windows has some scale…
AdjustTokenPrivileges Error if not Administrator
Hi, I'm currently trying to make a mimic of chown by building a chown.exe using C language. When running my app from command prompt as Administrator , it runs fine. But when running it from "normal command prompt , it fails with…
CryptAcquireCertificatePrivateKey fails to retrieve the private key for certificate listed under CERT_SYSTEM_STORE_LOCAL_MACHINE
I used Below program to retrieve the private key of "1-ksp-digitalid-MSKSP 27th June" certificate stored under LOCAL_MACHINE. It gives me error 0x80090016 i.e. Keyset does not exist error. On Properties you can see dialog saying that…
Why does my transparent-background window turn into black screen after window ghosting?
I have a pop-up window that acts as a watermark on my application over a parent window. It has a transparent background (WS_EX_TRANSPARENT), but when the application becomes non-responsive, Windows adds a ghost window with a black background. I tried…
How can I launch my application automatically on system reboot?
Is there an API or method that I can use to make sure my application launches automatically when the system restarts? I would appreciate any help or guidance on this matter.
Need to get real OS Version
Hi need to get the real OS Version of the current machine in C++. Essentially I need something similar to "GetVersionExW", but a version of it that: Is not deprecated Does not require the application to be explicitly manifested…
Where to find correct version information using in C on Windows
I'm looking to programmatically find the correct version information for Windows using the "C" programming language. I've searched online with no luck. Does anyone know where I can find resources to help me achieve this goal?
How to read and output the NPU utilization
Hi All How to use the following MS learning to read and output the NPU utilization. Thank you. https://learn.microsoft.com/en-us/windows/win32/api/activitycoordinatortypes/ne-activitycoordinatortypes-activity_coordinator_resource
How to obtain API keys in OneDrive
We are planning to integrate TANDA to our OneDrive so that the Qualification Documents in TANDA will be automatically synced in our OneDrive folder. This is to avoid unnecessary manual saving of files and to ensure that the file that we have is always…
How do I find out a public IP address on the Internet using the Win32 API?
How do I find out a public IP address on the Internet using the Win32 API? I am interested in the public ip address, not the IP address of the local network. Interested in IPv4 and IPv6. Now I find out my ip address like this: I go to some site that…
How to use BCryptDeriveKeyCapi with RC4 to replace CryptoAPI code
I have some old code that uses CryptoAPI to encrypt data with RC4. The legacy process is (in summary): CryptAcquireContext() CryptCreateHash("MD5") CryptHashData (password, length) CryptDeriveKey ("RC4", ) CryptEncrypt () The new…
Cannot receive WM_POWERBROADCAST message on Win10 2004
I write an application with C++, , I regist the system message notification already.when it runs on win10 1809, it can receive WM_POWERBROADCAST message, but when it runs on Win10 2004, WM_POWERBROADCAST message cannot received, I am really…
Taskbar (Shell_TrayWnd) Transparency like in TranslucentTB using Win32 API
I'm trying to implement transparency for the taskbar (Shell_TrayWnd) in Windows, similar to the functionality that TranslucentTB has. However, in my implementation, the problem is that elements such as the Start button, search box, and attached programs…
How to specify maxLength on the text size while getting the text from text box supporting ValuePattern?
I'm using the IUIAutomation textRange GetText method if my text box supports the text pattern. There, I can specify the maxLength as given here:…
cfapi: How to hydrate placeholder file partially
Hi, We have a requirement to partially hydrate a placeholder file based on application read request and do not want hydration of rest of the file to continue in the background. Going by the documentation on the hydration policy…
Veracode error with SetWindowsHookEx win API call
I am getting an Embedded Malicious Code (CWE ID 506) error while using the SetWindowsHookEx win API call and running a Veracode security scan. The error message states that this technique is typically used by rootkits or other malicious code. Can anyone…