Skip to content

Instantly share code, notes, and snippets.

@Seth-Johnson
Created December 2, 2014 03:55
Show Gist options
  • Save Seth-Johnson/7699302d886323c1d802 to your computer and use it in GitHub Desktop.
Save Seth-Johnson/7699302d886323c1d802 to your computer and use it in GitHub Desktop.
if (SendMessage(g_hLabel, WM_SETTEXT, 0, (LPARAM)L"Guess a number between 0 and 99."))
bool x = TRUE;
else
bool x = FALSE;
}
// snip
switch (message)
{
case WM_ACTIVATE:
g_hSubmit_Answer = CreateWindow(L"button",
L"GUESS",
(WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON),
90,
300,
300,
100,
hWnd,
(HMENU)SUBMIT_ANSWER,
hInst,
NULL
);
g_hEdit_Answer = CreateWindowEx(WS_EX_CLIENTEDGE,
L"edit",
L"",
(WS_CHILD | WS_VISIBLE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_NUMBER ),
90,
175,
300,
100,
hWnd,
(HMENU)EDIT_ANSWER,
hInst,
NULL
);
g_hLabel = CreateWindow(L"static",
NULL,
(WS_CHILD | WS_VISIBLE | SS_CENTER | SS_BLACKFRAME),
90,
50,
300,
100,
hWnd,
(HMENU)TEXT_LABEL,
hInst,
NULL);
bigFont = CreateFont(90, 20, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 0, TEXT("Courier New"));
mediumFont = CreateFont(90, 20, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 0, TEXT("Segoe UI"));
SendMessage(g_hEdit_Answer, WM_SETFONT, (WPARAM)bigFont, 0);
SendMessage(g_hSubmit_Answer, WM_SETFONT, (WPARAM)mediumFont, 0);
// snip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment