Hi, I'm a beginner coder, I'm trying to make a calculator using windows.h. I manage to create all the buttons but I can't figure out how to implement integers or algorithms to solve for an integer. can someone explain this to me?
im using windows.h header file
[/code]
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_CREATE:
case WM_COMMAND:
{
if (LOWORD(wParam)== 1)
{
a = 1;
}
if (LOWORD(wParam)== 2)
{
a = 2;
}
if (LOWORD(wParam)== 3)
{
a = 3;
}
if (LOWORD(wParam)== 4)
{
a = 4;
}
if (LOWORD(wParam)== 5)
{
a = 5;
}
if (LOWORD(wParam)== 6)
{
a = 6;
}
if (LOWORD(wParam)== 7)
{
a = 7;
}
if (LOWORD(wParam)== 8)
{
a = 8;
}
if (LOWORD(wParam)== 9)
{
a = 9;
}
if (LOWORD(wParam)== 0)
{
a = 0;
}
break;
}
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}