[HELP VB6] Running and Hiding Programs and much more
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 14 of 14

Thread: [HELP VB6] Running and Hiding Programs and much more

  1. #1
    Join Date
    Aug 2010
    Posts
    7

    [HELP VB6] Running and Hiding Programs and much more

    Hi all... I need some help in the project that I am going to make...
    I did it once a while back.. but I lost my source code and the binary....

    What I want to do is make a program that runs another program and set its starting directory then hide it. Then check if the program is finished loading and running then proceed to running the next program if there is any.

    I also want to bring up/show up the specific program that I hide.

    And also, I want my program to constantly check if the program is running, so if ever the program is closed by other means other than my program, it will restart it or rerun it and hide it again.

    And of course, I want my program to close those i have run or just restart it.



    I hope you can help me about it.

    I know I have to use API 's to achieve this but I am not sure as to what and how.

  2. #2
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,997

    Re: [HELP VB6] Running and Hiding Programs and much more

    Depends on the nature of your program. We don't help people do bad things, and with nothing to go on, posting code could be futile...
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Aug 2010
    Posts
    7

    Re: [HELP VB6] Running and Hiding Programs and much more

    My program will be used to run a game server.
    There are 7 servers to run before the game can be played.
    I can run the program directly but it will show in my task bar and it gets annoying when your also opening other programs or folders.
    I want to make this program to run the server and hide it from the taskbar.
    I hope someone can help.

  4. #4
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,997

    Re: [HELP VB6] Running and Hiding Programs and much more

    I wouldn't use VB6, but you could use REMOTE DESKTOP, to allow users to open only your app, and when it closes, logs them off.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Aug 2010
    Posts
    7

    Re: [HELP VB6] Running and Hiding Programs and much more

    Im sorry but you didn't quite get what I meant...

    There are 7 applications that I want to run on my local machine using my program. Run it 1 by 1 setting its starting directory and hiding it from the taskbar. Then monitor if the application is successfully run. After the application is good and running, my program will start the next application and then to the next until all 7 applications are running.

    Whenever any of the running application fails or close by it self, my program will automatically restart it and hide it again.

    I also want my program to be able to show again the application that it hides allowing me to end its process manually.

    And I also want my program to stop all those 7 application whenever my program will close.

    Ohh.. And I also what my program to check first if there is any of the same application is already running and prompts if there is any.

    These 7 application is run in the same machine where my program is.

    I have successfully Run one of the application and set its starting directory using the ShellExecute API and hide it after it executes.... but i do not know how to show it again on the screen.

  6. #6
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,997

    Re: [HELP VB6] Running and Hiding Programs and much more

    Not sure if that's a good idea...

    You could start other apps from that, but Microsoft GINA doesn't let two users to interact (without a Server). Admin can hide apps, but users cannot.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  7. #7
    Join Date
    Aug 2010
    Posts
    7

    Re: [HELP VB6] Running and Hiding Programs and much more

    This application is a Game Server... an Emulator... So users do not need to access the the server.... only they connect to the server.... The Server machine needs to run this 7 servers so that the players/users can connect using their game client....

    This 7 servers when will show in the task bar... and it is very space consuming in the task bar... That is why i want to make a program that will hide this pesky little servers that is showing in the task bar and only show it when needed to....

    Anyway... I have manage to run and hide this 7 servers using the ShellExecute API.... the only problem for me is how to close it using VB.... I search the net and found about SendMessage API that sends message to the application..... but its lack in details on how to use it..... I didn't quite get how to use the code.....

    My other problem is how to make my program know that the application that I run is finish loading so it can proceed to running the next application/server...
    I also want to make my program to monitor if the application/server that I run is still running... If ever it is stopped unexpectedly - example if error occured - my program will automatically restart it.... so the admin do not need to always keep an eye on the process....

    My program is named Server Starter....
    It runs 7 Server Applications (3rd Party Program) namely:
    Account
    Database
    Core
    Certifier
    Login
    Cache
    World
    Then Hide these 7 Servers.... <---- ShellExecute
    Monitor these 7 Servers... if error occured, Restart it...
    If my program is closed, these Servers will also close....
    Able to restart the 7 servers anytime....

  8. #8
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,997

    Re: [HELP VB6] Running and Hiding Programs and much more

    I don't think you'd want to use VB6 to write any part of that. Really, you're re-inventing the wheel. You'd need to write an OS that does what you need.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  9. #9
    Join Date
    Aug 2010
    Posts
    7

    Re: [HELP VB6] Running and Hiding Programs and much more

    I think you really didn't get my point ^_^

    Here is the Video that I posted way back...
    The Program is not finished yet but it can run and hide the servers... and close it when the program is closed... it can also be restarted...

    http://www.youtube.com/watch?v=wewElgL-DEw

  10. #10
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,997

    Re: [HELP VB6] Running and Hiding Programs and much more

    Well, if you change the name of one of those programs, things could go REALLY BAD for the owner of the server... Do NOT post the code for that program.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  11. #11
    Join Date
    Aug 2010
    Posts
    7

    Re: [HELP VB6] Running and Hiding Programs and much more

    Its ok if you cant help me here... i will just find another forum to find help with my problem...

  12. #12
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    4,850

    Re: [HELP VB6] Running and Hiding Programs and much more

    It sounds kinda odd that you would need to run 7 different programs, A solution may be to use VB.Net and create them as a service assuming of course these programs do not use a GUI.
    Always use [code][/code] tags when posting code.

  13. #13
    Join Date
    Aug 2010
    Posts
    7

    Re: [HELP VB6] Running and Hiding Programs and much more

    Actually... i can run this 7 programs directly... I just want to create a program that will run these 7 3rd Party Programs and be able to hide it from the taskbar and show it again if needed/necessary...
    I already figured out how to run and hide it... but showing it again or terminating it are my problems...
    My program is just a Starter Program from those 7 programs...

    and by the way... these 7 programs are Game Servers... needed to play a certain game... running it directly leaves all 7 servers lying on taskbar leaving small space for other programs to run... making taskbar a bit crowded and/or full...

    the video i posted is my old Starter that I showed to other people... But sadly, after reformatting my PC, I lost the source code... My old post was deleted a while back... that is why I am asking this topic again...

    I have not touched VB6 for almost a year, so I mainly forgot some advance codes like Window API which mainly what powers my old Starter Program...

  14. #14
    Join Date
    Aug 2010
    Posts
    2

    Re: [HELP VB6] Running and Hiding Programs and much more

    Well, if you've managed to open and hide the applications, you can just add this in Form_Unload:

    Shell "cmd.exe /c takskill /f /im " & yourAppName

    Just call this for each application, and it will close them all.

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center