MSG msg

I'm a trying to do something with Win32, can anyone tell me what the newxt line of code does?

 
MSG msg = { };
This..Question is not making any sense, for all we know you could be performing a Process Injection, or a PE relocation, please specify whats your aim before asking us to predict.
It just declares a struct of type MSG.
It's a struct, so it can contain other structs or other values like ints, shorts...
For Win32, this struct will store data related to a system (or user) message, such as a mouse click, a key press, a timer event, a redraw request...
And the = { }; is initializing it to zero. Same as if you'd used

1
2
MSG msg;
memset(&msg, 0, sizeof(MSG));


Andy

PS Note that the empty braces is valid C++ but not C. For C you need = { 0 };, which also works with C++.
Last edited on
Topic archived. No new replies allowed.