I have a VB program which loads a jpg file into a picture box. I want to be
able to d/click on the picture box and have Internet Explorer show this jpg
file.
What code do I put into the Image1_DblClick() function to show this pic in
IExplorer??
Help would be appreciated.
Thanks
Trevor. 9 3951
The easy way is to poke a browser onto your form, and on d/click, do a
BrowserName.Navigate2 "filename of picture".
The harder (and possibly more rewarding way) would be to
have your program throw together an HTML file with all all your
formatting (still using the source file), and do a ShellExecute on
the .htm file.
"The Roys" <tr*****@hotmail.com> wrote in message
news:7j*********************@news-server.bigpond.net.au... I have a VB program which loads a jpg file into a picture box. I want to
be able to d/click on the picture box and have Internet Explorer show this
jpg file. What code do I put into the Image1_DblClick() function to show this pic in IExplorer?? Help would be appreciated.
Thanks Trevor.
"CajunCoiler (http://www.cajuncoiler.tk)"
<po**********@totallyspamless.cox.net> wrote in message
news:hhZgb.63466$a16.50139@lakeread01... The easy way is to poke a browser onto your form, and on d/click, do a BrowserName.Navigate2 "filename of picture".
The harder (and possibly more rewarding way) would be to have your program throw together an HTML file with all all your formatting (still using the source file), and do a ShellExecute on the .htm file.
"The Roys" <tr*****@hotmail.com> wrote in message news:7j*********************@news-server.bigpond.net.au... I have a VB program which loads a jpg file into a picture box. I want to be able to d/click on the picture box and have Internet Explorer show this jpg file. What code do I put into the Image1_DblClick() function to show this pic
in IExplorer?? Help would be appreciated.
I don't know the exact syntax, but can't he just use the shell command
calling the browser, and passing the images path as a parameter?
Adrian
"Adrian Parker" <no@addy.com> wrote in message
news:GJ*******************@news20.bellglobal.com.. . "CajunCoiler (http://www.cajuncoiler.tk)" <po**********@totallyspamless.cox.net> wrote in message news:hhZgb.63466$a16.50139@lakeread01... The easy way is to poke a browser onto your form, and on d/click, do a BrowserName.Navigate2 "filename of picture".
The harder (and possibly more rewarding way) would be to have your program throw together an HTML file with all all your formatting (still using the source file), and do a ShellExecute on the .htm file.
"The Roys" <tr*****@hotmail.com> wrote in message news:7j*********************@news-server.bigpond.net.au... I have a VB program which loads a jpg file into a picture box. I want
to be able to d/click on the picture box and have Internet Explorer show
this jpg file. What code do I put into the Image1_DblClick() function to show this
pic in IExplorer?? Help would be appreciated.
I don't know the exact syntax, but can't he just use the shell command calling the browser, and passing the images path as a parameter?
Adrian
In theory, it can be done that way, but it's quite haphazard as final
distribution
goes. The end user may have more than one browser installed. The way I
described, whichever browser is set as the default, will take the image. If
shelling out to a specific browser is used, what happens if that browser is
uninstalled? Using the ShellExecute API eliminates the need. If you're not
sure how to impliment it, I have written a module that interfaces with your
code like: ShellExec.RunFile "picture.htm". I can send to you via e-mail.
c a j u n c o i l e r @ c o x . n e t
>>I don't know the exact syntax, but can't he just use the shell command calling the browser, and passing the images path as a parameter? Adrian In theory, it can be done that way, but it's quite haphazard as final distribution goes. The end user may have more than one browser installed. The way I described, whichever browser is set as the default, will take the image. If shelling out to a specific browser is used, what happens if that browser is uninstalled? Using the ShellExecute API eliminates the need. If you're not sure how to impliment it, I have written a module that interfaces with your code like: ShellExec.RunFile "picture.htm". I can send to you via e-mail. c a j u n c o i l e r @ c o x . n e t
You rely on the association of .HTM, IMHO that's even worse...
What if you set the execution of .HTM to Notepad, like I did?
Then no image will be shown :D
I don't know the code either, but this should be used to be 'almost'
fail-proof: ShellExec.DefaultBrowser "picture.htm"
And then you can use: ShellExec.DefaultBrowser "picture.jpg"
Cookie
"Cookie" <co******@SPAMyucom.be> wrote in message
news:bm**********@news.worldonline.be... I don't know the exact syntax, but can't he just use the shell command calling the browser, and passing the images path as a parameter? Adrian In theory, it can be done that way, but it's quite haphazard as final distribution goes. The end user may have more than one browser installed. The way I described, whichever browser is set as the default, will take the
image. If shelling out to a specific browser is used, what happens if that browser
is uninstalled? Using the ShellExecute API eliminates the need. If you're
not sure how to impliment it, I have written a module that interfaces with
your code like: ShellExec.RunFile "picture.htm". I can send to you via
e-mail. c a j u n c o i l e r @ c o x . n e t
You rely on the association of .HTM, IMHO that's even worse... What if you set the execution of .HTM to Notepad, like I did? Then no image will be shown :D I don't know the code either, but this should be used to be 'almost' fail-proof: ShellExec.DefaultBrowser "picture.htm" And then you can use: ShellExec.DefaultBrowser "picture.jpg"
Setting the OPEN method of .htm files to notepad was not a very
smart thing to do. If you're going to play around with associations,
it's a LOT better to create an EDIT option for that, instead.
That edit method should read...
"c:\windows\notepad.exe" "%1"
....do not use DDE
CajunCoiler ( http://www.cajuncoiler.tk) wrote: "Cookie" <co******@SPAMyucom.be> wrote in message news:bm**********@news.worldonline.be...
I don't know the exact syntax, but can't he just use the shell command calling the browser, and passing the images path as a parameter? Adrian
In theory, it can be done that way, but it's quite haphazard as final distribution goes. The end user may have more than one browser installed. The way I described, whichever browser is set as the default, will take the image. If shelling out to a specific browser is used, what happens if that browser is uninstalled? Using the ShellExecute API eliminates the need. If you're not sure how to impliment it, I have written a module that interfaces with your code like: ShellExec.RunFile "picture.htm". I can send to you via e-mail. c a j u n c o i l e r @ c o x . n e t
You rely on the association of .HTM, IMHO that's even worse... What if you set the execution of .HTM to Notepad, like I did? Then no image will be shown :D I don't know the code either, but this should be used to be 'almost' fail-proof: ShellExec.DefaultBrowser "picture.htm" And then you can use: ShellExec.DefaultBrowser "picture.jpg"
Setting the OPEN method of .htm files to notepad was not a very smart thing to do. If you're going to play around with associations, it's a LOT better to create an EDIT option for that, instead.
That edit method should read... "c:\windows\notepad.exe" "%1" ....do not use DDE
Excuse me, but I'm not 'playing' around... I know exactly what I'm doing...
I have an whole bunch of alternative associations.
I tweak the register a lot. I'm not an avarage user.
I edit html-pages a lot, that's why I changed the default association to
notepad. When I want to view an HTM in the browser I choose 'View'
(which I also created). BTW, links in documents etc. to html-pages still
works fine, cause they all use the method they should use. This means
not relying on the associations, but start the (defaul)browser with the
right parameters....
Cookie
On Wed, 8 Oct 2003 21:56:05 -0500, "CajunCoiler
\(http://www.cajuncoiler.tk\)" <po**********@totallyspamless.cox.net>
wrote:
<snip> In theory, it can be done that way, but it's quite haphazard as final distribution goes. The end user may have more than one browser installed. The way I described, whichever browser is set as the default, will take the image. If shelling out to a specific browser is used, what happens if that browser is uninstalled?
Surely if that is the case then finding the default browser will fail
or come up with crud
My understanding is that ShellExecute calls FindExecutable
Using the ShellExecute API eliminates the need. If you're not sure how to impliment it, I have written a module that interfaces with your code like: ShellExec.RunFile "picture.htm".
There is a pretty good case for knowing that the 'viewer' one is going
to launch is _not_ the default viewer for the extension
There is nothing wrong with launching a browser to view a JPG
- but it is unlikely that ShellExecute would launch a browser ... There is nothing wrong with launching a browser to view a JPG - but it is unlikely that ShellExecute would launch a browser ...
If the file you're trying to execute is something browseable, such as a
website URL, or a mailto, then it would... that's how I put links on
forms.
Put this code in a module called "ShellExec" ...
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Public 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 Const SW_SHOWNORMAL = 3
Public Function RunFile(ByVal strDocName As String) As Long
Dim Scr_hDC As Long
Dim lngRes As Long
Scr_hDC = GetDesktopWindow()
RunAssociateFile = ShellExecute(Scr_hDC, "Open", strDocName, "", "C:\",
SW_SHOWNORMAL)
End Function
Now you can do things like...
Go to a website: ShellExec.RunFile " http://www.cajuncoiler.tk "
Send an email: ShellExec.RunFile " mailto:ca*********@cox.net "
On Sat, 11 Oct 2003 17:59:21 -0500, "CajunCoiler
\(http://www.cajuncoiler.tk\)" <po**********@totallyspamless.cox.net>
wrote: There is nothing wrong with launching a browser to view a JPG - but it is unlikely that ShellExecute would launch a browser ... If the file you're trying to execute is something browseable, such as a website URL, or a mailto, then it would... that's how I put links on forms.
Put this code in a module called "ShellExec" ...
I think you misunderstood what I was saying.
My point was that ShellExecute is useless if you want to use a
different App to display (say a JPG) than the one associated in the
Registry Private Declare Function GetDesktopWindow Lib "user32" () As Long Public 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 Const SW_SHOWNORMAL = 3 Public Function RunFile(ByVal strDocName As String) As Long Dim Scr_hDC As Long Dim lngRes As Long Scr_hDC = GetDesktopWindow() RunAssociateFile = ShellExecute(Scr_hDC, "Open", strDocName, "", "C:\", SW_SHOWNORMAL) End Function
Now you can do things like...
Go to a website: ShellExec.RunFile " http://www.cajuncoiler.tk " Send an email: ShellExec.RunFile " mailto:ca*********@cox.net "
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Kubaton Lover |
last post by:
I have a pdf file (syllabus.pdf) on the server. I have written the
following PHP code. It correctly finds the file, but it is sending the file
back as text I think because I'm seeing the binary...
|
by: Raymond H. |
last post by:
Hello,
I create a vb4 project which can also naviger on Internet via the
WebBrowser control which I put on my form.
My question is: if this program is installed on a station having already...
|
by: Michael Brennan |
last post by:
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????...
|
by: Frostillicus |
last post by:
I'm trying to get an ASP to return a zip file to the remote browser from an
Image (BLOB) field in SQL Server 2000 but Internet Explorer keeps saying:
Cannot open C:\Documents and...
|
by: harry |
last post by:
Hi,
I have a program that runs on multiple client pc's. Occasionally one or more
of those pc's use VPN to connect to another corporate network. When using
VPN they need to set proxy server in...
|
by: Reimar Bauer |
last post by:
Dear all
I have written a data handling tool in php and probably you all know
already what are my problems.
Lets explain:
I have found some strange behaviour in Internet Explorer filling...
|
by: tshad |
last post by:
At work we are setting up a new web site and had a problem with running a
page when using URL:
\\phoenix\cdrive\inetpub\wwwroot\hrworkshop\index.aspx
It would start up notepad to edit the...
|
by: BASSPU03 |
last post by:
Private Sub FilePath_Click()
Rem Me!
Dim stAppName As String
Dim stlink As String
stlink = Me!
stAppName = "C:\Program Files\Internet Explorer\IEXPLORE.EXE...
|
by: undbund |
last post by:
Hi I am creating a newsletter system. The software should run from
desktop computer (localhost) but be able to send email to anyone on
the internet. Can you guys give me some ideas on how to...
|
by: Rina0 |
last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
|
by: erikbower65 |
last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps:
1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal.
2. Connect to...
|
by: erikbower65 |
last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA:
1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
|
by: kcodez |
last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
|
by: Taofi |
last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same
This are my field names
ID, Budgeted, Actual, Status and Differences
...
|
by: DJRhino1175 |
last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this -
If...
|
by: Rina0 |
last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
| | |