zoukankan      html  css  js  c++  java
  • GetParent( ) 和AfxGetMainWnd( )

    The GetParent function retrieves a handle to the specified window's parent or owner.

    To retrieve a handle to a specified ancestor, use theGetAncestorfunction.

    //该函数返回的是指定子窗口的父窗口的句柄,其中,参数hWnd为子窗口的句柄

    Syntax

    HWND GetParent(      

        HWND hWnd );

    Parameters

    hWnd[in] Handle to the window whose parent window handle is to be retrieved.  

    举个例子来说:你在对话框中添加了一个Edit的控件,通过GetDlgItem( int ID)你能获得该控件的句柄,如果你想获得该对话框的句柄,就能以GetParent( GetDlgItem(ID))来实现,也就是说,获得的是子窗口所在的父窗口的句柄。

  • 相关阅读:
    最小路径
    零钱兑换
    硬币
    三步问题
    区域和检索
    除数博弈
    URI和URL的辨别
    交叉编译OpenMP
    牛客挑战赛44D-数列的和
    CF1408H. Rainbow Triples
  • 原文地址:https://www.cnblogs.com/CBDoctor/p/2520249.html
Copyright © 2011-2022 走看看