Category "winapi"

Strange unicode error when converting Chinese wide strings to regular strings in C++

Some of my Chinese software users noticed a strange C++ exception being thrown when my C++ code for Windows tried to list all running processes: 在ࣩ

Looking for a complete Python script so that it runs my Macro?

I'm trying to create a Python script that opens MS Access and runs a Macro. I have the following script: import win32api,time from win32com.client import Dispat

GetFullPathNameA Returns Project's Path

When I tried the following code: char pathStr[MAX_PATH]; DWORD pathLen = GetFullPathNameA("notepad++.exe", MAX_PATH, pathStr, NULL); I got in "pathStr" the c

How do I set a custom cursor when the mouse is over a certain control?

I want to change the cursor when the mouse is over a certain control. I'm having the png of my cursor. How do I achieve it in C++ ? I tried like this as descri

how to obtain SeDebugPrivilege in Python?

How does one obtain SeDebugPrivilege in Python? I believe both the Ctypes api and PyWin32 are both individually capable of doing it, i don't care which API is u

WaitForMultipleObjects always returns a pipe read handle as signaled

My question is: How to use WaitForMultipleObjects to wait until there is something the be read from an anonymous pipe? The code below is a minimal reproducible

Windows Open Dialog Box hangs forever with Address Sanitizer enabled

When Address Sanitizer is enabled, the Open Dialog Box cannot be shown. It hangs forever. Thank you. It hangs when running hr = pFileOpen->Show(N

Why can't I `End` code while I'm subclassing without breaking everything?

Context I've written some code in VBA to subclass a userform so that ultimately I can intercept WM_TIMER messages being dispatched to it. I'm doing this instead

There is no "MouseButtons" information in "MOUSEMOVE" of 'winapi'

I'm trying to implement LBUTTONDOWN->MOUSEMOVE->WM_LBUTTONUP using winapi in outfocus. But the "MouseButtons" information doesn't come. I want to simulat

"Windows Kits\10\Redist\ucrt\DLLs" doesn't exist

I am trying to build a WebRTC library. It has a bunch of build python scripts one of which is trying to access C:\Program Files (x86)\Windows Kits\10\Redis

windows-rs GetNamedSecurityInfoW error 87

I'm trying to use windows-rs to use GetNamedSecurityInfoW microsoft api docs to read file permission information, but I keep getting error code 87 corresponds t

Win32 window instances behaving differently

I have created a window class using the win32 api. It creates a window, passing in this as a parameter so that I can create and grab the object instance inside

Why is HANDLE event object assumed valid in thread function?

Why is HANDLE event object(synchronization object which is created by CreateEvent function) in winapi assumed to be valid in thread function? From multithreadin

What folders make up a user's profile

Short version Is there an IShellItem that corresponds to a user's entire profile? Or given all known KNOWNFOLDER constants: is there a way to know if the KNOWNF

How do I close a socket (ipv4 and ipv6) connection on Windows from any process?

How do I close tcp v4 and tcp v6 connections on Windows? I don't want to kill the entire process that has the open connection as this obviously will kick everyo

Determine file owner from a Windows kernel-mode driver

Using C in a Windows in a Kernel Mode Driver using KMDF, how do I determine the owner a of file? I searched high and low but could not find any hint. Only C++

Determine if there is an active Microsoft Teams call via the Windows API

Is there a function in the Windows API that can be called to determine if there is an active Microsoft Teams call in progress?

How to get the "Last Saved By" property for workbook file

In Windows Explorer, if I right-click a file and choose Properties to get the file's Properties window, and then select the Details tab, there is a property lis

Unhook Window into its original State

I hook a window into a Panel using this code: SetParent(win, pnlApp.Handle); SetWindowLong(win, GWL_STYLE, WS_VISIBLE); MoveWindow(win, 0, 0, pnlApp.Width, pnlA

Change Monitor Input Source

I want to change my monitor input source with AutoHotkey, and I have this partially working. However when I use the hotkey to change the Monitor Input Source to