Results 1 to 5 of 5

Thread: integrating windows copy/paste/cut with my app...

  1. #1

    Thread Starter
    Fanatic Member jian2587's Avatar
    Join Date
    Aug 2000
    Location
    I bet u need a fusion powered shuttle to reach my place...
    Posts
    963

    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

  2. #2
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935
    use the clipboard functions

    VB Code:
    1. strdata = clipboard.Text

    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

  3. #3
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    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:
    1. Private Sub mnuCopy_Click ()
    2.    Clipboard.Clear
    3.    Clipboard.SetText Text1.SelText
    4. End Sub
    5.  
    6. Private Sub mnuCut_Click ()
    7.    Clipboard.Clear
    8.    Clipboard.SetText Text1.SelText
    9.    Text1.SelText = ""
    10. End Sub
    11.  
    12. Private Sub mnuPaste_Click ()
    13.    Text1.SelText = Clipboard.GetText()
    14. 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?

  4. #4

    Thread Starter
    Fanatic Member jian2587's Avatar
    Join Date
    Aug 2000
    Location
    I bet u need a fusion powered shuttle to reach my place...
    Posts
    963
    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

  5. #5
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935
    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
  •  



Click Here to Expand Forum to Full Width