作者LPH66 ((short)(-15074))
看板C_and_CPP
标题Re: [语法] winapi 关於CreateWindow
时间Sun Feb 8 21:30:32 2009
※ 引述《tyc5116 (累人啊....)》之铭言:
: 如下
: for (i = 0; i < dim(szCtlWnds); i++) {
: hwndChild = CreateWindowEx (WS_EX_CLIENTEDGE, szCtlWnds[i],
: TEXT (""), WS_CHILD, 0, 0, 200, 200, hWnd,
: (HMENU)(IDC_WNDSEL+i), hInst, NULL);
: // Destroy frame if client window not created.
: if (!IsWindow (hwndChild)) {
: DestroyWindow (hWnd);
: return 0;
: }
: }
: 这是节录书上所看到的语法,其中,(HMENU)(IDC_WNDSEL+i)
: 也就是功能表的参数
: 在这段程式码之前,他有先写
: #define IDC_WNDSEL 5
: 小弟想知道的是,5这个代码怎麽知道代表的是什麽
: 上msdn,但不知道要打什麽关键字才查的到....@@
: 烦请知道的版友说明一下,谢谢
就直接找 CreateWindowEx 的说明即可
http://msdn.microsoft.com/en-us/library/ms632680(VS.85).aspx
第10个参数是 HMENU hMenu
hMenu
[in] Handle to a menu, or specifies a child-window identifier, depending on
the window style. For an overlapped or pop-up window, hMenu identifies the
menu to be used with the window; it can be NULL if the class menu is to be
used.
For a child window, hMenu specifies the child-window identifier, an
integer value used by a dialog box control to notify its parent about events.
The application determines the child-window identifier; it must be unique for
all child windows with the same parent window.
回头看它的 style 是 (第四个参数) WS_CHILD 即子视窗
所以看上面的亮字
就知道它是随人订的 同父视窗中要唯一就是了
只是这个视窗把讯息丢给父视窗(即这里的呼叫者)时会用这个值告诉上面是我传来的
--
'Oh, Harry, dont't you
see?' Hermione breathed. 'If she could have done
one thing to make
absolutely sure that every single person in this school
will read your interview, it was
banning it!'
---'Harry Potter and the order of the phoenix', P513
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.30.84
1F:推 tyc5116:我想我知道了,谢谢 02/08 21:39