Skip to content

Commit c5487c4

Browse files
well shii
1 parent 16cfc3f commit c5487c4

File tree

1 file changed

+0
-48
lines changed

1 file changed

+0
-48
lines changed

windows/openfile_windows.c

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -45,54 +45,6 @@ BOOL launchQuickLook(const wchar_t* filePath, BOOL fullscreen) {
4545
return FALSE;
4646
}
4747

48-
// Function to get the path to QuickLook.exe
49-
BOOL getQuickLookPath(wchar_t* quickLookPath) {
50-
const wchar_t* paths[] = {
51-
L"%LOCALAPPDATA%\\Programs\\QuickLook\\QuickLook.exe",
52-
L"%PROGRAMFILES%\\QuickLook\\QuickLook.exe",
53-
L"%PROGRAMFILES(X86)%\\QuickLook\\QuickLook.exe"
54-
};
55-
56-
for (int i = 0; i < sizeof(paths)/sizeof(paths[0]); i++) {
57-
if (ExpandEnvironmentStringsW(paths[i], quickLookPath, MAX_PATH)) {
58-
DWORD fileAttr = GetFileAttributesW(quickLookPath);
59-
if (fileAttr != INVALID_FILE_ATTRIBUTES && !(fileAttr & FILE_ATTRIBUTE_DIRECTORY)) {
60-
return TRUE;
61-
}
62-
}
63-
}
64-
65-
return FALSE;
66-
}
67-
68-
// Function to preview files with QuickLook
69-
BOOL previewWithQuickLook(const wchar_t* filePath) {
70-
wchar_t quickLookPath[MAX_PATH];
71-
if (!getQuickLookPath(quickLookPath)) {
72-
return FALSE;
73-
}
74-
75-
if (!ensureQuickLookRunning(quickLookPath)) {
76-
return FALSE;
77-
}
78-
79-
// Build command line to tell QuickLook to preview the file
80-
wchar_t commandLine[MAX_PATH * 2];
81-
swprintf_s(commandLine, MAX_PATH * 2, L"\"%s\" /standby /preview: \"%s\"", quickLookPath, filePath);
82-
83-
STARTUPINFOW si = {0};
84-
PROCESS_INFORMATION pi = {0};
85-
si.cb = sizeof(si);
86-
87-
if (CreateProcessW(NULL, commandLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
88-
CloseHandle(pi.hProcess);
89-
CloseHandle(pi.hThread);
90-
return TRUE;
91-
}
92-
93-
return FALSE;
94-
}
95-
9648
// Simplified Windows file opener
9749
int openFiles(int argc, const char **argv, int fullscreen) {
9850
if (argc < 1 || !argv) return 1;

0 commit comments

Comments
 (0)