mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[Analyzers][CPP] Turn on warning 4459 (#22234)
* Turn on warning 4459 * minor format
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
<ClCompile>
|
<ClCompile>
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
<WarningLevel>Level4</WarningLevel>
|
<WarningLevel>Level4</WarningLevel>
|
||||||
<DisableSpecificWarnings>26800;28251;6387;4458;4505;4459;4702;6031;6248;26451;28182;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
<DisableSpecificWarnings>26800;28251;6387;4458;4505;4702;6031;6248;26451;28182;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
<DisableAnalyzeExternal >true</DisableAnalyzeExternal>
|
<DisableAnalyzeExternal >true</DisableAnalyzeExternal>
|
||||||
<ExternalWarningLevel>TurnOffAllWarnings</ExternalWarningLevel>
|
<ExternalWarningLevel>TurnOffAllWarnings</ExternalWarningLevel>
|
||||||
<ConformanceMode>false</ConformanceMode>
|
<ConformanceMode>false</ConformanceMode>
|
||||||
|
|||||||
@@ -646,7 +646,7 @@ void D2DOverlayWindow::hide_thumbnail()
|
|||||||
|
|
||||||
void D2DOverlayWindow::render(ID2D1DeviceContext5* d2d_dc)
|
void D2DOverlayWindow::render(ID2D1DeviceContext5* d2d_dc)
|
||||||
{
|
{
|
||||||
if (!hidden && !instance->overlay_visible())
|
if (!hidden && !overlay_window_instance->overlay_visible())
|
||||||
{
|
{
|
||||||
hide();
|
hide();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#include <common/hooks/LowlevelKeyboardEvent.h>
|
#include <common/hooks/LowlevelKeyboardEvent.h>
|
||||||
|
|
||||||
// TODO: refactor singleton
|
// TODO: refactor singleton
|
||||||
OverlayWindow* instance = nullptr;
|
OverlayWindow* overlay_window_instance = nullptr;
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@@ -136,13 +136,13 @@ namespace
|
|||||||
if (event.lParam->vkCode == VK_ESCAPE)
|
if (event.lParam->vkCode == VK_ESCAPE)
|
||||||
{
|
{
|
||||||
Logger::trace(L"ESC key was pressed");
|
Logger::trace(L"ESC key was pressed");
|
||||||
instance->CloseWindow(HideWindowType::ESC_PRESSED);
|
overlay_window_instance->CloseWindow(HideWindowType::ESC_PRESSED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wasWinPressed && !isKeyDown(event) && isWin(event.lParam->vkCode))
|
if (wasWinPressed && !isKeyDown(event) && isWin(event.lParam->vkCode))
|
||||||
{
|
{
|
||||||
Logger::trace(L"Win key was released");
|
Logger::trace(L"Win key was released");
|
||||||
instance->CloseWindow(HideWindowType::WIN_RELEASED);
|
overlay_window_instance->CloseWindow(HideWindowType::WIN_RELEASED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isKeyDown(event) && isWin(event.lParam->vkCode))
|
if (isKeyDown(event) && isWin(event.lParam->vkCode))
|
||||||
@@ -153,7 +153,7 @@ namespace
|
|||||||
if (onlyWinPressed() && isKeyDown(event) && !isWin(event.lParam->vkCode))
|
if (onlyWinPressed() && isKeyDown(event) && !isWin(event.lParam->vkCode))
|
||||||
{
|
{
|
||||||
Logger::trace(L"Shortcut with win key was pressed");
|
Logger::trace(L"Shortcut with win key was pressed");
|
||||||
instance->CloseWindow(HideWindowType::WIN_SHORTCUT_PRESSED);
|
overlay_window_instance->CloseWindow(HideWindowType::WIN_SHORTCUT_PRESSED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,7 +180,7 @@ namespace
|
|||||||
|
|
||||||
OverlayWindow::OverlayWindow(HWND activeWindow)
|
OverlayWindow::OverlayWindow(HWND activeWindow)
|
||||||
{
|
{
|
||||||
instance = this;
|
overlay_window_instance = this;
|
||||||
this->activeWindow = activeWindow;
|
this->activeWindow = activeWindow;
|
||||||
app_name = GET_RESOURCE_STRING(IDS_SHORTCUT_GUIDE);
|
app_name = GET_RESOURCE_STRING(IDS_SHORTCUT_GUIDE);
|
||||||
|
|
||||||
@@ -252,7 +252,7 @@ void OverlayWindow::CloseWindow(HideWindowType type, int mainThreadId)
|
|||||||
bool OverlayWindow::IsDisabled()
|
bool OverlayWindow::IsDisabled()
|
||||||
{
|
{
|
||||||
WCHAR exePath[MAX_PATH] = L"";
|
WCHAR exePath[MAX_PATH] = L"";
|
||||||
instance->get_exe_path(activeWindow, exePath);
|
overlay_window_instance->get_exe_path(activeWindow, exePath);
|
||||||
if (wcslen(exePath) > 0)
|
if (wcslen(exePath) > 0)
|
||||||
{
|
{
|
||||||
return is_disabled_app(exePath);
|
return is_disabled_app(exePath);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include "Generated Files/resource.h"
|
#include "Generated Files/resource.h"
|
||||||
|
|
||||||
// We support only one instance of the overlay
|
// We support only one instance of the overlay
|
||||||
extern class OverlayWindow* instance;
|
extern class OverlayWindow* overlay_window_instance;
|
||||||
|
|
||||||
class TargetState;
|
class TargetState;
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ void TargetState::toggle_force_shown()
|
|||||||
if (state != ForceShown)
|
if (state != ForceShown)
|
||||||
{
|
{
|
||||||
state = ForceShown;
|
state = ForceShown;
|
||||||
instance->on_held();
|
overlay_window_instance->on_held();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user