mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-02-28 01:00:17 +08:00
@@ -40,7 +40,7 @@ Shell32::FocusedWindowType Shell32::GetFocusedWindowType()
|
||||
{
|
||||
return DOPUS;
|
||||
}
|
||||
if (wcscmp(classBuffer, L"EVERYTHING") == 0)
|
||||
if (wcscmp(classBuffer, L"EVERYTHING") == 0 || wcscmp(classBuffer, L"EVERYTHING_SHELL_EXECUTE") == 0)
|
||||
{
|
||||
return EVERYTHING;
|
||||
}
|
||||
|
||||
@@ -75,33 +75,35 @@ namespace QuickLook
|
||||
|
||||
private void InvokeRoutine(Keys key, bool isKeyDown)
|
||||
{
|
||||
var path = NativeMethods.QuickLook.GetCurrentSelection();
|
||||
|
||||
Debug.WriteLine($"InvokeRoutine: key={key},down={isKeyDown}");
|
||||
|
||||
if (isKeyDown)
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
case Keys.Enter:
|
||||
PipeServerManager.SendMessage(PipeMessages.RunAndClose);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
case Keys.Up:
|
||||
case Keys.Down:
|
||||
case Keys.Left:
|
||||
case Keys.Right:
|
||||
PipeServerManager.SendMessage(PipeMessages.Switch, path);
|
||||
PipeServerManager.SendMessage(PipeMessages.Switch);
|
||||
break;
|
||||
case Keys.Space:
|
||||
PipeServerManager.SendMessage(PipeMessages.Toggle, path);
|
||||
PipeServerManager.SendMessage(PipeMessages.Toggle);
|
||||
break;
|
||||
case Keys.Escape:
|
||||
PipeServerManager.SendMessage(PipeMessages.Close);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void InstallKeyHook(KeyEventHandler downHandler, KeyEventHandler upHandler)
|
||||
|
||||
@@ -107,7 +107,9 @@ namespace QuickLook.NativeMethods
|
||||
Invalid,
|
||||
Desktop,
|
||||
Explorer,
|
||||
Dialog
|
||||
Dialog,
|
||||
Everything,
|
||||
DOpus
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,8 +73,11 @@ namespace QuickLook
|
||||
_viewerWindow.BeginHide();
|
||||
}
|
||||
|
||||
public void TogglePreview(string path)
|
||||
public void TogglePreview(string path = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
path = NativeMethods.QuickLook.GetCurrentSelection();
|
||||
|
||||
if (_viewerWindow.Visibility == Visibility.Visible && (string.IsNullOrEmpty(path) || path == _invokedPath))
|
||||
ClosePreview();
|
||||
else
|
||||
@@ -99,30 +102,28 @@ namespace QuickLook
|
||||
|
||||
var newWindow = new ViewerWindow();
|
||||
|
||||
/*if (_viewerWindow.WindowState != WindowState.Maximized)
|
||||
{
|
||||
newWindow.Top = _viewerWindow.Top;
|
||||
newWindow.Left = _viewerWindow.Left;
|
||||
newWindow.Width = _viewerWindow.Width;
|
||||
newWindow.Height = _viewerWindow.Height;
|
||||
}*/
|
||||
|
||||
_viewerWindow = newWindow;
|
||||
}
|
||||
|
||||
public void SwitchPreview(string path)
|
||||
public void SwitchPreview(string path = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
if (_viewerWindow.Visibility != Visibility.Visible)
|
||||
return;
|
||||
|
||||
if (_viewerWindow.Visibility != Visibility.Visible)
|
||||
if (string.IsNullOrEmpty(path))
|
||||
path = NativeMethods.QuickLook.GetCurrentSelection();
|
||||
|
||||
if (string.IsNullOrEmpty(path))
|
||||
return;
|
||||
|
||||
InvokePreview(path);
|
||||
}
|
||||
|
||||
public void InvokePreview(string path)
|
||||
public void InvokePreview(string path = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
path = NativeMethods.QuickLook.GetCurrentSelection();
|
||||
|
||||
if (string.IsNullOrEmpty(path))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user