Questions tagged [winapi]

The Windows API (formerly called the Win32 API) is the core set of application programming interfaces available for the Microsoft Windows operating systems. This tag is for questions about developing native Windows applications using the Windows API.

The Windows API, informally WinAPI, is Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. It was formerly called the Win32 API; however, the name Windows API more accurately reflects its roots in 16-bit Windows and its support on 64-bit Windows. Almost all Windows programs interact with the Windows API. You can find more help on the Windows API Documentation.

The Windows API (Win32) is primarily focused on the C programming language in that its exposed functions and data structures are described in that language in recent versions of its documentation. However, the API may be used by any programming language compiler or assembler capable of handling the (well defined) low level data structures along with the prescribed calling conventions for calls and callbacks.

42239 questions
10
votes
2 answers

How is SndVol able to change the volume level of a given audio session?

I am writing my own API to perform some of the functionality of the SndVol system utility. I would like part of this API to be the ability to set the volume level of a given audio session. SndVol displays a slider on the "Device" panel that the user…
Joseph Trebbien
  • 309
  • 1
  • 3
  • 8
10
votes
1 answer

Setting transparent background Win32

What I'm trying to do is very simple but there doesn’t seem to be a lot of information on it. Basically I have a normal non-transparent parent window and I want to place a child window (that has its own non-transparent controls) inside that parent…
pullo_van
  • 649
  • 6
  • 19
10
votes
1 answer

C win32 tab control

Alright so first im coding in C using the win32 api, no mfc, no .net, no wxwidgets. I've created a window with the WC_TABCONTROL class, and have added tabs to it, everything works fine except... I need to have content in each tab, I got the…
Josh
  • 6,046
  • 11
  • 52
  • 83
10
votes
1 answer

Win32 User Impersonation Curiosity

I have found some sample code on codeproject that allows for user impersonation. This code works by importing the following unmanaged Win32 API functions: [DllImport("advapi32.dll", SetLastError = true)] private static extern int LogonUser( …
Sean Hunter
  • 1,041
  • 8
  • 19
10
votes
3 answers

Detect external display being connected or removed under Windows 7

Is there some event or notification I can receive or hook each time an external LCD monitor is plugged in or unplugged from a laptop running Windows 7? The laptop detects this and switches my display to the external screen and back with certain…
hippietrail
  • 15,848
  • 18
  • 99
  • 158
10
votes
2 answers

How do I redirect calls to ole32.dll to my own proxy DLL?

I'm trying to detect all calls to CoCreateInstance in some process I'm starting (ideally, I'm able to detect calls in child processes as well). To achieve this, using Microsoft Visual Studio 2008 on Windows 7, I create a proxy DLL which forwards all…
Frerich Raabe
  • 90,689
  • 19
  • 115
  • 207
10
votes
2 answers

Get text from popup window

I'm trying to read the text from a popup window. The title is always the same. I've managed to identify the hwnd and get the title with the code below, but I can't figure out how to read the contents. import time import win32gui,…
Jesse Aldridge
  • 7,991
  • 9
  • 48
  • 75
10
votes
4 answers

How do I ask Windows for the size of system tray icons?

I noticed that my app sends icons to the Windows tray with a size of 16x16 pixels--and my Vista PC I've got a doublewide taskbar that appears to show icons at 18x18. The resizing artifacts on my app's icon look awful. How can I ask Windows what…
keelo
  • 211
  • 1
  • 2
  • 6
10
votes
1 answer

Retrieve state of Windows 10 Power mode slider

Is there any API to retrieve a state of Windows 10 Power mode slider? I was looking at Windows.System.Power namespace. But PowerManager class seem to provide only an immediate state of the power system, but not user preferences set by the…
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
10
votes
3 answers

How do I handle Python unicode strings with null-bytes the 'right' way?

Question It seems that PyWin32 is comfortable with giving null-terminated unicode strings as return values. I would like to deal with these strings the 'right' way. Let's say I'm getting a string like: u'C:\\Users\\Guest\\MyFile.asy\x00\x00sy'. This…
Steven T. Snyder
  • 5,847
  • 4
  • 27
  • 58
10
votes
2 answers

Does WPF support reading/writing WMF/EMF files natively?

Can Windows Presentation Foundation read/write WMF/EMF files without having to use WinForms Interop or Win32. If it does not, what is the reason?
user62572
  • 1,388
  • 2
  • 15
  • 24
10
votes
2 answers

How to convert from Virtual Key codes to System.Windows.Forms.Keys

If I intercept a key press using win32 calls, I now have a key code. Is there a way to convert that to a System.Windows.Forms.Keys value?
Jeremy
  • 44,950
  • 68
  • 206
  • 332
10
votes
1 answer

Set system cursor size

Is it possible to set the system cursor size to over 32px by 32px? Currently I am using this code to set the cursors. #define OEMRESOURCE #include #include #include int main() { //Load cursor const HCURSOR…
Dan
  • 7,286
  • 6
  • 49
  • 114
10
votes
2 answers

How can I log low-level OS file transactions in C#?

Since File/Process Monitor falls short in terms of filtering and unnecessary duplication when logging, I want to recreate what that program does and log all Windows file operations live in realtime. I want to record various attributes such as the…
Dan W
  • 3,520
  • 7
  • 42
  • 69
10
votes
2 answers

How to change the Console Ouptut Mode using SetConsoleMode in powershell?

I am trying to change the Windows Console Mode for output (CONOUT$) using the Windows API and SetConsoleMode calls. So I modified a PowerShell script, based on ConinMode.ps1 (and which works for input), to do this. Reading works fine with both the…
not2qubit
  • 14,531
  • 8
  • 95
  • 135