2,736 questions with Windows API - Win32 tags

Sort by: Updated
3 answers

Does win32 PostMessage and GetMessage use release acquire fencing?

I've been looking ALL over for this information explicitly, but I can not find anything documented. Does PostMessage and GetMessage internally implement or behave like they implement atomic release acquire fencing? Specifically, does PostMessage release…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
asked 2025-02-12T04:04:12.5433333+00:00
Jim Bean 0 Reputation points
commented 2025-02-14T22:52:59.6166667+00:00
Darran Rowe 1,426 Reputation points
0 answers

CComboBoxEx in dark mode (with Dropdown style) in MFC

I am trying to implement a dark mode for my application, by using DarkMode_Explorer / DarkMode_CFD etc. I have handled OnCtlColor and set the theme using SetWindowTheme. If my CComboBoxEx is a DropList then it renderings properly. But when I set it to…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,856 questions
asked 2025-02-14T18:32:24.68+00:00
ChuckieAJ 201 Reputation points
1 answer

Why does IPsecSaContextSetSpi0 from the WFP API seem to only accept even SPI values?

When creating an IPsec SA using the WFP API, IpsecSaContextSetSpi0 doesn't seem to accept an odd SPI value. Why is this the case? RFC 4303 Section 2.1 talks about valid SPI values for an IPsec SA. It makes no mention of odd values being invalid, and…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
asked 2025-02-13T19:39:45.3633333+00:00
Nathan 0 Reputation points
commented 2025-02-14T18:05:26.2166667+00:00
Nathan 0 Reputation points
1 answer

In C++, are global objects guaranteed to exist throughout the execution of a SetConsoleCtrlHandler() callback function?

In C++, are global objects guaranteed to exist throughout the execution of a SetConsoleCtrlHandler() callback function? I'm wondering what would happen if both regular program execution (and the eventual destruction of global variables) and the…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,856 questions
asked 2025-02-05T01:22:18.9666667+00:00
Geoff Hale 0 Reputation points
commented 2025-02-13T07:05:00.2633333+00:00
Roy Li - MSFT 33,931 Reputation points Microsoft Vendor
1 answer

How to make a RichEdit control resizable in the up and down directions?

// RichEditReSizeable_cpp_win32.cpp : Defines the entry point for the application. // #include "framework.h" #include "RichEditReSizeable_cpp_win32.h" #define MAX_LOADSTRING 100 #ifndef MSFTEDIT_CLASS #define MSFTEDIT_CLASS…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
asked 2025-02-02T01:29:39.93+00:00
Cristoforo Montanari 0 Reputation points
commented 2025-02-13T06:45:16.82+00:00
Roy Li - MSFT 33,931 Reputation points Microsoft Vendor
0 answers

DirectComposition click through in transparent areas

I have an application with DirectComposition and Direct2D that I do have a window bigger than the drawings to handle somethings like shadows underneath the rectangles. The issue that I'm having is in the transparent areas, the click-through is not…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
asked 2025-01-31T22:57:11.4266667+00:00
Vitor Hugo Gomes 0 Reputation points
commented 2025-02-13T06:44:47.4+00:00
Roy Li - MSFT 33,931 Reputation points Microsoft Vendor
0 answers

Why does EnumDisplayMonitors Still Return just Disconnected Monitor

I'm working om win32 Desktop application in CPP and I'm checking what happens if I try to fetch Display info with EnumDisplayMonitors when All displays are disconnected! Surprisingly it is giving display info of previously connected Display. Why is this…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
asked 2025-02-11T06:48:09.9366667+00:00
Harshithraj1871 1,581 Reputation points
edited a comment 2025-02-12T16:27:35.8233333+00:00
Castorix31 86,981 Reputation points
1 answer

Issue with Win32 API Loading of PE Resources Containing Lowercase Letters

Issue description I am creating an abstraction layer over portable executable (PE) resources, and am trying to identify invalid inputs that should be rejected. Through testing I got the impression that certain non-ASCII lower case letters in resource…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
asked 2025-02-06T22:30:46.7466667+00:00
MauriceKayser-8381 0 Reputation points
commented 2025-02-12T03:26:15.26+00:00
Jeanine Zhang-MSFT 10,536 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

CMFCVisualManager memory leak, still there?

I see that there was a post about this in 2017 (4 years ago), but I'm wondering if it was a bug of of the solution was the correct way of handling it. I'm using VS2019. It looks like when you use a control like CMFCEditBrowseCtrl it can cause a memory…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
asked 2021-11-05T17:39:58.913+00:00
Owen Ransen 546 Reputation points
commented 2025-02-11T22:33:25.2066667+00:00
ChuckieAJ 201 Reputation points
1 answer

How to extend execution of background task in WinUI 3 (analog of ExtendedExecutionSession in UWP)?

My application has a background task that performs a cleanup of unnecessary or unused system files selected by the user. However, this task takes more than 30 seconds to complete, which exceeds the standard time limit. Question: Is there any way to…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,105 questions
Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
823 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,296 questions
asked 2025-02-10T11:59:45.8866667+00:00
answered 2025-02-11T18:58:41.5266667+00:00
Jonathan Pereira Castillo 14,230 Reputation points Microsoft Vendor
0 answers

How do I force a python script to run in efficiency mode so the green leaf appears next to its' listing in TaskManager?

Hi all, as the title states, I'm looking to make a python script run in efficiency mode and it has to show the leaf in TaskManager so psutils is out (right?). I'm running cmd as administrator and I've tried using ctypes to throttle the power through…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
asked 2025-02-08T01:30:45.95+00:00
Matt_the_ok 0 Reputation points
commented 2025-02-11T05:48:04.4566667+00:00
Jeanine Zhang-MSFT 10,536 Reputation points Microsoft Vendor
4 answers One of the answers was accepted by the question author.

Unable to set my CStatusBar background colour

I am surprised that I can't do this because the File Explorer in Windows 11 has a dark statusbar. So initially I tried: SetWindowTheme(m_wndStatusBar.GetSafeHWnd(), L"DarkMode_Explorer", nullptr); And it did nothing. I then tried: // Set dark…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,856 questions
asked 2025-02-03T11:30:25.02+00:00
ChuckieAJ 201 Reputation points
edited the question 2025-02-11T02:58:35.7333333+00:00
Roy Li - MSFT 33,931 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

Drawing Check Box and Radio controls on a CDialogEx for Dark Mode (Win32)

If I switch off the theme for my checkbox / radio controls with: SetWindowTheme(hControl, L" ", L" "); I then get the text colours as I would like, but the actual check / radio symbols are drawn differently: If I don't switch off…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,856 questions
asked 2025-02-04T11:35:15.4433333+00:00
ChuckieAJ 201 Reputation points
edited the question 2025-02-11T02:58:15.14+00:00
Roy Li - MSFT 33,931 Reputation points Microsoft Vendor
0 answers

How to apply ROPs (Raster Operation) when drawing with GDI+ and do we need to use ROPs with GDI+?

I am doing drawing image to EMF file using GDI+ however I don't see any function of GDI+ related to ROPs. I understand that GDI+ is designed with object oriented thinking and supports high quality graphics. So do we need ROPs when using GDI+?

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,856 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,746 questions
asked 2025-02-07T02:22:18.55+00:00
lam nguyen 0 Reputation points
commented 2025-02-11T02:18:01.73+00:00
Roy Li - MSFT 33,931 Reputation points Microsoft Vendor
0 answers

IMMDevice Activation (windows-rs)

Hello, I've been trying to activate any IMMDevice, for the moment just trying to access a default audio endpoint to collect data on current audio sessions. I've attempted a few times, and no matter what IMMDevice apparently doesn't have the Activate…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
asked 2025-02-10T07:02:05.72+00:00
eora 0 Reputation points
commented 2025-02-10T13:09:58.2366667+00:00
eora 0 Reputation points
0 answers

write fault error writing device PRN windows 7

write fault error writing device PRN windows 7 MS-DOS oprtaing system

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
asked 2025-02-07T14:53:19.5666667+00:00
JOSE OSCAR VERA R 0 Reputation points
commented 2025-02-10T02:38:06.5133333+00:00
Jeanine Zhang-MSFT 10,536 Reputation points Microsoft Vendor
1 answer

Why SetWindowCompositionAttribute makes text also transparent

When I called SetWindowCompositionAttribute to make the main window blurred, text of controls on it also became transparent and thus hard to read. I want to keep the text pure black without transparency while the main window is blurred and transparent.…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,856 questions
asked 2025-02-03T03:24:51.68+00:00
szx0427 101 Reputation points
commented 2025-02-06T21:20:04.96+00:00
David Lowndes 2,590 Reputation points MVP
2 answers One of the answers was accepted by the question author.

How to get number of Virtual Desktops

Im working on a WinUI3 desktop application in cpp. I want to get the total number of Virtual desktops currently available. I didn't find any reference online for this. Is there any Win32/COM/WinrRT API that returns the total number of Virtual desktops?

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
asked 2025-02-03T06:24:25.3666667+00:00
Harshithraj1871 1,581 Reputation points
answered 2025-02-06T13:39:47.9733333+00:00
Thulani Manini 0 Reputation points
4 answers One of the answers was accepted by the question author.

How to display menu by NotifyIcon without displaying the form in Taskbar

I have a form with a NotifyIcon and a ContextMenuStrip and I want to display the menu by clicking on the notification, but unfortunately it is displayed in the taskbar. Why? I tried setting the ShowInTaskbar property to false, but it didn't work.Tip Only…

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,922 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,780 questions
asked 2024-08-10T19:15:01.1466667+00:00
Mansour_Dalir 2,016 Reputation points
answered 2025-02-06T10:38:05.2+00:00
Stephan Berger 0 Reputation points
0 answers

What are different error cases in Win32 APIs

Hi, I'm working on Win32 desktop application in CPP. I'm trying to find all the error cases where a Win32 API can fail. But the documentation does not give us a clear information when can a particular API fail. It just tells to get the error status with…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,736 questions
asked 2025-02-06T07:59:17.4633333+00:00
Harshithraj1871 1,581 Reputation points
commented 2025-02-06T09:20:55.0366667+00:00
RLWA32 47,206 Reputation points