How to open the Game file through VB.NET - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to open the Game file through VB.NET

MamathasriMamathasri Posts: 6Member
Hi

I have one Game project EXE file,i want to open the Game through that EXE file when i click a button. I tried one example with the code like as below.
System.Diagnostics.Process.Start("c:program filesStardockDrengin.netgalcivgalciv.exe")
It is working fine.The game is opened,but after one second it is turned back to code window.If you know please tell me, how can i maintained the code to run a game without turn to code window.

mamatha

Comments

  • Bill25Bill25 Posts: 51Member
    i think you can use this after calling the exe

    ..
    SendKeys.Flush()
    ..

  • MamathasriMamathasri Posts: 6Member
    : i think you can use this after calling the exe
    :
    : ..
    : SendKeys.Flush()
    : ..
    :
    :

    I have used following 2 ways to execute exe( This exe invokes a game)
    way 1:
    Shell(path & "galciv.exe", AppWinStyle.MaximizedFocus, True, 10000)
    SendKeys.Flush()

    way 2:
    System.Diagnostics.Process.Start(path & "galciv.exe")
    SendKeys.Flush()

    Here in both ways the game is startingbut immidiately stoping and coming to end of function in the code.

    So what could be the reason for this? and how to solve this problem?
Sign In or Register to comment.