I am currently using
int nRet=(int)ShellExecute(NULL,
_T("open"),
_T("\"")+cPathToFile+_T("\""),
_T(""),
cDir,
SW_SHOW);
to open a pdf file from my VC++ application. The file opens correctly but then if I try to open another file from the explorer it doesn't show up. If I close the previuos opened file then all works correctly, as if the application was "locking" the pdf viewer.
Is this a normal/known behaviour?
Related
I have few questions:
Where pdf files are saved when opened in browser?
Is it possible when i open pdf in Chrome, access that file somewhere
in my pc system?
They are stored at this path %USERPROFILE%\AppData\Local\ in Windows. Run this command %TEMP% in the run dialog box to visit the folder.
I created an autorun.inf file for my dvd so that it would display a splash page (just an image), then go directly to and open a pdf. As well as set the icon for the drive. However the icon didn't change, and neither the splash page or pdf opened or displayed upon inserting the disc.
My code in the autorun.info file is as follows
[AutoRun]
OPEN=winopen \start_here.pdf filename splash.jpg
ICON=icon.ico
The .inf file is sitting in the same folder as the start_here.pdf, the splash.jpg and the icon.ico.
Thoughts?
Open statement does not open the associated file, but only executable and html-files. To launch the associated files by their extensions, you must use "ShellExecute" statement.
The shellexecute command is more flexible than the open command and will allow you to open nearly any file on a PC in its native application, so can be used for PDFs, Word files, web pages and movies where the open command would not work.
[AutoRun]
shellexecute=myfile.pdf
I am trying to develop an application for iPad using Sencha touch which needs to run a local PPT or PPSX file on a button click and return to main application after finishing the presentation .I am not sure whether this is possible.Please share your thoughts..Thanks in advance...
If I understand your problem;
With sencha-touch, code runs on browser, so you could not access local files of users file system except he choose files with a file chooser(but in that case you must upload the file to server).
If you want to open a file without closing your app, you may open file in a new window.
I hope, this gives you some idea.
I want to open a mdb file through VB.NET
Currently, I use:
retval = shell("explorer.exe " & filename)
where filename includes the path.
It should open the mdb file in Microsoft Access.
This works fine on Windows 7 (my system), but when I try it on Windows XP (client machine) it comes up with the file download security warning dialog asking to Open, Save or Cancel. If I click Open it presents the same dialog but now with Save and Cancel only.
I am sure there is a quick and easy way to open a file in its proper program through VB.NET. I know I can open the database using Interop, but I don't want to go down that route.
Thanks
You can use Process.Start to launch a program. Some good examples here: http://www.dotnetperls.com/process-start-vbnet
For example:
System.Diagnostics.Process.Start("database.mdb")
Is there any way to automate a opening files with open dialog box on Mac OS? The application asks user to open files with the standard open dialog box. But I need open files automatically.
The idea is to write script or a small application which will click the button in the target application to open dialog box and then somehow select files which I needed. But I don't know how can I do it. Any suggestions will be very appreciated.
If you already know what file(s) you want to open, then the open file dialog box is usually bypassed completely by the target application.
You'll have to look at the Dictionary for your target application to see if the Open command is defined. If an application is scriptable, then that's going to be one the basics, though each implementation will vary slightly.
If an application doesn't have a Dictionary, you can use the Finder to open the file:
tell application "Finder"
set theApplication to "Path:To:Application.app" as alias
set theFile to "Path:To:File.ext" as alias
open theFile using theApplication
end tell