Solved

Best way to code something vb6

Posted on 2015-02-24
4
94 Views
Last Modified: 2015-02-24
I have a reminder program that loops thru files that contain a date Eg:
C:\Backups\Tasks\02-20-2016.rtf
C:\Backups\Tasks\02-28-2015.rtf
C:\Backups\Tasks\03-01-2015.rtf
C:\Backups\Tasks\03-10-2015.rtf
C:\Backups\Tasks\03-10-2016.rtf
C:\Backups\Tasks\06-23-2015.rtf
C:\Backups\Tasks\06-23-2016.rtf
the current date is 4 days before one of the dates then a message box displays
Call MsgBox("You have a scheduled task to consider in " & miFirstReminderDays & " days", vbInformation, "Needs attention") and the rtf files is loaded and the form displayed
I have the program run when windows starts invisible and only is shown if a reminder date is found
but i also need to start the program visible to add new items
The only way i could determine a way is to make 2 exeys
one visible and one invisible
Is there another way ?
0
Comment
Question by:isnoend2001
  • 2
  • 2
4 Comments
 
LVL 45

Accepted Solution

by:
Martin Liss earned 500 total points
Comment Utility
Add a timer to your form and then add this code. with this code the form will show up 1 second after F3 is pressed. You can use any function key that's convenient and you can also make the reaction fater by decreasing the 1000, but the smaller it is the more recourses you will be using up.

Option Explicit
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer

Private Sub Form_Load()
Me.Visible = False
Timer1.Interval = 1000 ' 1 second
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()

   If GetAsyncKeyState(vbKeyF3) <> 0 Then
      Me.Visible = True
   End If

End Sub

Open in new window

0
 

Author Closing Comment

by:isnoend2001
Comment Utility
Thanks Marty glad you are here
0
 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
So am I:)  You're welcome.
0
 

Author Comment

by:isnoend2001
Comment Utility
Lot better than 2 exeys I added this:
Private Sub Form_Load()
MsgBox "Press F3 to open"
Me.Visible = False
Timer1.Interval = 1000 ' 1 second
Timer1.Enabled = True
End Sub
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now