2,734 questions with Windows API - Win32 tags

Sort by: Updated
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,734 questions
asked 2025-02-02T01:29:39.93+00:00
Cristoforo Montanari 0 Reputation points
edited a comment 2025-02-21T06:18:05.01+00:00
Roy Li - MSFT 34,091 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,734 questions
asked 2025-01-31T22:57:11.4266667+00:00
Vitor Hugo Gomes 0 Reputation points
edited a comment 2025-02-21T06:17:48.8033333+00:00
Roy Li - MSFT 34,091 Reputation points Microsoft Vendor
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,734 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,861 questions
asked 2025-02-05T01:22:18.9666667+00:00
Geoff Hale 0 Reputation points
edited a comment 2025-02-21T06:17:15.0633333+00:00
Roy Li - MSFT 34,091 Reputation points Microsoft Vendor
2 answers

Failed to disable Peek Preview in Windows 11

Hi, everyone! To implement some custom fetatures I need to disable peek preview for the window. So I call DwmSetWindowAttribute with DWMWA_DISALLOW_PEEK set to True to disallow peek preview. It works well in Win7 and Win10 but in my newest…

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,734 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,807 questions
asked 2022-07-21T02:13:19.12+00:00
trance 11 Reputation points
commented 2025-02-21T04:41:53.3766667+00:00
Hasaranga 0 Reputation points
4 answers

IUpdate2::CopyToCache method Windows 11

It seems that this method no longer works on Windows 11: https://learn.microsoft.com/en-us/windows/win32/api/wuapi/nf-wuapi-iupdate2-copytocache Interface not registered Do you have an idea?

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,734 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,807 questions
asked 2024-12-12T12:09:00.7133333+00:00
Simon Fonteneau 55 Reputation points
answered 2025-02-20T08:05:46.9866667+00:00
Friese, Manuela 0 Reputation points
2 answers One of the answers was accepted by the question author.

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 and RFC 4302 Section 2.4 talk about valid SPI values for an IPsec SA. It makes no mention of odd…

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,734 questions
asked 2025-02-13T19:39:45.3633333+00:00
Nathan 20 Reputation points
edited a comment 2025-02-19T19:03:18.7333333+00:00
Nathan 20 Reputation points
1 answer

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,734 questions
asked 2025-02-08T01:30:45.95+00:00
Matt_the_ok 0 Reputation points
answered 2025-02-19T18:09:15.4566667+00:00
Matt_the_ok 0 Reputation points
2 answers One of the answers was accepted by the question author.

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,734 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,861 questions
asked 2025-02-14T18:32:24.68+00:00
ChuckieAJ 241 Reputation points
accepted 2025-02-19T14:36:30.57+00:00
ChuckieAJ 241 Reputation points
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,734 questions
asked 2025-02-11T06:48:09.9366667+00:00
Harshithraj1871 1,581 Reputation points
commented 2025-02-19T06:56:05.5366667+00:00
Harshithraj1871 1,581 Reputation points
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,734 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,861 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,807 questions
asked 2025-02-07T02:22:18.55+00:00
lam nguyen 0 Reputation points
commented 2025-02-19T06:20:05.1233333+00:00
Roy Li - MSFT 34,091 Reputation points Microsoft Vendor
2 answers One of the answers was accepted by the question author.

ndfapi.dll's NdfRunDllDiagnoseWithAnswerFile and NetworkDiagnosticsSharing API call Description

Good Day! I have been searching online regarding the API calls NdfRunDllDiagnoseWithAnswerFile and NetworkDiagnosticsSharing but the results were being pointed to **NdfDiagnoseIncident function (ndfapi.h) **which i am not sure if this is the updated…

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,730 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,734 questions
Windows Network
Windows Network
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Network: A group of devices that communicate either wirelessly or via a physical connection.
831 questions
asked 2025-02-17T15:56:41.9733333+00:00
Cre Ate 20 Reputation points
commented 2025-02-18T13:19:24.6666667+00:00
Cre Ate 20 Reputation points
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,734 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
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,734 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,626 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,734 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 241 Reputation points
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,734 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,861 questions
asked 2025-02-03T11:30:25.02+00:00
ChuckieAJ 241 Reputation points
edited the question 2025-02-11T02:58:35.7333333+00:00
Roy Li - MSFT 34,091 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,734 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,861 questions
asked 2025-02-04T11:35:15.4433333+00:00
ChuckieAJ 241 Reputation points
edited the question 2025-02-11T02:58:15.14+00:00
Roy Li - MSFT 34,091 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,734 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
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,734 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,861 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,734 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,923 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,734 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,782 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