Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Functionality unique to Win32 API?

Tags:

winapi

It seems that the Win32 API (the C API for native Windows applications) is becoming more and more overtaken by more modern frameworks and toolkits, including Microsoft's own WPF and Qt.

If the programming language is not a concern -- if you're not set on a managed environment, or a functional programming style, etc. -- does Win32 API bring anything to the table? Is there any functionality that one can implement with Win32 API that's not available with WPF or other frameworks?

I know it's possible to mix Win32 code into WPF/managed software, so one doesn't have to choose one or the other. But what are some examples of needing to break out Win32 API when developing a program in a higher-level language/framework?

like image 503
Philip Avatar asked Oct 03 '13 05:10

Philip


People also ask

What is Win32 API functions?

The Windows API (application programming interface) allows user-written programs to interact with Windows, for example to display things on screen and get input from mouse and keyboard. All Windows programs except console programs must interact with the Windows API regardless of the language.

Is Win32 API still used?

Over the years, Microsoft has adopted it internally for the development of Office 365, Skype, and other applications. That was 16 years ago. However, Win32 still is the predominant legacy programming API. More apps out in the wild use it than anything else.

On which operating system could you use the Win32 API?

Win32 APIs exist for many features and technologies in Windows 10, including core user interface and windowing APIs, audio and graphics, and networking.

What are Win32 API calls?

Remarks# WinAPI (also known as Win32; officially called the Microsoft Windows API) is an application programming interface written in C by Microsoft to allow access to Windows features. The main components of the WinAPI are: WinBase: The kernel functions, CreateFile, CreateProcess, etc.


3 Answers

Another more specific example is "windows hooks".

I needed to hook some socket programs at some point and the only possible way was windows api.

To elaborate i wanted to receive all communication received on some listening socket on a different one. Doing this requires hooks

like image 161
fkl Avatar answered Oct 03 '22 06:10

fkl


Certainly.

All the frameworks are written in terms of the Win32 API. The frameworks cover 80-95% of what programmers need to do, but if you need really low-level control over something, you'll need to drop to the underlying Win32 API. Some examples would be:

  1. precise control over text rendering (via DirectWrite),
  2. detailed control over speech recognition using SAPI (there are literally dozens of interfaces not exposed through System.Speech),
  3. low-level networking code (i.e., anything not HTTP related),
  4. Practically anything audio related, if you're interested in performance.
like image 39
Eric Brown Avatar answered Oct 03 '22 07:10

Eric Brown


... and don't forget about direct hardware access like "WinUSB" and debugging functionality (writing programs that act as debuggers).

like image 41
Martin Rosenau Avatar answered Oct 03 '22 06:10

Martin Rosenau