- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi 调用viewer-Windows10 图像浏览器
uses ShlObj, ShellAPI;
function GetSpecialPath(CSIDL: word): string;
var
s: string;
begin
SetLength(s, MAX_PATH);
if not SHGetSpecialFolderPath(0, PChar(s), CSIDL, true) then s:='';
Result:=PChar(s);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ShellExecute(0,'open','cmd.exe',Pchar('/c rundll32 "'+GetSpecialPath($26)+'\Windows Photo Viewer\PhotoViewer.dll",ImageView_Fullscreen C:\Users\haokucn\Desktop\QQ图片20191012161522.png'),nil,SW_HIDE);
end;