473,503 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ShellExecute and MS Photo Editor

I am using ShellExecute to open JPG files with the associated application,
MS Photo Editor, from within an Access 2000 application. When the code is
run the first time (Photo Editor closed), there's a blinking in my
application title bar, and nothing appears. Then, if I do it a second time,
Photo Editor appears, but with two copies of the image. And, as long as
Photo Editor stays open, the images open fine. But if it's closed, it takes
two times to get it open.

This doesn't happen with MS Picture and Fax Viewer as the default
application. With Picture and Fax Viewer, the same code opens it up
immediately. However, users have MS Photo Editor as their default app, and
they prefer it.

Anyone know what's going on with MS Photo Editor here? Code is below.

Thanks,

Neil

Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As
String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal
lpDirectory As String, _
ByVal nShowCmd As Long) As Long

Public Function OpenFile(strPath As String, strFilename As String)

Call ShellExecute(Application.hWndAccessApp, "open", strFilename,
vbNullString, strPath, 0)

End Function
Mar 10 '06 #1
1 4448
On Fri, 10 Mar 2006 17:29:47 GMT, "Neil" <no****@nospam.net> wrote:
I am using ShellExecute to open JPG files with the associated application,
MS Photo Editor, from within an Access 2000 application. When the code is
run the first time (Photo Editor closed), there's a blinking in my
application title bar, and nothing appears. Then, if I do it a second time,
Photo Editor appears, but with two copies of the image. And, as long as
Photo Editor stays open, the images open fine. But if it's closed, it takes
two times to get it open.

... Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As
String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal
lpDirectory As String, _
ByVal nShowCmd As Long) As Long

Public Function OpenFile(strPath As String, strFilename As String)

Call ShellExecute(Application.hWndAccessApp, "open", strFilename,
vbNullString, strPath, 0)

End Function


I don't have PhotoEditor here to test it, but part of the problem may
be the nShowCmd arg. 0 equates to SW_HIDE, so unless the app overrides
it (which PE apparently does not), you end up launching an instance
with no visible UI. Change it to SW_NORMAL (1) and see what happens.
-Tom
MVP - Visual Basic
(please post replies to the newsgroup)
Mar 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7480
by: Zeroeffect | last post by:
Hello! I have a database with alot of embedded images. The reason for having the images embedded is security. My problem is that it works fine on my computer, but not on my clients computer....
2
4205
by: falk.strobach | last post by:
Hallo, ich habe mir im Access eine Bilddatenbank angelegt. Die Bilder sind als OLE-Objekt (verbunden mit dem Photo Editor) in der Datenbank enthalten. Mit der Umstellung auf MS Office 2003 gibt...
3
5451
by: Wiktor Zychla | last post by:
I have a problem I cannot solve. My application hosts IE activex control. I follow the standard procedure: I just aximp shdocvw.dll. Note that this gives you two files: axshdocvw.dll and...
0
1806
by: the_openFace | last post by:
I'm trying to display the shell's property page for various files and I'm using this code: class Win32Shell { // ... other stuff here public static extern Int32 ShellExecute( Int32 hwnd,...
1
2214
by: Throw | last post by:
G'day everyone I'm looking for a simple photo gallery script in PHP (or Perl), but not too simple. I have tried several photo gallery scripts in either language and I have found that they are...
1
2855
by: =?Utf-8?B?SnVhbiBDYXJsb3M=?= | last post by:
how create a small photo editor in visual basic.net??? just the basic, resize, contrast, etc. TY!
4
5490
by: dclingan | last post by:
OS XP Access 2003 additional program available MS Photo Editor 3 I understand Access 2003 did not come with Photo Editor and such needs to be installed. I have done this. I have inserted a...
27
16046
fnwtech
by: fnwtech | last post by:
I have been reading the forums, but I really need a step by step. I took a one day vb class about 3 years ago, so I know just enough to be confused! I have a database of students that I have to...
6
2390
by: piyusht | last post by:
Hello, I have a small piece of code to launch a file and print it to desired printer. The code is as follows: objProcess.StartInfo.FileName = "C:\test.jpg"; objProcess.StartInfo.WindowStyle...
0
7201
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
379
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.