هذه المقالة متوفرة أيضا باللغة العربية، اقرأها هنا.
Windows comes with two types that represent a Boolean variable (TRUE or FALSE.) Both represent FALSE if 0 and TRUE if non-zero.
The big difference you need to care when working with that two Booleans is that BOOL defined as int which is 32 bits (4 bytes) on 32-bit environments and 16 bits (2 bytes) on 16-bit environments. BOOLEAN on the other hand, defined as BYTE, which in turn defined as unsigned char. Thus, BOOLEAN only occupies 8 bits (1 byte) from memory.
Although you can convert between them easily, BOOL is much common than BOOLEAN and it is very popular in the Windows API.
Now, the decision is yours!
- A Short Speech about Unions
- Converting between color decimal and hexadecimal representation
- Marshaling Unions
- Retrieving Motherboard Serial Number using WMI
- .NET Interoperability at a Glance 3 – Unmanaged Code Interoperation
- Clearing the Console Screen using API
- Changing Display Settings Programmatically
- Marshaling with C# Pocket Reference