control
-
dear friend... if i have a form in vb.net such as (A) and another application in c language such as (B) how can i control the application (B) from the buttons based on form (A) and i mean of control : 1-run application B 2-minimize and mazimize form B 3-close form B 4- the most thing is make the form A always active that mean you cant use the appliation B except throught the form (A) thanx all kilany kilany kilany
-
dear friend... if i have a form in vb.net such as (A) and another application in c language such as (B) how can i control the application (B) from the buttons based on form (A) and i mean of control : 1-run application B 2-minimize and mazimize form B 3-close form B 4- the most thing is make the form A always active that mean you cant use the appliation B except throught the form (A) thanx all kilany kilany kilany
First, you can NOT make another application a modal child of your own. Once launched, there is nothing you can do to reliably stop a user from switching over to the other application and using it without your interface. It's very easy to launch the other app (point 1 in your post). Point 2 is also pretty easy. All you need to do is get the Window handle of the launched app and call the Win32 function ShowWindow with the appropriate parameters. Point 3 is a bit more complicated, despite it's seeming ease. You can easily tell the application to exit, but if it wants to show some window that wants comfirmation of exit or saving changes, then you've got a problem. You have to find those windows, if they exist, then send the appropriate commands to those windows. Point 4 - Not practically possible. There is nothing you can do to prevent the user from skipping your app, or shutting it down, and just using the app your trying to control. Point 5 (you didn't put this) - How do you intend to control the other application?? The only way to do it is not reliable and is far more complex than the benefits your going to get from implementing it. Dave Kreskowiak Microsoft MVP - Visual Basic