|
-
June 5th, 2013, 02:16 AM
#3
Re: call a module from a form
 Originally Posted by HanneSThEGreaT
Well, it is a Public sub, so, by definition, you should be able to call and use it from anywhere.
If you give us a bigger picture of what you're actually trying to achieve, we could advise better.
I want to put codes in "my application" that can terminate a process/processes when the specified processes is running, I want it active all the time when "my application" is running.
but then I found this code that more simple than the above codes:
Code:
Private Sub TerminateProcess(app_exe As String)
Dim Process As Object
For Each Process In GetObject("winmgmts:").ExecQuery("Select Name from Win32_Process Where Name = '" & app_exe & "'")
Process.Terminate
Next
End Sub
and put this code in cmdStart:
Code:
TerminateProcess ("notepad.exe")
TerminateProcess ("explorer.exe")
TerminateProcess ("blablabla.exe")
my problem now is I don't know how to make cmdStart... (Feeling stupid)
Last edited by blumoon; June 5th, 2013 at 03:18 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|