hScrlH=CreateWindow("SCROLLBAR",TEXT("标准横向"),WS_CHILD|WS_VISIBLE|SBS_HORZ,120,5,100,20,hwnd,(HMENU)IDC_Scrol,0,0);//创建滑块条??
CreateWindow(TRACKBAR_CLASS, "trackbar", WS_CHILD | WS_VISIBLE,120, 30, 180, 30, hwnd, HMENU(0), 0, 0);//默认横向滑块条 刻度
CreateWindow(TRACKBAR_CLASS, "", WS_CHILD | WS_VISIBLE|TBS_AUTOTICKS|TBS_LEFT,120, 70, 150, 30, hwnd, HMENU(0), 0, 0);//自动刻度 + TBS_LEFT向上指示
CreateWindow(TRACKBAR_CLASS, "", WS_CHILD | WS_VISIBLE|TBS_HORZ |TBS_NOTICKS,120, 100, 120, 30, hwnd, HMENU(0), 0, 0);//横向滑块条 无刻度
CreateWindow(TRACKBAR_CLASS, "", WS_CHILD | WS_VISIBLE|TBS_HORZ |TBS_BOTH,120, 140, 100, 40, hwnd, HMENU(0), 0, 0);//横向滑块条 上下刻度
CreateWindow(TRACKBAR_CLASS, "", WS_CHILD | WS_VISIBLE|TBS_VERT ,130, 180, 30, 100, hwnd, HMENU(0), 0, 0);//垂直滑块条
CreateWindow(TRACKBAR_CLASS, "", WS_CHILD | WS_VISIBLE|TBS_VERT|TBS_LEFT,150, 180, 30, 100, hwnd, HMENU(0), 0, 0);//垂直滑块条 向左指示
CreateWindow(TRACKBAR_CLASS, "", WS_CHILD | WS_VISIBLE|TBS_VERT|TBS_LEFT,150, 180, 30, 100, hwnd, HMENU(0), 0, 0);//垂直滑块条 向左指示 刻度
CreateWindow(TRACKBAR_CLASS, "", WS_CHILD | WS_VISIBLE|TBS_VERT|TBS_BOTH,190, 180, 40, 100, hwnd, HMENU(0), 0, 0);//垂直滑块条 两边刻度
SetScrollRange(hScrlH,SB_CTL,0,1000,TRUE);//设置滑块条1000
SetScrollPos(hScrlH,SB_CTL,500,TRUE);//设置滑块条初始位置在中间
hComboBox=CreateWindow(TEXT("combobox"), NULL, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS,300 , 20, 100, 400, hwnd, (HMENU)IDC_CoBox , NULL, NULL);//创建列表框
SendMessage(hComboBox,CB_ADDSTRING,0,(LPARAM)"列表框");
for (i=0;i<=17;i++)
{
char temp[1024]; //复习一下16进制的16==10(1 0) 17== 11 (一 一)
SendMessage(hComboBox,CB_ADDSTRING,0,(LPARAM)itoa(i,temp,16));
}
小节:win32 api C语言写窗口程序 太垃圾了 (不适合)
|