mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
reverting formatting of files
This commit is contained in:
@@ -14,8 +14,7 @@ std::optional<POINT> get_mouse_pos();
|
|||||||
// Gets active window, filtering out all "non standard" windows like the taskbar, etc.
|
// Gets active window, filtering out all "non standard" windows like the taskbar, etc.
|
||||||
HWND get_filtered_active_window();
|
HWND get_filtered_active_window();
|
||||||
// Gets window ancestor (usualy the window we want to do stuff with), filtering out all "non standard" windows like the taskbar, etc. and provide the app process path
|
// Gets window ancestor (usualy the window we want to do stuff with), filtering out all "non standard" windows like the taskbar, etc. and provide the app process path
|
||||||
struct WindowAndProcPath
|
struct WindowAndProcPath {
|
||||||
{
|
|
||||||
HWND hwnd = nullptr;
|
HWND hwnd = nullptr;
|
||||||
std::wstring process_path;
|
std::wstring process_path;
|
||||||
};
|
};
|
||||||
@@ -33,8 +32,7 @@ int run_message_loop();
|
|||||||
|
|
||||||
void show_last_error_message(LPCWSTR lpszFunction, DWORD dw);
|
void show_last_error_message(LPCWSTR lpszFunction, DWORD dw);
|
||||||
|
|
||||||
enum WindowState
|
enum WindowState {
|
||||||
{
|
|
||||||
UNKNONW,
|
UNKNONW,
|
||||||
MINIMIZED,
|
MINIMIZED,
|
||||||
MAXIMIZED,
|
MAXIMIZED,
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "PowerRenameInterfaces.h"
|
#include "PowerRenameInterfaces.h"
|
||||||
|
|
||||||
// Note: Not moving these strings to the resource file as these are internal and used as IDs
|
|
||||||
const wchar_t c_rootRegPath[] = L"Software\\Microsoft\\PowerRename";
|
const wchar_t c_rootRegPath[] = L"Software\\Microsoft\\PowerRename";
|
||||||
const wchar_t c_mruSearchRegPath[] = L"SearchMRU";
|
const wchar_t c_mruSearchRegPath[] = L"SearchMRU";
|
||||||
const wchar_t c_mruReplaceRegPath[] = L"ReplaceMRU";
|
const wchar_t c_mruReplaceRegPath[] = L"ReplaceMRU";
|
||||||
@@ -167,10 +165,10 @@ bool CSettings::GetRegStringValue(_In_ PCWSTR valueName, __out_ecount(cchBuf) PW
|
|||||||
return (SUCCEEDED(HRESULT_FROM_WIN32(SHGetValue(HKEY_CURRENT_USER, c_rootRegPath, valueName, &type, value, &cb) == ERROR_SUCCESS)));
|
return (SUCCEEDED(HRESULT_FROM_WIN32(SHGetValue(HKEY_CURRENT_USER, c_rootRegPath, valueName, &type, value, &cb) == ERROR_SUCCESS)));
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef int(CALLBACK* MRUCMPPROC)(LPCWSTR, LPCWSTR);
|
|
||||||
|
|
||||||
typedef struct
|
typedef int (CALLBACK* MRUCMPPROC)(LPCWSTR, LPCWSTR);
|
||||||
{
|
|
||||||
|
typedef struct {
|
||||||
DWORD cbSize;
|
DWORD cbSize;
|
||||||
UINT uMax;
|
UINT uMax;
|
||||||
UINT fFlags;
|
UINT fFlags;
|
||||||
@@ -190,21 +188,15 @@ class CRenameMRU :
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// IUnknown
|
// IUnknown
|
||||||
IFACEMETHODIMP_(ULONG)
|
IFACEMETHODIMP_(ULONG) AddRef();
|
||||||
AddRef();
|
IFACEMETHODIMP_(ULONG) Release();
|
||||||
IFACEMETHODIMP_(ULONG)
|
|
||||||
Release();
|
|
||||||
IFACEMETHODIMP QueryInterface(_In_ REFIID riid, _Outptr_ void** ppv);
|
IFACEMETHODIMP QueryInterface(_In_ REFIID riid, _Outptr_ void** ppv);
|
||||||
|
|
||||||
// IEnumString
|
// IEnumString
|
||||||
IFACEMETHODIMP Next(__in ULONG celt, __out_ecount_part(celt, *pceltFetched) LPOLESTR* rgelt, __out_opt ULONG* pceltFetched);
|
IFACEMETHODIMP Next(__in ULONG celt, __out_ecount_part(celt, *pceltFetched) LPOLESTR* rgelt, __out_opt ULONG* pceltFetched);
|
||||||
IFACEMETHODIMP Skip(__in ULONG) { return E_NOTIMPL; }
|
IFACEMETHODIMP Skip(__in ULONG) { return E_NOTIMPL; }
|
||||||
IFACEMETHODIMP Reset();
|
IFACEMETHODIMP Reset();
|
||||||
IFACEMETHODIMP Clone(__deref_out IEnumString** ppenum)
|
IFACEMETHODIMP Clone(__deref_out IEnumString** ppenum) { *ppenum = nullptr; return E_NOTIMPL; }
|
||||||
{
|
|
||||||
*ppenum = nullptr;
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// IPowerRenameMRU
|
// IPowerRenameMRU
|
||||||
IFACEMETHODIMP AddMRUString(_In_ PCWSTR entry);
|
IFACEMETHODIMP AddMRUString(_In_ PCWSTR entry);
|
||||||
@@ -233,8 +225,7 @@ private:
|
|||||||
|
|
||||||
CRenameMRU::CRenameMRU() :
|
CRenameMRU::CRenameMRU() :
|
||||||
m_refCount(1)
|
m_refCount(1)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
CRenameMRU::~CRenameMRU()
|
CRenameMRU::~CRenameMRU()
|
||||||
{
|
{
|
||||||
@@ -277,14 +268,12 @@ HRESULT CRenameMRU::CreateInstance(_In_ PCWSTR regPathMRU, _In_ ULONG maxMRUSize
|
|||||||
}
|
}
|
||||||
|
|
||||||
// IUnknown
|
// IUnknown
|
||||||
IFACEMETHODIMP_(ULONG)
|
IFACEMETHODIMP_(ULONG) CRenameMRU::AddRef()
|
||||||
CRenameMRU::AddRef()
|
|
||||||
{
|
{
|
||||||
return InterlockedIncrement(&m_refCount);
|
return InterlockedIncrement(&m_refCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
IFACEMETHODIMP_(ULONG)
|
IFACEMETHODIMP_(ULONG) CRenameMRU::Release()
|
||||||
CRenameMRU::Release()
|
|
||||||
{
|
{
|
||||||
long refCount = InterlockedDecrement(&m_refCount);
|
long refCount = InterlockedDecrement(&m_refCount);
|
||||||
|
|
||||||
@@ -475,6 +464,7 @@ void CRenameMRU::_FreeMRUList()
|
|||||||
{
|
{
|
||||||
pfnFreeMRUList(m_mruHandle);
|
pfnFreeMRUList(m_mruHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
m_mruHandle = NULL;
|
m_mruHandle = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user