Windows API Reference

Win32 API

The Win32 API is a broad set of application programming interfaces (APIs) that developers can use to create applications for Microsoft Windows operating systems.

CreateProcessW

Creates a new process and its primary thread. The new process is the calling thread's copy of the process. Specifies the filename or module name for the new process.

lpApplicationName
The name of the module to be executed.
lpCommandLine
The command line for the process to be executed.
lpProcessAttributes
A pointer to a SECURITY_ATTRIBUTES structure that determines whether the returned handle can be inherited by the child process.
lpThreadAttributes
A pointer to a SECURITY_ATTRIBUTES structure that determines whether the returned handle can be inherited by the child process.
bInheritHandles
If this parameter is TRUE, the calling process's environment variables are copied to the new process. Otherwise, they are not.
dwCreationFlags
Flags that control the priority class and creation behavior of the new process.
lpEnvironment
A pointer to a null-terminated string array that specifies the environment variables for the new process.
lpCurrentDirectory
A pointer to a null-terminated string that specifies the full path of the current directory for the child process.
lpStartupInfo
A pointer to a STARTUPINFO structure that specifies the window station, standard handles, and appearance of the main window for the application.
lpProcessInformation
A pointer to a PROCESS_INFORMATION structure that receives identification information about the new process and its primary thread.

C++ Example:


    STARTUPINFO si;
    PROCESS_INFORMATION pi;

    ZeroMemory( &si, sizeof(si) );
    si.cb = sizeof(si);
    ZeroMemory( &pi, sizeof(pi) );

    // Start the child process.
    if( !CreateProcess( NULL,   // No module name (use command line)
        "notepad.exe",        // Command line
        NULL,           // Process handle not inheritable
        NULL,           // Thread handle not inheritable
        FALSE,          // Set handle inheritance to FALSE
        0,              // No creation flags
        NULL,           // Use parent's environment block
        NULL,           // Use parent's starting directory
        &si,            // Pointer to STARTUPINFO structure
        &pi )           // Pointer to PROCESS_INFORMATION structure
    )
    {
        printf( "CreateProcess failed (%d).\n", GetLastError() );
        return;
    }

    // Wait until child process exits.
    WaitForSingleObject( pi.hProcess, INFINITE );

    // Close process and thread handles.
    CloseHandle( pi.hProcess );
    CloseHandle( pi.hThread );
                    

Universal Windows Platform (UWP) APIs

UWP provides a modern API model for building apps that can run across all Windows 10/11 devices.

Windows.Devices.Geolocation.Geolocator

Represents a service that asynchronously retrieves the device's current location.

C# Example:


    var geolocator = new Geolocator();
    var position = await geolocator.GetGeopositionAsync();

    if (position != null)
    {
        var latitude = position.Coordinate.Point.Position.Latitude;
        var longitude = position.Coordinate.Point.Position.Longitude;
        // Use latitude and longitude
    }
                    

DirectX APIs

DirectX is a collection of APIs for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms.

Explore APIs for graphics, audio, input, and networking.

ID3D11Device::CreateBuffer
Creates a buffer resource, which can be used for vertex data, index data, constant data, or unordered access.

.NET Framework APIs

The .NET Framework provides a vast library of classes and functionalities for developing Windows applications.

Key namespaces include System.Windows.Forms, System.Web, and System.IO.