Hello,
Is there a fix or patch of some sort that will STOP VB6 from clearing the clipboard when it starts?
Thanks!
Hello,
Is there a fix or patch of some sort that will STOP VB6 from clearing the clipboard when it starts?
Thanks!
Found this in a Google group. I guess there is always a way...but still open to suggestions...
On Mon, 21 Oct 2002 14:02:15 -0500, "Norm Cook"
<normc...@cableone.net> wrote:
>Sigh, just something we have to live with. It's burned me so many times
>that I've learned to start VB before doing any copying.
Well, maybe not. If this thing works for you guys too then i guess a
couple of problems are solved. It's a quick and dirty hack, i'm sure
there are some more elegant ways, but i coldn't be arsed.
So it may need some tender loving play with extending or reducing the
timeout in the for next loop but you guys are programmers right ? :-)
All in a standard module, formless code.
I called this vb66.exe and changed the path in the file associations
"open" to point at this exe instead.
So far so good, it keeps my clipboard intact and i'm starting up in my
project directory too. Double whammy and so far so good. :-)
Nb: Not tested on NT/2k/XP let me know how you went.
Option Explicit
'CHANGE THIS TO YOUR VB EXE's PATH
--Code:Private Const VBPath = "c:\mvs\vb98\vb6.exe" Private Declare Function ShellExecute Lib "shell32.dll" Alias _ "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As _ String, ByVal lpFile As String, ByVal lpParameters As String, _ ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds _ As Long) Sub Main() Dim saveBuffer As String Dim startPath As String Dim i As Long, ct As Long, ret As Long 'check for and grab any text If Clipboard.GetFormat(vbCFText) = True Then saveBuffer = Clipboard.GetText End If 'eval the commandline and grab the project path. If Command$ <> "" Then i = InStrRev(Command$, "\") If i Then startPath = Left$(Command$, i) Else startPath = "" End If End If 'ask the user to use project path or not. ' if it bugs you get rid of this. Select Case MsgBox("Set path to : " & vbCrLf & _ startPath, vbYesNoCancel Or vbDefaultButton1, _ "About to launch VB") Case vbYes: ' just break Case vbNo: startPath = "" 'don't care Case vbCancel: End ' I'm already denying this. End Select 'launch VB ret = ShellExecute(0, "open", VBPath, Command$, startPath, 1) If ret <= 32 Then MsgBox ("Failed to launch VB") saveBuffer = "" 'force a drop through below End If ct = 0 DONE: If saveBuffer <> "" Then Do While Clipboard.GetFormat(vbCFText) = True 'catch the clearing Call Sleep(300) 'hang about until the cb is cleared by VB. DoEvents ct = ct + 1 If ct > 100 Then Exit Do ' but have to give up at some time. Loop On Error Resume Next Clipboard.SetText saveBuffer, vbCFText ' make sure it stuck and VB doesn't clear it again..which it ' does at times :-/ For ct = 1 To 5 Call Sleep(300) If (Clipboard.GetFormat(vbCFText) <> True) Then Clipboard.SetText saveBuffer, vbCFText End If Next End If ' if we're lucky we should still have a clipboard full of goodies End Sub
Regards, Frank
Last edited by birthjay; Aug 29th, 2007 at 03:16 PM. Reason: Can't ever copy code with this dumb thing.
Are you using SP6?
I had the same problem a while ago, but after installing SP6 everything remained in the clipboard when starting VB6.
http://www.microsoft.com/downloads/d...displaylang=en
Thanks...but I can't install it because we develop with SP5. Good to know they must have fixed it though.
SP6 has no effect on this and did try creating a "memory" files before as well...
So, in short - just live with it.![]()
Microsoft MVP - Visual Basic 2006-2013
Why VB clears the clipboard on startup and how to avoid it? . Filtering Arrays . Save File To Database . Extract File From Database .
Extract picture from database without using hard drive . Change Menu BackColor . How to use MS Flexgrid . Make Frame Transparent .
The Easiest Way to Create an NT Service With VB6 . How to comment blocks of code in VB5 and VB6 . How to find and replace missing members of control array
Visual Basic 6.0 On-Line Documentation . Connection Strings
I am running VB6 SP6 and I have not had any problems - until recently when I installed the VBCodeHelper addin. Now when ever I start VB the clipboard is erased. Disabling VBCodeHelper instantly restores normal behaviour.
Hope this helps.![]()
But "normal" behaviour for VB6 is to clear the clipboard. Do you have anything else installed - something like MZ Tools?
Microsoft MVP - Visual Basic 2006-2013
Why VB clears the clipboard on startup and how to avoid it? . Filtering Arrays . Save File To Database . Extract File From Database .
Extract picture from database without using hard drive . Change Menu BackColor . How to use MS Flexgrid . Make Frame Transparent .
The Easiest Way to Create an NT Service With VB6 . How to comment blocks of code in VB5 and VB6 . How to find and replace missing members of control array
Visual Basic 6.0 On-Line Documentation . Connection Strings
Nope! and I just tried it again to prove the point. I copied all of the code in post #2 and then started VB. Tried to paste into the form - nothing!
Same as above but I disabled VBCodeHelper before quitting the programme, copied the code, started VB and viola!! Are you certaikn that the normal behaviour of VB is to clear the clipboard?
I have come up from VB3 - VB5 - VB6 and cannot recall this ever happening before, until last week when I installed VBCodeHelper (great addin though).
I don't buy it - the entire VB community in the world is suffering since VB5 and you are not?
You must have something else installed (or missing) that directly affects (in a good way) behaviour.
btw, what version of VB6 do you have? I've never used anything but Enterprise.
Microsoft MVP - Visual Basic 2006-2013
Why VB clears the clipboard on startup and how to avoid it? . Filtering Arrays . Save File To Database . Extract File From Database .
Extract picture from database without using hard drive . Change Menu BackColor . How to use MS Flexgrid . Make Frame Transparent .
The Easiest Way to Create an NT Service With VB6 . How to comment blocks of code in VB5 and VB6 . How to find and replace missing members of control array
Visual Basic 6.0 On-Line Documentation . Connection Strings
Well you've actually made me doubt myself, so I've just tried the same things as in my last post. No VBCodeHelper and I can copy your post, start VB and paste it into a form. With VBCodeHelper - nothing.
VB6 Professional with SP6 and the MS updates to overcome the SP6 bugs.
I think I've attached an image of my addin manager.
OK - Here's an update for you. At the weekend I reloaded XP SP2 onto my notebook and, although I had installed VB, I hadn't used it.
Just tried it out on there and it does exactly what everyone else in the world is getting - Spooky.
Notebook = HP AMD 2400XP+ - 512MB - XP/SP2
Main Machine HP AMD X2 3800+ 64bit - 1GB - 32bit XP/SP2
Wow, look at the time and I have to up at 5.![]()
This has been discussed before. See RobDog888's post #8 in this thread.
Do not worry about your difficulties in Mathematics. I can assure you mine are still greater.Tips, Examples & Tutorials:
Albert Einstein
A valuable forum tool Generate unique TreeView keys TreeView with "open" and "closed folder" icons Time code using GetTickCount How to trap the Tab key Scroll a form NumberBox ActiveX control Color a ListView row An InputBox form How to use SaveSetting and GetSetting A program registration scheme Spellcheck a Textbox Resize controls Open Windows Explorer at Last Visited Path A Blackjack Game Count lines of code Private Message Viewer Copy/Paste VB Code Paste VB Code Add-In Insert Procedure Names Add-In A calculator for the game of Spider My review of REALbasic 2008 VB6 Debug Tutorial Picture/Video Viewer VBF Photo Contest Winners
2009 - 2013
Hmmm, interesting observation btw.
I tried it and if you unload ALL add-ins and also make sure NONE is selected to be loaded at startup then "problem" goes away.
But that beats the purpose of using add-ins !!!![]()
And since some of them are loaded by default and ARE quite useful practically nobody bothers to unload them.
That explains. Thanks Marty for pointing out to that thread.
ps, after all I'd rather have say Component Services loaded and have VB to clear clipboard then visa versa...![]()
Last edited by RhinoBull; Aug 29th, 2007 at 08:26 PM.
Microsoft MVP - Visual Basic 2006-2013
Why VB clears the clipboard on startup and how to avoid it? . Filtering Arrays . Save File To Database . Extract File From Database .
Extract picture from database without using hard drive . Change Menu BackColor . How to use MS Flexgrid . Make Frame Transparent .
The Easiest Way to Create an NT Service With VB6 . How to comment blocks of code in VB5 and VB6 . How to find and replace missing members of control array
Visual Basic 6.0 On-Line Documentation . Connection Strings
It's become pretty much a habit for me to highlight the code, open VB, go back to the window, copy, back to VB, and paste. Kind of a pain...but come on...it takes only a few extra seconds. Surely if you're a programmer that can't be too bad...
I think it would take more time for me to try and break that habit and get used to it not clearing the clipboard at this point.
I know this is an old thread, but an easy solution is a 3rd party clipboard tool.
I use Yanky Clipper, it's free and good!
http://www.intelexual.com/products/YC3/
Codebank Submissions: Create/Delete Shortcuts including Special Folders like Startup , Custom MsgBox form
Hmm, why not use the savesetting/getsettings?
When form loads, savesetting clipboard data, then getsettings clipboard data?
We're not talking about saving app data here but rather that some add-ins cause VB the clear the clipboard when VB is started.
Do not worry about your difficulties in Mathematics. I can assure you mine are still greater.Tips, Examples & Tutorials:
Albert Einstein
A valuable forum tool Generate unique TreeView keys TreeView with "open" and "closed folder" icons Time code using GetTickCount How to trap the Tab key Scroll a form NumberBox ActiveX control Color a ListView row An InputBox form How to use SaveSetting and GetSetting A program registration scheme Spellcheck a Textbox Resize controls Open Windows Explorer at Last Visited Path A Blackjack Game Count lines of code Private Message Viewer Copy/Paste VB Code Paste VB Code Add-In Insert Procedure Names Add-In A calculator for the game of Spider My review of REALbasic 2008 VB6 Debug Tutorial Picture/Video Viewer VBF Photo Contest Winners
2009 - 2013