Created
September 22, 2020 03:23
-
-
Save timsneath/a9fcd1f71586a834c91fd92ac05b2d3f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // C signature for Win32 API in kernel32.dll: | |
| // BOOL WINAPI SetConsoleCursorPosition( | |
| // _In_ HANDLE hConsoleOutput, | |
| // _In_ COORD dwCursorPosition | |
| // ); | |
| typedef nativePrototype = Int32 Function( | |
| IntPtr hConsoleOutput, Int32 dwCursorPos); | |
| typedef dartPrototype = int Function(int hConsoleOutput, int dwCursorPos); | |
| final kernel32 = DynamicLibrary.open('kernel32.dll'); | |
| final SetConsoleCursorPosition = kernel32 | |
| .lookupFunction<nativePrototype, dartPrototype>('SetConsoleCursorPosition'); | |
| // outputHandle is STDOUT (not shown here) | |
| SetConsoleCursorPosition(outputHandle, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment