随笔 - 2146  文章 - 97 评论 - 11767 trackbacks - 253

//声明:
GetParent(
  hWnd: HWND {窗口句柄}
): HWND;     {返回父窗口句柄}

//举例: procedure TForm1.Button1Click(Sender: TObject); var h1,h2: HWND; begin h1 := GetParent(Button1.Handle); h2 := Panel1.Handle; ShowMessage(IntToStr(h1)); {590862} ShowMessage(IntToStr(h2)); {590862} h1 := GetParent(Panel1.Handle); h2 := Self.Handle; ShowMessage(IntToStr(h1)); {459824} ShowMessage(IntToStr(h2)); {459824} ShowMessage(IntToStr(GetParent(Handle))); {0} end;
//效果图:

posted on 2008-02-12 13:31  万一  阅读(...)  评论(...编辑  收藏