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

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

?? generic.html

?? windows系統編程 一本很好的書!值得看哦!
?? HTML
?? 第 1 頁 / 共 3 頁
字號:
<html>
<head>
<title>Generic</title>
<meta  name="description" content="Reliable software Win32 Tutorial: Generic app">
<meta name="keywords" content="reliable, software, windows, cplusplus, source code, example, tutorial, object oriented, CreateWindow, WindowClass, MVC, model, view, controller">
</head>

<body background="../images/grid.gif" bgcolor="white" text="black">
<script language="JAVASCRIPT">
<!--
if (navigator.onLine){
document.write("<!-- Spidersoft WebZIP Ad Banner Insert -->");
document.write("<TABLE width=100% border=0 cellpadding=0 cellspacing=0>");
document.write("<TR>");
document.write("<TD>");
document.write("<ILAYER id=ad1 visibility=hidden height=60></ILAYER>");
document.write("<NOLAYER>");
document.write("<IFRAME SRC='http://www.spidersoft.com/ads/bwz468_60.htm' width=100% height=60 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no></IFRAME>");
document.write("</NOLAYER>");
document.write("</TD>");
document.write("</TR>");
document.write("</TABLE>");
document.write("<!-- End of Spidersoft WebZIP Ad Banner Insert-->");
}
 //-->
</script>

<table cellpadding=10 width="100%">
<tr>
   <td width=100 align=center valign=middle>
      <a href="../index.htm">
      <img src="../images/rsbullet.gif" alt="RS" border=0 width=39 height=39>
      <br>Home</a>
   <td><font face="arial" color="#009966">
       <h1 align=center>The Generic Windows Program</h1>
       </font>
</table>


<table width="100%"><!-- main table -->
<tr>
   <td width=10> <!-- Left margin -->
   <td> <!-- Middle column, there is also the right margin at the end -->

   <table cellpadding=10 cellspacing=0 width="100%">
   <tr>
   <td bgcolor=white>


<hr><!--Text-->
<font size="+1"><b>This program uses</b></font> the basic set of classes that encapsulate the Windows API.
<ul>
<li>Controller-- The bridge between Window Procedure and Object Oriented world.
<li>View-- Encapsulates the output of a Windows program.
<li>Canvas-- Encapsulated various Device Contexts and things you can do with them.
<li>Model-- The worker and the brain of your program. Doesn't deal with Windows at all.
</ul>
<table bgcolor="#FFFF99" cellspacing="2" cellpadding="2" border="1" frame="box">
<tr>
    <td>
Note: This is a Win32 program-- it will run under Windows 95 and Windows NT.
	</td>
</tr>
<tr>
    <td>
Note: <b>_set_new_handler</b> is Microsoft-specific. If you're using some other compiler, just remove this line of code. According to current C++ standard, operator new should throw exceptions anyway.
	</td>
<tr>
    <td>
Note: Older compilers might have problems with templates. In such case, you may substitute the use of <b>Win[Get/Set]Long</b> templates with direct calls to <b>Get/SetWindowLong</b>. For instance, instead of calling
<p><font face="courier">
Controller * pCtrl = WinGetLong<Controller *> (hwnd);
</font>

<p>you can call 
<p><font face="courier">
Controller * pCtrl = reinterpret_cast&lt;Controller *&gt; (::GetWindowLong (hwnd, GWL_USERDATA));
</font>
	</td>
</tr>
</table>

<p>Download <a href="source/generic.zip"><img src="images/generic.gif" alt="generic icon" width=32 height=32>eneric</a> sources (zipped file 11k).
<hr>
<p><font size="+1"><b>Let's start with WinMain</b></font> where we create the Window class and the top window of our application. I have encapsulated these actions inside two classes: <font color="#cc0066"><b>WinClass</b></font> and <font color="#cc0066"><b>WinMaker</b></font>. WinClass can also tell us if there already are running instances of our program. When something like that happens, in our example, we will simply activate the previously running instance of the program and exit. You should do that when you want only one instance of your program running at a time.
<p>Once the top window is successfully created, we enter the message loop. Notice that this time we are processing keyboard shortcuts by calling <font color="#000099"><b>TranslateMessage</b></font>. That's because our program has menu items that can be accessed using Alt+key combinations.
<p>Another interesting twist in this program is that we are no longer using strings to name our resources--we use numerical ids. More than that--even when the API's call for strings, like the name of the Windows class or the caption, we store the strings in <i>string resources</i> and access them through ids. Your Windows development environment most likely has a resource editor that lets you create icons, menus, and string resources and assign them appropriate numerical ids. Symbolic names for these ids are stored in a header file produced by such an editor--in our case it's called <i>resource.h</i>.
<p>The constant, ID_MAIN, for instance, refers to the main program's icons (large and small in the same resource), the main menu, and the string with the Windows class name. ID_CAPTION refers to the window caption string. Such organization promotes code reusability, not to mention the ease of localization.
<hr>

         <!--Yellow background-->
        <table cellpadding=10 cellspacing=0 width="100%">
                <tr>
                      <td width=20>
            	      <td bgcolor="#e0e080">
<pre><font face="courier">int WINAPI <font color="#cc0066"><b>WinMain</b></font>
    (HINSTANCE hInst, HINSTANCE hPrevInst,
     char * cmdParam, int cmdShow)
{
    _set_new_handler (&amp; NewHandler);

    <font color="#cc0066">// Using exceptions here helps debugging your program
    // and protects from unexpected incidents.</font>
    try
    {
        <font color="#cc0066">// Create top window class</font>
        TopWinClass topWinClass (ID_MAIN, hInst, MainWndProc);
        <font color="#cc0066">// Is there a running instance of this program?</font>
        HWND hwndOther = topWinClass.GetRunningWindow ();
        if (hwndOther != 0)
        {
            ::SetForegroundWindow (hwndOther);
            if (::IsIconic (hwndOther))
                ::ShowWindow (hwndOther, SW_RESTORE);
            return 0;
        }
        topWinClass.Register ();

        <font color="#cc0066">// Create top window</font>
        ResString caption (hInst, ID_CAPTION);
        TopWinMaker topWin (topWinClass, caption);
        topWin.Create ();
        topWin.Show (cmdShow);
        <font color="#cc0066">// The main message loop</font>
        MSG  msg;
        int status;
        while ((status = ::GetMessage (&amp;msg, 0, 0, 0)) != 0)
        {
            if (status == -1)
                return -1;
            ::TranslateMessage (&amp;msg);
            ::DispatchMessage (&amp;msg);
        }

        return msg.wParam;
    }
    catch ( WinException e )
    {
        char buf [50];
        wsprintf (buf, "%s, Error %d", e.GetMessage (), e.GetError ());
        ::MessageBox (0, buf, "Exception", MB_ICONEXCLAMATION | MB_OK);
    }
    catch (...)
    {
        ::MessageBox (0, "Unknown", "Exception", MB_ICONEXCLAMATION | MB_OK);
    }

    return 0;
}</font></pre><!--End Code-->
                      <td width=20>
        </table>
        <!--End of yellow background-->

<hr><!--Text-->
Let's have a look at the <font color="#cc0066"><b>WinClass</b></font> class. It encapsulates a Windows-defined structure called <font color="#009966">WNDCLASSEX</font> and provides reasonable defaults for all its fields. It is derived from a simple WinSimpleClass class, which you might use to encapsulate some built-in Windows classes (like buttons, list views, etc.).
<p>I have provided examples of methods that can be used to override the defaults. For instance, <font color="#cc0066"><b>SetBgSysColor</b></font> changes the default background color of the user area of the window to one of the predefined system colors. The method <font color="#cc0066"><b>SetResIcons</b></font> loads appropriate icons from resources and attaches them to the Window class. These icons will then appear in the upper left corner of the main window and on the Windows' taskbar.
<p><font color="#cc0066"><b>TopWinClass</b></font> derived from <font color="#cc0066"><b>WinClass</b></font> makes use of this method. It also assigns the menu to the top window class.

<hr><!--End Text-->

         <!--Yellow background-->
        <table cellpadding=10 cellspacing=0 width="100%">
                <tr>
                      <td width=20>
            	      <td bgcolor="#e0e080">
<pre><font face="courier"><!--Code-->
class <font color="#cc0066"><b>WinSimpleClass</b></font>
{
public:
	WinSimpleClass (char const * name, HINSTANCE hInst)
		: _name (name), _hInstance (hInst)
	{}
	WinSimpleClass (int resId, HINSTANCE hInst);
	char const * GetName () const { return _name.c_str (); }
	HINSTANCE GetInstance () const { return _hInstance; }
    HWND GetRunningWindow ();
protected:
	HINSTANCE	_hInstance;
	std::string	_name;
};

<font color="#cc0066"><b>WinSimpleClass::WinSimpleClass</b></font> (int resId, HINSTANCE hInst)
: _hInstance (hInst)
{
	ResString resStr (hInst, resId);
	_name = resStr;
}

HWND <font color="#cc0066"><b>WinSimpleClass::GetRunningWindow</b></font> ()
{
    HWND hwnd = ::<font color="#000099"><b>FindWindow</b></font> (GetName (), 0);
    if (::<font color="#000099"><b>IsWindow</b></font> (hwnd))
    {
        HWND hwndPopup = ::<font color="#000099"><b>GetLastActivePopup</b></font> (hwnd);
        if (::<font color="#000099"><b>IsWindow</b></font> (hwndPopup))
            hwnd = hwndPopup;
    }
    else 
        hwnd = 0;

    return hwnd;
}
<hr>
class <font color="#cc0066"><b>WinClass</b></font>: public <font color="#cc0066"><b>WinSimpleClass</b></font>
{
public:
    WinClass (char const * className, HINSTANCE hInst, WNDPROC wndProc);
    WinClass (int resId, HINSTANCE hInst, WNDPROC wndProc);
    void SetBgSysColor (int sysColor)
    {
        _class.hbrBackground = reinterpret_cast&lt;HBRUSH&gt; (sysColor + 1);
    }
    void SetResIcons (int resId);
    void Register ();
protected:
    void SetDefaults ();
    <font color="#009966"><b>WNDCLASSEX</b></font> _class;
};

<font color="#cc0066"><b>WinClass::WinClass</b></font> (char const * className, HINSTANCE hInst, WNDPROC wndProc)
    : WinSimpleClass (className, hInst)
{
    _class.lpfnWndProc = wndProc;
	SetDefaults ();
}

<font color="#cc0066"><b>WinClass::WinClass</b></font> (int resId, HINSTANCE hInst, WNDPROC wndProc)
    : WinSimpleClass (resId, hInst)
{
    _class.lpfnWndProc = wndProc;
	SetDefaults ();
}

void <font color="#cc0066"><b>WinClass::SetDefaults</b></font> ()
{
    // Provide reasonable default values
    _class.cbSize = sizeof (WNDCLASSEX);
    _class.style = 0;
    _class.lpszClassName = GetName ();
    _class.hInstance = GetInstance ();
    _class.hIcon = 0;
    _class.hIconSm = 0;
    _class.lpszMenuName = 0;
    _class.cbClsExtra = 0;
    _class.cbWndExtra = 0;
    _class.hbrBackground = reinterpret_cast&lt;HBRUSH&gt; (COLOR_WINDOW + 1);
    _class.hCursor = ::LoadCursor (0, IDC_ARROW);
}

void <font color="#cc0066"><b>WinClass::SetResIcons</b></font> (int resId)
{
    _class.hIcon = reinterpret_cast&lt;HICON&gt; (
        ::<font color="#000099"><b>LoadImage</b></font> (
            _class.hInstance, 
            MAKEINTRESOURCE (resId), 
            IMAGE_ICON, 
            ::<font color="#000099"><b>GetSystemMetrics</b></font> (SM_CXICON),
            ::<font color="#000099"><b>GetSystemMetrics</b></font> (SM_CYICON),
            0));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人免费av在线| 亚洲一区二三区| 国产成人在线免费观看| 国产日韩欧美一区二区三区乱码| 久久国产尿小便嘘嘘| 久久久精品综合| 99视频国产精品| 亚洲综合色噜噜狠狠| 欧美日韩精品一区二区| 蜜桃av一区二区在线观看| 久久婷婷一区二区三区| 波多野结衣一区二区三区| 亚洲人精品午夜| 欧美久久久久久久久久| 国产伦精品一区二区三区在线观看 | 国产美女精品人人做人人爽| 中文字幕一区二区在线观看| 欧美三级电影在线观看| 日韩成人精品在线观看| 久久久精品中文字幕麻豆发布| 99精品视频在线播放观看| 亚洲第一av色| 久久久久九九视频| 在线免费观看视频一区| 精品一区二区三区免费毛片爱| 国产精品亲子伦对白| 欧美久久久久免费| 粉嫩av一区二区三区| 亚洲风情在线资源站| 国产欧美视频一区二区| 欧美色精品在线视频| 高清国产一区二区| 亚洲chinese男男1069| 精品国产91久久久久久久妲己| av中文字幕一区| 蜜臀久久99精品久久久久久9| 亚洲国产精品二十页| 欧美丰满高潮xxxx喷水动漫| 成人深夜视频在线观看| 日韩av电影免费观看高清完整版 | 成人免费毛片app| 日本欧美韩国一区三区| 国产精品色哟哟| 中文成人综合网| 欧美一级免费观看| 色综合久久久久| 国产精品中文字幕欧美| 奇米影视一区二区三区| 亚洲精品免费视频| 久久嫩草精品久久久久| 制服.丝袜.亚洲.另类.中文| 一本大道综合伊人精品热热| 国产乱码精品一区二区三| 婷婷激情综合网| 一区二区免费在线播放| 国产精品久久久久久久久动漫 | 成人免费av网站| 久草中文综合在线| 日韩精品成人一区二区在线| 亚洲一线二线三线久久久| 日韩理论片在线| 成人免费在线视频观看| 久久人人97超碰com| 日韩美一区二区三区| 欧美一区二区视频在线观看2022 | 99久久久久免费精品国产| 国产一区二区福利视频| 久久超级碰视频| 久久er精品视频| 青娱乐精品视频| 蜜臀av在线播放一区二区三区| 亚洲sss视频在线视频| 一区二区三区自拍| 亚洲精品免费在线| 樱桃国产成人精品视频| 亚洲精品网站在线观看| 日韩理论电影院| 亚洲综合视频在线观看| 亚洲午夜激情网页| 亚洲gay无套男同| 日韩精品乱码免费| 日韩成人午夜精品| 蜜桃精品在线观看| 久久91精品久久久久久秒播| 麻豆精品国产91久久久久久| 久久99最新地址| 国产一区二区在线免费观看| 国产乱码精品1区2区3区| 精品一区二区三区免费视频| 国产制服丝袜一区| 国产成人在线观看免费网站| 成人激情综合网站| 91色.com| 欧美福利一区二区| 日韩精品一区二区三区视频 | 91色porny在线视频| 久久蜜桃一区二区| 国产精品伦理一区二区| 一区二区三区免费在线观看| 肉色丝袜一区二区| 国产精品自在在线| 97国产一区二区| 6080午夜不卡| 久久先锋影音av鲁色资源网| 国产精品久久久久7777按摩| 一区二区成人在线| 狠狠色丁香婷综合久久| 成人网男人的天堂| 欧美三级日韩三级国产三级| 欧美一级一区二区| 国产精品女主播在线观看| 亚洲国产综合人成综合网站| 美女任你摸久久 | 欧美在线啊v一区| 日韩欧美一区二区不卡| 中文在线资源观看网站视频免费不卡 | 一区二区三国产精华液| 蜜臀精品久久久久久蜜臀| 成人的网站免费观看| 欧美区一区二区三区| 日本一区二区三区在线观看| 一区二区三区中文字幕电影| 精品一区二区免费视频| 一本色道久久综合亚洲精品按摩 | 日韩你懂的在线观看| 一区二区中文字幕在线| 美女在线一区二区| 色综合久久九月婷婷色综合| 久久久影院官网| 天天色综合天天| 91偷拍与自偷拍精品| 久久新电视剧免费观看| 日韩高清不卡在线| 91视频观看视频| 久久精子c满五个校花| 天堂成人免费av电影一区| 不卡一卡二卡三乱码免费网站| 日韩一区二区三| 亚洲第一福利视频在线| 91网站在线观看视频| 日本一区二区三级电影在线观看| 日日夜夜一区二区| 欧美日精品一区视频| 国产精品免费久久| 精品一区精品二区高清| 91精品欧美福利在线观看| 一区二区三区av电影 | 亚洲精品一二三| 99精品在线免费| 中文字幕的久久| 国产sm精品调教视频网站| 日韩欧美中文一区二区| 天天影视涩香欲综合网| 欧美日韩中字一区| 亚洲最新在线观看| 天堂在线亚洲视频| 欧美日韩一区二区欧美激情 | 欧美视频在线播放| 亚洲天堂中文字幕| hitomi一区二区三区精品| 国产亚洲精品7777| 国产在线精品一区二区夜色 | 欧美日韩日日摸| 亚洲一级在线观看| 欧美三级一区二区| 午夜精品免费在线| 欧美日韩二区三区| 日本最新不卡在线| 日韩欧美一区中文| 激情欧美一区二区| 国产色婷婷亚洲99精品小说| 国产精品白丝av| 国产精品人妖ts系列视频| 丰满放荡岳乱妇91ww| 亚洲欧洲色图综合| 色琪琪一区二区三区亚洲区| 一区二区在线观看免费视频播放| 91色婷婷久久久久合中文| 一区二区三区精品| 91精品在线免费观看| 久久www免费人成看片高清| 国产日韩精品一区二区三区| 成人妖精视频yjsp地址| 中文字幕在线不卡一区| 在线亚洲欧美专区二区| 午夜精品福利视频网站 | 国产日产亚洲精品系列| 成人午夜视频免费看| 亚洲码国产岛国毛片在线| 欧美色涩在线第一页| 久久精品理论片| 中文字幕精品一区| 欧美三级视频在线播放| 国产综合色产在线精品| 1024亚洲合集| 337p亚洲精品色噜噜| 国产白丝精品91爽爽久久 | 欧美精品色一区二区三区| 国内不卡的二区三区中文字幕 | 成人h版在线观看|