Results 1 to 11 of 11

Thread: detect file

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Posts
    86

    detect file

    i need to detect of an onother appcliaction is open or closed

    is there a way to know this

    if yes please help me

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    you could find its window to see if it is present. do you know the program that you want to find? you may be able to just open the .exe. if it works, then it's not locked (in use)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Posts
    86
    yes i tought the same thing but

    won't this be anoying for the user ???
    can they see that the prgram opens or won't they zee anything???

    and how do you close another apllication???


    i know witch program i need to detect and i want to create some sort of online status so it wil be executed with a timer

  4. #4
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    What about the FindWindow API?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Posts
    86
    k please explain to me how to use it because i'm not very good with using dll files

    if i just can detect of the file CoDMP.exe is open or not then i have evrything i need

    this file contains a game

  6. #6
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    VB Code:
    1. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    2.  
    3. Dim Ret as String
    4. Dim WinWnd as long
    5. Ret = InputBox("Enter the exact window title:" + Chr$(13) + Chr$(10) + "Note: must be an exact match")
    6.     'Search the window
    7.     WinWnd = FindWindow(vbNullString, Ret)
    8.     If WinWnd = 0 Then MsgBox "Couldn't find the window ..."

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Posts
    86
    k thanx

    this works

    but wath about programs that are active but has no open windows icon in taskbar

  8. #8
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    I'm guessing now but this might help
    Create a new project and add a multiline textbox with a scrollbar.
    VB Code:
    1. 'Add this code to a form
    2. Private Sub Form_Load()
    3.     'KPD-Team 2000
    4.     'URL: [url]http://www.allapi.net/[/url]
    5.     'E-Mail: [email][email protected][/email]
    6.     'Set the form's graphics mode to persistent
    7.     Me.AutoRedraw = True
    8.     'call the Enumwindows-function
    9.     EnumWindows AddressOf EnumWindowsProc, ByVal 0&
    10. End Sub
    11.  
    12. Option Explicit
    13.  
    14. 'Add this code to a module
    15. Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Boolean
    16. Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
    17. Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
    18.  
    19. Public Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Boolean
    20.     Dim sSave As String, Ret As Long
    21.     Ret = GetWindowTextLength(hwnd)
    22.     sSave = Space(Ret)
    23.     GetWindowText hwnd, sSave, Ret + 1
    24.     Form1.Text1.Text = Form1.Text1.Text & Str$(hwnd) + " " + sSave & vbCrLf
    25.     'continue enumeration
    26.     EnumWindowsProc = True
    27. End Function

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Posts
    86
    it say's invalid use of AddressOf

  10. #10
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    Did you put the first part in the forms code and the second part(from option explicit down) in a module?

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Posts
    86
    ok
    no errors now i did not put the finction in a module only the diclaire functions

    now it works but i see this

    Text1 1181150
    1115694
    65664
    394544
    526200
    459816
    524428
    460450
    394904 SysFader
    12059132
    65672
    591778
    65650
    65648
    65646
    65668 CiceroUIWndFrame
    196678
    131158
    131298
    460072
    329402
    197998
    132472 Emoticon popup
    525572
    65684
    66682
    132202
    66060
    65734 Logitech_HiddenMessageWnd_E1000FE7-BFF5-4746-9792-218C4CE4851D
    65726 Logitech Camera Control
    65722
    65716 CiceroUIWndFrame
    65712 TF_FloatingLangBar_WndTitle
    65710
    131154 ALSMTray
    65574 NetDDE Agent
    66578
    262660 Volgende
    788056 Start
    1770978 Code Window (Break)
    3540502 Form1
    1377876
    1640078
    1377752
    1902214
    1705568
    1705570
    2885112
    198124
    263540 Project1 - Microsoft Visual Basic [run]
    263578 Project1 - Microsoft Visual Basic [run]
    197988
    3409510
    394688
    591294
    329154
    853520 VBForums.com - detect file - Microsoft Internet Explorer
    2426406 MCI command handling window
    1181178
    722514
    1902116
    1246774
    3016180
    4851346
    1312214
    3933836 DDE Server Window
    197982
    263536
    263550 Project1
    460204
    984164
    525614
    525606
    263598
    263604
    329164
    394648 DDE Server Window
    919058 Acrobat IEHelper
    1508832
    460448
    853622
    853516
    394572
    16516352
    132298 Contextmenu
    1377342 Contextmenu
    1901610 Contextmenu
    132236 Postvak IN - Microsoft Outlook
    4326722 #ULTD|Waninio - Chat-Venster
    1443126
    3277068 Xfire - #ULTD|Black Waltz
    131294 Xfire
    656674
    459808
    460578
    526122
    329556
    329548
    329624
    329526
    329532
    329542
    4130412 MSN Messenger
    263960
    66004
    2426516
    66770 Voortgang van verzenden/ontvangen in Outlook
    197906
    197908
    197914
    197912
    197910 ActiveMovie Window
    197916 ActiveMovie Window
    197918 MSP PNP Notification Window
    197938 CRTCClient
    197838 MCI command handling window
    66810 DDE Server Window
    66806
    66802 Microsoft Word
    66788
    66768
    66760
    66748
    66712 DDE Server Window
    263294 WMS ST Notif Window 00000CF8 00000CFC
    132228 WMS Idle
    459896 W
    263278
    459868 Microsoft Outlook
    66688 MSNUnnamedWindow
    132200 Dummy Video Parent
    66676 MCI command handling window
    66522 ColorNick - QuickNicks
    66548 Updates
    66570 Gebeurtenissenlogboek - Huidige Activiteit
    66576
    66644 EchoPortManagerWnd
    66648
    66658 MSNUnnamedWindow
    66516
    66332 ColorNick - Voorkeuren
    66326 ColorNick - Help
    66316 Over...
    66078
    66074 ColorNick
    66070
    66068
    66058
    66056
    131534 MSNMSGRPassportLogin
    66040
    66042
    66018 hp psc 1200 series - Status
    66012
    65896
    65894
    65892 MCI command handling window
    66050
    66046 MSBLNetConn
    66016 MSNUnnamedWindow
    66014
    197064 DDE Server Window
    262328 MessengerPlusWnd_Manager
    66010
    131278
    262380
    66002
    131536
    65994 MCI command handling window
    131446 MCI command handling window
    65914 Kaspersky Anti-Virus Personal
    131306 Connections Tray
    4915466 Energiemeter
    196886 MS_WebcheckMonitor
    65882
    65868
    65854
    65796
    65792
    131326
    131322
    65788
    65782
    65776
    131290
    65740 MPWnd_Hooker
    65760 DIEmWin
    65750
    65748 AiODeeDeeNotificationWindow
    65744
    65736 _IS_Low_Light
    65724
    65700 LogiTray
    65708
    65694 LVComSWnd
    196712 ATI Tray Icon Application
    131152 iTouchWin
    65654
    131162
    196710
    196708
    196706 ATI video bios poller client
    65578 ATI video bios poller
    65706
    131584 Task Status
    263262 GDI+ Window
    66804 GDI+ Window
    262604
    984656 GDI+ Window
    65686
    1508894 SysFader
    65674 Program Manager


    what about the numbers ????
    what do they mean

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