Re: [語法] winapi 關於CreateWindow

看板C_and_CPP (C/C++)作者 ((short)(-15074))時間16年前 (2009/02/08 21:30), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串3/3 (看更多)
※ 引述《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

02/08 21:39, , 1F
我想我知道了,謝謝
02/08 21:39, 1F
文章代碼(AID): #19Zjvw8a (C_and_CPP)
討論串 (同標題文章)
文章代碼(AID): #19Zjvw8a (C_and_CPP)