Hey webJose,
1) So which is the best to use (let's take MessageBox as an example): the one with :: or the one without ::? Can I choose which one to use, or is there one which should be preferred over another?
2) Okay, thank you very much for the answer.
3) Ok, I think I understand this.
4) Okay, I understand this. But I noticed it's often given a null value, why is that?
5) So when you have multiple main windows, you would use an array of window handles. Is this correct? If so, could you please give an easy example when you would use multiple main windows?
6) Wow, I think I will never remember this all...
Thank you very much for the answers =)
EDIT:
I hope you don't mind me asking another question.
7) I now have this piece of code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
LRESULT CALLBACK
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
int result = 0;
switch(msg)
{
case WM_LBUTTONDOWN:
MessageBox(0, "You have clicked within the window!", "Click!", MB_OK);
return 0;
case WM_KEYDOWN:
if (wParam == VK_ESCAPE)
result = MessageBox(0, "Do you want to close the program?", "Shutdown", MB_YESNO);
if (result == IDYES)
DestroyWindow(ghMainWnd);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hWnd, msg, wParam, lParam);
}
|
My questions about this:
1) Why does result needs to be an integer? It gets the value IDYES, why does it accepts that?
2) When exactly will result get the value "0" again (so when exactly will the window procedure be called again)?