# ScopedDPIAwarenessDisabler - From plugin code?

**URL:** <https://forum.juce.com/t/scopeddpiawarenessdisabler-from-plugin-code/56778>\
**Category:** General JUCE discussion\
**Created:** [June 23, 2023, 7:53am UTC](https://forum.juce.com/t/scopeddpiawarenessdisabler-from-plugin-code/56778 "2023-06-23T07:53:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobthedog](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@bobthedog](https://forum.juce.com/u/bobthedog)\
**Post date:** [June 23, 2023, 7:53am UTC](https://forum.juce.com/t/scopeddpiawarenessdisabler-from-plugin-code/56778/1 "2023-06-23T07:53:30Z")

</div>

Hi Guys,

I’m having problems with ScopedDPIAwarenessDisabler when used in a plugin, it doesn’t work!

If I run the plugin standalone then this test code works:

```auto
			delete m_pPluginEditor;
			m_pPluginEditor = m_audioProcessor.CreateHostedEditorIfNeeded();
			auto a = std::make_unique<juce::ScopedDPIAwarenessDisabler>();
			juce::DocumentWindow *pDoc = new juce::DocumentWindow("pop",
				juce::LookAndFeel::getDefaultLookAndFeel().findColour(juce::ResizableWindow::backgroundColourId),
				juce::DocumentWindow::minimiseButton | juce::DocumentWindow::closeButton);

			pDoc->setBounds(50, 50, 2000, 2000);

			pDoc->setContentOwned(m_pPluginEditor, true);
			pDoc->setResizable(m_pPluginEditor->isResizable(), false);
			pDoc->setVisible(true);
			pDoc->toFront(true);

```

When running as a plugin though it doesn’t.

The whole windows DPI thing is confusing the hell out of me, should this be possible?
