How to use WM_PASTE ?
-
Hello, How can I use WM_PASTE to send a plain text from clipboard to the active window and the focused textbox/combobox ? ---------- I want to paste by double-Click, I can detect the double click event and execute a code when it done so the destination window will be active the textbox/combobox will be focused please provide me a little sample project working with a timer in background and do the paste command. I keep searching for a solution to this problem for days but no results ------------------- Thanks
JusT LeT YouR MinD WorK
-
Hello, How can I use WM_PASTE to send a plain text from clipboard to the active window and the focused textbox/combobox ? ---------- I want to paste by double-Click, I can detect the double click event and execute a code when it done so the destination window will be active the textbox/combobox will be focused please provide me a little sample project working with a timer in background and do the paste command. I keep searching for a solution to this problem for days but no results ------------------- Thanks
JusT LeT YouR MinD WorK
-
Hello, How can I use WM_PASTE to send a plain text from clipboard to the active window and the focused textbox/combobox ? ---------- I want to paste by double-Click, I can detect the double click event and execute a code when it done so the destination window will be active the textbox/combobox will be focused please provide me a little sample project working with a timer in background and do the paste command. I keep searching for a solution to this problem for days but no results ------------------- Thanks
JusT LeT YouR MinD WorK
-
Hello, How can I use WM_PASTE to send a plain text from clipboard to the active window and the focused textbox/combobox ? ---------- I want to paste by double-Click, I can detect the double click event and execute a code when it done so the destination window will be active the textbox/combobox will be focused please provide me a little sample project working with a timer in background and do the paste command. I keep searching for a solution to this problem for days but no results ------------------- Thanks
JusT LeT YouR MinD WorK
Are you programming C# ? In WinForms ? WPF ? In C# WinForms doing what you describe is very simple: if you create two TextBoxes, and define DoubleClick EventHandlers for them as shown here:
private void textBox1\_DoubleClick(object sender, EventArgs e) { if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) { Clipboard.SetText(textBox1.Text); } } private void textBox2\_DoubleClick(object sender, EventArgs e) { if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) { textBox2.Text = Clipboard.GetText(); } }
Then the Text of textBox1 will be placed on the Clipoard when textBox1 is double-clicked, and whatever text is on the Clipboard will be pasted into textBox2, when it's double-clicked. imho, use of DoubleClick in a TextBox is generally not a good idea, because of the way the TextBox uses double-click as a method for selection. I assume you have a good reason for wanting to duplicate paste-and-copy functionality.
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview
-
Hello, How can I use WM_PASTE to send a plain text from clipboard to the active window and the focused textbox/combobox ? ---------- I want to paste by double-Click, I can detect the double click event and execute a code when it done so the destination window will be active the textbox/combobox will be focused please provide me a little sample project working with a timer in background and do the paste command. I keep searching for a solution to this problem for days but no results ------------------- Thanks
JusT LeT YouR MinD WorK
I assume, since you posted on this Forum, you are using C# ... correct ? Please state in what context you are using C#: WinForms ? WPF ? SilverLight ? ... ? Whatever you are using: what is it that you double-click on that triggers the Paste Event into the "destination window ... active ... textbox/combobox" ? Are you saying you want to detect a double-click Event anywhere in your application's main window, or in its child controls ? Does that imply you want to disable the standard double-click functions that occur in certain controls, like a TextBox ? Not a good idea. If you double-click on a WinForm the focus of the application may change, depending on what you clicked on; there may be no active Control. For example, if I have a TextBox and a PropertyGrid on a WinForm: if the TabOrder is set so that the TextBox is the Control with Focus when the application starts, then if I click on the PropertyGrid there is no active control on the Form. However, if I double-click on the Form itself, then Form.ActiveControl will still retain its last valid setting. I doubt anyone here is psychic enough (unless OriginalGriff is here) to figure out what the role of a Timer is in whatever you are trying to build. If you take the time to describe your problem in detail, I do think we can help you search more "smartly," however. You may be "spinning your wheels" right now as a result of "trying too hard:" that happens to me :)
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview
-
Hello, How can I use WM_PASTE to send a plain text from clipboard to the active window and the focused textbox/combobox ? ---------- I want to paste by double-Click, I can detect the double click event and execute a code when it done so the destination window will be active the textbox/combobox will be focused please provide me a little sample project working with a timer in background and do the paste command. I keep searching for a solution to this problem for days but no results ------------------- Thanks
JusT LeT YouR MinD WorK
This not help ? how to copy to clipboard how to copy data to the clipboard[^] how to paste from clipboard http://social.msdn.microsoft.com/Forums/windows/en-US/8c677273-77bf-4423-a799-528e3aed837e/c-paste-from-clipboard[^]
Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
-
I assume, since you posted on this Forum, you are using C# ... correct ? Please state in what context you are using C#: WinForms ? WPF ? SilverLight ? ... ? Whatever you are using: what is it that you double-click on that triggers the Paste Event into the "destination window ... active ... textbox/combobox" ? Are you saying you want to detect a double-click Event anywhere in your application's main window, or in its child controls ? Does that imply you want to disable the standard double-click functions that occur in certain controls, like a TextBox ? Not a good idea. If you double-click on a WinForm the focus of the application may change, depending on what you clicked on; there may be no active Control. For example, if I have a TextBox and a PropertyGrid on a WinForm: if the TabOrder is set so that the TextBox is the Control with Focus when the application starts, then if I click on the PropertyGrid there is no active control on the Form. However, if I double-click on the Form itself, then Form.ActiveControl will still retain its last valid setting. I doubt anyone here is psychic enough (unless OriginalGriff is here) to figure out what the role of a Timer is in whatever you are trying to build. If you take the time to describe your problem in detail, I do think we can help you search more "smartly," however. You may be "spinning your wheels" right now as a result of "trying too hard:" that happens to me :)
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview
I refuse to remove my tin-foil hat for this one! :laugh:
The only instant messaging I do involves my middle finger.
-
I understand this all what I need is a simple example to know how to do it
JusT LeT YouR MinD WorK
-
I assume, since you posted on this Forum, you are using C# ... correct ? Please state in what context you are using C#: WinForms ? WPF ? SilverLight ? ... ? Whatever you are using: what is it that you double-click on that triggers the Paste Event into the "destination window ... active ... textbox/combobox" ? Are you saying you want to detect a double-click Event anywhere in your application's main window, or in its child controls ? Does that imply you want to disable the standard double-click functions that occur in certain controls, like a TextBox ? Not a good idea. If you double-click on a WinForm the focus of the application may change, depending on what you clicked on; there may be no active Control. For example, if I have a TextBox and a PropertyGrid on a WinForm: if the TabOrder is set so that the TextBox is the Control with Focus when the application starts, then if I click on the PropertyGrid there is no active control on the Form. However, if I double-click on the Form itself, then Form.ActiveControl will still retain its last valid setting. I doubt anyone here is psychic enough (unless OriginalGriff is here) to figure out what the role of a Timer is in whatever you are trying to build. If you take the time to describe your problem in detail, I do think we can help you search more "smartly," however. You may be "spinning your wheels" right now as a result of "trying too hard:" that happens to me :)
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview
I have no problem with double-click event it is already working without any problem All what I need is to paste from clipboard to the active window and the focused textbox I tried SendMessage and PostMessage but it is not working with me
JusT LeT YouR MinD WorK