I'm not trying to tell anyone how to do anything, I'm just trying to
communicate what I want to accomplish in a way that programmers will
easily
understand. I guess not so successfully, sorry for the confusion.
I try to be as succinct as I can be because in the past if an answer leads
to a further clarifying question the thread (in my experience anyway) is
ignored.
In any case thanks for you interest to date and any subsequent help.
I want to run in Kiosk mode and for my main form this is working well,
thanks to the sample from Sergey.
What I want to do is run mstse40.exe (Terminal Services Client) and stay
in
Kiosk mode for a seamless passover from my app to the terminal services
app.
i.e. so that the user simply clicks a single button and waits for the app
running on ts to present itself.
I'm running the following from my main Kiosk form:
private void startMStsc()
{
ProcessStartInfo startInfo;
bool processSwitch;
ProcessEntry[] pe;
lblStatus.Visible = true;
txtStatus.Visible = true;
//--------------------------------------------------
// Kill off Terminal Server Client if it is running
//--------------------------------------------------
pe = ProcessEntry.GetProcesses();
foreach (ProcessEntry x in pe)
{
if (x.ExeFile == "mstsc40.exe")
{
x.Kill();
}
}
processSwitch = true;
startInfo = new ProcessStartInfo();
startInfo.UseShellExecute = processSwitch;
startInfo.FileName = "\\windows\\mstsc40.exe";
startInfo.Arguments = "";
setRadioOn();
// wait for connection
txtStatus.Text = "Waiting for Network";
//+++++++++++++++++++++++++++++++++++++
// connection code goes here
//+++++++++++++++++++++++++++++++++++++
txtStatus.Text = "Connected";
Process.Start(startInfo);
Thread.Sleep(5000); // give tsc some time to load
f = getForm("Terminal Services Client");
//+++++++++++++++++++++++++++++++++++++
// put term service form into kiosk mode
// Note: will have to do this for the ts connection form
// and the ts connected form
//+++++++++++++++++++++++++++++++++++++
}
Again thanks for any help.
Paul G. Tobey said:
Well, just that's not so easy. You are running in a second application
and
you want to get a reference to form (assuming that this window is in a
managed forms-based application)? You should not be able to do that.
Tell us *what* you want to do, not *how* you're trying to do it...
Paul T.
C# is new to me and I don't know how to get a reference to a Form when
all
I
have is a handle to a Window.
i.e.
hwnd = GetWindow(hwnd, GW_HWNDNEXT);
Form f = ???????????(hwnd);
thanks for any help.