2,519 questions with Windows API - Win32 tags

Sort by: Updated
2 answers

[win10] The title bar still appears even though I have handled WM_NCCALCSIZE

I am attempting to create an application with a custom-drawn title bar, similar to Chrome. Therefore, I need to handle WM_NCCALCSIZE. However, I found that the title bar still appears under certain conditions: let dpi = unsafe { GetDpiForWindow(handle)…

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,187 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,519 questions
asked 2024-07-12T07:44:21.48+00:00
峻魁 张 20 Reputation points
answered 2024-07-17T05:54:04.1466667+00:00
Jeanine Zhang-MSFT 9,431 Reputation points Microsoft Vendor
1 answer

Not able to reach even wWinMain in Windows Server Core Machine 2022

Hi, I am trying to run a C++ Win32 application with XAML Island as UI Library. I am able to run on normal desktop machines such as Windows 11 but when I try to run the same application on Windows Server core machine it failed and didn't even reach our…

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,519 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,634 questions
asked 2024-07-16T10:52:59.8866667+00:00
Shyam Butani 190 Reputation points
edited an answer 2024-07-16T14:38:43.69+00:00
Darran Rowe 566 Reputation points
0 answers

Apply changes made in registry regarding window metrics

I want to set specific values for: Computer\HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics Is there a way to apply registry changes without the need of logging off and on? Perhaps some service needs restarting? I've tried to restart explorer.exe…

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,519 questions
asked 2024-04-23T13:05:40.3633333+00:00
Lukas 0 Reputation points
commented 2024-07-16T13:40:15.0866667+00:00
Bikram Sandhu 5 Reputation points
1 answer One of the answers was accepted by the question author.

SetNamedSecurityInfo() returns : Error: (1307)

Hi, I'm curently trying to buid a chown.exe using Win32API SetNamedSecurityInfo() to change file ownership. When running this .exe in elevated mode or if the new owner is the same as the current owner, it works file. But when targetting an other user as…

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,519 questions
asked 2024-07-03T08:25:49.16+00:00
Jean-Pierre Ribeauville 60 Reputation points
accepted 2024-07-15T09:28:07.1566667+00:00
Jean-Pierre Ribeauville 60 Reputation points
1 answer One of the answers was accepted by the question author.

Help needed to retrieve the LogonType using Win32LogonSession class in C++

Hello, I am trying to use Win32LogonSession to retrieve the LogonType in my C++ code. However, I'm encountering several errors and I am unsure if I'm writing the correct code. Can anyone provide assistance? 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,519 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,634 questions
asked 2024-07-12T06:19:11.6866667+00:00
Rohan Pande 420 Reputation points
commented 2024-07-15T09:18:10.4633333+00:00
Rohan Pande 420 Reputation points
2 answers

shut off monitor will flash display,by use SendMessage command.

SendMessage function Win32 API Windows and Messages Similar problems monitor-will-flash-before-shut-off-or-monitor-will.html screen recording onedrive using System; using System.Runtime.InteropServices; namespace ConsoleApp { …

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,519 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,641 questions
asked 2022-06-20T07:16:44.397+00:00
microsoft 1 Reputation point
edited a comment 2024-07-11T15:38:09.1233333+00:00
Alan T 0 Reputation points
1 answer One of the answers was accepted by the question author.

Changing Taskbar (Shell_TrayWnd) Color to Transparent

0 I found a way to change color to fully transparent, by researching structure of DesktopWindowXamlSource of Taskbar (Shell_TrayWnd). I'm curious is it possible to somehow change BackgroundFill in DesktopWindowXamlSource to Windows.UI.Xaml.Media.Brush…

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.
5,094 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,519 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,641 questions
asked 2024-07-09T09:51:43.66+00:00
Jacob Mordon 65 Reputation points
accepted 2024-07-11T11:32:45.5+00:00
Jacob Mordon 65 Reputation points
2 answers One of the answers was accepted by the question author.

How can I know if started by WER, the OS is running in a GUI environment?

Hi, I am building a Win32 application using WinUI2 as GUI. Before displaying a window to the user, we are checking our Desktop capabilities from the Operating System has shown below. bool CheckDesktop () noexcept { HDESK thread_desktop; …

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,519 questions
asked 2024-07-04T07:48:35.1333333+00:00
Rohan Pande 420 Reputation points
accepted 2024-07-11T01:52:49.19+00:00
Rohan Pande 420 Reputation points
1 answer

Minimize App when all you have is AppUserModelId

I get all the apps from AppsFolder: `ShellObject appsFolder = (ShellObject)KnownFolderHelper.FromKnownFolderId(AppEntry.AppsKnownFolderId);` ```which I enumerate and display each app in a list (name and icon from the shell object). The user selects an…

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,519 questions
asked 2024-07-05T21:35:14.5066667+00:00
ScottSharp 0 Reputation points
edited the question 2024-07-10T06:19:06.3833333+00:00
Roy Li - MSFT 32,731 Reputation points Microsoft Vendor
1 answer

Where to find correct version information using in C on Windows

I'm looking to programmatically find the correct version information for Windows using the "C" programming language. I've searched online with no luck. Does anyone know where I can find resources to help me achieve this goal?

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.
5,094 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,519 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,634 questions
asked 2024-06-22T22:13:39.2533333+00:00
Thad T 26 Reputation points
commented 2024-07-09T13:50:28.56+00:00
RLWA32 43,146 Reputation points
1 answer

Program crash when creating MagnificationAPI window in Windows 11

While executing the following statement, programs on the target computer crash without warning and without a runtime error pop-up box. hwndMag = CreateWindow(WC_MAGNIFIER, TEXT("IdtScreenMagnifierMag"), WS_CHILD | MS_CLIPAROUNDCURSOR |…

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,519 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,634 questions
asked 2024-07-05T04:07:40.6+00:00
RL Chen 230 Reputation points
answered 2024-07-08T03:15:39.3333333+00:00
RL Chen 230 Reputation points
2 answers

How Can I track the Last DPI which is sent by WM_DPICHANGED in WPF?

I want to scale my WPF application according to available screen DPI. I know there Per Monitor DPI aware available but that are completely different what I want to achieve. I want to disable scaling for my WPF application even if windows has some scale…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,710 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,519 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,641 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,634 questions
asked 2024-06-23T21:10:17.6933333+00:00
MERUN KUMAR MAITY 531 Reputation points
commented 2024-07-08T02:00:19.47+00:00
Hongrui Yu-MSFT 1,025 Reputation points Microsoft Vendor
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,519 questions
asked 2024-03-29T11:51:46.94+00:00
Rohan Pande 420 Reputation points
commented 2024-07-06T22:18:47.6266667+00:00
Darran Rowe 566 Reputation points
2 answers One of the answers was accepted by the question author.

How to record the mouse drag event and simulate it ?

I'm a newbie of Rust, and try to write a windows desktop app. I read the documents then I found SetWindowsHookExA(WH_MOUSE_LL,...) can record the mouse event, but I only record the mouse down, move and up. no drag event produced. I try to simulate them…

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,519 questions
asked 2024-07-04T15:41:08.25+00:00
泽东 钱 20 Reputation points
commented 2024-07-06T08:40:41.4766667+00:00
泽东 钱 20 Reputation points
1 answer One of the answers was accepted by the question author.

How to get the text from the label by the handle with specific coordinates on any part of the desktop screen

I want to extract the text inside the label by giving certain coordinates from the screen, if the type of the coordinates is from the label, then extract the part of the obtained part.

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,872 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,519 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,666 questions
asked 2024-06-06T07:48:09.8966667+00:00
Mansour_Dalir 1,716 Reputation points
accepted 2024-07-06T04:04:39.1133333+00:00
Mansour_Dalir 1,716 Reputation points
2 answers One of the answers was accepted by the question author.

Launching Windows Applications using Voice Assistants

Is there an alternative to Cortana on Windows that I can use to launch my applications using a voice command like "Open Abc App"? I have come across an application named "Voice Access," but I can't find any documentation on how to use…

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.
750 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,519 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,634 questions
asked 2024-04-24T06:38:51.75+00:00
Rohan Pande 420 Reputation points
edited an answer 2024-07-04T14:43:43.1966667+00:00
Caozhi Li 0 Reputation points Student Ambassador
0 answers

CreateFile() takes a long time (~5 seconds) to fail on COM ports already exclusively locked/opened by another program

Good day, I'm writing a program ( well, have written, and it's working fine ), and part of the startup is to scan the available COM ports to see which one our device is connected to. It all works fine except that on some devices there can be a…

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,519 questions
asked 2024-07-03T13:10:07.55+00:00
Paul Daniels 5 Reputation points
commented 2024-07-04T11:07:12.0233333+00:00
Paul Daniels 5 Reputation points
1 answer

Does URLDownloadToFile still work on a Windows 11 computer without Internet Explorer on it?

I have written a windows console program that uses the win32 URLDownloadToFile function. This then ran for a long time without any problems on a windows 11 machine. However, 2 months ago this PC was reinstalled and since then the program no longer works…

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,519 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,634 questions
asked 2024-07-04T07:03:02.5766667+00:00
valentin anderegg 0 Reputation points
answered 2024-07-04T08:38:26.8066667+00:00
Jeanine Zhang-MSFT 9,431 Reputation points Microsoft Vendor
3 answers

How to change drive letters (was: Can I use Visual C to program system tools)

I need to be able to write a tool that can change the drive letter in my application. When I insert a usb hard drive the program recognises the volume it should be with the drive letter in [] brackets in the label. When I insert the usb drive sometimes…

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,519 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,977 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,325 questions
asked 2024-07-01T22:19:00.44+00:00
Terry Foster 0 Reputation points
commented 2024-07-03T11:24:28.1+00:00
Terry Foster 0 Reputation points
1 answer

Why max_align_t not defined in stddef.h in Windows SDK 10.0.20348.0 C17 (/std:c17)

#include <stdio.h> #include <stddef.h> int main(void) { printf("%d\n", _Alignof(max_align_t)); ```} This C code, Error: E0020, C2061, in Visual Studio Community 2019 16.11.17, Windows SDK 10.0.20348.0, C17 or C11 The same error…

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,519 questions
asked 2024-06-24T13:33:18.9533333+00:00
zhimin yuan 0 Reputation points
commented 2024-07-03T00:50:14.99+00:00
zhimin yuan 0 Reputation points