ShowMessage(buf, FALSE);
HRESULT CheckInstances(){  char  section[MAX_BUF];  char  processName[MAX_BUF];  char  className[MAX_BUF];  char  windowName[MAX_BUF];  char  closeAllWindows[MAX_BUF];  char  message[MAX_BUF];  char  msgTitleStr[MAX_BUF];  char  prettyName[MAX_BUF];  char  buf[MAX_BUF];  char  msgWait[MAX_BUF];  int   index;  int   killProcessTries = 0;  int   instanceOfFoundProcess = 0;  BOOL  bContinue;  BOOL  bCloseAllWindows;  HWND  hwndFW;  LPSTR szWN;  LPSTR szCN;  DWORD dwRv0;  DWORD dwRv1;  GetPrivateProfileString("Messages", "MB_ATTENTION_STR", "", msgTitleStr, sizeof(msgTitleStr), szFileIniInstall);  bContinue = TRUE;  index    = -1;  while(bContinue)  {    *className  = '\0';    *windowName = '\0';    *message    = '\0';    wsprintf(section, "Check Instance%d", ++index);    GetPrivateProfileString(section, "Process Name", "", processName, sizeof(processName), szFileIniConfig);    GetPrivateProfileString(section, "Pretty Name", "", prettyName, sizeof(prettyName), szFileIniConfig);    GetPrivateProfileString(section, "Message Wait", "", msgWait, sizeof(msgWait), szFileIniConfig);    GetPrivateProfileString(section, "Close All Process Windows", "", closeAllWindows, sizeof(closeAllWindows), szFileIniConfig);    if(lstrcmpi(closeAllWindows, "TRUE") == 0)      bCloseAllWindows = TRUE;    else      bCloseAllWindows = FALSE;    if(instanceOfFoundProcess != index)    {      killProcessTries = 0;      instanceOfFoundProcess = index;    }    if((killProcessTries == 1) && (*processName != '\0'))    {      if(FindAndKillProcess(processName, KP_DO_NOT_KILL_PROCESS))      {        /* found process, display warning message, then kill process */        GetPrivateProfileString("Messages", "MSG_FORCE_QUIT_PROCESS", "", message, sizeof(message), szFileIniInstall);        if(*message != '\0')        {          wsprintf(buf, message, prettyName, processName, prettyName, prettyName);          ShowMessageAndQuitProcess(NULL, buf, msgWait, bCloseAllWindows, processName, CI_FORCE_QUIT_PROCESS);          ++killProcessTries;          instanceOfFoundProcess = index--;        }      }      continue;    }    else if(killProcessTries == MAX_KILL_PROCESS_RETRIES)    {      GetPrivateProfileString("Messages", "MSG_FORCE_QUIT_PROCESS_FAILED", "", message, sizeof(message), szFileIniInstall);      if(*message != '\0')      {        wsprintf(buf, message, prettyName, processName, prettyName);        switch(sgProduct.mode)        {          case NORMAL:            MessageBox(hWndMain, buf, msgTitleStr, MB_ICONEXCLAMATION | MB_SETFOREGROUND);            break;          case AUTO:            /* Setup mode is AUTO.  Show message, timeout, then auto close             * all the windows associated with the process */            ShowMessage(buf, TRUE);            Delay(5);            ShowMessage(buf, FALSE);            break;          default:            break;        }      }      /* can't kill the process for some unknown reason.  Stop the installation. */      return(TRUE);    }    else if((killProcessTries > 1) &&            (killProcessTries < MAX_KILL_PROCESS_RETRIES) &&            (*processName != '\0'))    {      if(FindAndKillProcess(processName, KP_KILL_PROCESS))      {        ++killProcessTries;        instanceOfFoundProcess = index--;      }      continue;    }    dwRv0 = GetPrivateProfileString(section, "Class Name",  "", className,  sizeof(className), szFileIniConfig);    dwRv1 = GetPrivateProfileString(section, "Window Name", "", windowName, sizeof(windowName), szFileIniConfig);    if((dwRv0 == 0L) && (dwRv1 == 0L) && (*processName == '\0'))    {      bContinue = FALSE;    }    else if((*className != '\0') || (*windowName != '\0'))    {      if(*className == '\0')        szCN = NULL;      else        szCN = className;      if(*windowName == '\0')        szWN = NULL;      else        szWN = windowName;      /* If an instance is found, call PreCheckInstance first.       * PreCheckInstance will try to disable the browser's       * QuickLaunch feature. If the browser was in QuickLaunch       * mode without any windows open, PreCheckInstance would       * shutdown the browser, thus a second call to FindAndKillProcess       * is required to see if the process is still around. */      if((hwndFW = FindWindow(szCN, szWN)) != NULL)        PreCheckInstance(section, szFileIniConfig);      if((hwndFW = FindWindow(szCN, szWN)) != NULL)      {        GetCheckInstanceQuitMessage(section, message, sizeof(message));        if(*message != '\0')        {          ShowMessageAndQuitProcess(hwndFW, message, msgWait, bCloseAllWindows, processName, CI_CLOSE_PROCESS);          ++killProcessTries;          instanceOfFoundProcess = index--;        }        else        {          /* No message to display.  Assume cancel because we can't allow user to continue */          return(TRUE);        }      }    }    if((killProcessTries == 0) && (*processName != '\0'))    {      /* The first attempt used FindWindow(), but sometimes the browser can be       * in a state where there's no window open and still not fully shutdown.       * In this case, we need to check for the process itself and kill it. */      if(FindAndKillProcess(processName, KP_DO_NOT_KILL_PROCESS))      {        GetCheckInstanceQuitMessage(section, message, sizeof(message));        if(*message != '\0')        {          ShowMessageAndQuitProcess(hwndFW, message, msgWait, bCloseAllWindows, processName, CI_FORCE_QUIT_PROCESS);          ++killProcessTries;          instanceOfFoundProcess = index--;        }        else        {          /* No message to display.  Assume cancel because we can't allow user to continue */          return(TRUE);        }      }    }  }  return(FALSE);}