Asking for VB program please..???
Dear Experts,
I use Windows XP Pro SP2...
I have a program (created by my own) that is opening on desktop during start up...my questions are:
1. Within the program interface, there is a button called "Finance"..which is when I click that button, it will opens "finance.exe"...So, what kind of codes should I write to open "finance.exe" please...???
2. What kind of codes, when I click "X" (close) or "-" (minimize), that program will go to the start up icon (which is small icon on the right below on the Windows...)..???
Please help me... ;)
Thanks for your kind helps..
Jennifer :)
Re: Asking for VB program please..???
Quote:
Originally Posted by zach007
1. Within the program interface, there is a button called "Finance"..which is when I click that button, it will opens "finance.exe"...So, what kind of codes should I write to open "finance.exe" please...???
VB Code:
Option Explicit
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 Const SW_SHOWNORMAL = 1
Private Sub Command1_Click()
ShellExecute Me.hwnd, vbNullString, "Finance.Exe", vbNullString, "C:\", SW_SHOWNORMAL
End Sub
Quote:
Originally Posted by zack007
2. What kind of codes, when I click "X" (close) or "-" (minimize), that program will go to the start up icon (which is small icon on the right below on the Windows...)..???
Do you want to minimize the program or put it in the system tray?
Re: Asking for VB program please..???
Here's a link to some systray code (code to add an icon next to the clock). It's not that easy, so give us a shout if u need a hand.
http://www.vbforums.com/showthread.p...hreadid=300765
WOka
Re: Asking for VB program please..???
A good systray example:
I do not remeber where I got it from. Hope it any use for you. I still use it. It is very stable and works very well.
There is mentioned in the code that: 'the form must be fully visible before calling Shell_NotifyIcon
Nope!!! Doesn't have to. Well. At least not to me.
With some code-tuning you'll be able to make it very nice. Good luck... :wave: