Skip to content

Commit

Permalink
♻️ #46 ::IsChild()を使用するようにしました
Browse files Browse the repository at this point in the history
  • Loading branch information
hebiiro committed Feb 4, 2024
1 parent 0cdea29 commit 08ce495
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions Common/WinUtility.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,7 @@ inline BOOL setWindowRect(HWND hwnd, LPCRECT rc, UINT flags = 0)
//
inline BOOL isAncestor(HWND hwnd1, HWND hwnd2)
{
while (hwnd1)
{
if (hwnd1 == hwnd2)
return TRUE;

hwnd1 = ::GetParent(hwnd1);
}

return FALSE;
return hwnd1 == hwnd2 || ::IsChild(hwnd2, hwnd1);
}

//--------------------------------------------------------------------
Expand Down

0 comments on commit 08ce495

Please sign in to comment.