Post Reply

Forums -> UltraMon™ SDK -> Close application
Arjan van Someren   2008-11-09 19:44
Hi,

I can lanch an application to a chosen monitor but I wan't also close it from whithin my application. I use following code ( c# )
Does someone have ideas?

ULTRAMONLib.UltraMonUtilityClass util = new ULTRAMONLib.UltraMonUtilityClass();
string cmd = @"%WINDIR%\Notepad.exe";
if (util.Run(cmd, ULTRAMONLib.SHOWSTATE.SHOWSTATE_NORMAL, false, ""))
{
procID = util.ProcessId;

wnd = new ULTRAMONLib.UltraMonWindowClass();
wnd.Monitor = 2;
if (wnd.GetAppMainWindow(util.ProcessId, 2000))
{
wnd.SHOWSTATE = (int)ULTRAMONLib.SHOWSTATE.SHOWSTATE_NORMAL;
wnd.ApplyChanges((int)ULTRAMONLib.WNDCHANGE.WNDCHANGE_CLIP_TO_WORKSPACE);
}
}

Arjan van Someren
Christian Studer   2008-11-10 10:40
You can't do this via UltraMon, but you could use the PostMessage API function to send the application a WM_CLOSE message.

Christian Studer - www.realtimesoft.com
Forums -> UltraMon™ SDK -> Close application

Post Reply