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))来实现,也就是说,获得的是子窗口所在的父窗口的句柄。

  • 相关阅读:
    Vue小实例
    Bootstrap进度条
    Bootstrap导航栏
    Bootstrap表单
    java date类
    正则表达式(java)规则大全
    正则表达式(java)
    java Stringbuffer类
    java String类
    object类
  • 原文地址:https://www.cnblogs.com/CBDoctor/p/2520249.html
Copyright © 2011-2022 走看看