|
1 窗口滚动条
hwnd=CreateWindow("windows","创建一个新窗口",WS_OVERLAPPEDWINDOW|WS_CAPTION|WS_SYSMENU|WS_HSCROLL,0,0,300,550,NULL,NULL,hInstance,NULL);//创建窗体
// WS_HSCROLL //水平滚动条的标识符
// WS_VSCROLL //垂直滚动条的标识符,
2 分组框
CreateWindow(TEXT("BUTTON"), TEXT("group"), WS_CHILD | WS_VISIBLE | BS_GROUPBOX, 3, 200, 110,180, hwnd, (HMENU)IDC_GROUP,NULL,NULL);//创建 分组框
3 窗口内滑动条(像不像滑动条?)
CreateWindowA(TEXT("ScrollBar"),TEXT("标准横向"), WS_CHILD| WS_VISIBLE , 120, 110, 150, 20, hwnd, (HMENU)IDC_Scrol,NULL, NULL); //创建滑块条??
4 纯属意外啊
CreateWindow(TEXT("button"), TEXT("按钮滑块条1"),WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL, 123,10, 150, 50, hwnd,NULL,NULL,NULL);
5意外的惊喜??
CreateWindow(TEXT("EDIT"), TEXT("编辑框滑块条2"),WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL, 123,200, 150, 100, hwnd,NULL,NULL,NULL);
6测试窗口内大小
case WM_SIZE:
cxClient = LOWORD (lParam) ;
cyClient = HIWORD (lParam) ;
wsprintf(TEXT(str),"窗口内宽度:%d窗口内高度:%d",cxClient,cyClient );
SetDlgItemTextA(hwnd, IDC_Edit, TEXT(str));
break;
程序运行效果:
|
|