Monday 28 November 2011

Should a Windows program care about the OEM key codes?in C programming

Should a Windows program care about the OEM key codes?

No. As FAQ XXI.15 explains, OEM key codes refer to the original 255 characters of the IBM character set
that comes preprogrammed into every 80x86 ROM.

Many of these characters were used in older DOS-based programs to represent characters that normally would have required graphics. Because Windows is a graphical environment that contains hundreds of functions for creating graphical objects, these characters are no longer needed. Instead of writing Windows functions to use the OEM character set to draw a rectangle, for instance, you can simply call the Windows API function Rectangle(). Thus, the OEM character codes are not needed in Windows, and you can effectively ignore them when writing your Windows programs.

Note that although you can ignore these key codes, Windows cannot. For instance, you probably already know that many of your DOS programs can be run in a window under Windows. When this is the case, Windows must “interpret” the DOS program’s use of the OEM character set and map it accordingly on-screen.

Cross Reference:

XXI.15: What are OEM key codes?
XXI.17: What are virtual key codes?
XXI.18: What is a dead key?

No comments:

Post a Comment