|
-
Nov 19th, 2001, 06:15 AM
#1
Thread Starter
Fanatic Member
integrating windows copy/paste/cut with my app...
Yeah, vb guyz, how do I integrate cut/copy/paste and things like that into my app?
Not only copy paste, any other functions.
Which means whenever a user use this function,
it will point into my app, thus I know he's doing this
and do what should I do, then transfer back to windows
sort of changing interrupt in asm...
thanks
ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
Programming is fun, but only if you're not on a tight deadline 
So I consider all those working engineers sad people
VB FTP class
3 page PHP crash course
Crash Course on DX9 Managed with VB.NET covering basics till terrain creation
-
Nov 19th, 2001, 06:25 AM
#2
Fanatic Member
use the clipboard functions
and you are talking about using windows hooks and subclassing to trap windows system events and get your app to respond to them
check out sites like www.planetsourcecode.com and vbnet for examples on how to do this
-
Nov 19th, 2001, 06:27 AM
#3
Fanatic Member
Two of the most useful Clipboard methods are SetText and GetText. These two methods transfer string data to and from the Clipboard.
SetText copies text onto the Clipboard, replacing whatever text was stored there before. You use SetText like a statement. Its syntax is:
Clipboard.SetText data[, format]
GetText returns text stored on the Clipboard. You use it like a function:
destination = Clipboard.GetText()
By combining the SetText and GetText methods with the selection properties introduced in "Working with Selected Text," you can easily write Copy, Cut, and Paste commands for a text box. The following event procedures implement these commands for controls named mnuCopy, mnuCut, and mnuPaste:
VB Code:
Private Sub mnuCopy_Click ()
Clipboard.Clear
Clipboard.SetText Text1.SelText
End Sub
Private Sub mnuCut_Click ()
Clipboard.Clear
Clipboard.SetText Text1.SelText
Text1.SelText = ""
End Sub
Private Sub mnuPaste_Click ()
Text1.SelText = Clipboard.GetText()
End Sub
Note The example works best if these are menu controls, because you can use menus while Text1 has the focus.
Notice that both the Copy and Cut procedures first empty the Clipboard with the Clear method. (The Clipboard is not cleared automatically because you may want to place data on the Clipboard in several different formats, as described in "Working with Multiple Formats on the Clipboard" later in this chapter.) Both the Copy and Cut procedures then copy the selected text in Text1 onto the Clipboard with the following statement:
Clipboard.SetText Text1.SelText
In the Paste command, the GetText method returns the string of text currently on the Clipboard. An assignment statement then copies this string into the selected portion of the text box (Text1.SelText). If no text is currently selected, Visual Basic places this text at the insertion point in the text box:
Text1.SelText = Clipboard.GetText()
This code assumes that all text is transferred to and from the text box Text1, but the user can copy, cut, and paste between Text1 and controls on other forms.
Because the Clipboard is shared by the entire environment, the user can also transfer text between Text1 and any application using the Clipboard.
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Nov 19th, 2001, 06:32 AM
#4
Thread Starter
Fanatic Member
sir, u didn't get my point.
I already know clipboard since I was 3 yr old
What I meant was:
Whenever a user executes a windows functions, say, a delete file function, it will let my app gain control, say, I want to check if he's deleting important files, then passes back the control to windows.
Got that? Sort of interrupt changing in asm...
ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
Programming is fun, but only if you're not on a tight deadline 
So I consider all those working engineers sad people
VB FTP class
3 page PHP crash course
Crash Course on DX9 Managed with VB.NET covering basics till terrain creation
-
Nov 19th, 2001, 06:39 AM
#5
Fanatic Member
jian first of all i seriously doubt that you knew about the vb clipboard functions at the tender age of 3
Second
as i stated in my first post
what you are wanting to acheive can only be done with subclassing and windows hooks
check out the api calls and other articles at www.allapi.net
and www.mvps.com/vbnet
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|