John Owen Guest
|
Posted: Tue Apr 19, 2005 9:49 am Post subject: intercepting an program's dialog box |
|
|
Hi,
I've just changed ISP and no longer enjoy a static IP address. I've written
a small Delphi app which monitors my IP address and which can launch
Microsoft Media Encoder and close it, if required.
I get the Handle to the Encoder with something like:
var ProgShell: THandle;
ProgShell:= ExecutedFileHandle(Handle, ProgName, cmdLine, '',
SW_SHOWNORMAL);
where ExecutedFilehandle returns the Windows handle to 'ProgName' (ie Media
Encoder in this case).
The theory was that, if my IP address changed, the app would close the
Encoder and relaunch it so that it, too, could detect the new IP address and
start broadcasting on it.
Although my app can launch and auto-start the encoder via its command line
and shut it down again, I can't find a way to prevent the Encoder
dialogue "Are you sure you want to stop encoding?" popping up when my app
tries to close it. Naturally, that stops my app "re-booting" the Encoder
without 'human' intervention.
Any thoughts or suggestions would be appreciated,
Thanks,
John.
|
|