⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 windows sdk编程之基本结构_windows编程_操作系统_软件开发_天新网1.htm

📁 windows develop spec about win32 program, hope it s useful to you
💻 HTM
📖 第 1 页 / 共 4 页
字号:
      color=#ffffff> | </FONT><A href="http://dev.21tx.com/os/"><FONT 
      color=#ffcc00>操作系统</FONT></A><FONT color=#ffffff> | </FONT><A 
      href="http://dev.21tx.com/softengine/"><FONT color=#ffffff>软件工程</FONT></A> 
      <BR><A href="http://dev.21tx.com/language/vb/"><FONT 
      color=#ffffff>VB</FONT></A> <A 
      href="http://dev.21tx.com/language/vc/"><FONT color=#ffffff>VC</FONT></A> 
      <A href="http://dev.21tx.com/language/delphi/"><FONT 
      color=#ffffff>Delphi</FONT></A> <A 
      href="http://dev.21tx.com/language/pb/"><FONT color=#ffffff>PB</FONT></A> 
      <A href="http://dev.21tx.com/language/bcb/"><FONT 
      color=#ffffff>BCB</FONT></A> <A 
      href="http://dev.21tx.com/language/c/"><FONT 
      color=#ffffff>C++</FONT></A><FONT color=#ffffff> - </FONT><A 
      href="http://dev.21tx.com/dotnet/aspnet/"><FONT 
      color=#ffffff>ASP.net</FONT></A> <A 
      href="http://dev.21tx.com/dotnet/csharp/"><FONT 
      color=#ffffff>C#</FONT></A> <A 
      href="http://dev.21tx.com/dotnet/vbnet/"><FONT 
      color=#ffffff>VB.net</FONT></A><FONT color=#ffffff> - </FONT><A 
      href="http://dev.21tx.com/java/j2ee/"><FONT color=#ffffff>J2EE</FONT></A> 
      <A href="http://dev.21tx.com/java/j2se/"><FONT 
      color=#ffffff>J2SE</FONT></A> <A 
      href="http://dev.21tx.com/java/j2me/"><FONT color=#ffffff>J2ME</FONT></A> 
      <A href="http://dev.21tx.com/java/ejb/"><FONT 
      color=#ffffff>EJB</FONT></A><FONT color=#ffffff> - </FONT><A 
      href="http://dev.21tx.com/web/asp/"><FONT color=#ffffff>ASP</FONT></A> <A 
      href="http://dev.21tx.com/web/php/"><FONT color=#ffffff>PHP</FONT></A> <A 
      href="http://dev.21tx.com/java/jsp/"><FONT color=#ffffff>JSP</FONT></A> <A 
      href="http://dev.21tx.com/web/cgi/"><FONT 
      color=#ffffff>CGI</FONT></A><FONT color=#ffffff> - </FONT><A 
      href="http://dev.21tx.com/database/mssql/"><FONT 
      color=#ffffff>MSSQL</FONT></A> <A 
      href="http://dev.21tx.com/database/oracle/"><FONT 
      color=#ffffff>Oracle</FONT></A> <A 
      href="http://dev.21tx.com/database/db2/"><FONT 
      color=#ffffff>DB2</FONT></A> <A 
      href="http://dev.21tx.com/database/mysql/"><FONT 
      color=#ffffff>MySQL</FONT></A><FONT color=#ffffff> - </FONT><A 
      href="http://dev.21tx.com/codinglife/"><FONT 
      color=#ffffff>CodingLife</FONT></A></TD>
    <TD width=8 height=33></TD>
    <TD align=right width=8 height=33><IMG height=38 
      src="Windows SDK编程之基本结构_Windows编程_操作系统_软件开发_天新网1.files/main_r.gif" 
    width=8></TD></TR></TBODY></TABLE></SPAN><SPAN id=txsite_search>
<TABLE cellSpacing=0 cellPadding=0 width=760 align=center border=0>
  <TBODY>
  <TR>
    <TD width=10 
    background="Windows SDK编程之基本结构_Windows编程_操作系统_软件开发_天新网1.files/menubg.gif" 
    height=25></TD>
    <TD width=45 
    background="Windows SDK编程之基本结构_Windows编程_操作系统_软件开发_天新网1.files/menubg.gif" 
    height=25><IMG height=25 
      src="Windows SDK编程之基本结构_Windows编程_操作系统_软件开发_天新网1.files/search4.gif" 
      width=45></TD>
    <TD 
    background="Windows SDK编程之基本结构_Windows编程_操作系统_软件开发_天新网1.files/menubg.gif" 
    height=25>
      <TABLE cellSpacing=0 cellPadding=0 border=0>
        <FORM name=txsite_searchform 
        action=http://txsite.21tx.com/script/TXSiteSearch.aspx method=post 
        target=_blank>
        <TBODY>
        <TR>
          <TD vAlign=center 
          background="Windows SDK编程之基本结构_Windows编程_操作系统_软件开发_天新网1.files/menubg.gif" 
          height=25><INPUT size=12 name=k> <INPUT type=hidden value=2 name=s> 
            <INPUT type=hidden value=dev.21tx.com name=d> <SELECT 
            style="HEIGHT: 10pt" name=ck> <OPTION value=469 
              selected>软件开发</OPTION><OPTION value=275>开发语言</OPTION><OPTION 
              value=144>.Net开发</OPTION><OPTION value=145>Java开发</OPTION><OPTION 
              value=274>Web开发</OPTION><OPTION value=1261>移动开发</OPTION><OPTION 
              value=91690>游戏开发</OPTION><OPTION value=95>数据库开发</OPTION><OPTION 
              value=1176>企业开发</OPTION><OPTION value=1205>操作系统</OPTION><OPTION 
              value=150>软件工程</OPTION><OPTION value=91566>程序人生</OPTION><OPTION 
              value=91768>开发文摘</OPTION></SELECT> </TD>
          <TD vAlign=bottom align=middle width=40 
          background="Windows SDK编程之基本结构_Windows编程_操作系统_软件开发_天新网1.files/menubg.gif" 
          height=25><INPUT type=image 
            src="Windows SDK编程之基本结构_Windows编程_操作系统_软件开发_天新网1.files/search5.gif" 
            border=0> </TD></TR></FORM></TBODY></TABLE></TD>
    <TD 
    background="Windows SDK编程之基本结构_Windows编程_操作系统_软件开发_天新网1.files/menubg.gif" 
    height=25>
      <TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
        <TBODY>
        <TR>
          <TD align=middle height=2></TD></TR>
        <TR>
          <TD align=middle><SPAN 
    id=ad_search_right></SPAN></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></SPAN>
<TABLE cellSpacing=0 cellPadding=0 width=760 align=center border=0>
  <TBODY>
  <TR>
    <TD class=mainbgcolor align=middle height=2></TD></TR></TBODY></TABLE><SPAN 
id=txsite_smallcolumnmenu>
<TABLE cellSpacing=0 cellPadding=0 width=760 align=center border=0>
  <TBODY>
  <TR>
    <TD class=mainbgcolor width=6></TD>
    <TD 
    style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 1px solid" 
    vAlign=center bgColor=#666666 height=25>&nbsp; <A 
      href="http://dev.21tx.com/os/"><FONT color=#ffffff>操作系统首页</FONT></A><FONT 
      color=#ffffff> | </FONT><A href="http://dev.21tx.com/os/windows/"><FONT 
      color=#ffcc00>Windows编程</FONT></A><FONT color=#ffffff> | </FONT><A 
      href="http://dev.21tx.com/os/linux/"><FONT 
      color=#ffffff>Linux编程</FONT></A> </TD>
    <TD class=mainbgcolor width=6></TD></TR></TBODY></TABLE></SPAN>
<TABLE cellSpacing=0 cellPadding=0 width=760 align=center border=0>
  <TBODY>
  <TR>
    <TD class=mainbgcolor width=6></TD>
    <TD style="BORDER-LEFT: #cccccc 1px solid" vAlign=top align=middle 
    bgColor=#ffffff>
      <TABLE cellSpacing=0 cellPadding=0 width="100%">
        <TBODY>
        <TR>
          <TD colSpan=2 height=3></TD></TR>
        <TR>
          <TD width="2%"><IMG height=22 
            src="Windows SDK编程之基本结构_Windows编程_操作系统_软件开发_天新网1.files/dline.gif" 
            width=19></TD>
          <TD width="98%" 
          background="Windows SDK编程之基本结构_Windows编程_操作系统_软件开发_天新网1.files/dline02.gif">&nbsp; 
            您现在的位置:<A href="http://www.21tx.com/">天新网</A> &gt; <A 
            href="http://dev.21tx.com/">软件开发</A> &gt; <A 
            href="http://dev.21tx.com/os/">操作系统</A> &gt; <A 
            href="http://dev.21tx.com/os/windows/">Windows编程</A> 
      </TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=6 width="98%" 
      background="Windows SDK编程之基本结构_Windows编程_操作系统_软件开发_天新网1.files/data_title_bg.gif" 
      border=0>
        <TBODY>
        <TR>
          <TD align=middle><FONT class=f18 color=#339900><B>Windows 
            SDK编程之基本结构</B></FONT></TD></TR>
        <TR>
          <TD align=middle>http://dev.21tx.com 2004年08月17日 <FONT 
            color=#a20010>vckbase 冯明德</FONT></TD></TR></TBODY></TABLE>
      <P align=center><SPAN id=txsite_ad_cnt_top1></SPAN><SPAN 
      id=txsite_ad_cnt_top2>
      <TABLE cellSpacing=0 cellPadding=0 width=468 align=center border=0>
        <TBODY>
        <TR>
          <TD height=6></TD></TR>
        <TR>
          <TD 
          style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 1px solid" 
          align=middle width=468>
            <SCRIPT type=text/javascript>
var arrBaiduCproConfig=new Array();
arrBaiduCproConfig['uid'] = 111945;
arrBaiduCproConfig['n'] = 'txadcpr';
arrBaiduCproConfig['tm'] = 30;
arrBaiduCproConfig['cm'] = 68;
arrBaiduCproConfig['um'] = 34;
arrBaiduCproConfig['rad'] = 1;
arrBaiduCproConfig['w'] = 468;
arrBaiduCproConfig['h'] = 60;
arrBaiduCproConfig['bd'] = '#ffffff';
arrBaiduCproConfig['bg'] = '#ffffff';
arrBaiduCproConfig['tt'] = '#0000ff';
arrBaiduCproConfig['ct'] = '#000000';
arrBaiduCproConfig['url'] = '#666666';
arrBaiduCproConfig['bdl'] = '#ffffff';
arrBaiduCproConfig['wn'] = 2;
arrBaiduCproConfig['hn'] = 1;
arrBaiduCproConfig['ta'] = 'right';
arrBaiduCproConfig['tl'] = 'bottom';
arrBaiduCproConfig['bu'] = 0;
</SCRIPT>

            <SCRIPT 
            src="Windows SDK编程之基本结构_Windows编程_操作系统_软件开发_天新网1.files/ui.js" 
            type=text/javascript>
</SCRIPT>

            <SCRIPT type=text/javascript>
<!--
document.write(baiduCproIFrame());
-->
</SCRIPT>
          </TD></TR>
        <TR>
          <TD height=6></TD></TR></TBODY></TABLE></SPAN><SPAN 
      id=txsite_ad_cnt_top3></SPAN></P><SPAN id=txsite_day_commend>
      <TABLE cellSpacing=1 cellPadding=3 width=540 align=center bgColor=#1250ab 
      border=0>
        <TBODY>
        <TR>
          <TD align=middle bgColor=#e3ecf9 colSpan=2><B>每日文章精萃</B></TD></TR>
        <TR>
          <TD width="50%" bgColor=#ffffff><A 
            href="http://www.21tx.com/dev/dotnet/vs/" target=_blank><FONT 
            color=#000000><B>.Net:</B></FONT></A><A title=.NET下的动态代码编译探索 
            href="http://www.21tx.com/dev/2006/02/28/10572.html" 
            target=_blank><B>.NET下的动态代码编译探索</B></A></TD>
          <TD width="50%" bgColor=#ffffff><A 
            href="http://www.21tx.com/dev/java/adv/xml/" target=_blank><FONT 
            color=#000000><B>Java:</B></FONT></A><A title=XML在B/S架构开发中的应用 
            href="http://www.21tx.com/dev/2002/08/20/10069.html" 
            target=_blank><B>XML在B/S架构开发中的应用</B></A></TD></TR>
        <TR>
          <TD width="50%" bgColor=#ffffff><A 
            href="http://www.21tx.com/dev/web/asp/certple/" target=_blank><FONT 
            color=#000000><B>ASP:</B></FONT></A><A title=股票报价的WebService之一 
            href="http://www.21tx.com/dev/2001/05/25/10479.html" 
            target=_blank><B>股票报价的WebService之一</B></A></TD>
          <TD width="50%" bgColor=#ffffff><A 
            href="http://www.21tx.com/dev/web/php/" target=_blank><FONT 
            color=#000000><B>PHP:</B></FONT></A><A title=一个个人网页自动化生成系统(1) 
            href="http://www.21tx.com/dev/2004/06/17/11273.html" 
            target=_blank><B>一个个人网页自动化生成系统(1)</B></A></TD></TR>
        <TR>
          <TD width="50%" bgColor=#ffffff><A 
            href="http://www.21tx.com/dev/java/jsp/" target=_blank><FONT 
            color=#000000><B>JSP:</B></FONT></A><A title="javamail在jsp中调用 一" 
            href="http://www.21tx.com/dev/2004/06/21/11293.html" 
            target=_blank><B>javamail在jsp中调用 一</B></A></TD>
          <TD width="50%" bgColor=#ffffff><A 
            href="http://www.21tx.com/dev/web/cgi/" target=_blank><FONT 
            color=#000000><B>CGI:</B></FONT></A><A title=CGI教程(7)解码数据发送给CGI脚本之一 
            href="http://www.21tx.com/dev/2005/04/12/14009.html" 
            target=_blank><B>CGI教程(7)解码数据发送给CGI脚本之</B></A></TD></TR>
        <TR>
          <TD width="50%" bgColor=#ffffff><A 
            href="http://www.21tx.com/dev/language/vb/" target=_blank><FONT 
            color=#000000><B>VB:</B></FONT></A><A title="Visual Basic编程访问WMI对象" 
            href="http://www.21tx.com/dev/2005/04/06/29764.html" 
            target=_blank><B>Visual Basic编程访问WMI对象</B></A></TD>
          <TD width="50%" bgColor=#ffffff><A 
            href="http://www.21tx.com/dev/language/vc/" target=_blank><FONT 
            color=#000000><B>VC:</B></FONT></A><A 
            title="在ATL Browser Helper对象中使用WTL TreeView" 
            href="http://www.21tx.com/dev/2005/05/06/12059.html" 
            target=_blank><B>在ATL Browser Helper对象中使用WTL 
      </B></A></TD></TR></TBODY></TABLE>
      <P></P></SPAN>
      <TABLE id=txsite_content cellSpacing=0 cellPadding=0 width="98%" 
        border=0><TBODY>
        <TR>
          <TD class=content><SPAN id=txsite_ad_cnt_start></SPAN>
            <P align=right><A 
            href="http://www.21tx.com/dev/2004/08/17/10394.html">上一页</A> <A 
            href="http://www.21tx.com/dev/2004/08/17/10394.html">1</A> <FONT 
            color=red>2</FONT> 
            </P>  <STRONG>四、消息循环<BR></STRONG><BR>  系统会将针对这个程序的消息依次放到程序的“消息队列”中,由程序自己依次取出消息,在分发到对应的窗口中去。因此,建立窗口后,将进入一个循环。<BR><BR>  在循环中,取出消息、派发消息,循环往复,直到取得的消息是退出消息。<BR><BR>  循环退出后,程序即结束。 
            <BR><BR>
            <TABLE class=txcode cellSpacing=0 cellPadding=0 align=center 
            border=0>
              <TBODY>
              <TR>
                <TD>#include "stdafx.h"<BR>#include &lt;<A 
                  href="http://dev.21tx.com/os/windows/" 
                  target=_blank>Windows</A>.h&gt;<BR><BR>//一、消息处理函数<BR>//参数:窗口句柄,消息,消息参数,消息参数<BR>LRESULT 
                  CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, 
                  LPARAM lParam)<BR>{<BR> //处理感兴趣的消息<BR> switch 
                  (message)<BR> {<BR>  case 
                  WM_DESTROY:<BR>   //当用户关闭窗口,窗口销毁,程序需结束,发退出消息,以退出消息循环<BR>   PostQuitMessage 
                  (0) ;<BR>   return 0 
                  ;<BR> }<BR> //其他消息交给由系统提供的缺省处理函数<BR> return ::DefWindowProc 
                  (hwnd, message, wParam, lParam) 
                  ;<BR>}<BR><BR>//二、应用程序主函数<BR>//参数:实例句柄、前一个实例的句柄、命令行参数、窗口显示方式<BR>int 
                  WINAPI WinMain (HINSTANCE hInstance, HINSTANCE 
                  hPrevInstance,<BR>PSTR szCmdLine, int 
                  iCmdShow)<BR>{<BR> //1.注册窗口类<BR> static TCHAR szAppName[] = 
                  TEXT ("HelloWin") ; //窗口类名称<BR> //定制"窗口类"结构<BR> WNDCLASS 
                  wndclass ;<BR> wndclass.style = CS_HREDRAW | CS_VREDRAW 
                  ;<BR> wndclass.lpfnWndProc = WndProc ; //关联消息处理函数 
                  <BR> wndclass.cbClsExtra = 0 ;<BR> wndclass.cbWndExtra = 0 
                  ;<BR> wndclass.hInstance = hInstance ; 
                  //实例句柄<BR> wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ; 
                  //图标<BR> wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ; 
                  //光标<BR> wndclass.hbrBackground = (HBRUSH) GetStockObject 
                  (WHITE_BRUSH); //画刷<BR> wndclass.lpszMenuName = NULL 
                  ;<BR> wndclass.lpszClassName = szAppName; 
                  //类名称<BR> //注册<BR> if (!Re<A 
                  href="http://dev.21tx.com/corp/gis/" 
                  target=_blank>GIS</A>terClass 
                  (&amp;wndclass))<BR> {<BR>  MessageBox (NULL, TEXT 
                  ("RegisterClass Fail!"), <BR>  szAppName, MB_ICONERROR) 
                  ;<BR>  return 0 ;<BR> }<BR><BR> //建立窗口<BR> HWND hwnd 
                  ;<BR> hwnd = CreateWindow (szAppName, //窗口类名称<BR> TEXT ("The 
                  Hello Program"), //窗口标题 <BR> WS_OVERLAPPEDWINDOW, 
                  //窗口风格<BR> CW_USEDEFAULT,<BR> CW_USEDEFAULT,<BR> CW_USEDEFAULT,<BR> CW_USEDEFAULT,<BR> NULL,<BR> NULL,<BR> hInstance, 
                  //实例句柄<BR> NULL);<BR><BR> ShowWindow (hwnd, iCmdShow) 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -