Last active
August 29, 2015 14:04
-
-
Save LinkTsang/56b22b64e4358b327ff4 to your computer and use it in GitHub Desktop.
Get 936 code for NumPad (windows only)
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
| unsigned short GetMagicNumber(wchar_t WideChar) | |
| { | |
| wchar_t wc[2]; | |
| wc[0] = WideChar; | |
| wc[1] = NULL; | |
| union { | |
| char c[2]; | |
| short s; | |
| } buffer , output; | |
| buffer.s = 0; | |
| WideCharToMultiByte(936, 0, wc, -1, (char*)&buffer, 2, 0, 0); | |
| output.c[0] = buffer.c[1]; | |
| output.c[1] = buffer.c[0]; | |
| return output.s; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment