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…
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 !
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…
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,…
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…
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…
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.…
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…
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?
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…
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…
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;…
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…
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, …
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.…
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…
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…
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…
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…
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…