Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
process.h File Reference
#include "windows.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


#define WM_CLOSE_TIMEOUT_VALUE   10000 /* 3 secs */


BOOL FindAndKillProcess (LPSTR aProcessName, BOOL aKillProcess)
BOOL CloseAllWindowsOfWindowHandle (HWND hwndWindow, char *aMsgWait)

Define Documentation

Definition at line 47 of file process.h.

Definition at line 46 of file process.h.

#define WM_CLOSE_TIMEOUT_VALUE   10000 /* 3 secs */

Definition at line 43 of file process.h.

Function Documentation

BOOL CloseAllWindowsOfWindowHandle ( HWND  hwndWindow,
char *  aMsgWait 

Definition at line 215 of file process.c.

  CAWOWH closeWindowInfo;
  BOOL  rv = TRUE;

  if(*aMsgWait != '\0')
    ShowMessage(aMsgWait, TRUE);

  GetWindowThreadProcessId(aHwndWindow, &closeWindowInfo.processID);

  /* only close the visible windows */
  closeWindowInfo.cwState = CW_CLOSE_VISIBLE_ONLY;
  EnumWindows(EnumWindowsProc, (LPARAM)&closeWindowInfo);

  /* only check to make sure that the visible windows were closed */
  closeWindowInfo.cwState = CW_CHECK_VISIBLE_ONLY;
  rv = EnumWindows(EnumWindowsProc, (LPARAM)&closeWindowInfo);
    /* All visible windows have been closed.  Close all remaining windows now */
    closeWindowInfo.cwState = CW_CLOSE_ALL;
    EnumWindows(EnumWindowsProc, (LPARAM)&closeWindowInfo);
  if(*aMsgWait != '\0')
    ShowMessage(aMsgWait, FALSE);


Here is the call graph for this function:

Here is the caller graph for this function:

BOOL FindAndKillProcess ( LPSTR  aProcessName,
BOOL  aKillProcess 

Definition at line 106 of file process.c.

  HANDLE hKernel       = NULL;
  BOOL   bDoWin95Check = TRUE;
  kpf    kpfRoutines;

  if((hKernel = GetModuleHandle("kernel32.dll")) == NULL)

  kpfRoutines.pCreateToolhelp32Snapshot = (NS_CreateSnapshot)GetProcAddress(hKernel, "CreateToolhelp32Snapshot");
  kpfRoutines.pProcessWalkFirst         = (NS_ProcessWalk)GetProcAddress(hKernel,    "Process32First");
  kpfRoutines.pProcessWalkNext          = (NS_ProcessWalk)GetProcAddress(hKernel,    "Process32Next");

  if(kpfRoutines.pCreateToolhelp32Snapshot && kpfRoutines.pProcessWalkFirst && kpfRoutines.pProcessWalkNext)
    return(_FindAndKillProcess(&kpfRoutines, aProcessName, aKillProcess));
    return(_FindAndKillProcessNT4(aProcessName, aKillProcess));

Here is the call graph for this function:

Here is the caller graph for this function: