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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? generic.html

?? windows系統(tǒng)編程 一本很好的書!值得看哦!
?? HTML
?? 第 1 頁 / 共 3 頁
字號(hào):
<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));

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩不卡手机在线v区| 成人在线视频一区| 国产精品久久久久久久久搜平片| 欧美色网站导航| 成人一区二区三区视频在线观看| 性感美女久久精品| 亚洲欧美一区二区久久 | 欧美婷婷六月丁香综合色| 精品一区二区三区在线播放| 亚洲精选在线视频| 国产精品三级av在线播放| 欧美成人综合网站| 3d动漫精品啪啪1区2区免费| 色综合 综合色| jlzzjlzz亚洲女人18| 精品一区二区三区免费视频| 亚洲国产aⅴ天堂久久| 日韩伦理电影网| 中文无字幕一区二区三区| 精品人在线二区三区| 在线不卡免费欧美| 欧美三级电影在线看| 色爱区综合激月婷婷| 972aa.com艺术欧美| 成人av资源在线| 成人免费视频国产在线观看| 国产91富婆露脸刺激对白| 国产乱人伦偷精品视频免下载| 另类的小说在线视频另类成人小视频在线| 亚洲成人黄色小说| 亚洲大片在线观看| 首页国产欧美日韩丝袜| 日韩成人精品在线| 日韩高清中文字幕一区| 日韩精品免费专区| 日本成人在线不卡视频| 日本最新不卡在线| 日韩av电影天堂| 久久se精品一区二区| 久久99国产乱子伦精品免费| 黄色小说综合网站| 国产呦精品一区二区三区网站| 美女高潮久久久| 国产美女精品一区二区三区| 国产酒店精品激情| www.亚洲在线| 色素色在线综合| 欧美日韩久久一区| 91精品国产丝袜白色高跟鞋| 精品三级在线看| 国产欧美精品一区二区三区四区| 日本一区二区三区国色天香| 国产精品天天看| 专区另类欧美日韩| 亚洲国产中文字幕在线视频综合| 午夜欧美电影在线观看| 久久疯狂做爰流白浆xx| 国产成人免费在线视频| av不卡在线播放| 欧美私人免费视频| 日韩欧美在线综合网| 国产亚洲精久久久久久| 亚洲图片另类小说| 日韩电影免费在线| 国产成人精品免费| 日本韩国欧美在线| 日韩一区二区在线看片| 久久精品欧美日韩| 一区二区三区在线观看动漫| 视频在线观看91| 国产乱色国产精品免费视频| 99精品欧美一区二区三区小说| 欧美性生活影院| xvideos.蜜桃一区二区| 亚洲图片激情小说| 天堂一区二区在线| 懂色av一区二区三区蜜臀| 欧美日韩另类一区| 国产三级精品视频| 亚洲福利视频导航| 成人黄页毛片网站| 在线综合+亚洲+欧美中文字幕| 欧美国产成人在线| 日本特黄久久久高潮| eeuss国产一区二区三区| 欧美一区二区三区日韩| 中文字幕一区免费在线观看| 蜜臀av一区二区在线观看 | 成人黄动漫网站免费app| 3751色影院一区二区三区| 中文字幕精品一区| 日本欧美在线看| 91久久精品一区二区| 久久久久国产精品麻豆| 亚洲国产成人av| 91在线无精精品入口| 精品毛片乱码1区2区3区| 夜夜夜精品看看| 成人性视频免费网站| 欧美tickle裸体挠脚心vk| 亚洲成人av免费| 91蜜桃视频在线| 久久久91精品国产一区二区三区| 亚洲v日本v欧美v久久精品| 99re这里只有精品首页| 国产欧美精品日韩区二区麻豆天美| 日韩和欧美的一区| 欧美午夜一区二区三区| 国产精品国产三级国产aⅴ原创 | 国产一区视频在线看| 欧美人与性动xxxx| 亚洲一区二区精品视频| 91在线观看下载| 亚洲国产精品精华液2区45| 另类小说一区二区三区| 91精品国产综合久久蜜臀| 一区二区久久久| 91视频国产资源| 中文字幕av一区二区三区高| 国产麻豆午夜三级精品| 久久综合精品国产一区二区三区| 奇米影视一区二区三区| 91精品国模一区二区三区| 香蕉影视欧美成人| 欧美区在线观看| 日韩精品欧美成人高清一区二区| 欧美日韩小视频| 午夜视频一区在线观看| 欧美日韩你懂得| 天天影视涩香欲综合网| 91精品欧美综合在线观看最新| 日韩精品成人一区二区三区| 欧美日韩国产乱码电影| 三级在线观看一区二区| 日韩限制级电影在线观看| 麻豆精品精品国产自在97香蕉| 日韩免费看的电影| 国内一区二区视频| 亚洲精品一区二区三区香蕉| 国产制服丝袜一区| 国产三区在线成人av| 国产传媒欧美日韩成人| 中文av一区特黄| 色综合天天综合在线视频| 一区二区三区不卡在线观看| 欧美日韩黄色影视| 蜜臀a∨国产成人精品| 日韩精品一区二区三区视频在线观看| 国内外成人在线视频| 日本一区二区成人| 91麻豆精品国产91久久久使用方法| 秋霞成人午夜伦在线观看| 久久品道一品道久久精品| 99久久精品免费精品国产| 亚洲一区二区三区爽爽爽爽爽| 这里只有精品视频在线观看| 国产揄拍国内精品对白| 国产精品麻豆一区二区| 欧美三电影在线| 久久97超碰国产精品超碰| 欧美激情在线免费观看| 色网站国产精品| 日韩av电影免费观看高清完整版 | 亚洲精品国产精品乱码不99| 欧美精品久久天天躁| 国内精品久久久久影院薰衣草| 国产精品女同一区二区三区| 欧美午夜视频网站| 国产一区二区成人久久免费影院 | 成人av高清在线| 亚洲香蕉伊在人在线观| 日韩欧美成人午夜| kk眼镜猥琐国模调教系列一区二区| 亚洲gay无套男同| 久久久精品黄色| 欧美日韩一级二级| 国产91色综合久久免费分享| 亚洲自拍偷拍av| 国产片一区二区| 欧美日韩欧美一区二区| 国产91露脸合集magnet| 日日欢夜夜爽一区| 国产精品家庭影院| 精品久久一二三区| 欧美午夜精品久久久久久超碰| 国产精品一区二区在线播放| 亚洲成年人影院| 国产精品网站在线观看| 欧美男女性生活在线直播观看| 国产成人av影院| 日韩av一区二区在线影视| 亚洲欧美韩国综合色| 久久久一区二区三区捆绑**| 欧美美女网站色| 91网站黄www| 国产精品亚洲成人| 日本特黄久久久高潮| 一区二区三区蜜桃网| 国产精品私人影院| 日韩午夜中文字幕|