INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Using Shell to Open Windows Explorer: iPhone Path for Photos

Using Shell to Open Windows Explorer: iPhone Path for Photos

(OP)
This fails to open explorer to see iphone photos:

Declare Integer ShellExecute In shell32.Dll Integer hndWin,String cAction, String cFileName,String cParams, String cDir, Integer nShowWin
cFileName = "explorer"
cAction = "open"
cPath = "iPhone\Internal Storage\DCIM\108APPLE"
ShellExecute(0,cAction,cFileName,cPath,"",1)

Do you possibly know of a way to open iPhone photos in VFP.

Utmost thanks/blessings!
Philip Traynor

RE: Using Shell to Open Windows Explorer: iPhone Path for Photos

I think that might be a relative path issue.

Try prefixing the cPath with a double backslash?

At the moment I think you are asking it to open cPath below either the folder your app started in or
perhaps your default path (something like c:\program files\myapp\iPhone\Internal Storage\DCIM\108APPLE)

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

RE: Using Shell to Open Windows Explorer: iPhone Path for Photos

(OP)
Griff:
ShellExecute(0,"Open","\\mycomputer\iphone","","",1) fails for some reason
ShellExecute(0,"Open","\\mycomputer","","",1) ... succeeds

Poor man's workaround:

CODE -->

PROCEDURE iphoneExplore
oWSH = CREATEOBJECT("wscript.shell")
* Do WindowToSearcherOpen With "dpw","c:\dpw"  && problems
*DECLARE INTEGER ShellExecute IN shell32.dll INTEGER hndWin,STRING cAction,STRING cFileName,STRING cParams,STRING cDir,INTEGER nShowWin
ShellExecute(0,"Open","C:\DPW","","",1)	&&ROG
*oWSH.AppActivate("DPW")   && fails oft
WAIT WINDOW "" TIMEOUT 0.2
oWSH.SendKeys('{Tab}')	
WAIT WINDOW "" TIMEOUT 0.2
oWSH.SendKeys('{Tab}')	
WAIT WINDOW "" TIMEOUT 0.2
oWSH.SendKeys('{Tab}')	
WAIT WINDOW "" TIMEOUT 0.2
oWSH.SendKeys('{Tab}')	
WAIT WINDOW "" TIMEOUT 0.2
oWSH.SendKeys('{Enter}')	
WAIT WINDOW "" TIMEOUT 0.2
oWSH.SendKeys("iPhone\Internal Storage\DCIM\108APPLE")
*!*	WAIT WINDOW "" TIMEOUT 0.2
*!*	oWSH.SendKeys("iPhone\Internal Storage")
*!*	WAIT WINDOW "" TIMEOUT 0.2
*!*	oWSH.SendKeys("\DCIM\108APPLE")
WAIT WINDOW "" TIMEOUT 0.2
oWSH.SendKeys('{Enter}') 

I'll keep you posted if I progress.
Utmost thanks/blessings,
Philip

RE: Using Shell to Open Windows Explorer: iPhone Path for Photos

I have an idea, can you use a subst command to map a drive letter to the iPhone folder?

CODE

cd \iPhone
subst x: . 

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

RE: Using Shell to Open Windows Explorer: iPhone Path for Photos

I'm only saying because the need for the 'keyboard' stuff looks tenuous and unreliable

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

RE: Using Shell to Open Windows Explorer: iPhone Path for Photos

If ShellExecute() fails, it will return an error code that tells you what went wrong. In other words:

CODE -->

lnCode = ShellExecute(0,"Open","\\mycomputer\iphone","","",1)
IF lnCode <= 32
  * Something went wrong
  * lnCode contains the error code
ENDIF 

Perhaps you could try that and then let us know what the error code contains.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Using Shell to Open Windows Explorer: iPhone Path for Photos

(OP)
Mike and all:

CODE -->

lnCode = ShellExecute(0,"Open","\\ROG\iPhone\Internal Storage\DCIM\108APPLE","","",1) &&ROG = mycomputer
IF lnCode <= 32 && error
  MESSAGEBOX(lnCode)
ENDIF 
lnCode = 3 "The specified path was not found."

CODE -->

lnCode = ShellExecute(0,"Open","Iphone","","",1)
IF lnCode <= 32 && error
  MESSAGEBOX(lnCode)
ENDIF 
= 2 = "The specified file was not found"

CODE -->

lnCode = ShellExecute(0,"Open","ROG\Iphone","","",1) &&ROG = mycomputer
IF lnCode <= 32 && error
  MESSAGEBOX(lnCode)
ENDIF 
= 2 = "The specified file was not found"

Etc. ... Errors are always #2 or #3 (above). Of course I checked connections and could manually type in "iphone" into explorer-address bar ... and it would open the iPhone directory.

Utmost thanks and blessings.

RE: Using Shell to Open Windows Explorer: iPhone Path for Photos

(OP)
GriffMg,

Thank you for your creative thoughts. CD and Getdir() both fail to navigate to iPhone in VFP 9 (Win10).
Interestingly, Getfile() does navigate the Win10 directory hierarchy. So I'd expect a Shell command to do the same.

So if I pull up an iPhone file, Getfile() -->:
C:\USERS\PHILIP\APPDATA\LOCAL\MICROSOFT\WINDOWS\INETCACHE\IE\A8URGNKR\IMG_8926[1].JPG

CODE -->

ShellExecute(0,"Open","C:\USERS\PHILIP\APPDATA\LOCAL\MICROSOFT\WINDOWS\INETCACHE\IE\A8URGNKR","","",1)
IF lnCode <= 32 
--> IE (irrelevant) cached files, iirc.

I will keep you posted, as I experiment.

Utmost thanks/blessings!
Philip

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close