亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? app_three.html

?? This tutorial attempts to get you started developing with the Win32 API as quickly and clearly as po
?? HTML
字號:
<HTML><LINK HREF="style.css" REL="STYLESHEET" TYPE="text/css"><HEAD><TITLE>App Part 3: Tool and Status bars</TITLE></HEAD><BODY><FONT SIZE="-1">[ <A HREF="./index.html">contents</A>| <A HREF="http://www.winprog.org/">#winprog</A>]</FONT><HR><H1>App Part 3: Tool and Status bars</H1><P>Example: app_three</P><IMG SRC="images/app_three.gif" ALT="[images/app_three.gif]" ALIGN="right"><H3>An IMPORTANT Word on Common Controls</H3><P>As with all common controls, you must call <CODE>InitCommonControls()</CODE><I>BEFORE</I> you try and use them.  You will need to <CODE>#include &lt;commctrl.h&gt;</CODE>in order to use this function and to get the functions and declarations necessary foruse of the Common Controls.  You will also need to add <CODE>comctl32.lib</CODE>to your linker settings if it is not already there.  Note that <CODE>InitCommonControls()</CODE>is an older API, and for more control you can use <CODE>InitCommonControlsEx()</CODE> (aka <I>InitCommonControlSex()</I>) which is also required for the most recent common controls.  Howeversince I'm not using any of the advanced features, <CODE>InitCommonControls()</CODE> is adequateand simpler.<H2>Toolbars</H2><P>You can create a toolbar using <CODE>CreateToolbarEx()</CODE> but I'm not goingto, so there.  First thing you need to do is actually create the toolbar...<PRE CLASS="SNIP">    hTool = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0,        hwnd, (HMENU)IDC_MAIN_TOOL, GetModuleHandle(NULL), NULL);</PRE><P>That's simple enough, <CODE>TOOLBARCLASSNAME</CODE> is a constant defined by thecommon control headers. <CODE>hwnd</CODE> is the parent window, the one youwant to put the toolbar in.  <CODE>IDC_MAIN_TOOL</CODE> is an identifier that you canuse later to get the <CODE>HWND</CODE> of the toolbar using <CODE>GetDlgItem()</CODE>,if you so desire.<PRE CLASS="SNIP">     // Send the TB_BUTTONSTRUCTSIZE message, which is required for     // backward compatibility.     SendMessage(hTool, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);</PRE><P>This message is required to let the system figure out which version of the common controls library you are using.  Since new versions add new stuff to the structure, by giving it the size it can figureout what behaviour you are expecting.<H3>Toolbar buttons</H3>Button bitmaps on basic toolbars come in two varieties, standard buttons that are provided by comctl32, anduser defined buttons that you create yourself.<B>NOTE:</B> Buttons and bitmaps are added to toolbars seperately... first you add a list of imagesto use, and THEN you add a list of buttons, and telling it which button uses which image.<H3>Adding Standard Buttons</H3>Now that we have a toolbar created, we need to add some buttons to it.  The most common bitmapsare available in the common control library itself, so we don't need to recreate them or add them to every exe that uses them.<P>First we declare a <CODE>TBBUTTON</CODE> and <CODE>TBADDBITMAP</CODE><PRE CLASS="SNIP">    TBBUTTON tbb[3];    TBADDBITMAP tbab;</PRE>And then we add the standard bitmaps to the toolbar, using the imagelist predefined in the common control library...<PRE CLASS="SNIP">    tbab.hInst = HINST_COMMCTRL;    tbab.nID = IDB_STD_SMALL_COLOR;    SendMessage(hTool, TB_ADDBITMAP, 0, (LPARAM)&tbab);</PRE>Now that we have our images loaded up, we can add some buttons that use them...<PRE CLASS="SNIP">    ZeroMemory(tbb, sizeof(tbb));    tbb[0].iBitmap = STD_FILENEW;    tbb[0].fsState = TBSTATE_ENABLED;    tbb[0].fsStyle = TBSTYLE_BUTTON;    tbb[0].idCommand = ID_FILE_NEW;    tbb[1].iBitmap = STD_FILEOPEN;    tbb[1].fsState = TBSTATE_ENABLED;    tbb[1].fsStyle = TBSTYLE_BUTTON;    tbb[1].idCommand = ID_FILE_OPEN;    tbb[2].iBitmap = STD_FILESAVE;    tbb[2].fsState = TBSTATE_ENABLED;    tbb[2].fsStyle = TBSTYLE_BUTTON;    tbb[2].idCommand = ID_FILE_SAVEAS;    SendMessage(hTool, TB_ADDBUTTONS, sizeof(tbb)/sizeof(TBBUTTON), (LPARAM)&tbb);</PRE>Here we've added a New, Open and Save As button using the standard images, which is alwaysa good idea since people are used to seeing them and they know what they mean.<P>The indexes of each image in the imagelist are defined in the common control headers and arelisted in MSDN.<P>We have assigned each button an ID (<CODE>ID_FILE_NEW</CODE> etc...) which is identical to the IDs of theequivalent menu items.  These buttons will generate <CODE>WM_COMMAND</CODE> messages identical to the menu,so no extra processing is required!  If we were adding a button for a command that didn't alreadyhave a menu item, we would simply pick a new ID for it and add a handler to <CODE>WM_COMMAND</CODE>.<P>If you're wondering what's up with the funky <CODE>wParam</CODE> I passed to <CODE>TB_ADDBUTTONS</CODE>it's doing a calculation of the number of buttons in the array tbb so that we don't need tohardcode a value.  If I put in 3 instead it would still be correct, but as soon as I added anotherbutton I'd have to change it to 4 and in programming that's bad... you want one change to causeas few other changes as possible.  For example if the <CODE>sizeof(TBBUTTON)</CODE> was 16 bytes(I made that up, it actually varies by platform) then since we have 3 buttons the <CODE>sizeof(tbb)</CODE>would be 16 * 3 or 48.  Therefor 48/16 gives us the number of buttons, 3.<H2>Status bars</H2>Something often found in apps with toolbars are status bars, the little things at the bottom ofthe window that display information.  They're pretty simple to use, just create...<PRE CLASS="SNIP">    hStatus = CreateWindowEx(0, STATUSCLASSNAME, NULL,        WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP, 0, 0, 0, 0,        hwnd, (HMENU)IDC_MAIN_STATUS, GetModuleHandle(NULL), NULL);</PRE>And then (optionally) set the number of sections that you want.  If you don't set any,it will simply have one section using the entire width of the bar, and you can set and retreivethe text with <CODE>SetWindowText()</CODE> as with many other controls.  For more than onepart, you need to give the widths of each section, and then use <CODE>SB_SETTEXT</CODE> toset the text of each one.<P>To define the widths, we declare an array of <CODE>int</CODE>s, where each value is thewidth in pixels of a section.  If you want one section to use up any remaining space, setit's width to <CODE>-1</CODE>.<PRE CLASS="SNIP">    int statwidths[] = {100, -1};    SendMessage(hStatus, SB_SETPARTS, sizeof(statwidths)/sizeof(int), (LPARAM)statwidths);    SendMessage(hStatus, SB_SETTEXT, 0, (LPARAM)"Hi there :)");</PRE><P>The wParam again is our calculation of how many elements are in the array.  Once we're done adding sections, we set the first one (index <CODE>0</CODE>) to see it in action.<H2>Proper Sizing</H2>Unlike menus, tool and status bars are seperate controls that live inside the parent window's client area.  Therefor if we just leave our <CODE>WM_SIZE</CODE> code from before, they are going to overlap with the edit control we added in the previous examples.  This is a simple matter to correct...in <CODE>WM_SIZE</CODE>, we move the tool and status bars into position, and then subtract theirheights and positions from the client area so that we can move our edit control to fill the remainingspace...<PRE CLASS="SNIP">    HWND hTool;    RECT rcTool;    int iToolHeight;    HWND hStatus;    RECT rcStatus;    int iStatusHeight;    HWND hEdit;    int iEditHeight;    RECT rcClient;    // Size toolbar and get height    hTool = GetDlgItem(hwnd, IDC_MAIN_TOOL);    SendMessage(hTool, TB_AUTOSIZE, 0, 0);    GetWindowRect(hTool, &rcTool);    iToolHeight = rcTool.bottom - rcTool.top;    // Size status bar and get height    hStatus = GetDlgItem(hwnd, IDC_MAIN_STATUS);    SendMessage(hStatus, WM_SIZE, 0, 0);    GetWindowRect(hStatus, &rcStatus);    iStatusHeight = rcStatus.bottom - rcStatus.top;    // Calculate remaining height and size edit    GetClientRect(hwnd, &rcClient);    iEditHeight = rcClient.bottom - iToolHeight - iStatusHeight;    hEdit = GetDlgItem(hwnd, IDC_MAIN_EDIT);    SetWindowPos(hEdit, NULL, 0, iToolHeight, rcClient.right, iEditHeight, SWP_NOZORDER);</PRE><P>Unfortunately it's a somewhat long code snippet, but it's quite simple... toolbars willauto position themselves when sent the <CODE>TB_AUTOSIZE</CODE> message, and status bars will do thesame if you send them <CODE>WM_SIZE</CODE> (the common control libraries are not known for consistancy).<HR><FONT SIZE="-1">Copyright &copy; 1998-2003, Brook Miles (<A HREF="mailto:forger(nospam)winprog.org">theForger</A>).  All rights reserved.</FONT><SCRIPT language="JavaScript"><!--   var re = /\(nospam\)/ig;   var str;   for(i = 0;i < document.links.length;i++)    {      str = "" + document.links(i).href;      if(str.search(re) != -1)         document.links(i).href = str.replace(re, "@");      str = "" + document.links(i).innerHTML;      if(str.search(re) != -1)         document.links(i).innerHTML = str.replace(re, "@");   }--></SCRIPT></BODY></HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色久优优欧美色久优优| 久久成人麻豆午夜电影| 日韩视频一区二区三区| 成人激情校园春色| 日韩国产高清影视| 欧美国产精品中文字幕| 欧美一区二区三区在线视频| 91视频一区二区三区| 狠狠色狠狠色综合系列| 亚洲成av人**亚洲成av**| 国产精品区一区二区三区| 日韩欧美一区在线| 色激情天天射综合网| 不卡一区二区在线| 黄色日韩三级电影| 奇米精品一区二区三区在线观看 | 最新国产成人在线观看| 日韩精品综合一本久道在线视频| 在线一区二区三区| 成人动漫一区二区在线| 国精产品一区一区三区mba视频 | 日韩一区二区电影| 欧美综合欧美视频| 色综合天天在线| 国产suv一区二区三区88区| 免费人成精品欧美精品| 天天综合天天综合色| 亚洲图片欧美视频| 亚洲国产精品视频| 亚洲精品国久久99热| 国产精品美女视频| 国产精品免费人成网站| 国产欧美日韩中文久久| 亚洲精品在线网站| 精品久久久久久久久久久久久久久| 欧美欧美欧美欧美首页| 色综合久久久久久久久| 91丨九色丨蝌蚪富婆spa| 99久久精品99国产精品| 91亚洲精品久久久蜜桃| 色婷婷综合久久久中文字幕| 成av人片一区二区| 91原创在线视频| 97精品国产97久久久久久久久久久久 | 亚洲综合丝袜美腿| 亚洲精品免费在线观看| 亚洲蜜臀av乱码久久精品蜜桃| 亚洲欧美成人一区二区三区| 樱桃国产成人精品视频| 亚洲综合丁香婷婷六月香| 亚洲一卡二卡三卡四卡无卡久久| 亚洲曰韩产成在线| 三级在线观看一区二区| 久久国产尿小便嘘嘘尿| 国产成a人亚洲| 99久久99久久精品免费看蜜桃 | 成人av网址在线观看| 不卡av在线免费观看| 91国在线观看| 欧美精品 日韩| 久久午夜免费电影| 国产精品久久久久影院老司| 一区二区三区91| 日本v片在线高清不卡在线观看| 韩国成人精品a∨在线观看| 国产99久久久国产精品| 91福利小视频| 91精品国产综合久久小美女| 久久精品一区蜜桃臀影院| 亚洲丝袜精品丝袜在线| 午夜精品久久久久久久久久 | 亚洲激情男女视频| 天天色综合天天| 国产精品亚洲午夜一区二区三区| 99精品视频在线观看免费| 欧美日韩成人综合天天影院| 欧美zozozo| 亚洲欧洲制服丝袜| 日本va欧美va瓶| jizzjizzjizz欧美| 欧美一区二区久久久| 国产精品丝袜一区| 日韩精品亚洲专区| 成人h动漫精品一区二区| 欧美日韩在线精品一区二区三区激情 | 欧美三级一区二区| 欧美zozo另类异族| 亚洲精品欧美二区三区中文字幕| 久久福利资源站| 色天天综合色天天久久| 日韩精品一区在线观看| 亚洲图片激情小说| 精品在线免费观看| 在线观看视频欧美| 欧美激情在线看| 日韩成人一级大片| 91浏览器打开| 国产亚洲欧洲997久久综合| 亚洲综合色区另类av| 国产91丝袜在线播放九色| 777精品伊人久久久久大香线蕉| 亚洲国产高清aⅴ视频| 免费一级片91| 欧美日韩免费一区二区三区| 国产精品久久久久久久久久免费看| 日韩电影在线看| 91视频免费看| 国产日产欧产精品推荐色| 日韩精品高清不卡| 在线观看免费亚洲| 国产精品久久综合| 国产精品原创巨作av| 日韩三级视频在线观看| 亚洲一区二区三区中文字幕在线| 国产91精品免费| 久久久蜜桃精品| 久久66热偷产精品| 欧美一级在线观看| 日韩高清在线一区| 欧美日韩在线直播| 亚洲线精品一区二区三区八戒| a级高清视频欧美日韩| 国产欧美一区二区在线观看| 国产一区999| 26uuu色噜噜精品一区| 激情文学综合插| 欧美va亚洲va香蕉在线| 秋霞午夜av一区二区三区| 欧美日韩精品欧美日韩精品一 | 成人午夜视频在线观看| 久久久99免费| 国产一区二区成人久久免费影院| 欧美成人a在线| 青青草原综合久久大伊人精品优势| 欧美精品一二三四| 天堂蜜桃91精品| 6080亚洲精品一区二区| 午夜久久久久久| 欧美精品在线一区二区三区| 日日夜夜精品免费视频| 欧美精品粉嫩高潮一区二区| 五月天精品一区二区三区| 欧美日韩视频不卡| 日本伊人午夜精品| 欧美一区二区视频在线观看2022| 蜜桃av噜噜一区| 久久五月婷婷丁香社区| 国产高清精品久久久久| 亚洲欧洲日韩女同| 在线免费观看日本欧美| 丝袜诱惑亚洲看片| 日韩精品中文字幕一区二区三区| 韩国精品主播一区二区在线观看 | 午夜免费欧美电影| 日韩欧美一区在线| 国产盗摄一区二区三区| 亚洲欧洲日韩综合一区二区| 欧美主播一区二区三区美女| 爽爽淫人综合网网站| 久久久久久久久一| 成人av在线播放网址| 亚洲成人精品一区二区| 91精品国产综合久久香蕉麻豆| 久久91精品久久久久久秒播| 国产精品女人毛片| 欧美日本乱大交xxxxx| 经典三级一区二区| 成人欧美一区二区三区1314| 欧美日韩免费视频| 国产精品自拍一区| 亚洲综合另类小说| 欧美变态口味重另类| 不卡视频在线看| 日韩一区精品字幕| 国产精品福利一区二区三区| 欧美人与性动xxxx| 粉嫩欧美一区二区三区高清影视| 一区二区三区视频在线看| 欧美不卡一区二区三区四区| 99re热这里只有精品视频| 日韩电影免费在线| 亚洲欧洲av在线| 日韩精品中文字幕一区| 91麻豆swag| 国产成人在线影院| 日韩不卡在线观看日韩不卡视频| 中文av一区二区| 日韩一区二区三区免费观看| 91免费观看在线| 国产一区免费电影| 亚洲丶国产丶欧美一区二区三区| 欧美激情在线一区二区三区| 91精品国模一区二区三区| 91香蕉国产在线观看软件| 麻豆成人免费电影| 一区二区成人在线观看| 中文成人av在线| 精品少妇一区二区三区在线播放 | 在线视频欧美精品| 国产成人午夜片在线观看高清观看|