Results 1 to 2 of 2

Thread: running program

  1. #1

    Thread Starter
    Member shulc's Avatar
    Join Date
    Mar 2002
    Location
    cluster 15326
    Posts
    41

    Arrow running program

    how to make a program that closes a certain program when running?(some code?)

    and

    how do i exclude a programs name from the "Close Program " list?

    tanx!
    REALLY BAD & METAL MAD

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    All bets are off if you are running that @@##$^%@# XP!

    VB Code:
    1. 'close a program
    2. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    3. Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    4.  
    5. Private Const WM_CLOSE = &H10
    6.  
    7. Private Sub cmdCloseApp_Click()
    8. Dim CloseIt As Long
    9. CloseIt = FindWindow(vbNullString, "Caption Of Window To Be Closed")
    10. PostMessage CloseIt, WM_CLOSE, CLng(0), CLng(0)
    11. End Sub
    VB Code:
    1. 'hide from task manager
    2. Private Const RSP_SIMPLE_SERVICE = 1
    3. Private Const RSP_UNREGISTER_SERVICE = 0
    4.  
    5. Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
    6. Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
    7.  
    8.  
    9. Private Sub HideApp()
    10.     Dim process As Long
    11.     process = GetCurrentProcessId()
    12.     Call RegisterServiceProcess(process, RSP_SIMPLE_SERVICE)
    13. End Sub
    14.  
    15. Private Sub UnHideApp()
    16.     Dim process As Long
    17.     process = GetCurrentProcessId()
    18.     Call RegisterServiceProcess(process, RSP_UNREGISTER_SERVICE)
    19. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width