Пример #1
0
int Mpr::killMpr()
{
	HWND	hwnd;
	int		i;

	hwnd = FindWindow(getAppName(), getAppTitle());
	if (hwnd) {
		PostMessage(hwnd, WM_QUIT, 0, 0L);

		//
		//	Wait for up to ten seconds while winAppWeb exits
		//
		for (i = 0; hwnd && i < 100; i++) {
			mprSleep(100);
			hwnd = FindWindow(getAppName(), getAppTitle());
		}
		if (hwnd == 0) {
			return 0;
		}

	} else {
		mprError(MPR_L, MPR_USER, "Can't find %s to kill", getAppName());
	}
	return -1;
}
Пример #2
0
int Mpr::killMpr()
{
	HWND	hwnd;
	int		i;

	hwnd = FindWindow(getAppName(), getAppTitle());
	if (hwnd) {
		PostMessage(hwnd, WM_QUIT, 0, 0L);

		//
		//	Wait for up to ten seconds while winAppweb exits
		//
		for (i = 0; hwnd && i < 100; i++) {
			mprSleep(100);
			hwnd = FindWindow(getAppName(), getAppTitle());
		}
		if (hwnd = 0) {
			return 0;
		}
	}
	return -1;
}