winapi Questions

2

I need to retrieve the handle of a window selected by the user and then retrieve its handle. This window must be one of those shown when ALT+TAB is pressed. I tried enumerating the windows using En...
Angelicaangelico asked 30/4, 2022 at 15:24

1

I want to get a build version on Windows 10 using WINAPI. Current Window Version: 10.0.19042.685 I tried to get it using WMI queries. select Version, BuildNumber from Win32_OperatingSystem. -> V...
Gunner asked 16/12, 2020 at 0:55

3

Solved

I would like to present meaningful error messages when my program encounters Win32 errors. I call GetLastError, and then FormatMessage. But some of the error messages contain placeholders. For inst...
Wellappointed asked 22/1, 2014 at 11:14

4

Solved

On Windows, you can call SetProcessAffinityMask for a process and SetThreadAffinityMask for a thread. However, Windows only appears to expose GetProcessAffinityMask and not a similar API for indivi...
Drag asked 6/7, 2011 at 19:30

9

Solved

I'm using C and sometimes I have to handle paths like C:\Whatever C:\Whatever\ C:\Whatever\Somefile Is there a way to check if a given path is a directory or a given path is a file?
Brisson asked 28/9, 2008 at 22:42

5

I have a shared network folder \\some.domain.net\Shared that contains multiple shared subfolders with different permissions for different users. I wish to open connections to multiple subfolders fr...
Maricruzmaridel asked 7/1, 2014 at 16:7

4

What is the simplest way to wait for more objects than MAXIMUM_WAIT_OBJECTS? MSDN lists this: Create a thread to wait on MAXIMUM_WAIT_OBJECTS handles, then wait on that thread plus the other han...
Fervent asked 27/2, 2011 at 23:19

6

Solved

I am trying to get another process' command-line parameters (on WinXP 32bit). I do the following: hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ | PROCESS_TERMINATE, FALSE, Proc...
Instantly asked 30/6, 2011 at 6:4

1

Solved

For the sake of description, I provide a minimal reproduction of the following code: #include <bits/stdc++.h> #include <iostream> #include <regex> #include <string> #include...
Bronnie asked 15/8 at 14:33

4

Solved

I'm a beginner and I'm trying to build an open source project for the first time in Windows, but I keep running into file not found errors when building. What I've found so far is that a header fil...
Cape asked 28/6, 2020 at 0:11

0

I've successfully registered an audio codec (x64,x86) for Media Foundation and third-party apps to use. MF can load an MP4 which contains audio compressed with it. However, the default Windows 11 M...
Bleareyed asked 11/8 at 18:22

1

Solved

As described in this question I'm trying to create a custom audio codec and save it with the Sink Writer in a MP4 file. I succeeded with the aid of setting MF_MT_MPEG4_SAMPLE_DESCRIPTION, following...
Occidental asked 9/8 at 18:15

0

I'm trying to encode audio to an MP4 file with a custom compression codec and my IMFTransform works correctly until SinkWriter's Finalize: 0xc00d4a45 : Sink could not create valid output file becau...
Stanstance asked 7/8 at 4:41

3

Solved

There are many questions on this site regarding Unicode and wchar_t. I guess I have grasped the concept, but then found something that proves most (if not all) answers wrong if it is true. On this ...

3

Thanks to a very old post available here https://web.archive.org/web/20140217003950/http://forum.sysinternals.com/topic16893_post83634.html I came across a function that will call WinVerifyTrust on...
Hersch asked 1/7, 2021 at 19:13

2

In my MSI installer custom-action handler (done with C++) I cannot obtain the SE_DEBUG_NAME privilege to be able to open and terminate a process, thus I have to resort to doing it with the taskkill...
Xuthus asked 8/9, 2013 at 10:28

2

Now that Microsoft have reinstated OneDrive in the file system in Windows 10 (and assuming they don't drop it again in 6 months time), I'm looking for how to determine the sync status of an arbitra...
Geometrid asked 23/10, 2017 at 15:5

2

Solved

I'd like to change the presence state in an App automatically to DND when Focus Assist is turned on. So two questions basically: Is it possible to check Focus Assist state through e.g. Windows 10 ...
Standin asked 21/11, 2018 at 7:47

3

I want to create a simple tooltip that will pop when user hovers over a button. To do that I have studied this example from MSDN. Everything works fine when I first time hover over the button, b...
Lamentation asked 20/1, 2014 at 15:56

8

Solved

How can I get the size of the display in centimeters or inches? This code does not always works correctly: HDC hdc = CreateDC(_T("DISPLAY"),dd.DeviceName,NULL,NULL); int width = GetDeviceCaps(hdc...
Foliose asked 23/2, 2009 at 14:7

4

Solved

I've registered a window with RegisterDeviceNotification and can successfully recieve DEV_BROADCAST_DEVICEINTERFACE messages. However, the dbcc_name field in the returned struct is always empty. Th...
Sooth asked 5/2, 2010 at 16:42

6

I have a cmd script that will execute a set of patches, and it's designed to abort if a reboot is required to avoid patching issues. I'd also like to extend the script to abort if a reboot is sched...
Balough asked 27/5, 2011 at 18:21

3

I want the worker threads to send a user-defined message to the UI thread message queue, but I am not sure if I should use WM_USER or WM_APP. The documentation for WM_APP says: WM_APP through 0x...
Affirm asked 15/6, 2015 at 11:0

4

A customer is using our dll which is creating a child process which uses an open source library, which ultimately fails because of a call to LoadLibraryExW(), the last error returned is ERROR_MOD_N...
Trengganu asked 22/5, 2013 at 20:14

2

Solved

I want to extract a path from the following registry key: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSavePidlMRU I didn't find any documentation, but it seems...
Fiscal asked 28/3, 2023 at 0:40

© 2022 - 2024 — McMap. All rights reserved.