Results 1 to 5 of 5

Thread: Strange Clipboard Behavoiur with VB

  1. #1
    Guest

    Question

    Hi!

    Anyone ever noticed when you put something on the clipboard (like paste-ing some code from this forum) and launching VB after that CLEARS the clipboard?

    Try putting something on the clipboard. Then launch VB and Paste. There won't be anything (at least at my PC).

    I use VB6 SP4 (Visual Studio 6 Pro (LEGAL I might add )

    Not that big of a problem, but still...
    Let me know...

  2. #2
    Lively Member
    Join Date
    Sep 1999
    Location
    Liverpool, UK
    Posts
    64

    Thumbs down

    Yep !

    Does that on mine too. VB6.0 on Windows 98.

  3. #3

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    It doesn't happen on my pc at home but it does at work.
    Home = 650 K7Chipset 128 Ram

    Speed & Mem?

    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  5. #5
    Guest
    No, I think it has nothing to do with Speed & mem...

    But I had an idea....

    Look at this solution:

    • Start a New project in VB6
    • Add a module
    • Remove the form
    • Paste this code:
      Code:
      Option Explicit
      
      Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
      
      Public Sub Main()
          Dim S As String
              
          S = Clipboard.GetText               ' Store Clipboard Contents
          Shell "vb6.exe", vbMaximizedFocus   ' Launch VB
          Sleep Val(Command)                  ' Wait the specified interval
          Clipboard.SetText S                 ' Restore the clipboard...
      End Sub                                 ' Done!
    • Compile to an Executable (Say "vbLaunch.exe")
    • Put the Compiled exe in the SAME directory as VB6.exe
    • Change te properties of the shortcut to VB6 from:

      "C:\Program Files\Microsoft Visual Studio\VB98\VB6.EXE" (or your own path)

      To :

      "C:\Program Files\Microsoft Visual Studio\VB98\VBLaunch.EXE" 5000

      Where 5000 is an interval in Milliseconds before the clipboard gets restored. If you have a fast PC try 1000. A slow PC? Try 10,000...


    Now put something on your clipboard, Double-Click the shortcut and paste in VB! Tadaaaaa...

    Brilliant, ain't it?

    Enjoy!

    (You can also download it Here)

    [Edited by RobIII on 10-02-2000 at 12:50 PM]

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