Skip to content

Latest commit

 

History

History
99 lines (77 loc) · 2.7 KB

README.md

File metadata and controls

99 lines (77 loc) · 2.7 KB

Win32 library

Build status

C++ wrappers to simplify native Windows API calls

Table of contents

Basic usage

TODO

Win32 namespace

All implemented wrappers in this library are scoped under Win32 namespace.

User namespace

  • Win32::User::GetWindowText

    GetWindowText API wrapper

    Function definition

    std::wstring Win32::User::GetWindowText(HWND hWnd)

    Usage

    #include <Win32/User.hpp>
    
    using namespace Win32;
    
    const auto& windowText = User::GetWindowText(hWindow);

SysInfoAPI namespace

  • Win32::SysInfoAPI::GetComputerNameEx

    GetComputerNameEx API wrapper

    Function definition

    std::wstring Win32::SysInfoAPI::GetComputerNameEx(COMPUTER_NAME_FORMAT format)

    Usage

    #include <Win32/SysInfoAPI.hpp>
    
    using namespace Win32;
    
    const auto& computerName = SysInfoAPI::GetComputerNameEx(ComputerNameNetBIOS);

DataProtection namespace

  • Win32::DataProtection::ProtectData

    CryptProtectData API wrapper

    Function definition

    std::string
    Win32::DataProtection::ProtectData(
      const std::string& unprotectedData,
      const std::string& optionalEntropy = std::string(),
      ProtectDataFlags flags = ProtectDataFlags::LocalMachine
    )

    Usage

    #include <Win32/DataProtection.hpp>
    
    using namespace Win32;
    
    const auto& protectedData = DataProtection::ProtectData("Some secret data to protect");
  • Win32::DataProtection::UnprotectData

    CryptUnprotectData API wrapper

    Function definition

    std::string
    Win32::DataProtection::UnprotectData(
      const std::string& protectedData, 
      const std::string& optionalEntropy = std::string(), 
      ProtectDataFlags flags = ProtectDataFlags::LocalMachine
    )

    Usage

    #include <Win32/DataProtection.hpp>
    
    using namespace Win32;
    
    const auto& unprotectedData = DataProtection::UnprotectData(previouslyProtectedData);

License