mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fix for win32 window confusion when running multiple juce apps.
This commit is contained in:
parent
173e8c083f
commit
39f12d3cc6
1 changed files with 7 additions and 3 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue