prasannavl / WinApi

A simple, direct, ultra-thin CLR library for high-performance Win32 Native Interop
Apache License 2.0
823 stars 101 forks source link

Add SetLastError() #34

Closed daggerbot closed 4 years ago

daggerbot commented 4 years ago

With some winapi functions, it's ambiguous whether the call succeeded from the return value (e.g. IsWindowVisible, GetWindowLongPtrW, etc.). The only way to know for sure is to set the thread's error code to zero before the call and check it after.

prasannavl commented 4 years ago

Great! Thanks :)