Utility packages for Windows: WinTypes.jl and WinKnownPaths.jl

Two simple utility packages for interacting with the Windows API:

WinTypes.jl

This package defines aliases in Julia to Windows Data types.

Example

import WinTypes: HANDLE, DWORD

hOutput = ccall(:GetStdHandle, stdcall, HANDLE, (DWORD,), -11 % DWORD)

compare this to without using WinTypes:

hOutput = ccall(:GetStdHandle, stdcall, Ptr{Cvoid}, (UInt32,), STD_OUTPUT_HANDLE % UInt32)

WinKnownPaths.jl

This package allows you to reliably call known Windows paths identified by their UUID without having to make brittle calls to the system environment variables.

Example

julia> using WinKnownPaths; import WinKnownPaths: FOLDERID

julia> WinKnownPaths.path(FOLDERID.System)
"C:\\WINDOWS\\system32"

julia> WinKnownPaths.path(FOLDERID.Fonts)
"C:\\WINDOWS\\Fonts"
5 Likes