473,626 Members | 3,276 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dragging a web address into a text box.

Does anyone know if dragging the URL from Internet Explorer and dropping it
into a text box in my own program is possible? erm ..and if so, how?

Failing that, is there some other method I can use to capture URL's to be
used in a VB6 program, without having to type the things in?

I would appreciate any help on this problem
TYIA
Graham


Jul 17 '05 #1
3 4092
On Fri, 27 Jun 2003 09:47:46 +0000 (UTC), "Sparky"
<gr*******@yaho o.com> wrote:
Does anyone know if dragging the URL from Internet Explorer and dropping it
into a text box in my own program is possible? erm ..and if so, how?

Failing that, is there some other method I can use to capture URL's to be
used in a VB6 program, without having to type the things in?

I would appreciate any help on this problem


This is not exactly 'dragging' - but it might solve your problem

Option Explicit

Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Function GetCursorPos _
Lib "user32" _
(lpPoint As POINTAPI) As Long

Private Declare Function WindowFromPoint _
Lib "user32" _
(ByVal xPoint As Long, _
ByVal yPoint As Long) As Long

Private Declare Function GetClassName _
Lib "user32" _
Alias "GetClassNa meA" _
(ByVal hwnd As Long, _
ByVal lpClassName As String, _
ByVal nMaxCount As Long) As Long

Private Declare Function SendMessage Lib "user32" Alias "SendMessag eA"
( _
ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long

Private Const WM_GETTEXT = &HD

Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 500
End Sub

Private Function WindowInf() As String
Dim Hnd As Long, Buff$, Q&
Dim PT As POINTAPI

GetCursorPos PT
Hnd = WindowFromPoint (PT.X, PT.Y)

WindowInf = Str$(Hnd)
' ---
Buff$ = Space$(255)
Q& = GetClassName(Hn d, Buff$, Len(Buff$))
WindowInf = WindowInf + ":" + Left$(Buff$, Q)
' ---
Q& = SendMessage(Hnd , WM_GETTEXT, Len(Buff$), ByVal Buff$)
WindowInf = WindowInf + ":" + Left$(Buff$, Q)

End Function
Private Sub Timer1_Timer()
Me.Caption = WindowInf
End Sub
Jul 17 '05 #2
"Sparky" <gr*******@yaho o.com> wrote in message news:<bd******* ***@hercules.bt internet.com>.. .
Does anyone know if dragging the URL from Internet Explorer and dropping it
into a text box in my own program is possible? erm ..and if so, how?
Private Sub Form_Load()
Text1.OLEDropMo de = vbOLEDragAutoma tic
End Sub

Private Sub Text1_OLEDragDr op(Data As DataObject, Effect As Long, _
Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1.Text = Data.GetData(vb CFText)
End Sub
Failing that, is there some other method I can use to capture URL's to be
used in a VB6 program, without having to type the things in?
copy & paste ?
I would appreciate any help on this problem
TYIA
Graham

Jul 17 '05 #3
Quick and Dirty method: Right Click and copy into the clipboard.
Right click on your text box and paste.

You may also use vb code with the built-in clipboard object.
Jul 17 '05 #4

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

Similar topics

0
1315
by: Fred Heida | last post by:
Hi, I try to implement dragging (and dropping) of text inside a rtf control (similar as word i guess) I have set AllowdDrop = true and setup the handlers for DragDrop, DragOver, DragEnter. is there anything else i need to do ? becuase if i now select some text in the control and start dragging this, the very first time i see the 'no entry' sign (none of my handlers getting
0
3240
by: Sin Jeong-hun | last post by:
If FlowLayoutPanel's AutoScroll is set to true, there appears a scroll bar on the right. Normally, users would expect the contents is scrolled while they are dragging the scroll bar. Well, it does, but not when the Windows's "Show window contents while dragging" is disabled. Almost all the Windows' common coltrols scrolls the contents while dragging even if that option is disabled. So, I think FlowLayoutPanel should behave like other...
16
1665
by: Geoff Jones | last post by:
Hiya Could anybody direct me to some examples of code to do the following: Display a bitmap on a form which can then be moved about i.e. dragged, using the left down button of the mouse. Thanks in advance Geoff
2
1421
by: Tull Clancey | last post by:
Does anyone have, or can anyone suggest a URL for code to drag a control around a form at run time? VB.Net 2003. I have written stuff in VB6 to do this before, but a long time ago and I don't have the code to refer to anymore. Cheers, Tull.
2
4524
by: Abubakar | last post by:
Hi, In a normal Windows.Forms.TextBox control, I want to be able to select a text (ie highlight, this is by default possible) and than be able to drag that text through my mouse pointer to another textbox, or any control, than drop it. How do v do this? Regards, ...ab
0
1262
by: ravishankar Maduri | last post by:
Hi Freinds if any one knows how to disable the dragging of images to the address bar In my project i implemented the dragging feature by using the cropped images, its working finebut when we drag that image to the addressbar its showing only that cropped image instead of whole site, i need to disable the dragging of cropped image tothe addressbar . Please if any one already ahead of this problem
4
26978
by: RobinS | last post by:
I am drawing a rectangle on a picture that has already been drawn on the graphics area (a user control). It works something like this: //in the MouseDown event m_isDragging = true; m_oldX = e.X; //save original positions m_oldY = e.Y; //in the MouseMove event if (m_isDragging)
4
1509
by: spectecjr | last post by:
Hey folks; I've got a weird problem... whenever I try to drag and drop a toolbox item onto a form in the Window Forms editor, the control is automatically added on the first click. This gives me very little control over where it ends up, and as you can imagine, is somewhat inconvenient. Anyone know a fix for this? My work system doesn't do this.
0
8203
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8711
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...
1
8368
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8512
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7203
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
6125
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
5576
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4094
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...
1
2630
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

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.