Private Declare Function ResumeThread Lib "kernel32.dll" (ByVal hThread As Long) As Long Private Declare Function SuspendThread Lib "kernel32.dll" (ByVal hThread As Long) As Long Private Declare Function OpenThread Lib "kernel32.dll" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwThreadId As Long) As Long Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long Private Const SUSPEND_RESUME = &H2 'This could be my problem. 'Same as GetWindowThreadProcessId (DUR) Public Declare Function GetThreadID Lib "user32" Alias "GetWindowThreadProcessId" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
hwnd = FindWindow("GFC_StdWindowClass", vbNullString)
If hwnd > 0 Then
PID = GetWindowThreadProcessId(hwnd, lngPID)
hProcess = OpenThread(SUSPEND_RESUME, False, PID)
If hProcess <> 0 Then
Call SuspendThread(PID)
