Skip to content
Search

Windows Api

lastmod 2025-02-26created 2014-04-3035 edits

The Windows API (WinAPI) is the API used by the Microsoft Windows operating systems. It was designed so that C/C++ programs can interact directly with the operating system, and even lower-level control is possible through the low-level DLL Ntdll.dll.

Hide console of Windows

With the Visual C++ compiler, this can be solved with the following linker option.

#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")

To do it in code:

FreeConsole();

// OR
#define _WIN32_WINNT 0x0500
#include <wincon.h> 
ShowWindow (GetConsoleWindow(), SW_HIDE);

With MinGW, the following compile option can be used.

$ g++ -mwindows winapp.c

With console window

#include <stdio.h>
#include <windows.h>

int main(void)
{
    puts("hi");
    MessageBox(NULL, "test", "test", NULL);
    GetStockObject(0);
    return 0;
}

The compiler options are as follows.

$ gcc -mconsole test_gdi.c -lgdi32

List of Windows API

List of Windows API

Base Services
Base Services give access to the fundamental resources available on a Windows system.



Base File Services
Groups the file-related services among the Base Services.

Multithread
Category related to multithreading (Multithread).



Advanced Services
Advanced Services give access to additional functionality beyond the kernel.

  • Windows registry.
  • Shutdown/restart the system or abort.
  • Windows service.
  • User accounts.



GDI
The Graphics Device Interface (GDI) provides functionality for delivering graphical content to monitors, printers, and other output devices.


User Interface
The User Interface provides functionality to create and manage screen windows as well as the most basic controls such as buttons and scrollbars, to receive mouse and keyboard input, and to integrate with the GUI of Windows.

Common Dialog Box Library
The Common Dialog Box Library provides standard dialog boxes for opening and saving files, choosing colors and fonts, and so on.


Common Control Library
The Common Control Library gives applications access to some advanced controls provided by the operating system. These include status bars, progress bars, toolbars, and tabs.


Windows Shell
This component of the Windows API lets applications access, change, and enhance the functionality provided by the operating system shell.

Network Services
Provides various networking capabilities to the operating system.



Localization
Internationalization and localization mean adapting publications, hardware, or software made in a different cultural environment (especially another country or culture) to a specific environment.



System Management
* System functions

Web
The Internet Explorer web browser also exposes many APIs that are often used by applications, and these can be considered part of the Windows API. Internet Explorer has been included with the operating system since Windows 98 SE, and has provided web-related services since Windows 98.


Multimedia
Since Windows 95 OSR2, Microsoft has provided the DirectX set of APIs as part of every Windows installation. DirectX provides multimedia and gaming services.



ETC
Collects other APIs that do not fall into any of the categories above.

Category

DLL

Debugging

Device

ETC

Troubleshooting

Undefined reference to WinMain

This mainly occurs when using MinGW, when the WinMain function used instead of main on Windows cannot be found. The error message looks like this.

C:/workspace/root/var/opm/apps/tdmgcc-4.9.2-150419-x86/bin/../lib/gcc/mingw32/4.9.2/../../..\libmingw32.a(main.o):main.c:(.text.startup+0xa7): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status

A simple fix is as follows.

int main(int argc, char ** argc)
{
    // ...
    return 0;
}

// For Windows Project Entry point.
#if defined(WIN32) || defined(_WIN32)
#include <windows.h>
int APIENTRY
WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdLine, int cmdShow)
{
    return main(__argc, __argv);
}
#endif

Microsoft APIs and frameworks

Microsoft APIs and frameworks

Graphics

Desktop Window Manager, Direct2D, Direct3D, D3D (extensions), GDI/GDI+, WPF, Silverlight, WinRT XAML, Windows Color System, Windows Image Acquisition, Windows Imaging Component

Audio

DirectMusic, DirectSound, DirectX plugin, XACT, Speech API, XAudio2

Multimedia

DirectX (Media Objects), DirectX (Video Acceleration), DirectInput, DirectShow, Image Mastering API, Managed DirectX, Media Foundation, XNA, Windows Media, Video for Windows

Web

MSHTML, RSS Platform, JScript, VBScript, BHO, XDR, SideBar Gadgets

Data access

Data Access Components, Extensible Storage Engine, ADO.NET, ADO.NET Entity Framework, Sync Framework, Jet Engine, MSXML, OLE DB, OPC

Networking

Winsock (LSP), Winsock Kernel, Filtering Platform, Network Driver Interface Specification, Windows Rally, BITS, P2P API, MSMQ, MS MPI, DirectPlay

Communication

Messaging API, Telephony API, WCF

Administration and management

Win32 console, Windows Script Host, WMI(extensions), PowerShell, Task Scheduler, Offline Files, Shadow Copy, Windows Installer, Error Reporting, Event Log, Common Log File System

Component model

COM, COM+, ActiveX, Distributed Component Object Model, .NET Framework

Libraries

Base Class Library (BCL), Microsoft Foundation Classes (MFC), Active Template Library (ATL), Windows Template Library (WTL)

Device drivers

Windows Driver Model, Windows Driver Foundation (KMDF), Windows Driver Foundation (UMDF), WDDM, NDIS, UAA, Broadcast Driver Architecture, VxD

Security

Crypto API (CAPICOM), Windows CardSpace, Data Protection API, Security Support Provider Interface (SSPI)

.NET

ASP.NET, ADO.NET, Base Class Library (BCL), Remoting, Silverlight, TPL, WCF, WCS, WPF, WF

Software factories

EFx Factory, Enterprise Library, Composite UI, CCF, CSF

IPC

MSRPC, Dynamic Data Exchange (DDE), Remoting, WCF

See also

Favorite site

References


  1. Soenlab_com.7z ↩

author Zer0 sitemap