Need some VB help.
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Need some VB help.

  1. #1
    Senior Member
    Join Date
    Feb 2002
    Posts
    262

    Question Need some VB help.

    I know this is forum is for sercuirty related programing but I'm already here and I just have a lil question to ask so anyway.

    I need to make a program that will run in the back ground and will just stay there and every 5 min or so it see if a program is runing and if it is it will kill it, I have no idea how I could do this.

    I was thinking that I could just use a timer but then I relized that I would get a run time error becouse once it trys to close it and its not there it will close.

    Well any help would be aprecated.
    aislinn, Aria, BTBAM, chevelle, codeseven, Cky, dredg, evergreen terrace, from autumn to ashes,hopesfall, hxc, luti-kriss, nirvana, norma jean, shai hulud, this hero dies, tool, underoath, zao,

  2. #2
    Senior Member
    Join Date
    Oct 2001
    Posts
    385
    Sorry I can't help, but, ummm...why would you like a program like that?
    Preliminary operational tests were inconclusive (the dang thing blew up)

    \"Ask not what the kernel can do for you, ask what you can do for the kernel!\"

  3. #3
    Senior Member
    Join Date
    Feb 2002
    Posts
    262
    ok ok no its not for some kind of weird virus or something lol.....My freinds (for real) wants me to make him a program that does that, becouse his lil brother is addicted to ever quest and he can never get on the computer so he wants me make him that app and I figuered that would be the best way.
    aislinn, Aria, BTBAM, chevelle, codeseven, Cky, dredg, evergreen terrace, from autumn to ashes,hopesfall, hxc, luti-kriss, nirvana, norma jean, shai hulud, this hero dies, tool, underoath, zao,

  4. #4
    Senior Member
    Join Date
    Oct 2001
    Posts
    385
    Sounds fun...would like to see the results when you're done.

    I'd look for the proper code now, but I have a big report due in the morning and I have done nothing on it yet, sorry.
    Preliminary operational tests were inconclusive (the dang thing blew up)

    \"Ask not what the kernel can do for you, ask what you can do for the kernel!\"

  5. #5
    Junior Member
    Join Date
    Mar 2002
    Posts
    20
    I've been learning to program in C/C++ by myself for a couple of months an haven't got up to doing anything like that
    .... but i remeber i downloaded this program for a websight that ran hidden and every 5 minutes it logged off windows.. i have the guys websight and you can email him from it asking what u posted.
    hope this helps you-*** http://crayzee.host.sk/ ***

  6. #6
    Senior Member
    Join Date
    Feb 2002
    Posts
    262
    thanks, x718xpimpm, but thats not what I was really looking for his brother is not all that smart but he knows how to reinstall the game and to close all programs running (thats why I made it hidden) but anyway I have it pretty much done but I just need that section of code that will do what i was saying but I can't find it.....
    aislinn, Aria, BTBAM, chevelle, codeseven, Cky, dredg, evergreen terrace, from autumn to ashes,hopesfall, hxc, luti-kriss, nirvana, norma jean, shai hulud, this hero dies, tool, underoath, zao,

  7. #7
    Senior Member
    Join Date
    Aug 2001
    Posts
    100
    if i understand you correctly you would like to have an app which can kill a specific runnign app
    this code is noramly used for install routins to kill an app with an earlyier version, but i think if you change the code slightly it should work for you:

    this code searches for a specific window caption, gets the window handle and kills it via sendkey

    'begin code listing

    Option Explicit
    DefInt A-Z

    Declare Function Findwindow Lib "User" (ByVal Class&, ByVal Caption&)
    Declare Function GetWindow Lib "User" (ByVal hWnd, ByVal wCmd)
    Declare Function GetNextWindow Lib "User" (ByVal hWnd, ByVal wCmd)
    Declare Function GetWindowText Lib "User" (ByVal hWnd, ByVal Buf$, ByVal lBuf)
    Declare Sub ShowWindow Lib "User" (ByVal hWnd, ByVal nCmd)
    Declare Function SendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Any) As Long

    Const WM_CLOSE = &H10
    Const GW_HWNDFIRST = 0
    Const GW_HWNDNEXT = 2

    Function GetWinCaption$ (hWnd)

    Dim strCaption As String * 256
    Dim NumChars

    NumChars = GetWindowText(hWnd, strCaption, 256)
    GetWinCaption$ = Left$(strCaption, NumChars)

    End Function

    Sub Main ()

    Dim Wnd, lResult As Long, iResult

    Wnd = SearchWindow("Your application name")
    If Wnd <> 0 Then
    Result = MsgBox("Another copy of *** is running, do you want to terminate it before starting the installation?", 4, "KillApp")
    If iResult = 6 Then
    lResult = SendMessage(Wnd, WM_CLOSE, 0, 0&)
    End If

    End
    End If

    End Sub

    Function SearchWindow (ByVal strSearch$)

    Dim hWnd

    ' Find the first window's handle
    hWnd = Findwindow(0, 0)
    hWnd = GetWindow(hWnd, GW_HWNDFIRST)

    ' Set all comparison to upper case
    strSearch$ = UCase$(strSearch$)

    ' Start the loop for all windows
    Do While hWnd <> 0

    ' If the searching caption is a sub string of the current window's caption
    If InStr(UCase$(GetWinCaption(hWnd)), strSearch$) Then
    ' Return the window's handle
    SearchWindow = hWnd
    Exit Function
    End If
    ' Get the next window handle
    hWnd = GetNextWindow(hWnd, GW_HWNDNEXT)
    Loop

    End Function

    'end code listing

    now for preventing that anybody can end this prog try to disable strg-alt-entf


    hope that will help you


    ----------------------------------------------------------------------------------------------------------------------
    "Knowledge is the Real Power"

  8. #8
    No Idea, sorry

  9. #9
    Senior Member
    Join Date
    Feb 2002
    Posts
    262
    thanks meister, I think that was what I was looking for, but one question,

    Wnd = SearchWindow("Your application name") <- what should I put for the aplication name, I mean like just what apperas at the top of the program or the excutable?
    aislinn, Aria, BTBAM, chevelle, codeseven, Cky, dredg, evergreen terrace, from autumn to ashes,hopesfall, hxc, luti-kriss, nirvana, norma jean, shai hulud, this hero dies, tool, underoath, zao,

  10. #10
    Banned
    Join Date
    Sep 2001
    Posts
    69
    Get a program like a game code cheater. And run it the same time as the game. It will show all its handlers and other codes. I you have Microsoft Visual C++ then you can do the same thing with the program called spy++.

Posting Permissions

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