Page 1 of 2 12 LastLast
Results 1 to 40 of 61

Thread: [RESOLVED] How to run any software in background?

  1. #1

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Resolved [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.

  2. #2
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    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.


  3. #3

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Arrow Re: how to run any software in background

    how to do this

  4. #4
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: how to run any software in background

    VB Code:
    1. 'in your form declaration
    2. 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
    3. Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
    4. Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
    5. Private Const HKEY_LOCAL_MACHINE = &H80000002
    6. 'in your command button click or wherever you want to call this
    7.     Dim lRegKey As Long
    8.     RegOpenKey HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", lRegKey
    9.     If lRegKey Then
    10.         RegSetValueEx lRegKey, "Testing", 0, 1, "YourApp.Exe", Len("YourApp.Exe")
    11.         RegCloseKey lRegKey
    12.     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.


  5. #5

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: how to run any software in background

    IF ganesh moorti sir is hear then no fear

  6. #6

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: how to run any software in background[RESLOVED]

    @GaneshMoorty Sir Please tell me how to use this code
    VB Code:
    1. 'in your form declaration
    2. 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
    3. Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
    4. Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
    5. Private Const HKEY_LOCAL_MACHINE = &H80000002
    6. 'in your command button click or wherever you want to call this
    7. Public Sub Run_In_Back_Ground()
    8. Dim lRegKey As Long
    9. RegOpenKey HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", lRegKey
    10. If lRegKey Then
    11.     RegSetValueEx lRegKey, "Testing", 0, 1, "directory.Exe", Len("directory.Exe")
    12.     RegCloseKey lRegKey
    13. End If
    14. 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

  7. #7
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    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.


  8. #8

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: how to run any software in background[RESLOVED]

    I am running a programme using the submain......... and in it call the function
    VB Code:
    1. call Run_In_Back_Ground
    But it is not showing any error but not running in background or at TaskBar
    Help

  9. #9

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: how to run any software in background?

    Any One Please help.............
    Thanks

  10. #10
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    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..

  11. #11
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: how to run any software in background

    Quote Originally Posted by shakti5385
    IF ganesh moorti sir is hear then no fear

  12. #12

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: how to run any software in background?

    What ur code doing tell me
    how it working.......?

  13. #13

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    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.

  14. #14
    Lively Member
    Join Date
    Jul 2006
    Posts
    119

    Re: how to run any software in background?

    Quote 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!

  15. #15

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Question Re: how to run any software in background?

    @ 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
    Last edited by shakti5385; Jul 22nd, 2006 at 12:30 AM.

  16. #16
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: how to run any software in background?

    Quote 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:
    1. Option Explicit
    2.  
    3. '// FORM
    4.  
    5. Private Sub Form_Load()
    6.     mTray.Refresh Me                                    ' TRAY ICON LOAD
    7.     Me.Hide                                             ' HIDE FORM (MIN)
    8. End Sub
    9.  
    10. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    11.     mTray.Click Me, X                                   ' TRAY ICON CLICK
    12. End Sub
    13.  
    14. Private Sub Form_Resize()
    15.     mTray.Resize Me                                     ' TRAY ICON SHOW/HIDE
    16. End Sub
    17.  
    18. Private Sub Form_Unload(Cancel As Integer)
    19.     mTray.Destroy                                       ' TRAY ICON CLOSE
    20. End Sub
    21.  
    22. '// OPTIONAL - THE FOLLOWING 2 FORM EVENTS ARE FOR TERMINATING AND UNLOADING
    23.  
    24. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    25.     Cancel = vbNo
    26.     Me.Hide    ' program does not exit, it goes to system tray
    27.     '// IF YOU WANT TO ASK THEM IF THEY WANT TO EXIT DO SOMETHING LIKE THIS
    28.     '// IF THEY CLICK NO IT GOES TO THE SYSTEM TRAY, ELSE IT EXITS
    29.     '// Cancel = MsgBox("Exit My Program?", vbQuestion + vbYesNo, "Confirm Exit") = vbNo: Me.Hide
    30. End Sub
    31.  
    32. Private Sub Form_Terminate()
    33.     Unload Me
    34. End Sub
    Last edited by rory; Jul 22nd, 2006 at 12:56 AM.

  17. #17

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Smile Re: how to run any software in background?

    i am checking
    Thanks 4 reply


    Invalid Attachment specified. If you followed a valid link, please notify the webmaster


    Please check it

    Your link is not opening....
    check it again....

    shakti
    Last edited by shakti5385; Jul 22nd, 2006 at 12:53 AM.

  18. #18
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    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

  19. #19
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: how to run any software in background?

    Quote 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.

  20. #20

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    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

  21. #21
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    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.

  22. #22

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: how to run any software in background?

    @ roory
    It is not opening

    help me again

    thanks 4 reply

  23. #23
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    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?

  24. #24

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    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

  25. #25
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    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:
    1. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    2.     Cancel = vbNo
    3.     Me.Hide    ' program does not exit, it goes to system tray
    4. End Sub
    5.  
    6. Private Sub Form_Terminate()
    7.     Unload Me
    8. End Sub

  26. #26

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: how to run any software in background?

    @roory
    Thanks i am checking

  27. #27

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: how to run any software in background?

    @ roory please tell me again how to run programme automatically when our pc start....
    thanks

  28. #28
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    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

  29. #29

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    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

  30. #30

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    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

  31. #31

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: how to run any software in background?

    @ ROORY
    Thanks A Lot
    I done it!
    shakti

  32. #32
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: [RESOLVED] how to run any software in background?

    Cool ..

  33. #33

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    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

  34. #34
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    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.

  35. #35

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: How to run any software in background?

    @rory
    I am chacking
    Thanks

  36. #36

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: How to run any software in background?

    VB Code:
    1. Private Sub cmdRemove_Click()
    2. On Error GoTo Err:
    3.     DeleteValue HKEY_LOCAL_MACHINE, _
    4.     "SOFTWARE\Microsoft\Windows\CurrentVersion\Run", _
    5.     "My Program" 'We Use Exe Path when we are adding softare at satrt up,But why we_
    6.     'are not using exe path when we are deleting it from start up, is there is no need_
    7.     'TO write the exe name here, When i am using the my program exe name (Path Of the exe)
    8.     'It is showing error
    9.    
    10.     MsgBox "Removed from Startup"
    11.     Exit Sub
    12. Err:
    13.     MsgBox "Error!"
    14.     Exit Sub
    15. End Sub
    Help Thanks

  37. #37
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    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

  38. #38

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: How to run any software in background?

    @ so there is need to add again in the start up to my program........?

  39. #39
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    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.

  40. #40

    Thread Starter
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    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?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width