43,733 questions
1
vote
1
answer
34
views
Windows.System.Profile.HardwareIdentification.GetPackageSpecificToken throws exception
I'm trying to get a hardware id with a .net console app (target framewotk is net8.0-windows10.0.17763.0).
The code is rather trivial, just
var token = Windows.System.Profile.HardwareIdentification....
1
vote
0
answers
58
views
How do I send arguments to application in windows launched with shell:appsFolder?
I know you can use the Get-AppxPackage and Get-AppxPackageManifest cmdlets in Powershell to get the package family and it's specific application entry point.
In this example with Windows Media Player ...
0
votes
1
answer
52
views
WriteFile failure when networkshare is disconnected
I have a win32 app opening a log file on a network share using CreateFile and WriteFile (non overlapped) to write records. What I am seeing when the network share is lost, WriteFile reports an error (...
1
vote
1
answer
73
views
Standard way to normalize mouse wheel input across devices and platforms?
If I want consistent scrolling behavior across platforms and different wheel resolutions, I need a way to make wheel input independent of the device’s physical precision.
Different mice seem to have ...
2
votes
1
answer
75
views
Flickering when drawing to IDCompositionSurface
I tried drawing a rounded rectangle via the renderTarget, but encountered an issue where the image disappears every other frame—what could be the cause?
#include <d2d1_1.h>
#include <d2d1_2.h&...
-1
votes
0
answers
91
views
ProcessID from ETW always return 0xFFFFFFFF
I am using Event Tracing for Windows to monitor disk io and network usage of processes. I have used ETW with KERNEL_LOGGER_NAME , EVENT_TRACE_FLAG_PROCESS , EVENT_TRACE_FLAG_DISK_IO, ...
0
votes
0
answers
130
views
C++ Unicode Problems/Questions
I wrote two versions of a little program in C++ with MSVC on Windows 11:
First one:
#include <iostream>
#include <Windows.h>
int main()
{
SetConsoleOutputCP(CP_UTF8);
std::cout &...
1
vote
1
answer
130
views
Confine mouse cursor within one monitor
I am writing a Windows GUI application which uses many monitors, but all mouse controls are on the first monitor (and it is the system monitor, too). It is rather troublesome when the cursor moves ...
0
votes
0
answers
46
views
Capture Device Disconnects From Custom CTransInPlaceFilter When Connecting To Renderer in GraphEdit/DirectShow
I've created a custom DirectShow CTransInPlace filter meant to replicate the SampleGrabber filter and related interfaces with support for VIDEOINFOHEADER2 called SampleGrabber2. I currently have the ...
-1
votes
1
answer
51
views
COM CCertRequest via CSWin32
I'm currently using a COM component to initialize an instance of CCertRequest from CertCliLib.
I would like to move to CSWin32 with that, but it seems the CCertRequest does not implement any ...
3
votes
1
answer
213
views
Encounter a problem that print wide_character in C
Here is my code:
#include "snake.h"
void SetPos(short x, short y)
{
//获得标准输出设备的句柄
HANDLE houtput = NULL;
houtput = GetStdHandle(STD_OUTPUT_HANDLE);
//定位光标的位置
COORD pos =...
-1
votes
1
answer
185
views
How can I monitor process creation/termination in C# using winapi? [closed]
I’m building a lightweight process monitoring tool in C# (.NET Framework 4.6.2).
Here’s my situation:
I cannot use WMI due to it's speed; (this is slow for antivirus app).
I also cannot rely on ETW (...
3
votes
1
answer
168
views
Windows API: Software breakpoints are not hit
I am using Python to write a rudimentary debugger that will use Windows APIs to debug C source files. I am stuck on creating the software breakpoints. I did some research and found this article that ...
0
votes
0
answers
92
views
Windows apisetschema, not existing lib
While trying to resolve dynamic DLLs (api-ms*, ext-ms*), I face a problem with an undefined reference from kernel32.AddDllDirectory: api-ms-win-core-libraryloader-l1-1-0.AddDllDirectory, but there is ...
1
vote
1
answer
166
views
How to SelectAll text when a TEdit gains input focus by the user clicking?
Short Version
How can i select all text in a TEdit when the control gains input focus from the user clicking the edit box?
Motiviation
Following the Windows User Design Guidelines for a "search&...
0
votes
1
answer
96
views
Win32: How to check if a HKL refers to a specific family of IMEs
The keyboard APIs of Win32 (Windows API family) are known to be confusing, and there are lots of SO answers about how to display approximate information to a human with enough polyglot skills to ...
2
votes
0
answers
157
views
Why doesn't Win32 dialog recognize controls reparented from other windows for mnemonic navigation?
I'm developing a module for Visual Basic 6.0 (or TwinBASIC) that allows us to use Windows Common Controls' PropertySheet and CreatePropertySheetPage functions with Visual Basic forms instead of Win32 ...
1
vote
0
answers
91
views
Win32 C++ Enumerate "Internal Storage" File System of devices such as iPhone and MTP-USB digital camera
In order to enumerate the content of connected devices such as iPhones and a digital camera connected via MTP (USB), which aren't simple file drives, I looked at the example WPD API Sample. The ...
1
vote
0
answers
51
views
How to enumerate microphone formats
So I found the undocumented API to change sound device formats How to change microphone format programmatically
However, it's still unclear how to enumerate the available endpoint formats that can be ...
0
votes
0
answers
78
views
AHK2 overlay only stays visible above taskbar when a file write triggers a refresh — any better alternatives?
I'm trying to keep a transparent always-on-top overlay (made in AHK v2) above the taskbar in Windows 10/11.
The Problem:
Everything works except when the Aero Peek / Show Desktop event fires (e.g. via ...
1
vote
0
answers
92
views
Win10 child process show it's window behind the last window on desktop [duplicate]
I have two processes - one starter app and one child app(any Qt application)
starter app code:
int main(int argc, char * argv[])
{
namespace bp = boost::process::v1;
auto env = boost::...
1
vote
1
answer
86
views
EnumFontFamiliesEx and LOGFONT
The LOGFONT structure has a member lfCharSet. Is there a way to determine the default value in this structure based on the system settings/locale?
I’d like to enumerate fonts, but the ...
3
votes
0
answers
215
views
How to cleanly shut down a real-time work queue?
I'm using the Windows Real-Time Work Queue API to do audio playback using WASAPI. The queue is created using RtwqLockSharedWorkQueue and work is submitted using RtwqPutWaitingWorkItem. From the ...
2
votes
1
answer
146
views
How to draw image to GDI properly?
I'm trying to use GDI to draw RGB images on Win32 window.
To draw, I first write colors to buffer in WM_CREATE and then draw it in WM_PAINT using StretchDIBits:
unsigned char imageData[46 * 32 * 3];
...
1
vote
1
answer
92
views
Win32 - MCI looping cuts off first note
Minimal sample:
#include <Windows.h>
void midiPlay(HWND hwnd, LPSTR midi) {
char s[256];
memset(s, 0, 256);
sprintf(s, "open %s type sequencer alias mus", midi);
...