Hi all, I' need a little help regarding my project.
On a page I've an input box, a winbutton and finally a listbox.
Here the codes:
WinButton
ListBox
On Double-Click
On Select
So, by using this, all my PDF are obviously opened with the installed viewer, in my case Adobe Reader as usual.
Now I need to open my PDF with a portable version of Sumatra PDF Reader, included in the Docs folder (SumatraPDF.exe)
Please help me, it's a simple project but very useful for my needs.
Thanks a lot in advance.
On a page I've an input box, a winbutton and finally a listbox.
Here the codes:
WinButton
Code:
ListBox.DeleteItem ("Listbox1", -1); -- clear the content of the search result list ListBox.SetUpdate ("Listbox1", false); sFile_name = Input.GetText ("Input1"); -- gets the name of the file (use * to find all files with the defined extension) StatusDlg.Show(); -- shows the status of the search function tFind_file = File.Find ("C:\\Archive", "*pdf", true, false); if tFind_file then -- if at least one file is found... for k, found_file in pairs(tFind_file) do -- enumerates the files found tSplit_found_path = String.SplitPath (found_file); if sFile_name == "*" then ListBox.AddItem ("Listbox1", tSplit_found_path.Filename..tSplit_found_path.Extension, found_file); -- add each file to the list else if String.Find (tSplit_found_path.Filename, sFile_name, 1, false) ~= -1 then ListBox.AddItem ("Listbox1", tSplit_found_path.Filename..tSplit_found_path.Extension, found_file); -- add each file to the list end end end end StatusDlg.Hide(); -- hide the status dialog if ListBox.GetCount ("Listbox1") == 0 then Dialog.Message ("Attention", "No files here.", MB_OK, MB_ICONEXCLAMATION); end ListBox.SetUpdate ("Listbox1", true); Page.SetFocus ("Input1");
ListBox
On Double-Click
Code:
if ListBox.GetSelected (this) ~= nil then Shell.Execute (ListBox.GetItemData (this, List_Select[1]), "open"); Window.Minimize(Application.GetWndHandle()); end
Code:
List_Select = ListBox.GetSelected (this); if ListBox.GetSelected (this) ~= nil then end
So, by using this, all my PDF are obviously opened with the installed viewer, in my case Adobe Reader as usual.
Now I need to open my PDF with a portable version of Sumatra PDF Reader, included in the Docs folder (SumatraPDF.exe)
Please help me, it's a simple project but very useful for my needs.
Thanks a lot in advance.
Comment