📄 group__control__fns.htm
字号:
<dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>spClassName</em> </td><td>The class name of the control. </td></tr> <tr><td valign="top"></td><td valign="top"><em>spCaption</em> </td><td>The caption of the control. </td></tr> <tr><td valign="top"></td><td valign="top"><em>dwStyle</em> </td><td>The control style. </td></tr> <tr><td valign="top"></td><td valign="top"><em>dwExStyle</em> </td><td>The extended control style. </td></tr> <tr><td valign="top"></td><td valign="top"><em>id</em> </td><td>The identifier of the control. </td></tr> <tr><td valign="top"></td><td valign="top"><em>x</em> </td><td>x,y: The initial position of the control in the parent window. </td></tr> <tr><td valign="top"></td><td valign="top"><em>y</em> </td><td>x,y: The initial position of the control in the parent window. </td></tr> <tr><td valign="top"></td><td valign="top"><em>w</em> </td><td>The initial width of the control. </td></tr> <tr><td valign="top"></td><td valign="top"><em>h</em> </td><td>The initial height of the control. </td></tr> <tr><td valign="top"></td><td valign="top"><em>hParentWnd</em> </td><td>The handle to the parent window. </td></tr> <tr><td valign="top"></td><td valign="top"><em>dwAddData</em> </td><td>The first private additional data of the control. Note that some control classes use this value to initialize some properties of the new control instance. For these control classes, you should pass a valid value to it.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The handle to the new control, HWND_INVALID on error.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__window__create__fns.htm#ga9">CreateMainWindow</a>, <a class="el" href="group__dialog__fns.htm#ga0">CTRLDATA</a></dd></dl>Example:<p><div class="fragment"><pre class="fragment"><span class="comment">/*</span><span class="comment"> * The following code creates some controls when handling the MSG_CREATE message.</span><span class="comment"> */</span><span class="preprocessor">#define IDC_STATIC1 100</span><span class="preprocessor"></span><span class="preprocessor">#define IDC_STATIC2 150</span><span class="preprocessor"></span><span class="preprocessor">#define IDC_BUTTON1 110</span><span class="preprocessor"></span><span class="preprocessor">#define IDC_BUTTON2 120</span><span class="preprocessor"></span><span class="preprocessor">#define IDC_EDIT1 130</span><span class="preprocessor"></span><span class="preprocessor">#define IDC_EDIT2 140</span><span class="preprocessor"></span><span class="keywordtype">int</span> ControlTestWinProc (<a class="code" href="group__handles.htm#ga1">HWND</a> hWnd, <span class="keywordtype">int</span> message, <a class="code" href="group__win32__types.htm#ga8">WPARAM</a> wParam, <a class="code" href="group__win32__types.htm#ga9">LPARAM</a> lParam){ <span class="keyword">static</span> <a class="code" href="group__handles.htm#ga1">HWND</a> hStaticWnd1, hStaticWnd2, hButton1, hButton2, hEdit1, hEdit2; <span class="keywordflow">switch</span> (message) { <span class="keywordflow">case</span> <a class="code" href="group__creation__msgs.htm#ga1">MSG_CREATE</a>: { hStaticWnd1 = <a class="code" href="group__control__fns.htm#ga5">CreateWindow</a> (<a class="code" href="group__ctrl__static.htm#ga0">CTRL_STATIC</a>, <span class="stringliteral">"This is a static control"</span>, <a class="code" href="group__styles.htm#ga3">WS_CHILD</a> | <a class="code" href="group__ctrl__static__styles.htm#ga18">SS_NOTIFY</a> | <a class="code" href="group__ctrl__static__styles.htm#ga11">SS_SIMPLE</a> | <a class="code" href="group__styles.htm#ga6">WS_VISIBLE</a> | <a class="code" href="group__styles.htm#ga11">WS_BORDER</a>, IDC_STATIC1, 10, 10, 180, 300, hWnd, 0); hButton1 = <a class="code" href="group__control__fns.htm#ga5">CreateWindow</a> (<a class="code" href="group__ctrl__button.htm#ga1">CTRL_BUTTON</a>, <span class="stringliteral">"Button1"</span>, <a class="code" href="group__styles.htm#ga3">WS_CHILD</a> | <a class="code" href="group__ctrl__button__styles.htm#ga0">BS_PUSHBUTTON</a> | <a class="code" href="group__styles.htm#ga6">WS_VISIBLE</a>, IDC_BUTTON1, 20, 20, 80, 20, hStaticWnd1, 0); hButton2 = <a class="code" href="group__control__fns.htm#ga5">CreateWindow</a> (<a class="code" href="group__ctrl__button.htm#ga1">CTRL_BUTTON</a>, <span class="stringliteral">"Button2"</span>, <a class="code" href="group__styles.htm#ga3">WS_CHILD</a> | <a class="code" href="group__ctrl__button__styles.htm#ga0">BS_PUSHBUTTON</a> | <a class="code" href="group__styles.htm#ga6">WS_VISIBLE</a>, IDC_BUTTON2, 20, 50, 80, 20, hStaticWnd1, 0); hEdit1 = <a class="code" href="group__control__fns.htm#ga5">CreateWindow</a> (<a class="code" href="group__ctrl__edit.htm#ga0">CTRL_EDIT</a>, <span class="stringliteral">"Edit Box 1"</span>, <a class="code" href="group__styles.htm#ga3">WS_CHILD</a> | <a class="code" href="group__styles.htm#ga6">WS_VISIBLE</a> | <a class="code" href="group__styles.htm#ga11">WS_BORDER</a>, IDC_EDIT1, 20, 80, 100, 24, hStaticWnd1, 0); hStaticWnd2 = <a class="code" href="group__control__fns.htm#ga5">CreateWindow</a> (<a class="code" href="group__ctrl__static.htm#ga0">CTRL_STATIC</a>, <span class="stringliteral">"This is child static control"</span>, <a class="code" href="group__styles.htm#ga3">WS_CHILD</a> | <a class="code" href="group__ctrl__static__styles.htm#ga18">SS_NOTIFY</a> | <a class="code" href="group__ctrl__static__styles.htm#ga11">SS_SIMPLE</a> | <a class="code" href="group__styles.htm#ga6">WS_VISIBLE</a> | <a class="code" href="group__styles.htm#ga11">WS_BORDER</a>, IDC_STATIC1, 20, 110, 100, 50, hStaticWnd1, 0); hEdit2 = <a class="code" href="group__control__fns.htm#ga5">CreateWindow</a> (<a class="code" href="group__ctrl__edit.htm#ga0">CTRL_EDIT</a>, <span class="stringliteral">"Edit Box 2"</span>, <a class="code" href="group__styles.htm#ga3">WS_CHILD</a> | <a class="code" href="group__styles.htm#ga6">WS_VISIBLE</a> | <a class="code" href="group__styles.htm#ga11">WS_BORDER</a>, IDC_EDIT2, 0, 20, 100, 24, hStaticWnd2, 0); <span class="keywordflow">break</span>; }....... } <span class="keywordflow">return</span> <a class="code" href="group__window__create__fns.htm#ga19">DefaultMainWinProc</a> (hWnd, message, wParam, lParam);}</pre></div> </td> </tr></table><a class="anchor" name="ga2" doxytag="window.h::DestroyWindow"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="group__simple__types.htm#ga0">BOOL</a> GUIAPI DestroyWindow </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__handles.htm#ga1">HWND</a> </td> <td class="mdname1" valign="top" nowrap> <em>hWnd</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Destroys a specified control. <p>This function destroys the specified control <em>hWnd</em>, which is created by <em>CreateWindowEx</em>.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>hWnd</em> </td><td>The handle to the control. </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>TRUE on success, FALSE on error.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__control__fns.htm#ga1">CreateWindowEx</a> </dd></dl> </td> </tr></table><a class="anchor" name="ga4" doxytag="window.h::GetNotificationCallback"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="group__control__fns.htm#ga0">NOTIFPROC</a> GUIAPI GetNotificationCallback </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__handles.htm#ga1">HWND</a> </td> <td class="mdname1" valign="top" nowrap> <em>hwnd</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Gets the notification callback procedure of a control. <p>This function gets the new notification callback procedure of the control of <em>hwnd</em>.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>hwnd</em> </td><td>The handle to the control.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The notification callback procedure.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__control__fns.htm#ga0">NOTIFPROC</a>, <a class="el" href="group__control__fns.htm#ga3">SetNotificationCallback</a> </dd></dl> </td> </tr></table><a class="anchor" name="ga3" doxytag="window.h::SetNotificationCallback"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="group__control__fns.htm#ga0">NOTIFPROC</a> GUIAPI SetNotificationCallback </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__handles.htm#ga1">HWND</a> </td> <td class="mdname" nowrap> <em>hwnd</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap><a class="el" href="group__control__fns.htm#ga0">NOTIFPROC</a> </td> <td class="mdname" nowrap> <em>notif_proc</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Sets a new notification callback procedure for a control. <p>This function sets the new notification callback procedure (<em>notif_proc</em>) for the control of <em>hwnd</em>.<p>By default, the notification from a control will be sent to its parent window within a MSG_COMMAND messsage.<p>Since version 1.2.6, MiniGUI defines the Notification Callback Procedure for control. You can specify a callback function for a control by calling <em>SetNotificationCallback</em> to receive and handle the notifications from the control.<p>If you did not set the notification callback function for a control, the notification will be sent to its parent as same as the earlier version of MiniGUI.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>hwnd</em> </td><td>The handle to the control. </td></tr> <tr><td valign="top"></td><td valign="top"><em>notif_proc</em> </td><td>The new notification callback procedure, can be NULL. </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The old notification callback procedure.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__control__fns.htm#ga0">NOTIFPROC</a>, <a class="el" href="group__control__fns.htm#ga4">GetNotificationCallback</a> </dd></dl> </td> </tr></table><hr size="1"><address style="align: right;"><small>Generated on Thu Nov 22 15:35:55 2007 for MiniGUI V1.6.10 API Reference by <a href="http://www.doxygen.org/index.html"><img src="http://www.minigui.com/api_ref/1.6.10/doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.2 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -