43,734 questions
1
vote
0
answers
22
views
How to prevent "appstarting" cursor when calling IContextMenu::QueryContextMenu?
I'm building a file explorer application and encountering an issue where IContextMenu::QueryContextMenu causes the cursor to briefly flash to the "appstarting" (arrow + spinner) cursor.
This ...
3
votes
2
answers
135
views
How can I get the file size with FindFirstFileW and FindNextFileW? (beginner)
I'm a beginner with the Windows API and C Programming, I am trying to get the file size from my files, but my output is not so as expected.
That's my code:
#include <Windows.h>
#include <...
1
vote
1
answer
208
views
How to detect if there's a Windows Update available using Delphi code?
I need to know from within my app whether the person has a pending Windows Update available or not, and then prompt him to update his Windows if it's not updated yet.
Is there a way to check if an ...
0
votes
2
answers
129
views
Is there a way to detect UEFI from a Delphi App?
I want to know if the computer I'm using has UEFI or Legacy BIOS.
Is it somehow possible to detect this from Delphi code?
I found ExGetFirmwareEnvironmentVariable which seem interesting, but I'm not ...
-2
votes
1
answer
119
views
How to get the names of my active monitors using Delphi VCL? [duplicate]
I found this function that is supposed to get the names of all the actively plugged-in monitors on the computer:
function GetMonitorNames: TArray<string>;
begin
Result := [];
var ...
0
votes
0
answers
84
views
Native window as child blocks native event messages for Qt parent
I am migrating a Win32 application to Qt little by little; and I replaced the top level window with a QMainWindow instead.
I am using the QWinHost from the qt-migrations github solution to do so, and ...
0
votes
2
answers
145
views
Reading a serial event with the winapi.h in MFC
I have a dialog-based MFC application build in Visual Studio. With my App I want to read a serial event from a potentiometer, which is attached to an Arduino board.
The Arduino is working just fine, ...
4
votes
1
answer
238
views
How to FIX printf resulted SIGSEGV when compiled with openssl?
I am trying to compile my code with openssl library. My code is printf then the program received SIGSEGV signal.
Code of test.c:
#include <winsock2.h>
#include <openssl/ssl.h>
#include <...
0
votes
0
answers
106
views
Do STA threads always need to pump messages?
Some components like DirectWrite or WIC don't do UI, and as the caller I can ensure that I never use them across apartments, thus no marshaling is required. Can I use them on a worker thread without ...
-1
votes
1
answer
191
views
Including Windows.h is producing errors of: 'byte': ambiguous symbol [duplicate]
I'm getting many errors of the following type. Clearly, Microsoft has a definition of byte that clashes with Standard C++'s definition of std::byte (after a using namespace std, that I use in ...
0
votes
2
answers
87
views
Win32 C++: Error in CComPtr Release(): ATL::_NoAddRefReleaseOnCComPtr<T> in "atlcomcli.h" is inaccessible
I'm writing a Win32 C++ function to iterate Portable Devices. After successfully opening and connecting to the device, I need to release it. (There's also a Close() but Microsoft's documentation ...
1
vote
0
answers
79
views
EvtSubscribe causes some events to be missed
I want to write a small program to work with the EvtSubscribe function. However, I encountered a problem. Every time the callback function is called, I print a message to the screen and then call ...
0
votes
0
answers
99
views
Get path of Portable Device file to enable Copy/Paste
In a previous thread I asked about listing real filenames stored on a Portable Device (e.g. an MTP Digital Camera). Per my answer I can now traverse the file system and display real filenames.
Now I ...
0
votes
0
answers
196
views
Monitoring changes to variables programmatically
This is a follow up to my previous question about creating a debugger for C source files in Python. The current issue I am facing is monitoring changes to variables. I want to monitor 8 variables say ...
1
vote
1
answer
67
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....
0
votes
1
answer
127
views
Windows 11 raw input API bad performance compared to Windows 10 [closed]
With my code which is just a regular RAW input example.... WM_INPUT, RIM_TYPEMOUSE... I'm getting on Windows 10 the full 1,000Hz of my mouse and on Windows 11 I'm getting about 128Hz.
How to fix this ...
2
votes
0
answers
96
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
74
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 (...
0
votes
0
answers
150
views
Which window can I passing a `WM_SYSCOMMAND` to carry out system commands?
An application can carry out any system command at any time by passing a WM_SYSCOMMAND message to DefWindowProc.
If I don't have any windows, which window can I post/send WM_SYSCOMMAND to carry out ...
1
vote
1
answer
95
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 ...
0
votes
0
answers
171
views
How to turn off Display on Windows, Without affecting GUI apps running
I am running a GUI app on a Windows device. The main thread for this is the UI thread. I'm adding functionality to turn off the display when the application is not being used for a certain time.
I ...
3
votes
1
answer
96
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&...
0
votes
0
answers
93
views
Shell_NotifyIcon(NIM_MODIFY, NIF_INFO) returns TRUE but no balloon/notification is shown (tray icon)
I'm implementing a tray icon for my game launcher on Windows (C++, Win32 API). The tray icon itself works fine: it appears in the system tray, I can right-click it to show a context menu, and double-...
-1
votes
0
answers
97
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, ...
-4
votes
1
answer
197
views
Display directly on screen. Work on Windows 10 not on Windows 11
A few years ago I wrote a WPF program which displays Google Agenda items (with some transparency) directly on the screen of Windows desktop.
This program works perfectly under Windows 10, by calling ...
0
votes
0
answers
143
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 &...
0
votes
0
answers
67
views
wrong transformes for model loaded with assimp in opengl
Im trying to apply the model's transforms by walking the node heirarchy, but the poses are wrong (im not trying to animate it, just load it in a pose by using the transforms given in the gtlf file)
...
1
vote
1
answer
145
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 ...
-7
votes
1
answer
122
views
Error while trying to get current active window [closed]
I'm trying to get the active process (no admin privileges needed I think) and both hwnd and pID aren't NULL and the issue seems to be at this line:
if (GetModuleBaseNameA(Handle, NULL, processName, ...
0
votes
0
answers
49
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 ...
-4
votes
1
answer
128
views
Is it possible that lParam on WM_MOUSEMOVE contains mouse coordinates outside of the client area on occasion?
I have a WinAPI (Win 10) C++ application that uses a Windows window capturing the WM_MOUSEMOVE event. I noticed that on rare occasions, the mouse coordinates are slightly outside the client area — for ...
-1
votes
1
answer
64
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 ...
2
votes
0
answers
120
views
How to capture when to refresh a ListView displaying a list of files after possibly multiple FindNextChangeNotification events?
I need to figure out the condition when I'm ready to display the final file list in a ListView after a series of FindNextChangeNotification events.
If there are multiple events coming in quick ...
3
votes
1
answer
228
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
199
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 (...
2
votes
0
answers
51
views
How to use ITaskbarList3::SetProgressState and ITaskbarList3::SetProgressValue in Go? [duplicate]
I make a software in Go. Because it made a long process, it displays a progression bar. I show one with a *fyne.widget.ProgressBar, and I would like to add another one directly on the taskbar button ...
3
votes
1
answer
190
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 ...
2
votes
0
answers
229
views
how to execute x64 ABI assembly code on heap from C
I am creating heap allocated memory with execute rights using windows.h VirtualAlloc and VirtualProtect.
void* write_into_executable(uint8_t code[]) {
SYSTEM_INFO info;
GetSystemInfo(&info)...
0
votes
0
answers
96
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
112
views
Printing lpServiceName gotten from EnumServicesStatus only yields 1 character
I am trying to write a small app that needs to list the currently configured services using the Win32 API. Following several examples I found online, no matter what I do, I only get one character ...
0
votes
1
answer
181
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
0
answers
112
views
Win32 api Edit Control doesn't respond to mouse clicks in child window
I'm having an issue with WinAPI Edit controls in a child window - they don't respond to mouse clicks, but work fine when placed in the main window. Other controls like buttons work normally in both ...
0
votes
1
answer
103
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 ...
1
vote
0
answers
155
views
How to make a Windows process resistant to termination (like PPL)?
I'm looking for legitimate methods to make a Windows user‑mode process harder to terminate. PPL would be ideal, but Microsoft is very selective about who can use it. What alternative options or best ...
2
votes
0
answers
170
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 ...
0
votes
0
answers
81
views
is there a windows dll that provides fprintf etc
The current Windows SDK seems to no longer have a DLL that provides a lot of the c runtime. I can find fopen in ucrtbase.dll, but fprintf is nowhere to be found. stdio has inline definitions:
...
2
votes
1
answer
130
views
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
87
views
How to fix single row of unpainted pixels underneath Win32 menu bar with Per-Monitor v2 DPI scaling?
I saw the following problem with my own app, but then I reproduced it with Windows Media Player, so I assume it's a bug in Windows.
The question is, how can I avoid it or work around it in my own app?
...
1
vote
0
answers
63
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 ...
6
votes
0
answers
282
views
Local static variables are not initialized if app is loaded as dll
We have sandbox.exe, app.exe and app.dll. If users want to run the not sandboxed application, they run app.exe. If users want to run the application in the sandbox, they run sandbox.exe that loads app....