|
-
May 6th, 2006, 01:21 AM
#1
Thread Starter
Just Married
[RESOLVED] How to run any software in background?
hi all
i am making an address software any idea
how it run directly when computer start!
if helpful coding then welcome
THANKS ALL
Last edited by shakti5385; Jul 25th, 2006 at 04:53 AM.
-
May 6th, 2006, 01:45 AM
#2
Re: how to run any software in background
you can add an entry of your application to the registry's run section, so that when windows starts it will run automatically, other way is by adding a shortcut link to the startup folder you can perform the same.
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
May 6th, 2006, 01:58 AM
#3
Thread Starter
Just Married
Re: how to run any software in background
-
May 6th, 2006, 02:11 AM
#4
Re: how to run any software in background
VB Code:
'in your form declaration
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Const HKEY_LOCAL_MACHINE = &H80000002
'in your command button click or wherever you want to call this
Dim lRegKey As Long
RegOpenKey HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", lRegKey
If lRegKey Then
RegSetValueEx lRegKey, "Testing", 0, 1, "YourApp.Exe", Len("YourApp.Exe")
RegCloseKey lRegKey
End If
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
May 6th, 2006, 02:18 AM
#5
Thread Starter
Just Married
Re: how to run any software in background
IF ganesh moorti sir is hear then no fear
-
Jul 20th, 2006, 02:01 AM
#6
Thread Starter
Just Married
Re: how to run any software in background[RESLOVED]
@GaneshMoorty Sir Please tell me how to use this code
VB Code:
'in your form declaration
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Const HKEY_LOCAL_MACHINE = &H80000002
'in your command button click or wherever you want to call this
Public Sub Run_In_Back_Ground()
Dim lRegKey As Long
RegOpenKey HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", lRegKey
If lRegKey Then
RegSetValueEx lRegKey, "Testing", 0, 1, "directory.Exe", Len("directory.Exe")
RegCloseKey lRegKey
End If
End Sub
You send me this code for run a vbexe in the back ground but i am not able to understand that how to use it..............
Please help me again
Thanks
-
Jul 20th, 2006, 02:04 AM
#7
Re: how to run any software in background[RESLOVED]
Shakti: the code i have sent is to register your program in windows registry to make it run whenever windows starts and not for running your exe at the background.
do you get any errors by running this code...
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
Jul 20th, 2006, 02:04 AM
#8
Thread Starter
Just Married
Re: how to run any software in background[RESLOVED]
I am running a programme using the submain......... and in it call the function
But it is not showing any error but not running in background or at TaskBar
Help
-
Jul 20th, 2006, 03:10 AM
#9
Thread Starter
Just Married
Re: how to run any software in background?
Any One Please help.............
Thanks
-
Jul 20th, 2006, 03:15 AM
#10
PowerPoster
Re: how to run any software in background?
add to startup
http://www.vbforums.com/showpost.php...35&postcount=6
then use me.hide in the program to run in background..
-
Jul 20th, 2006, 03:18 AM
#11
PowerPoster
Re: how to run any software in background
 Originally Posted by shakti5385
IF ganesh moorti sir is hear then no fear
-
Jul 20th, 2006, 03:31 AM
#12
Thread Starter
Just Married
Re: how to run any software in background?
What ur code doing tell me
how it working.......?
-
Jul 21st, 2006, 07:27 AM
#13
Thread Starter
Just Married
Re: how to run any software in background?
Any senior has any idea then please.... tell me
@Rorry ..........
<VBCODE>
"My Program", "C:\Program Files\IFW Directory\Directory.exe"
MsgBox "Added to Startup"
Exit Sub
</VBCODE>
how ur program in the background and when i am using above code it is not showing at the task bar
can u check it and tell me again
thanks
Last edited by shakti5385; Jul 21st, 2006 at 07:32 AM.
-
Jul 21st, 2006, 07:52 AM
#14
Lively Member
Re: how to run any software in background?
 Originally Posted by shakti5385
Any senior has any idea then please.... tell me
@Rorry ..........
<VBCODE>
"My Program", "C:\Program Files\IFW Directory\Directory.exe"
MsgBox "Added to Startup"
Exit Sub
</VBCODE>
how ur program in the background and when i am using above code it is not showing at the task bar
can u check it and tell me again
thanks
What!!!
Thats not even VB Code!
Well parts of it is & some parts aint!
-
Jul 22nd, 2006, 12:23 AM
#15
Thread Starter
Just Married
-
Jul 22nd, 2006, 12:40 AM
#16
PowerPoster
Re: how to run any software in background?
 Originally Posted by shakti5385
@ Roory....
your code running programme automatically whan i restart my pc again....
but u have any idea that how to show it at task bar
Thanks 
Hi .. do you mean the System Tray?
If so, in your program, in The Main Form Load use Me.Hide to hide the Form (program)..
See this code .. basically just copy the code in there into your project (copy the module into a new module and name it the same as i have it) .. add Me.Hide in your Form Load then it should automatically goto the system tray on loading the program .. to show your program again they simply left click on your program icon in the system tray ... and you can then minimize your program again to set it to the system tray.
http://www.vbforums.com/attachment.p...chmentid=49433
If you have problems with this let me know, ill throw together a custom version that auto hides on load.
This shows the code i attached in the Form, Modified to Auto Hide ..
Also i included the 2 form event examples, Terminate and Query Unload, incase you want to use those.
Also set Form ShowInTaskbar to False.
VB Code:
Option Explicit
'// FORM
Private Sub Form_Load()
mTray.Refresh Me ' TRAY ICON LOAD
Me.Hide ' HIDE FORM (MIN)
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
mTray.Click Me, X ' TRAY ICON CLICK
End Sub
Private Sub Form_Resize()
mTray.Resize Me ' TRAY ICON SHOW/HIDE
End Sub
Private Sub Form_Unload(Cancel As Integer)
mTray.Destroy ' TRAY ICON CLOSE
End Sub
'// OPTIONAL - THE FOLLOWING 2 FORM EVENTS ARE FOR TERMINATING AND UNLOADING
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Cancel = vbNo
Me.Hide ' program does not exit, it goes to system tray
'// IF YOU WANT TO ASK THEM IF THEY WANT TO EXIT DO SOMETHING LIKE THIS
'// IF THEY CLICK NO IT GOES TO THE SYSTEM TRAY, ELSE IT EXITS
'// Cancel = MsgBox("Exit My Program?", vbQuestion + vbYesNo, "Confirm Exit") = vbNo: Me.Hide
End Sub
Private Sub Form_Terminate()
Unload Me
End Sub
Last edited by rory; Jul 22nd, 2006 at 12:56 AM.
-
Jul 22nd, 2006, 12:49 AM
#17
Thread Starter
Just Married
Re: how to run any software in background?
Last edited by shakti5385; Jul 22nd, 2006 at 12:53 AM.
-
Jul 22nd, 2006, 12:55 AM
#18
PowerPoster
Re: how to run any software in background?
i included an attachment here that has the Auto Hide on Form Load, and Form Terminate/Unload feature (auto hide is commented out), i left in the part that asks the user if they want to exit, you could change that to ask them anything .. just there as an example.
Rory
-
Jul 22nd, 2006, 12:58 AM
#19
PowerPoster
Re: how to run any software in background?
 Originally Posted by shakti5385
Your link is not opening....
check it again....
sorry fixed that .. anyway try the last attachment i posted as it has the auto hide/minimize in it.
-
Jul 22nd, 2006, 01:16 AM
#20
Thread Starter
Just Married
Re: how to run any software in background?
@ roory it is working perfectly..........
now please tell me i want that when i send curser at the tash bar a text box open or a form wil open automatically
can we do this....
thanks 4 reply...
check ur reputation
-
Jul 22nd, 2006, 01:23 AM
#21
PowerPoster
Re: how to run any software in background?
you mean something like the MSN Popup thing .?
if so see this example .. originally from another member on this forum (Wokawidget), i just stripped it down ..
http://www.vbforums.com/attachment.p...chmentid=48852
If thats not what you want and you want to show another form of yours, or menu item, you would do something similar .. but instead of using the popup object such as in this example you would use the other form or the menu items .. a little different .. just depends what you want to do. Let me know ..
see the original from woko here:
http://www.vbforums.com/showthread.php?t=320639
Last edited by rory; Jul 22nd, 2006 at 01:27 AM.
-
Jul 22nd, 2006, 01:30 AM
#22
Thread Starter
Just Married
Re: how to run any software in background?
@ roory
It is not opening
help me again
thanks 4 reply
-
Jul 22nd, 2006, 01:31 AM
#23
PowerPoster
Re: how to run any software in background?
whats not opening? the attachment or the popup ..?
Also you may not even want this type of thing .. do you just want that when you mouse over the icon or left click a current form in your project appears in that location at the bottom right of the screen? Or maybe a menu?
-
Jul 22nd, 2006, 01:40 AM
#24
Thread Starter
Just Married
Re: how to run any software in background?
Attatchment is opening i send all the file in in attachment in a folder but when i am opening the oroject some form not opening basically it is not running.....
@ Roory In ur first attatchment....
when we run the program it send them at the task bar, but when we close it it also close from the task bar....
It is possible that it work at task bar and show icon there.....
when we close it
-
Jul 22nd, 2006, 01:43 AM
#25
PowerPoster
Re: how to run any software in background?
sure, you just use this instead, but then you will need a timer or something so you can exit the program at sometime .. otherwise it just stays in the system tray ..
VB Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Cancel = vbNo
Me.Hide ' program does not exit, it goes to system tray
End Sub
Private Sub Form_Terminate()
Unload Me
End Sub
-
Jul 22nd, 2006, 03:00 AM
#26
Thread Starter
Just Married
Re: how to run any software in background?
@roory
Thanks i am checking
-
Jul 22nd, 2006, 05:02 AM
#27
Thread Starter
Just Married
Re: how to run any software in background?
@ roory please tell me again how to run programme automatically when our pc start....
thanks
-
Jul 22nd, 2006, 05:04 AM
#28
PowerPoster
Re: how to run any software in background?
I thought you got that part working?
see this code again ..
http://www.vbforums.com/showpost.php...35&postcount=6
Rory
PS. 6am here now, im off to sleep
-
Jul 22nd, 2006, 05:11 AM
#29
Thread Starter
Just Married
Re: how to run any software in background?
@ roory do not go to bad....
here is 3.45..
wait i m coming after checking the problem
thanks
-
Jul 22nd, 2006, 05:53 AM
#30
Thread Starter
Just Married
Re: how to run any software in background?
@Roory ya i get the point
Now tell me that is it possible that if we place our cursor there then it show a textbox or a form that we can use for search our data
thanks
-
Jul 22nd, 2006, 06:38 AM
#31
Thread Starter
Just Married
Re: how to run any software in background?
@ ROORY
Thanks A Lot
I done it!
shakti
-
Jul 22nd, 2006, 10:58 AM
#32
PowerPoster
Re: [RESOLVED] how to run any software in background?
Cool ..
-
Jul 24th, 2006, 12:03 AM
#33
Thread Starter
Just Married
Re: How to run any software in background?
@Roory
Please a problem is occuring...
program is automatically running at start up.......
but can we give option to user that if he want then program run at start up otherwise not
thnaks
-
Jul 24th, 2006, 12:19 AM
#34
PowerPoster
Re: How to run any software in background?
sure, just provide them with a button or menu item to Install or Remove ..
Updated the following to include Add & Remove .. module also changed.
-
Jul 24th, 2006, 12:33 AM
#35
Thread Starter
Just Married
Re: How to run any software in background?
@rory
I am chacking
Thanks
-
Jul 24th, 2006, 12:48 AM
#36
Thread Starter
Just Married
Re: How to run any software in background?
VB Code:
Private Sub cmdRemove_Click()
On Error GoTo Err:
DeleteValue HKEY_LOCAL_MACHINE, _
"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", _
"My Program" 'We Use Exe Path when we are adding softare at satrt up,But why we_
'are not using exe path when we are deleting it from start up, is there is no need_
'TO write the exe name here, When i am using the my program exe name (Path Of the exe)
'It is showing error
MsgBox "Removed from Startup"
Exit Sub
Err:
MsgBox "Error!"
Exit Sub
End Sub
Help Thanks
-
Jul 24th, 2006, 12:55 AM
#37
PowerPoster
Re: How to run any software in background?
You are deleting the Value by using the Value's Name as a reference, no need to know the Value's Data in this case.
Its like you can call my name, Rory, and ill answer, no need to call me by my First and Last Name
-
Jul 24th, 2006, 01:01 AM
#38
Thread Starter
Just Married
Re: How to run any software in background?
@ so there is need to add again in the start up to my program........?
-
Jul 24th, 2006, 01:05 AM
#39
PowerPoster
Re: How to run any software in background?
when you delete it, its gone ...
so when they want to add it to the start up again, use the Add to Start up code ..
Last edited by rory; Jul 24th, 2006 at 01:31 AM.
-
Jul 24th, 2006, 01:33 AM
#40
Thread Starter
Just Married
Re: How to run any software in background?
@Rory
Working Properly
But
Problem is that if we add the program in the start up, on a check box click
But how we know that program is already added in the start up?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|