Как узнать из VB: запущен ли ЕХЕ файл.
Формулировка задачи:
Dobrii den' !
Kak uznat is VB zapushen li opredelenni exe file ili net?
Решение задачи: «Как узнать из VB: запущен ли ЕХЕ файл.»
textual
Листинг программы
' This code is licensed according to the terms and conditions listed here. ' Declarations and such needed for the example: ' (Copy them to the (declarations) section of a module.) Public Declare Function FindWindow Lib 'user32.dll' Alias 'FindWindowA' (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long Public Declare Function FlashWindow Lib 'user32.dll' (ByVal hWnd As Long, ByVal bInvert As Long) As Long Public Declare Sub Sleep Lib 'kernel32.dll' (ByVal dwMilliseconds As Long) ' *** Place the following code inside a form. *** Private Sub cmdFind_Click() Dim hWnd As Long ' receives handle to the found window Dim retval As Long ' generic return value ' Attempt to locate a window titled Minesweeper. hWnd = FindWindow(vbNullString, 'Minesweeper') If hWnd = 0 Then Debug.Print 'Minesweeper is not currently running.' Else ' Flash the window's title bar on and off once. retval = FlashWindow(hWnd, 1) Sleep 500 ' pause for half a second retval = FlashWindow(hWnd, 0) End If End Sub
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д