473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Clipboard Application - Pasting to IE

Hi,

I'm writing a custom clipboard application in VB .NET 2008 similar to
Ditto (http://ditto-cp.sourceforge.net/).
I have tried targeting .NET Frameworks 2.0, 3.0, and 3.5 with the same
results.
I have also tried targeting x86 and x64 CPUs. I am developing on
Windows Vista SP 1 x64.

My problem is that when pasting to IE forms, nothing is pasted! It
pastes to all other tested applications as expected.

Basically, I set the text to the clipboard and use SendKeys.Send("^V")
to send Control-V to foreground window. I am using Interop with
user32.dll's SetForegroundWindow (ByVal hwnd As IntPtr) As Long
function.

When I use SendKeys.Send() and pass the actual text as oppoesed to
Control-V, IE accepts the input as received BUT all CR's in text are
sent as {ENTER} and Posts the form. This causes undesirable results
in the form of a comment with the entire paste building at each CR. I
have been testing with a Comment field.
-------------------------------------------------
ie, trying to paste "Hello,
World"
results in two comments;
1st comment: Hello,
2nd comment: Hello,
World

Suggestions for resolving either of these issues is greatly
appreciated. Code below;

'Dim wsh As New WshShell
' Set last active window to foreground
Form1.SetForegroundWindow(awh)
' send clipped item to application in foreground
Clipboard.SetData(DataFormats.StringFormat,
lvClipped.SelectedItems(0).Text)

'Sleeping as a workaround does not fix IE paste to form
'Threading.Thread.CurrentThread.Sleep(4000)
' Using Windows Shell doesn't help IE paste to form
'wsh.SendKeys("^V")
' dispose of my COM object
'wsh = Nothing

SendKeys.SendWait("^V")
' Flushing doesn't help IE send to form
'SendKeys.Flush()
Jun 27 '08 #1
0 970

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

Similar topics

8
by: LG | last post by:
Just have a question with regards to the clipboard, and how to read what other applications (Adobe InDesignCS) place in the clipboard. I am currently in the process of creating a booklet from a...
0
by: Vlado | last post by:
Hello, I need to copy/paste image from Java application to/from the System clipboard. On windows everything is just fine, but on Mac OS is not. The problem is that when I transfer image to the...
5
by: DraguVaso | last post by:
Hi, I'm looking for a way to Copy and Paste Files to the clipboard. I found a lot of articles to copy pieces of text and bitmaps etc, but nog whole files. Whay I need is like you have in...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
15
by: Peter Duniho | last post by:
I'm trying to use .NET and C# to draw a metafile copied to the clipboard by another application (Word 2003 in this case, but it shouldn't matter). I naively thought that I'd be able to use the...
6
by: =?Utf-8?B?TWljaGFlbCAwMw==?= | last post by:
I need to disable the clipboard function in Windows XP. We are having a problem with users using CTRL+C in one program, then using CTRL+V in another. Specifically, they type their password into...
3
by: Jaez | last post by:
As a newbie to javascript and asp.net 2 I have come across a problem related to the windows clipboard. I have written an application in vb6 which collects data and puts it on the user's...
5
by: exhuma.twn | last post by:
As many might know, windows allows to copy an image into the clipboard by pressing the "Print Screen" button on the keyboard. Is it possible to paste such an image from the clipboard into a "Text"...
20
by: Joe Duchtel | last post by:
Hello - I have the following code to get a bitmap from the clipboard and to save it to a *.png file ... Dim lData As IDataObject = Clipboard.GetDataObject() If...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
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...
0
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...

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.