From: duke on
Hi
Here is the scenario: I have a browser open (Internet Explorer ,
FireFox or whatever), I then load my program written in VB6.
The program has a textbox or label with say a URL loaded in the text /
caption.
I want to be able to click on the textbox / label, and drag and drop
the loaded URL to the browser's address field.
Is this possible? If yes, please advise.

Thanx in Advance

Duke
From: Larry Serflaten on

"duke" <nospama(a)3web.net> wrote
> Hi
> Here is the scenario: I have a browser open (Internet Explorer ,
> FireFox or whatever), I then load my program written in VB6.
> The program has a textbox or label with say a URL loaded in the text /
> caption.
> I want to be able to click on the textbox / label, and drag and drop
> the loaded URL to the browser's address field.
> Is this possible? If yes, please advise.


I don't know about all the other browsers, but IE does not support
OLE Drag and Drop. You would have an easier time just launching
a new browser, or, with a bit of effort, you could find and use one that
is already open....

(Search Google for ShellExecute API)

LFS


From: Norm on
Larry Serflaten wrote on 7/17/2010 :
> "duke" <nospama(a)3web.net> wrote
>> Hi
>> Here is the scenario: I have a browser open (Internet Explorer ,
>> FireFox or whatever), I then load my program written in VB6.
>> The program has a textbox or label with say a URL loaded in the text /
>> caption.
>> I want to be able to click on the textbox / label, and drag and drop
>> the loaded URL to the browser's address field.
>> Is this possible? If yes, please advise.
>
>
> I don't know about all the other browsers, but IE does not support
> OLE Drag and Drop. You would have an easier time just launching
> a new browser, or, with a bit of effort, you could find and use one that
> is already open....
>
> (Search Google for ShellExecute API)
>
> LFS

You can do this using VB to open a textbox, enter the information you
wnat, then use vb to open internet explorer and go to the web page. I
use vb to open my web browser, go to my banking page and then click
through several links to the page I want to be at. Google for IE
automation as well.

Norm


From: mbyerley on
If you want to put the URL in the address bar, you can use SendMessage API
to to that.

"duke" <nospama(a)3web.net> wrote in message
news:43691c61-d2c0-4a8b-9b7a-bbcbf4e1b11f(a)d16g2000yqb.googlegroups.com...
> Hi
> Here is the scenario: I have a browser open (Internet Explorer ,
> FireFox or whatever), I then load my program written in VB6.
> The program has a textbox or label with say a URL loaded in the text /
> caption.
> I want to be able to click on the textbox / label, and drag and drop
> the loaded URL to the browser's address field.
> Is this possible? If yes, please advise.
>
> Thanx in Advance
>
> Duke


From: Dee Earley on
On 17/07/2010 18:09, duke wrote:
> Hi
> Here is the scenario: I have a browser open (Internet Explorer ,
> FireFox or whatever), I then load my program written in VB6.
> The program has a textbox or label with say a URL loaded in the text /
> caption.
> I want to be able to click on the textbox / label, and drag and drop
> the loaded URL to the browser's address field.
> Is this possible? If yes, please advise.

As said by other people, ShellExecute() is the better method as it open
in the users default browser with their preferences.

I was interested in the URL drag so I did some playing:

Private Const CFSTR_INETURL As String = "UniformResourceLocator"
Private CF_INETURL As Long

Private Sub Form_Load()
Dim ClipboardFormat As Long

'Register the requested clipboard ID
CF_INETURL = RegisterClipboardFormatA(CFSTR_INETURL)
'Convert to a signed value
CF_INETURL = Val("&H" & Hex(CF_INETURL))
End Sub

Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
'Start the drag
Label1.OLEDrag
End Sub

Private Sub Label1_OLEStartDrag(Data As DataObject, AllowedEffects As Long)
Dim DataA() As Byte

'Copy to an array as it expects an ANSI string
DataA = StrConv(Label1.Caption, vbFromUnicode)
Data.SetData DataA, CF_INETURL

'Say it can be moved or copied
AllowedEffects = vbDropEffectCopy Or vbDropEffectMove
End Sub

--
Dee Earley (dee.earley(a)icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)