@@ -45,54 +45,6 @@ BOOL launchQuickLook(const wchar_t* filePath, BOOL fullscreen) {
45
45
return FALSE;
46
46
}
47
47
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
-
96
48
// Simplified Windows file opener
97
49
int openFiles (int argc , const char * * argv , int fullscreen ) {
98
50
if (argc < 1 || !argv ) return 1 ;
0 commit comments