I was searching right here on StackOverflow and found the answer to Mute Volume in C#. I don't understand what's going on with the answer. I've never gotten deep into Marshaling or P/Invoke. I've used them before but never understood what I was doing.
So here's what I'm confused about:
private const int APPCOMMAND_VOLUME_MUTE = 0x80000;
private const int WM_APPCOMMAND = 0x319;
When declaring these, does it matter what they are named, or are they just treated like any integer regardless of what they're called?
Where do the values 0x80000
and 0x319
come from?
These values are defined in Winuser.h
, which is included in the more common Windows.h
.
The Winuser constants for WM_APPCOMMAND are documented on this MSDN page.
How you name these variables in your code, as with any variable, is technically up to you. However, it is common practice to keep naming consistent with that used by the library you are invoking (in this case Winuser.h). I see no reason to name them anything else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With