Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Kill a running application with no PID
Message
De
03/03/2009 16:26:36
John White
Micro-Oriented Software Techniques, Inc.
Phoenix, Arizona, États-Unis
 
 
À
03/03/2009 11:49:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows NT
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01385203
Message ID:
01385331
Vues:
70
>Hugo,
>
>That's the trick I needed. I worked great. As far as I know, this is the only 16-bit app on the workstations but I will do some more testing. Likewise, I just found this reference that seems to imply you can kill individual applications using a DLL named VDMDBG.dll.
>
>http://msdn.microsoft.com/en-us/library/aa287954(VS.71).aspx
>
>Thanks for everyone's help ... this will allow me to continue to develop the "kludge" of a solution that I'm working on.
>
>Robert
>
>
>>You could kill Ntvdm.exe if you are absolutely sure there is only one instance of it and it is running your db application, ie, you are not running any other 16 bits applicattion.
>
>>Robert


Maybe you could try something like the following. I have seen non-printable (and non-displayable) characters that LOOK like a space all too often. You could modify that function above with this to strip out "unknown" characters. All that's left of the process name is A-Z, 0-9 and a couple normal punctuation marks.
lcMyProcess = "WOWEXEC.EXE"
loProcesses = loWMI.ExecQuery([SELECT * FROM Win32_Process])
llIsRunning = .F.
IF loProcesses.Count > 0
    FOR EACH loProcess in loProcesses
        lcProcessName = upper(loProcess.Name)
        lcProcessName = chrtran(chrtran(lcProcessName,'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._-&',''),'')
        IF lcProcessName == lcMyProcess and llTerminate
            llIsRunning = .T.
            loProcess.Terminate(0)
        ENDIF
    ENDFOR
ENDIF
Hope this works or helps spark an idea.
John White [MOST]
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform