473,624 Members | 2,253 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.dl l" _
Alias "ShellExecu teA" (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(strPat h As String, strFilename As String)

Call ShellExecute(Ap plication.hWndA ccessApp, "open", strFilename,
vbNullString, strPath, 0)

End Function
Mar 10 '06 #1
1 4462
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.dl l" _
Alias "ShellExecu teA" (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(strPat h As String, strFilename As String)

Call ShellExecute(Ap plication.hWndA ccessApp, "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
7487
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. He hasn't got Microsoft Photo Editor installed and because of that he cant view the images when doubleclicking on them in the table. He can still see the pictures in the formview but when he doubelclicks the images a error message shows up.
2
4213
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 es den Photo Editor nicht mehr. Somit kann ich die Bilder nicht mehr in der Datenbank angezeigt werden. Gibt es eine Möglichkeit das OLE-Objekt umzuwandeln? Auch wenn ich dem OLE-Objekt die Klasse einer anderen Anwendung zuweise, hat das keinen
3
5460
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 shdocvw.dll. And there comes the problem. I reference the libraries from my project. For this to work, I put the libraries in the same directory as the application. Now, from my code I try to ShellExecute to a link (to show it in a new window):
0
1826
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, string lpOperation, string lpFile,
1
2221
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 either too complex or too simple for my purpose. Most photo gallery scripts are intended primarily for sharing new photos continuously and allowing visitors to comment on them. I want something more static, which allows more text content.
1
2862
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
5496
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 photos field in my table and tried to insert the photo by inserting object (the photo is the sample empid1.bmp with office). After I have inserted it I get "package" in the field. Now Access help says this is because Photo Editor was not install, but...
27
16118
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 add photos to. In Access 2000, I had added them using the OLE field type. I can't seem to get Access 2003 to do this, even after installing Photo Editor. In my reading, it appears that using a text type and using a path or using BLOBs are better...
6
2394
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 = ProcessWindowStyle.Hidden | ProcessWindowStyle.Minimized; objProcess.StartInfo.UseShellExecute = true; objProcess.StartInfo.CreateNoWindow = true; objProcess.StartInfo.ErrorDialog = false;
0
8238
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8624
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7164
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6111
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2607
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 we have to send another system
2
1485
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.