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

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

?? simple_window.html

?? This tutorial attempts to get you started developing with the Win32 API as quickly and clearly as po
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
        WS_EX_CLIENTEDGE,        g_szClassName,        "The title of my window",        WS_OVERLAPPEDWINDOW,        CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,        NULL, NULL, hInstance, NULL);</PRE><P>The first parameter (<CODE>WS_EX_CLIENTEDGE</CODE>) is the extended windows style, in thiscase I have set it to give it a sunken inner border around the window.  Set itto <CODE>0</CODE> if you'd like to see the difference.  Also play with other values tosee what they do.<P>Next we have the class name (<CODE>g_szClassName</CODE>), this tells the system what kindof window to create.  Since we want to create a window from the class we just registered, we use the name of that class.  After that we specify our window name or titlewhich is the text that will be displayed in the <I>Caption</I>, or <I>Title Bar</I> on our window.<P>The parameter we have as <CODE>WS_OVERLAPPEDWINDOW</CODE> is the <I>Window Style</I> parameter.There are quite a few of these and you should look them up and experiment tofind out what they do.  These will be covered more later.<P>The next four parameters (<CODE>CW_USEDEFAULT, CW_USEDEFAULT, 320, 240</CODE>) are theX and Y co-ordinates for the top left corner of your window, and the widthand height of the window.  I've set the X and Y values to <CODE>CW_USEDEFAULT</CODE>to let windows choosewhere on the screen to put the window.  Remeber that the left of the screen is anX value of zero and it increases to the right; The top of the screen is a Y valueof zero which increases towards the bottom.  The units are pixels, which isthe smallest unit a screen can display at a given resolution.<P>Next (<CODE>NULL, NULL, g_hInst, NULL</CODE>) we have the <I>Parent Window</I> handle, the menuhandle, the application instance handle, and a pointer to window creation data.In windows, the windows on your screen are arranged in a heirarchy of parent and childwindows.  When you see a button on a window, the button is the <I>Child</I> and it is contained withinthe window that is it's <I>Parent</I>.In this example, the parent handle is <CODE>NULL</CODE> because we have no parent, this is our main or <I>Top Level</I> window.The menu is <CODE>NULL</CODE> for now since we don't have one yet.  The instance handle isset to the value that is passed in as the first parameter to <CODE>WinMain()</CODE>. The creation data (which I almost never use) that can be used to send additional data to the window that is being created is also <CODE>NULL</CODE>.<P>If you're wondering what this magic <CODE>NULL</CODE> is, it's simply defined as <CODE>0</CODE> (zero).  Actually, in C it's defined as <CODE>((void*)0)</CODE>, since it's intended foruse with pointers.  Therefore you will possibly get warnings if you use NULL for integervalues, depending on your compiler and the warning level settings.  You can choose to ignorethe warnings, or just use <CODE>0</CODE> instead.<P>Number one cause of people not knowing what the heck is wrong with their programs is probablythat they didn't check the return values of their calls to see if they failed or not.<CODE>CreateWindow()</CODE> <I>will</I> fail at some point even if you're an experiancedcoder, simply because there are lots of mistakes that are easy to make.  Untill you learnhow to quickly identify those mistakes, at least give yourself the chance of figuring outwhere things go wrong, and <B>Always check return values!</B><PRE CLASS="SNIP">    if(hwnd == NULL)    {        MessageBox(NULL, "Window Creation Failed!", "Error!",            MB_ICONEXCLAMATION | MB_OK);        return 0;    }</PRE><P>After we've created the window and checked to make sure we have a valid handlewe show the window, using the last parameter in <CODE>WinMain()</CODE> and then update it toensure that it has properly redrawn itself on the screen.<PRE CLASS="SNIP">   ShowWindow(hwnd, nCmdShow);   UpdateWindow(hwnd);</PRE><P>The <CODE>nCmdShow</CODE> parameter is optional, you could simply pass in <CODE>SW_SHOWNORMAL</CODE>all the time and be done with it.  However using the parameter passed into <CODE>WinMain()</CODE> giveswhoever is running your program to specify whether or not they want your window to start offvisible, maximized, minimized, etc...  You will find options for these in the properties ofwindows shortcuts, and this parameter is how the choice is carried out.<H2>Step 3: The Message Loop</H2><P>This is the heart of the whole program, pretty much everything that your program doespasses through this point of control.<PRE CLASS="SNIP">    while(GetMessage(&Msg, NULL, 0, 0) > 0)    {        TranslateMessage(&Msg);        DispatchMessage(&Msg);    }    return Msg.wParam;</PRE><P><CODE>GetMessage()</CODE> gets a message from your application's message queue.  Any time the usermoves the mouse, types on the keyboard, clicks on your window's menu, or does anynumber of other things, messages are generated by the system and entered into your program's message queue.  By calling <CODE>GetMessage()</CODE> you are requesting the nextavailable message to be removed from the queue and returned to you for processing.  If thereis no message, <CODE>GetMessage()</CODE> <I>Blocks</I>.  If you are unfamiliar with the term, itmeans that it waits untill there is a message, and then returns it to you.<P><CODE>TranslateMessage()</CODE> does some additional processing on keyboardevents like generating <CODE>WM_CHAR</CODE> messages to go along with <CODE>WM_KEYDOWN</CODE> messages.Finally <CODE>DispatchMessage()</CODE> sends the message out to the window that themessage was sent to.  This could be our main window or it could be another one, or a control,and in some cases a window that was created behind the scenes by the sytem or another program.This isn't something you need to worry about because all we are concerned with is thatwe get the message and send it out, the system takes care of the rest making sure itgets to the proper window.<H2>Step 4: the Window Procedure</H2>If the message loop is the heart of the program, the window procedure is the brain.This is where all the messages that are sent to our window get processed.<PRE CLASS="SNIP">LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){    switch(msg)    {        case WM_CLOSE:            DestroyWindow(hwnd);        break;        case WM_DESTROY:            PostQuitMessage(0);        break;        default:            return DefWindowProc(hwnd, msg, wParam, lParam);    }    return 0;}</PRE><P>The window procedure is called for each message, the <CODE>HWND</CODE> parameter isthe handle of your window, the one that the message applies to.  This is important since you might have two or more windows of the same class and they will use thesame window procedure (<CODE>WndProc()</CODE>).  The difference is that the parameter<CODE>hwnd</CODE> will be different depending on which window it is.  For example whenwe get the <CODE>WM_CLOSE</CODE> message we destroy the window.  Since we use the window handlethat we received as the first paramter, any other windows will not be affected, only the one that the message was intended for.<P><CODE>WM_CLOSE</CODE> is sent when the user presses the Close Button <IMG SRC="images/button_close.gif" ALT="[x]"> or types Alt-F4.  This will cause the windowto be destroyed by default, but I like to handle it explicitly, since this is the perfectspot to do cleanup checks, or ask the user to save files etc. before exiting the program.<P>When we call <CODE>DestroyWindow()</CODE> the system sends the <CODE>WM_DESTROY</CODE>message to the window getting destroyed, in this case it's our window, and then destroysany remaining child windows before finally removing our window from the system.  Since thisis the only window in our program, we are all done and we want the program to exit, so wecall <CODE>PostQuitMessage()</CODE>.  This posts the <CODE>WM_QUIT</CODE> message to themessage loop.  We never receive this message, because it causes <CODE>GetMessage()</CODE>to return <CODE>FALSE</CODE>, and as you'll see in our message loop code, when that happenswe stop processing messages and return the final result code, the <CODE>wParam</CODE> of <CODE>WM_QUIT</CODE>  which happens to be the value we passed into <CODE>PostQuitMessage()</CODE>.The return value is only really useful if your program is designed to be called by another programand you want to return a specific value.<H2>Step 5: There is no Step 5</H2><P>Phew.  Well that's it!  If I haven't explained stuff clearly enough yet, justhang in there and hopefully things will become more clear as we get into moreusefull programs.<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一区二区三区免费野_久草精品视频
亚洲国产成人av好男人在线观看| 久久久久久久久久久久久久久99 | 国产精品中文有码| 欧美成人高清电影在线| 激情欧美一区二区三区在线观看| 久久亚洲免费视频| 丰满少妇在线播放bd日韩电影| 欧美韩国一区二区| 99久久伊人久久99| 亚洲图片欧美综合| 欧美一区二区在线看| 久久99国产精品久久99果冻传媒| 久久久影视传媒| 91在线国产观看| 亚洲国产视频a| 日韩欧美精品三级| 国产69精品久久久久777| 一区在线观看视频| 91精品国产欧美一区二区18| 精品亚洲国产成人av制服丝袜| 欧美激情中文字幕一区二区| 色94色欧美sute亚洲13| 日产国产高清一区二区三区| 国产日韩欧美精品在线| 欧美中文字幕久久 | 成人影视亚洲图片在线| 亚洲人成网站色在线观看| 欧美久久久久久久久中文字幕| 奇米影视一区二区三区| 久久久美女毛片| 精品视频色一区| 国产麻豆日韩欧美久久| 一区二区三区欧美亚洲| 精品国产乱码久久久久久1区2区| 成人国产亚洲欧美成人综合网| 日韩制服丝袜av| 麻豆精品在线播放| 亚洲欧美色图小说| 精品国产区一区| 色综合天天综合在线视频| 久久精品国产99| 亚洲亚洲人成综合网络| 中文字幕乱码久久午夜不卡| 91精品国产综合久久久蜜臀图片 | 久久99精品视频| 亚洲午夜av在线| 国产免费成人在线视频| 日韩亚洲欧美成人一区| 色天使色偷偷av一区二区| 国产一区在线看| 亚洲成a人v欧美综合天堂下载 | 欧美日韩免费在线视频| av色综合久久天堂av综合| 久久99精品久久久| 亚洲午夜一二三区视频| 国产精品毛片久久久久久| 日韩免费视频一区二区| 欧美精品1区2区| 一本久道久久综合中文字幕| 成人在线视频一区二区| 国内成人自拍视频| 免费久久精品视频| 天堂va蜜桃一区二区三区| 亚洲综合色视频| 成人欧美一区二区三区1314| 欧美国产精品专区| 欧美成人在线直播| 欧美一区二区不卡视频| 51精品秘密在线观看| 欧美中文字幕一区| 在线亚洲高清视频| 一本一本大道香蕉久在线精品| 成人app在线| 成人h动漫精品一区二| 成人网在线播放| jlzzjlzz亚洲女人18| 成人网男人的天堂| av电影天堂一区二区在线| 懂色av中文一区二区三区| 成人永久免费视频| av欧美精品.com| 一本色道亚洲精品aⅴ| 91久久精品一区二区三| 91福利社在线观看| 欧美日本一道本| 欧美一区二区视频在线观看2022| 51午夜精品国产| 日韩欧美区一区二| 欧美精品一区二区三区很污很色的| 欧美一级黄色片| www国产精品av| 欧美韩国日本一区| 自拍偷拍亚洲综合| 亚洲一线二线三线久久久| 亚洲成av人片观看| 久久精品国产第一区二区三区| 国产一区二区中文字幕| 精品国产一区二区亚洲人成毛片| 久久精品人人做人人爽人人| 欧美国产日韩a欧美在线观看| 日韩理论在线观看| 亚洲午夜av在线| 精品影院一区二区久久久| 国产精品自拍在线| 一本大道久久a久久精品综合| 日本韩国精品在线| 678五月天丁香亚洲综合网| 久久综合久久综合久久| 亚洲欧洲韩国日本视频| 天天影视网天天综合色在线播放| 美女视频网站久久| 99在线精品视频| 717成人午夜免费福利电影| 精品国产乱码久久久久久蜜臀| 国产精品久久久久久久久免费桃花| 亚洲国产一区二区视频| 久久99精品国产.久久久久久| 成人一区二区三区| 欧美精选一区二区| 国产精品久久久久久久久搜平片 | 一区二区三区四区在线| 久久机这里只有精品| 97精品国产露脸对白| 日韩欧美一区二区在线视频| 亚洲欧美综合另类在线卡通| 免播放器亚洲一区| 99久久精品国产导航| 日韩精品一区二区三区四区| 亚洲卡通欧美制服中文| 国产原创一区二区三区| 欧美日高清视频| 国产精品免费看片| 美女高潮久久久| 欧美亚洲动漫精品| 国产精品无码永久免费888| 奇米综合一区二区三区精品视频| 色婷婷久久综合| 久久久久久久久久看片| 偷拍日韩校园综合在线| 99久久国产综合精品色伊| 精品日本一线二线三线不卡| 亚洲成人av电影在线| av午夜精品一区二区三区| 精品国产第一区二区三区观看体验| 亚洲一区二区三区小说| 99久久精品免费| 中文字幕不卡一区| 国产呦萝稀缺另类资源| 制服丝袜国产精品| 亚洲午夜激情av| 91麻豆成人久久精品二区三区| 国产色爱av资源综合区| 精品一区二区三区视频| 日韩丝袜美女视频| 一区二区三区四区蜜桃| 91丝袜高跟美女视频| 欧美国产精品一区| 国产成人av一区二区三区在线观看| 欧美成人三级在线| 麻豆成人免费电影| 欧美一区中文字幕| 视频一区在线视频| 欧美日韩免费观看一区三区| 亚洲精品日产精品乱码不卡| 成人国产视频在线观看| 中文子幕无线码一区tr| 成人美女视频在线看| 久久久精品免费免费| 国产综合色精品一区二区三区| 欧美肥大bbwbbw高潮| 日韩精品欧美成人高清一区二区| 欧美日韩一区二区在线视频| 亚洲最新在线观看| 在线观看日韩av先锋影音电影院| 亚洲男人的天堂av| 在线亚洲人成电影网站色www| 亚洲伦在线观看| 在线看日本不卡| 日韩一区欧美二区| 精品久久久久久久久久久院品网| 国内外成人在线视频| 日本一区二区三区视频视频| 成人av影院在线| 一区二区三区精品| 91麻豆精品91久久久久久清纯| 蜜桃久久久久久久| 国产亚洲欧美日韩俺去了| av电影天堂一区二区在线观看| 一区二区三区高清| 日韩视频一区二区| 国产成人av一区二区| 中文字幕一区二区三区不卡| 色哟哟国产精品| 视频一区免费在线观看| 久久亚洲一级片| 91麻豆精品一区二区三区| 日韩电影在线免费| 2022国产精品视频| 91丨九色丨蝌蚪富婆spa| 日韩二区三区四区|