From: duke on
On Jul 19, 2:55 am, Dee Earley <dee.ear...(a)icode.co.uk> wrote:
> 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.ear...(a)icode.co.uk)
> i-Catcher Development Team
>
> iCode Systems
>
> (Replies direct to my email address will be ignored.
> Please reply to the group.)

Special Thanks to Dee Earley, you put me on the right track and my
program now works just great.

Thank You all for your assistance.

Duke
From: Tony Toews on
On Mon, 19 Jul 2010 09:55:57 +0100, Dee Earley
<dee.earley(a)icode.co.uk> wrote:

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

Very nice.

Tony (catching up on postings)
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/