2,425 questions with Windows API - Win32 tags

Sort by: Updated
1 answer

Getting logs for WinHTTP system error.

Hi, All! Recently, during development of an application, I've started facing troublesome issue: calls to WinHTTP subsystem (specifically, WinHttpReadData/WinHttpQueryDataAvailable APIs) present me with 12004 ERROR_WINHTTP_INTERNAL_ERROR outcome. Doesn't…

Windows
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.
4,766 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,425 questions
asked 2024-04-11T14:03:06.43+00:00
Ivanov 0 Reputation points
answered 2024-04-12T02:40:13.9933333+00:00
Xiaopo Yang - MSFT 11,496 Reputation points Microsoft Vendor
3 answers One of the answers was accepted by the question author.

How to cancel the "print preview" option in the printer preferences by coding?

I want to cancel the "print preview" option in the printer preferences by coding, maybe can use c++ windows api or C#. Then how to do it ? Thank you !

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,425 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.
10,272 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,536 questions
asked 2024-04-10T04:00:43.3266667+00:00
szmm 25 Reputation points
commented 2024-04-11T06:41:00.6566667+00:00
Castorix31 81,736 Reputation points
1 answer One of the answers was accepted by the question author.

Repaint issue with DWM, WM_NCCALSIZE WVR_VALIDRECTS, and Scroll Bars

The following program is based on code from Raymond Chen's The Old New Thing blog post from September 15th, 2003 (https://devblogs.microsoft.com/oldnewthing/20030915-00/?p=42493). I added a menu and scroll bars to test/verify that non-client parts of the…

Windows
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.
4,766 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,425 questions
asked 2024-04-05T19:00:00.12+00:00
Jeff Stoner 20 Reputation points
commented 2024-04-10T08:33:11.9466667+00:00
Tong Xu - MSFT 1,361 Reputation points Microsoft Vendor
3 answers One of the answers was accepted by the question author.

How to Enable/Disable audio devices

Hi, I want to enable/disable audio devices listed in sound control panel (mmsys.cpl) but either through programmatically or through any power shell commands/scripts or windows internal utilities(pnputil, devcon). I tried using WMI APIs, Core Audio APIs,…

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,653 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,425 questions
asked 2024-03-14T09:13:27.3433333+00:00
Ramashankar 25 Reputation points
commented 2024-04-10T05:12:26.8833333+00:00
Ramashankar 25 Reputation points
1 answer

How to remove thin black border while printing bitmap in Win32 app

Hello, I'm working on C++/WinRT application, and trying to print bitmap using printer. But I'm getting thin black border on the printed page. I'm doing similar to below code snippet. // Printer HDC HDC hdc_printer = CreateDCW (NULL, L"My…

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.
726 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,425 questions
asked 2024-04-09T12:49:16.9433333+00:00
Shyam Butani 20 Reputation points
answered 2024-04-10T02:03:21.4366667+00:00
Xiaopo Yang - MSFT 11,496 Reputation points Microsoft Vendor
1 answer

Rendering 3D fluent emojis with IDWriteTextLayout

Hi Castorix31, I tested your example **Direct2D_CScrollingText **in Win11 and also this example (https://github.com/microsoft/Windows-universal-samples/blob/main/Samples/DWriteColorGlyph). Your example uses this code to render…

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,425 questions
asked 2024-04-05T10:10:16.4266667+00:00
Pedro Gil 5 Reputation points
commented 2024-04-09T06:04:33.02+00:00
Jeanine Zhang-MSFT 9,181 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

Exception: "Element Not Found" while calling StartDoc() in Visual Studio 2022 debugger

I am attempting to print from a Desktop application using the following APIs: StartDoc (...) StartPage (...) TextOut (...) When I run my application using Visual Studio 2022 Debugger, StartDoc() throws an exception as shown in the image below.…

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,425 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
942 questions
Windows Server Printing
Windows Server Printing
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Printing: Printer centralized deployment and management, scan and fax resources management, and document services
641 questions
asked 2024-03-28T09:23:17.2666667+00:00
Shyam Butani 20 Reputation points
accepted 2024-04-02T05:57:33.0333333+00:00
Shyam Butani 20 Reputation points
1 answer

Some doubt in Exception Handling

I am trying to learn about the exception handling provided by Windows operating system. Now there are two different types of exception handling: One we probably know where we know that this call could fail -- we could use Structured Exception…

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,425 questions
asked 2024-03-29T11:51:46.94+00:00
Rohan Pande 290 Reputation points
edited the question 2024-04-02T02:10:47.41+00:00
Jack J Jun 24,296 Reputation points Microsoft Vendor
5 answers

How to make the radio button background transparent

I created a simple win32 program, first create a window, its background is black. Then create its child window, but the background color of the child window is gray, not transparent. How to deal with making it 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,425 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,536 questions
asked 2021-11-18T07:56:18+00:00
Ni_Yin 11 Reputation points
commented 2024-04-01T08:47:04.83+00:00
KOZ6.0 4,890 Reputation points
2 answers One of the answers was accepted by the question author.

Does This HTREEITEM Belong To This TreeView Control?

Hello Folks: Developing on Win 10 Pro, Visual Studio 2022 Version 17.9.4 ( updated yesterday), C++, Win32 no MFC. TL,DR: Is there a way to see if an HTREEITEM belongs to a TreeView? My treeview's customdraw notification is being passed an HTREEITEM…

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,620 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,425 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,536 questions
asked 2024-03-30T05:17:42.5433333+00:00
a_unique_name 381 Reputation points
accepted 2024-03-31T23:19:00.6933333+00:00
a_unique_name 381 Reputation points
1 answer One of the answers was accepted by the question author.

Where to find missing referenced items in 'How to Play Media Files with Media Foundation'

I am trying to cut and paste the code for CPlayer in the 'How to Play Media Files with Media Foundation' tutorial. I used code from the following browser search results: 'player.h - Win32 apps' & 'player.cpp - Win32 apps' . I cannot find 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,425 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,536 questions
asked 2024-03-28T17:51:59.62+00:00
Thomas Littlepage 20 Reputation points
commented 2024-03-31T17:21:22.63+00:00
Thomas Littlepage 20 Reputation points
1 answer

How to extract an icon from executable and save it on disk properly? Any lightweight library?

Is there something in c++? (Windows API/ WinRT) I've tried some solutions online and none of them work. I didn't find anything useful on Github either. I want to display the icons regardless of whether the exe is still there, so I want to save the icon;…

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.
726 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,425 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,536 questions
asked 2024-01-20T12:01:43.6833333+00:00
youki 996 Reputation points
edited a comment 2024-03-29T15:15:29.7633333+00:00
youki 996 Reputation points
0 answers

What does the WTS_E_EXTRACTIONPENDING HRESULT returned by IThumbnailCache::GetThumbnail mean?

Attemting to call IThumbnailCache::GetThumbnail on an dehydrated placeholder (i.e. from OneDrive or other sync programs that utilize Cloud Filter) which its thumbnail doesn't exist in the Windows Thumbnail Cache results in…

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,425 questions
asked 2024-03-28T06:12:53.6233333+00:00
jl-syno 0 Reputation points
commented 2024-03-29T06:30:22.5966667+00:00
Xiaopo Yang - MSFT 11,496 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

BitBlt is too slow

Is there an analogue of copying a rectangle from the screen that works faster? Or how do I optimize it? _ = BitBlt( h_dc, 0, 0, config.rect.size.x, config.rect.size.y, h_src, config.rect.pos.x, …

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,425 questions
asked 2024-03-27T15:50:07.58+00:00
Артём Лосев 20 Reputation points
accepted 2024-03-28T16:45:28.8766667+00:00
Артём Лосев 20 Reputation points
0 answers

Logging in to different domain using LogonUser API

Calling LogonUser before a Winforms application starts running. So if the credentials are correct the application starts and if they are wrong the application wont start. So this working fine with the user credentials for the domain my system belongs 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,425 questions
asked 2024-03-20T09:37:38.5933333+00:00
Bhattacharjee, Aditya 0 Reputation points
edited a comment 2024-03-27T05:37:40.2133333+00:00
Xiaopo Yang - MSFT 11,496 Reputation points Microsoft Vendor
2 answers

I would like to use the Windows Sensor API to acquire gyro sensor data so that the viewpoint of the camera can be moved.

I would like to use the Windows Sensor API to acquire gyro sensor data so that the viewpoint of the camera can be moved. I'm trying to do the above with Unity, is it possible? If possible, please tell me how to do it. Also, if there is another…

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,653 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,425 questions
asked 2021-07-18T06:23:39.313+00:00
aa12234aa 1 Reputation point
answered 2024-03-26T10:45:48.14+00:00
HF Jensen 0 Reputation points
0 answers

How the media bitrate information is obtained in file property

The following code to query the video encoding bitrate of a media file (mp4) yields a number that deviates significantly from the value obtained by viewing it with other tools like mediainfo/ffprobe: #include <windows.h> #include…

Windows
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.
4,766 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,425 questions
asked 2024-03-11T03:06:41.4566667+00:00
domo 0 Reputation points
commented 2024-03-26T06:22:32.0366667+00:00
Xiaopo Yang - MSFT 11,496 Reputation points Microsoft Vendor
1 answer

Journal Playback Hooks

Good morning, I have a question about the Journal Playback Hooks (https://learn.microsoft.com/en-us/windows/win32/winmsg/journalplaybackproc). On this page I find the quote: "are unsupported starting in Windows 11 and will be removed in a future…

Windows
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.
4,766 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,425 questions
asked 2024-03-01T13:38:46.2566667+00:00
DasElias 0 Reputation points
commented 2024-03-26T02:34:18.9066667+00:00
Xiaopo Yang - MSFT 11,496 Reputation points Microsoft Vendor
2 answers

WaitForInputIdle

Hi everyone, I'm working on a Windows C++ application where I need to wait for a multi-threaded process to finish processing its initial. I'm aware that WaitForInputIdle from winuser.h only waits for one thread in the target process to be idle, which…

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,425 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,536 questions
asked 2024-03-22T11:18:49.5166667+00:00
2ourc3 0 Reputation points
commented 2024-03-25T09:37:36.25+00:00
Jeanine Zhang-MSFT 9,181 Reputation points Microsoft Vendor
1 answer

WFP Define Filter Conditions

Can some on help me whit this. Well i try to Define Filter Conditions. Well, I'm not good to windows but i need to my goal is to access raw data from the network card.. IPv4 and IPv6 in socket IPv6 is restrict by windows so i can't work whit…

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,425 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,536 questions
asked 2024-03-18T22:20:58.6633333+00:00
Hello Junior 0 Reputation points
commented 2024-03-25T05:59:22.0166667+00:00
Jeanine Zhang-MSFT 9,181 Reputation points Microsoft Vendor