Page 70 - DCAP408_WEB_PROGRAMMING
P. 70
Windows Programming
Notes #ifdef __BORLANDC__
#pragma argsused
#endif
#include “resource.h”
//—————————————————————————————————————
HWND hWnd;
HWND hWndComboBox;
HINSTANCE hInst;
LRESULT CALLBACK DlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM
lParam);
//—————————————————————————————————————
int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow )
{
hInst = hInstance;
DialogBox(hInstance, MAKEINTRESOURCE(IDD_CONTROLSDLG),
hWnd, reinterpret_cast<DLGPROC>(DlgProc));
return 0;
}
//—————————————————————————————————————
LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM
lParam)
{
switch(Msg)
{
case WM_INITDIALOG:
hWndComboBox = CreateWindow(“COMBOBOX”,
NULL,
WS_CHILD | WS_VISIBLE | WS_TABSTOP,
60, 62, 136, 60,
hWndDlg,
NULL,
hInst,
NULL);
64 LOVELY PROFESSIONAL UNIVERSITY