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

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

?? windlg.html

?? windows系統編程 一本很好的書!值得看哦!
?? HTML
字號:
<html>
<head>
<title>Dialog Box Applet</title>
<meta  name="description" content="Reliable software Win32 Tutorial: Dialog Box Applest">
<meta name="keywords" content="windows, cplusplus, source code, example, tutorial, object oriented, CreateDialog, IsDialogMessage, Win32">
</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>Program with a Dialog Box as the Main Window</h1>
       </font>
</table>


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

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


<hr>
<font size="+1"><b>The main window</b></font> of a program doesn't have to be a resizable general purpose window. Many small applications work better in a dialog box format. The obvious advantage of such an approach is that you can use a resource editor to arrange all your controls on the surface of the box.  This is in fact how the UI of the <a href="../freq.html">Frequency Analyzer</a> was implemented. Since this is a useful technique, I will describe it in some detail. You can also <a href="source/DlgApp.zip">download the source code</a> for a simple application that demonstrates the techniques described here (courtesy Laszlo Radanyi).
<p>First of all, we have to design the dialog box using the resource editor. We assign identifiers to all the controls and to the dialog itself. Here, the dialog resource has the identifier DLG_MAIN. In the <i>WinMain</i> procedure we don't have to register any window class, because Windows has a pre-defined class for dialog boxes. Instead of creating a window, we call <i>CreateDialog</i>, passing it a pointer to our own dialog procedure (explained later).
<p>The message loop is non-standard in that it calls <i>IsDialogMessage</i> for every message. This API not only checks whether a given message is directed at the dialog box, but more importantly, it dispatches it to the dialog procedure. If the message was not for the dialog, we do the standard translation and dispatching.
<p>For convenience, we keep the value of HINSTANCE in a global variable. This is actually a precursor of a more general object--the Application. Here, however, we decided it was too trivial to deserve a class of its own.
<hr>
<pre><font face="courier">
<font color="#009966">HINSTANCE</font> TheInstance = 0;

int <font color="#009966">WINAPI</font> <font color="#cc0066"><b>WinMain</b></font>
   (<font color="#009966">HINSTANCE</font> hInst, <font color="#009966">HINSTANCE</font> hPrevInst, char * cmdParam, int cmdShow)
{
    TheInstance = hInst;
    _set_new_handler (&amp; NewHandler);

    <font color="#009966">HWND</font> hDialog = 0;

    hDialog = <font color="#000099"><b>CreateDialog</b></font> (hInst, <font color="#000099"><b>MAKEINTRESOURCE</b></font> (DLG_MAIN), 0, DialogProc);

    if (!hDialog)
    {
        char buf [100];
        wsprintf (buf, "Error x%x", GetLastError ());
        <font color="#000099"><b>MessageBox</b></font> (0, buf, "CreateDialog", <font color="#009966">MB_ICONEXCLAMATION</font> | <font color="#009966">MB_OK</font>);
        return 1;
    }

    MSG  msg;
    int status;
    while ((status = <font color="#000099"><b>GetMessage</b></font> (&amp; msg, 0, 0, 0)) != 0)
    {
        if (status == -1)
            return -1;
        if (!<font color="#000099"><b>IsDialogMessage</b></font> (hDialog, &amp; msg))
        {
            <font color="#000099"><b>TranslateMessage</b></font> ( &amp; msg );
            <font color="#000099"><b>DispatchMessage</b></font> ( &amp; msg );
        }
    }

    return msg.wParam;
}
</font></pre>
<hr>
The dialog procedure is just like Windows procedure, except that it returns TRUE when it processes a message and FALSE when it doesn't. There is no need to call the default procedure, because Windows does it for us whenever the dialog procedure returns FALSE (makes you thing why wasn't the same design used in Windows procedure...). The first message the dialog gets is WM_INITDIALOG and the last one is WM_CLOSE. During the processing of these messages we create and destroy the Controller. Other than that, the dialog expects messages from its controls--these are passed as WM_COMMAND. One control that requires special processing is a (horizontal) scrollbar--it sends the WM_HSCROLL message. There are scrollbar controls in the Frequency Analyzer and that's how they are dealt with.
<hr>
<pre><font face="courier">
BOOL CALLBACK <font color="#cc0066"><b>DialogProc</b></font> (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    static Controller* control = 0;
    switch (message)
    {
    case <font color="#009966">WM_INITDIALOG</font>:
        try
        {
            control = new Controller (hwnd);
        }
        catch (WinException e)
        {
            <font color="#000099"><b>MessageBox</b></font> (0, e.GetMessage (), "Exception", <font color="#009966">MB_ICONEXCLAMATION</font> | <font color="#009966">MB_OK</font>);
        }
        catch (...)
        {
            <font color="#000099"><b>MessageBox</b></font> (0, "Unknown", "Exception", <font color="#009966">MB_ICONEXCLAMATION</font> | <font color="#009966">MB_OK</font>);
            return -1;
        }
        return TRUE;
    case <font color="#009966">WM_COMMAND</font>:
        control-&gt;Command(hwnd, LOWORD (wParam), HIWORD (wParam));
        return TRUE;
    case <font color="#009966">WM_HSCROLL</font>:
        control-&gt;Scroll (hwnd, LOWORD (wParam), HIWORD (wParam));
        return 0;
    case <font color="#009966">WM_CLOSE</font>:
        delete control;
        <font color="#000099"><b>DestroyWindow</b></font> (hwnd);
        return TRUE;
    }
    return FALSE;
}
</font></pre>
<hr>
Let's have a look at the Controller. Notice how every control on the face of the dialog box has a corresponding (embedded) <a href="controls.html">control object</a> inside the Controller. There are edits, combos, radio buttons and scrollbars. There is a special metafile control that draws the frequency scale and two view objects corresponding to two static panes upon which we draw the graphs. Finally we have the <a href="../recorder.html">Painter</a> object that is responsible for the asynchronous repainting of the two panes.
<hr>
<pre><font face="courier">
class <font color="#cc0066"><b>Controller</b></font>
{
public:
    Controller(HWND hwnd);
    ~Controller ();
    void Command (HWND hwnd, int id, int code);
    void Scroll (HWND hwnd, int cmd, int pos);
    void Paint (HWND hwnd);
    void ReInit (HWND hwnd);
    void Stop (HWND hwnd);

private:
    void InitScrollPositions ();
    void PaintScale ();

    BOOL                _isStopped;

    int                 _bitsPerSample;
    int                 _samplesPerSecond;
    int                 _fftPoints;
    int                 _samplesPerBuf;

    EditReadOnly        _edit;
    Combo               _comboFreq;
    Combo               _comboPoints;
    RadioButton         _radio8;
    RadioButton         _radio16;
    ScrollBarMap        _scroll;

    StaticEnhMetafileControl    _scaleFreq;

    ViewWave            _viewWave;
    ViewFreq            _viewFreq;

    Painter             _display;
};

</font></pre>
<hr>
The constructor of the Controller takes care of the initialization of all the controls by passing them the handle to the dialog box window and the appropriate identifiers. As a matter of cosmethics, we attach our own icon to the dialog--otherwise the system would use the standard Windows icon.
<hr>
<pre><font face="courier">

<font color="#cc0066"><b>Controller::Controller</b></font> (HWND hwnd)
   :_isStopped (TRUE),
    _bitsPerSample (16),
    _samplesPerSecond (SAMPLES_SEC),
    _fftPoints (FFT_POINTS * 4),
    _samplesPerBuf (FFT_POINTS * 2),
    _radio8 (hwnd, IDC_8_BITS),
    _radio16 (hwnd, IDC_16_BITS),
    _scroll (hwnd, IDC_SCROLLBAR),
    _edit (hwnd, IDC_EDIT),
    _comboFreq (hwnd, IDC_SAMPLING),
    _comboPoints (hwnd, IDC_POINTS),
    _viewWave (hwnd, IDS_WAVE_PANE, FFT_POINTS * 8),
    _viewFreq (hwnd, IDS_FREQ_PANE),
    _scaleFreq (hwnd, IDC_FREQ_SCALE),
    _display (hwnd,
            _viewWave,
            _viewFreq,
            _samplesPerBuf,
            _samplesPerSecond,
            _fftPoints)
{
    // Attach icon to main dialog
    HICON hIcon = <font color="#000099"><b>LoadIcon</b></font> (TheInstance, <font color="#000099"><b>MAKEINTRESOURCE</b></font> (ICO_FFT));
    <font color="#000099"><b>SendMessage</b></font> (hwnd, <font color="#009966">WM_SETICON</font>, WPARAM (<font color="#009966">ICON_SMALL</font>), LPARAM (hIcon));
    // Other initializations...
}

</font></pre>
<hr>
Using a dialog box as the main window is a very handy and simple technique, especially for applications that display a panel-like interface. By the way, the Battleship app (see the <a href="../index.htm">home page</a>) uses the same trick. You may now continue to the next tutorial on the use of <a href="dialog.html">dialog boxes</a> in Windows applications.
<hr>
   </table>
</table>



<layer src="http://www.spidersoft.com/ads/bwz468_60.htm" visibility=hidden id=a1 width=600 onload="moveToAbsolute(ad1.pageX,ad1.pageY); a1.clip.height=60;visibility='show';"></layer>
</body>
</html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
五月综合激情婷婷六月色窝| 国产精品乱人伦中文| 亚洲国产成人porn| 欧美日韩情趣电影| 日本不卡一区二区三区 | 99久久99久久综合| 亚洲三级电影网站| 欧美视频一区在线观看| 日韩精品色哟哟| 欧美不卡一区二区三区| 国产成a人亚洲精品| 一区二区三区四区视频精品免费| 欧日韩精品视频| 久久精品国产亚洲一区二区三区| 久久众筹精品私拍模特| 成人国产精品免费| 亚洲一区二区不卡免费| 精品伦理精品一区| 91麻豆产精品久久久久久| 婷婷综合另类小说色区| 精品精品国产高清一毛片一天堂| 成人午夜av影视| 午夜a成v人精品| 国产精品五月天| 日韩三级在线观看| 99久久综合精品| 蜜桃视频一区二区三区在线观看| 日本一区二区三区免费乱视频| 欧美性一二三区| 高清av一区二区| 日韩激情一二三区| 亚洲欧洲成人自拍| 日韩精品一区二区三区视频播放 | 亚洲视频一区二区在线| 日韩一区二区免费电影| jlzzjlzz国产精品久久| 美女国产一区二区| 一区二区三区在线视频观看| 精品日韩成人av| 欧美一a一片一级一片| 国产精品白丝av| 免费看精品久久片| 亚洲国产一区二区a毛片| 国产欧美精品国产国产专区| 欧美精品久久一区| 色婷婷av久久久久久久| 国产呦精品一区二区三区网站| 亚洲与欧洲av电影| 亚洲欧洲av在线| 国产午夜精品久久| 日韩免费福利电影在线观看| 99精品国产99久久久久久白柏| 紧缚捆绑精品一区二区| 五月激情综合色| 亚洲制服丝袜av| 亚洲男人的天堂av| 成人免费视频在线观看| 国产欧美1区2区3区| 精品久久久久久综合日本欧美| 欧美吞精做爰啪啪高潮| 91麻豆免费看片| 99久久精品国产精品久久| 成人毛片老司机大片| 国产精品一区二区三区99 | 国产乱人伦偷精品视频免下载 | 激情亚洲综合在线| 久久国产精品第一页| 日韩中文欧美在线| 亚瑟在线精品视频| 亚洲va欧美va人人爽午夜| 一区二区理论电影在线观看| 亚洲色图在线播放| 亚洲素人一区二区| 樱桃视频在线观看一区| 亚洲一区日韩精品中文字幕| 一区二区不卡在线播放 | 欧美日韩电影一区| 欧美精品一二三| 欧美一区二区三区婷婷月色| 欧美一级午夜免费电影| 日韩一卡二卡三卡国产欧美| 欧美一区二区观看视频| 久久尤物电影视频在线观看| 欧美videofree性高清杂交| 精品国产一区二区国模嫣然| 久久亚洲一区二区三区明星换脸 | 91一区二区三区在线播放| 色婷婷综合久久久久中文一区二区| 99久久婷婷国产| 色综合久久天天| 欧美日韩一区国产| 欧美一区二区三区爱爱| 久久蜜桃香蕉精品一区二区三区| 国产精品丝袜久久久久久app| 国产精品视频yy9299一区| 亚洲视频精选在线| 亚洲va韩国va欧美va| 另类小说综合欧美亚洲| 岛国精品一区二区| 在线观看亚洲a| 欧美一区二区视频观看视频| 久久久美女艺术照精彩视频福利播放| 国产日韩欧美精品一区| 亚洲综合偷拍欧美一区色| 美日韩一级片在线观看| 99久久婷婷国产| 欧美一级二级三级乱码| 国产视频一区二区在线| 一区二区三区免费观看| 蜜臀av一区二区| 99re免费视频精品全部| 91精品国产全国免费观看| 久久精品水蜜桃av综合天堂| 一区二区三区日韩欧美| 激情综合色播激情啊| 欧美主播一区二区三区| www激情久久| 亚洲国产成人高清精品| 国产成人精品免费在线| 欧美色图第一页| 国产日产欧产精品推荐色| 亚洲成人自拍网| 成人动漫一区二区三区| 欧美一区二区三级| 亚洲精品一卡二卡| 国产成人欧美日韩在线电影| 欧美色视频在线观看| 中文字幕+乱码+中文字幕一区| 亚洲成人三级小说| 成人永久看片免费视频天堂| 91精品福利在线一区二区三区 | 在线视频欧美区| 国产蜜臀av在线一区二区三区| 五月激情六月综合| 色综合久久88色综合天天免费| 亚洲精品一区二区三区精华液 | 欧美日韩一级黄| 日本一区二区三区高清不卡| 日本不卡1234视频| 色偷偷成人一区二区三区91| 国产日韩影视精品| 激情文学综合插| 欧美xxxx老人做受| 免费欧美日韩国产三级电影| 91久久人澡人人添人人爽欧美 | 久久五月婷婷丁香社区| 视频在线观看91| 欧美日韩一区三区| 伊人色综合久久天天| 99久久99久久精品免费看蜜桃| 久久青草欧美一区二区三区| 水蜜桃久久夜色精品一区的特点| 91亚洲大成网污www| 18涩涩午夜精品.www| 夫妻av一区二区| 日本一区二区三区dvd视频在线| 经典一区二区三区| 欧美sm美女调教| 麻豆成人久久精品二区三区红 | 国产精品一品视频| 久久久一区二区三区捆绑**| 久久99国产精品成人| 欧美mv和日韩mv的网站| 免费观看日韩电影| 日韩欧美一级精品久久| 久久97超碰色| 国产亚洲精品aa| 国产成人免费视频网站| 欧美激情一区二区三区在线| 国产精品1024| 中文在线一区二区| 不卡在线视频中文字幕| 亚洲日本在线观看| 欧美视频一区二区三区在线观看 | 欧美亚洲禁片免费| 亚洲成人福利片| 日韩欧美一级特黄在线播放| 美日韩黄色大片| 国产日韩影视精品| 色综合一个色综合亚洲| 一区二区三区国产精品| 777久久久精品| 久久99国内精品| 国产精品无遮挡| 在线观看不卡一区| 日韩影院免费视频| 久久亚洲二区三区| 99久久免费视频.com| 亚洲午夜精品网| 久久青草欧美一区二区三区| 成人福利视频在线看| 亚洲一区二区精品3399| 精品欧美一区二区在线观看| 国产成a人亚洲精品| 亚洲专区一二三| www国产精品av| 在线免费av一区| 国产一区二区中文字幕| 亚洲精品第一国产综合野| 欧美xxxxx牲另类人与|