Browse Source

Fix for win32 window confusion when running multiple juce apps.

tags/2021-05-28
jules 14 years ago
parent
commit
39f12d3cc6
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      modules/juce_events/native/juce_win32_HiddenMessageWindow.h

+ 7
- 3
modules/juce_events/native/juce_win32_HiddenMessageWindow.h View File

@@ -73,16 +73,20 @@ class JuceWindowIdentifier
public:
static bool isJUCEWindow (HWND hwnd) noexcept
{
return GetWindowLong (hwnd, GWLP_USERDATA) == improbableWindowNumber;
return GetWindowLongPtr (hwnd, GWLP_USERDATA) == getImprobableWindowNumber();
}
static void setAsJUCEWindow (HWND hwnd, bool isJuceWindow) noexcept
{
SetWindowLongPtr (hwnd, GWLP_USERDATA, isJuceWindow ? improbableWindowNumber : 0);
SetWindowLongPtr (hwnd, GWLP_USERDATA, isJuceWindow ? getImprobableWindowNumber() : 0);
}
private:
enum { improbableWindowNumber = 0xf965aa01 };
static LONG_PTR getImprobableWindowNumber() noexcept
{
static LONG_PTR number = (LONG_PTR) Random::getSystemRandom().nextInt64();
return number;
}
};
//==============================================================================


Loading…
Cancel
Save