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
1 answer

How can I convert a Unicode path to a c string?

How can i convert from a Unicode path name (LPWSTR) to the ASCII equivalent? The library that gets called understands only c strings. Edit: Okay, I took the GetShortPathName and the WideCharToMultiByte suggestions and created that piece of code, i…
metafex
  • 179
  • 2
  • 11
10
votes
1 answer

"Correct" Dialog / UI font on Windows

When creating a control (e.g. an edit control) on the fly using CreateWindow, it usually starts out with an ugly (boldish sans serif) font. Usually I wok around that by grabbing the parent dialog's font, and setting it to the control - I can't even…
peterchen
  • 40,917
  • 20
  • 104
  • 186
10
votes
1 answer

What is the native equivalent of PrincipalContext.ValidateCredentials?

What is the native way to validate a set of user domain credentials (username, password, domain) against that domain? In other words, i am looking for the native equivalent of: Boolean ValidateCredentials(String username, String password, String…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
10
votes
1 answer

Why does Windows have no DeleteConditionVariable() function to go together with InitializeConditionVariable()?

I'm trying out Windows support for Condition Variables today (as provided by Microsoft for Windows Vista and later). To initialize a condition variable, I call InitializeConditionVariable(), which is straightforward enough, but I don't see any way…
Jeremy Friesner
  • 70,199
  • 15
  • 131
  • 234
10
votes
3 answers

Does 64-bit Anaconda on win32 uses 32-bit or 64-bit?

I guess the answer is 32-bit, but I'm a bit confused on why I can even install Anaconda 64 in a win32. I used to work on Anaconda 64-bit but I just realized that my system is win32 and this generated some exceptions from time to time. See for…
alberto
  • 2,625
  • 4
  • 29
  • 48
10
votes
1 answer

Programmatically check whether a drive letter is a shared/network drive

Is there a way to check whether a drive letter stands for a shared drive/network drive or a local disc in python? I guess there is some windows api function that gives me that info, but I can't find it. Perhaps there is even a method already…
Philip Daubmeier
  • 14,584
  • 5
  • 41
  • 77
10
votes
2 answers

Creating a Transparent Bitmap with GDI?

I want to implement a layering system in my application and was thinking of creating a bunch of transparent bitmaps, adding content to them then blitting them on top of each other, how can this be done without setting each pixel to (0,0,0,0). I'm…
jmasterx
  • 52,639
  • 96
  • 311
  • 557
10
votes
3 answers

How to get the OS version in Win8.1 as GetVersion/GetVersionEx are deprecated?

I have scenarios where i want to specifically know the OS major/minor version and build number etc. From windows 8.1 onwards GetVersion and GetVersionEx have been deprecated, stating: [GetVersion/GetVersionEx may be altered or unavailable for…
10
votes
1 answer

Calling Win32 functions returning strings with alien in Lua

I'm trying to use alien to call Win32 functions. I tried this code, but it crashes and I don't understand why. require( "alien" ) local f = alien.Kernel32.ExpandEnvironmentStringsA f:types( "int", "string", "pointer", "int" ) local buffer =…
Jazz
  • 5,747
  • 5
  • 43
  • 55
10
votes
3 answers

Get current laptop lid state

I'm writing a C# app (specifically for laptops) and I want to be aware of the state of the lid, i.e. when is it open and when is it closed. I've already used pInvoke along with Microsoft's RegisterPowerSettingNotification function with the help of…
ZivS
  • 2,094
  • 2
  • 27
  • 48
10
votes
3 answers

Windows Ribbon Framework: How to change font face and size?

How do you change the font face and font size used by the Windows Ribbon Framwork's UIRibbon? The font used by the ribbon does not match the font the user has chosen as their Windows preferences - which is the preference my application uses. This…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
10
votes
3 answers

Win32: Is there a replacement GDI32.dll that uses hardware acceleration?

Has anyone out there created a version of GDI32.dll that takes advantage of hardware acceleration available on the machine? gdiplus.dll? Starting with Windows Vista, GDI is no longer hardware accelerated. (GDI+ was never hardware accelerated).…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
10
votes
1 answer

FindFirstFile(Ex) wildcard characters

The Windows API FindFirstFile() and FindFirstFileEx() accept wildcard characters for the path to search, "for example, an asterisk (*) or a question mark (?)". No where can I actually find an explanation of which others (if any) characters it…
KTC
  • 8,967
  • 5
  • 33
  • 38
10
votes
1 answer

Delphi: code after Application.Run does not execute if user reboots/shuts down

I have some code placed after "Application.Run;" which is normally run when the app shuts down. This point is never reached however when the user reboots or shuts Windows down. Can this be solved without capturing WM_ENDSESSION? (and not involving…
hikari
  • 3,393
  • 1
  • 33
  • 72
10
votes
6 answers

No module named 'win32api'

In Python 3.4 from Anaconda, I created a program and it is giving me and import error each time I run it. Using Spyder. ImportError: No module named 'win32api' I already have the pywin32 installed. And I can see the win32api.pyd under…