Skip to content

Commit

Permalink
Fixed SetWindowLongPtr constants
Browse files Browse the repository at this point in the history
  • Loading branch information
zenden2k committed Jan 12, 2025
1 parent d1ae0af commit e20dba8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/Gui/GuiTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,16 +642,16 @@ BOOL IsWindowVisibleOnScreen(HWND hwnd) {
}

void SetWindowPointer(HWND hwnd, void* pthis) {
::SetWindowLongPtr(hwnd, GWL_USERDATA, reinterpret_cast<LONG_PTR>(pthis));
::SetWindowLongPtr(hwnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(pthis));
}

bool CheckWindowPointer(HWND hwnd, void* pthis) {
return ::IsWindow(hwnd)
&& ::GetWindowLongPtr(hwnd, GWL_USERDATA) == reinterpret_cast<LONG_PTR>(pthis);
&& ::GetWindowLongPtr(hwnd, GWLP_USERDATA) == reinterpret_cast<LONG_PTR>(pthis);
}

void ClearWindowPointer(HWND hwnd) {
::SetWindowLongPtr(hwnd, GWL_USERDATA, 0);
::SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
}

}

0 comments on commit e20dba8

Please sign in to comment.