Important alert: (current site time 7/16/2013 3:25:10 AM EDT)
 

winzip icon

AutoSave

Email
Submitted on: 10/18/2000 11:23:03 PM
By: Daniel Vandersluis  
Level: Advanced
User Rating: By 21 Users
Compatibility: VB 5.0, VB 6.0
Views: 24418
(About the author)
 
     AutoSave is a program that automatically saves the file you are working on in the program you specify as often as you want. It is a very useful program especially if you work in a program that has crashing tendecies, and you are worried that your work might be lost. AutoSave demonstrates use of Registry, Menu and Window API calls, and is commented pretty fully. ***Autosave v1.2 is now out!*** Bugs found in the first version have been fixed, so it now works well in both VB5 and VB6! Check it out at http://www.planet-source-code.com/vb/scripts/showcode.asp?txtCodeId=12825 and be sure to vote!

 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
'Windows API/Global Declarations for :AutoSave
'**************************************
Check out the code; It uses a ton of APIs:
* Registry APIs
* Menu APIs
* Window APIs
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

10/18/2000 11:27:37 PMDaniel Vandersluis

Well here it is! I've been trying to actually have something to submit to PSC forever! I hope you like me code. And comments, questions, concerns can be directed to dvandersluis@icqmail.com
Thanks, and don't forget to vote!
(If this comment was disrespectful, please report it.)

 
10/18/2000 11:29:30 PMDaniel Vandersluis

Oh, by the way, feel free to comment on PSC, and I'll be sure to respond... Thanks.
(If this comment was disrespectful, please report it.)

 
10/19/2000 12:10:35 AMSux2BMe

I still think this should have been made in C++... what's the point in making so many .bas files full of "Declare this Lib this Alias this (this) As this"
But hey... what the heck
I guess the VB community deserves some code too, even if their programming language is INFERIOR to C++ (I say such controvercial things all the time, don't I?)

Great code, nonetheless...
I must also add that this program will vanish if people actually learned that there is a menu called Save programmed into most programs..............
they should use it once in a while, and their lives will get SOOOOO much easier
(If this comment was disrespectful, please report it.)

 
10/19/2000 5:40:48 AMRik

Type Missmatch...

This line:
chkSaveAs.Value = GetKeyValue(HKEY_LOCAL_MACHINE,
(If this comment was disrespectful, please report it.)

 
10/19/2000 5:42:42 AMRik

Sorry.. half my post disappeard...

12th line in Form Load anyhow. I'm on win2000, any ideas?
(If this comment was disrespectful, please report it.)

 
10/19/2000 10:08:31 AMRik

I commented it out (since it was just regisrtary stuff) and it gave no errors... But I aint got it to save anything.....
(If this comment was disrespectful, please report it.)

 
10/19/2000 11:37:17 AMAfshaad Patel

This application does not work on visual basic 6.0 and win 2000
can you please help :)
(If this comment was disrespectful, please report it.)

 
10/19/2000 1:03:27 PMDaniel Vandersluis

1) Rik: I'm not sure exactly, but I'll try. Basically, this takes the Registry Key value that stores the value of that checkbox. I'm not really sure why it doesn't want to work, but perhaps you could try adding a Registry Key manually...
2) Afshaad: This version was created on visual Basic 5 and Windows 98 SE. I'm not sure why it wouldn't work, but maybe the APIs are a little different. The next version will hopefully be written in VB6, once I get it (I should have it soon). Hope this helps!
(If this comment was disrespectful, please report it.)

 
10/24/2000 1:05:32 PMDaniel Vandersluis

Thank you to everyone who voted for me! Feel free to post any questions, and keep on voting!
(If this comment was disrespectful, please report it.)

 
11/3/2000 9:34:41 AMDaniel Vandersluis

Thank you to all the voters for helping me win a coding contest award!
I have a couple things to report on:
1) There is a small problem using this with Visual Basic 6 - it will give you error 13 - type mismatch at a couple of places, including the calls to retrieve values from the registry. Although I am currently working on fixing this, and the release of Autosave 1.2, which is coming out soon, and built in VB6, will work properly, you could temporarily fix this Registry problem by manually adding the Registry keys (I don't remember what they are offhand, but if you look at my code, you can find them). I'm sorry for this little problem. Autosave works perfectly, however, with VB5.

(If this comment was disrespectful, please report it.)

 
11/3/2000 9:34:57 AMDaniel Vandersluis

2) Since I used the VB Timer, the maximum interval that can be used is 65535, which is a little bit over 65 seconds. However, Autosave 1.2 will have a longer timer that I hopefully will make using Windows Timing APIs.

As usual, thanks for all your comments and suggestions. Please continue to make thes comments, and vote for me! :)

(If this comment was disrespectful, please report it.)

 
11/6/2000 10:34:50 PMAdam Cowart

Try this on the registry save

chkSaveAs.Value =
Val(GetKeyValue(HKEY_LOCAL_MACHINE....)

That should return the value of
GetKeyValue(HKEY_LOCAL_MACHINE..) in stead of saying that it equals
(If this comment was disrespectful, please report it.)

 
11/6/2000 10:37:36 PMAdam Cowart

I have not downloaded the source but I was considering it. On the registry load error try this:
chkSaveAs.Value =
Val(GetKeyValue(HKEY_LOCAL_MACHINE...)

That should return the value of the actual key instead of returning the value as:
"GetKeyValue(HKEY_LOCAL_MACHINE...)"
(If this comment was disrespectful, please report it.)

 
11/27/2000 9:26:49 AMAckbar

Sux2BMe we could also say C++ is inferior to c :) I mean it's slower isn't it :P I prefer c over any language and do most all my programming in it. C++ was written in c after all :)
(If this comment was disrespectful, please report it.)

 
7/15/2002 8:23:45 AMSANDOWN Software

Well, ladies, I reckon C, C++ and VB are all inferior to Delphi. But, hey, who cares what I think?
(If this comment was disrespectful, please report it.)

 
7/31/2002 2:35:17 AMDivya

Hi,

Its nice job u have done.But it is listing the windows which we opened.I want to save them automatically without user interaction.So,when I forgot to save the data manually the system should save them automatically.So,whenever system got shutdowned,I can retrieve the data again.Is it possible through your program .Do u have any idea on that.If u have send it to
divya319@rediffmail.com,It is very URGENT!!!!!!
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.