windows - ShellExecuteEx silently fails in 64-bit call to hidden file -


i have 64-bit console app wants open file. file's hidden attribute set (the file hidden). code below fails on machines. shellexecuteex return true, .txt file not open in notepad, , hprocess member of shellexecuteinfo structure remains 0 after call.

coinitializeex(null, coinit_apartmentthreaded | coinit_disable_ole1dde);  shellexecuteinfo sei = {0}; sei.cbsize = sizeof(shellexecuteinfo); sei.fmask = see_mask_nocloseprocess; sei.hwnd = getconsolewindow(); sei.lpverb = _t("open"); sei.nshow = sw_shownormal; sei.lpfile = _t("c:\\some\\existing\\file.txt");  bool brc = shellexecuteex(&sei);  messagebox(getconsolewindow(), sei.lpfile, sei.lpverb, mb_ok); 

call messagebox there there's enough time shellexecuteex magic. .txt file open in notepad if @ least 1 of following conditions met:

  • .txt file not hidden
  • the calling process 32-bit, instead of 64-bit
  • the machine other (can't figure out difference between machines, file not open in @ least 1 vista , 1 windows 8.1)
  • lpverb nullptr, "openas" or "properties" (which of course show file's properties), instead of "open", "edit", or "runas" (for .exe instead of .txt)

what going on here? windows explorer opens hidden file, because uses null verb, have use verb ("runas" actually, please don't distracted info). should work "open" well. doing wrong?

turns out problem in 1 explorer extension. ironically (but unsurprisingly) our own extension. if extension unregistered problem gone, , shellexecute works again verbs.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -