PDA

View Full Version : Terminate Biotouch apps in vb.net - anyone know the window names?


carlosp_uk
03-12-2007, 07:15 PM
Hi there

I've been upgrading 'Touch Settings' recently to be compatible with the new HTC devices (Vogue, Touch Dual, etc.) and it's now reached the point where I really need to automatically terminate some running processes at the beginning of the app. Specifically, I need to close:

mediahubmini.exe
APlauncher.exe
QuickDial.exe

In VB.NET, I'm using a DLLImport to find the window handle and then SendMessage WM_CLOSE to close the app, but it doesn't seem to work!

Does anybody know the specific window names, or have any code examples of how to shut down these processes from within vb.net ? (a c# example is also fine)

Yours hopefully


Carlos

PS: Touch Settings is very nearly at the point now where it will automatically re-generate all the necessary cube animation (BRN) files with user-selected icons. watch this space!

CmdKewin
03-12-2007, 07:23 PM
Sure those are processes? I mean, if they are registered as services, sending WM_CLOSE won't help. You'll have to stop it.

I have never dealed with WinMobile services, but you could try with the following.

System.ServiceProcess.ServiceController sc2 = new System.ServiceProcess.ServiceController("ServiceName", "MACHINE_NAME");

if (sc2.Status.Equals(System.ServiceProcess.ServiceCo ntrollerStatus.Running))
{
sc2.Stop();
}

(Shouldn't be "that" much different...)

carlosp_uk
03-12-2007, 07:52 PM
Sure those are processes? I mean, if they are registered as services, sending WM_CLOSE won't help. You'll have to stop it.


Yeah, you're right, sorry, of course, they are processes. They appear as running processes in MemMaid, at any rate. Thanks for that tip, appreciated.

I'll look to see if your code translates into the compact framework. Anyone else got any example .net code?

JasonStern
03-12-2007, 10:44 PM
Carlos,

If you are using the .net compact framework 2.0 or later, it provides built in support for closing and killing processes.

Take a look at http://msdn2.microsoft.com/en-us/library/system.diagnostics.process.closemainwindow.aspx and http://msdn2.microsoft.com/en-us/library/system.diagnostics.process.kill.aspx