Created
January 8, 2013 21:40
-
-
Save garethlewin/4488235 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch (message) | |
{ | |
case WM_CREATE: | |
hChannelMembers = CreateWindow(_T("LISTBOX"), _T(""), | |
WS_CHILD | WS_VISIBLE | LBS_STANDARD, | |
0, 0, 0,0, hWnd, IDC_MEMBERS, hInst, NULL); | |
hMessages = CreateWindow(_T("LISTBOX"), _T(""), | |
WS_CHILD | WS_VISIBLE | LBS_STANDARD, | |
0, 0, 0,0, hWnd, IDC_MESSAGES, hInst, NULL); | |
hInputBox = CreateWindow(_T("EDIT"), _T(""), | |
WS_CHILD | WS_VISIBLE | WS_BORDER, | |
0, 0, 0,0, hWnd, NULL, hInst, NULL); | |
hSendButton = CreateWindow(_T("BUTTON"), _T("&Send"), | |
WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON, | |
0, 0, 0,0, hWnd, IDC_SEND, hInst, NULL); | |
break; | |
case WM_SIZE: | |
{ | |
int nWidth = LOWORD(lParam); | |
int nHeight = HIWORD(lParam); | |
const int nMembersWidth = 200; | |
const int nEditBoxHeight = 23; // http://msdn.microsoft.com/en-us/library/aa511279.aspx#sizingspacing | |
const int buttonWidth = 40; | |
SetWindowPos(hChannelMembers, NULL, 0, 0, nMembersWidth, nHeight, SWP_NOZORDER); | |
SetWindowPos(hMessages, NULL, nMembersWidth, 0, nWidth-nMembersWidth, nHeight-nEditBoxHeight, SWP_NOZORDER); | |
SetWindowPos(hInputBox, NULL, nMembersWidth, nHeight-nEditBoxHeight, nWidth-nMembersWidth - buttonWidth, nHeight, SWP_NOZORDER); | |
SetWindowPos(hSendButton, NULL, | |
nWidth - buttonWidth, | |
nHeight-nEditBoxHeight, | |
buttonWidth, | |
nHeight, SWP_NOZORDER); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment