国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項超值服

開通VIP
getdlgitem
所屬類別 :
函數(shù)

函數(shù)功能

返回窗口中指定參數(shù)ID的子元素的句柄,可以通過返回的句柄對窗口內(nèi)的子元素進(jìn)行操作。

基本信息

  • 外文名稱

    GetDlgItem

  • 說    明

    根據(jù)繼承關(guān)系

  • 返回值

    標(biāo)識所標(biāo)記的控制窗口句柄

  • 參數(shù) nID

    接收消息的控件的標(biāo)識

折疊 編輯本段 函數(shù)功能

返回窗口中指定參數(shù)ID的子元素的句柄,可以通過返回的句柄對窗口內(nèi)的子元素進(jìn)行操作。

折疊 編輯本段 函數(shù)說明

根據(jù)繼承關(guān)系,有如下幾類:

1).CWindow::GetDlgItem

HWND GetDlgItem( int nID)const;

說明——

參數(shù) nID:接收消息的控件的標(biāo)識;

返回值:標(biāo)識所標(biāo)記的控制窗口句柄;

2).CWnd::GetDlgItem

CWnd* GetDlgItem ( int nID ) const;

void CWnd::GetDlgItem( int nID, HWND* phWnd ) const;

說明——

參數(shù) nID:接收消息的控件的標(biāo)識;

參數(shù)phWnd:子類窗口的指針;

返回值:標(biāo)識所標(biāo)記的控件(或子類窗口)的指針;

Example

// Uses GetDlgItem to return a pointer to a user interface control.

CEdit* pBoxOne;

pBoxOne = (CEdit*) GetDlgItem(IDC_EDIT1);

GotoDlgCtrl(pBoxOne);

3).Windows SDK

HWND GetDlgItem(

HWND hDlg, // handle to dialog box

int nIDDlgItem // control identifier

折疊 編輯本段 參數(shù)

折疊 hDlg

標(biāo)識含有控件的對話框

折疊 nlDDlgltem

指定將被檢索的控件標(biāo)識符。

返回值:如果函數(shù)調(diào)用成功則返回值為給定控件的窗口句柄。如果函數(shù)調(diào)用失敗,則返回值為NULL,表示為一個無效的對話框句柄或一個不存在的控件。若想獲得更多錯誤信息,請調(diào)用GetLastError函數(shù)。

備注:可以通過使用任何父子窗口對來使用GetDlgltem函數(shù),而不僅只是對話框。只要hDlg參數(shù)指定一個父窗口,且子窗口有一個獨(dú)立的標(biāo)識符(象CreateWindow中hMenu參數(shù)指定的或創(chuàng)建子窗口的CreateWindowEx指定的那樣),GetDlgltem就會返回一個有效的句柄到子窗口。

Windows CE:GetDlgltem函數(shù)只為對話框中的直接于控制工作,它不通過嵌套的對話框來搜尋。

速查:Windows NT:3.1及以上版本;Windows:95及以上版本;Windows CE:1.0及以上版本;頭文件:winuser.h;庫文件:user32.lib。

多數(shù)以GetDlgitem(控件標(biāo)識符);來使用

折疊 用法C#

IntPtr hwnd;

IntPtr hwnd1;

IntPtr hwnd2;

IntPtr hwnd3;

IntPtr hwnd4;

hwnd = FindWindow(null, "QQ2011");

hwnd1 = GetDlgItem(hwndQQ, 0);

hwnd2 = GetDlgItem(hwnd1, 0);

hwnd3 = GetDlgItem(hwnd2, 894);

SendMessage(hwnd3, 194, 0, this.txtInput.Text);

hwnd4 = GetDlgItem(hwnd1, 1);

SendMessage(hwnd4, 245, 0, Convert.ToString(0));/*

GetDlgItem Function

The GetDlgItemfunction retrieves a handle to a control in the specified dialog box.

Syntax

HWND GetDlgItem(

HWND hDlg, int nIDDlgItem);

Parameters

hDlg[in] Handle to the dialog box that contains the control. nIDDlgItem[in] Specifies the identifier of the control to be retrieved.

Return Value

If the function succeeds, the return value is the window handle of the specified control.

If the function fails, the return value is NULL, indicating an invalid dialog box handle or a nonexistent control. To get extended error information, call GetLastError.

Remarks

You can use the GetDlgItemfunction with any parent-child window pair, not just with dialog boxes. As long as the hDlgparameter specifies a parent window and the child window has a unique identifier (as specified by the hMenuparameter in the CreateWindowor CreateWindowExfunction that created the child window), GetDlgItemreturns a valid handle to the child window.

詞條標(biāo)簽: 窗體
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
VC++中有關(guān)句柄和指針及其轉(zhuǎn)換
感悟VB細(xì)水長流話API(一)
VC中句柄、指針、ID之間的轉(zhuǎn)換
安全獲取窗口GetSafeHwnd詳細(xì)解說
VC/MFC中常用消息總結(jié)
怎樣讓MFC的editbox在初始運(yùn)行時不顯示0
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服