Ejemplo n.º 1
0
static INT_PTR CALLBACK PopupDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg) {
	case UM_POPUPACTION:
		if (HIWORD(wParam) == BN_CLICKED) {
			LPMSGPOPUPDATA pmpd = (LPMSGPOPUPDATA)PUGetPluginData(hDlg);
			if (pmpd) {
				switch (LOWORD(wParam)) {
				case IDYES:
					if (IsWindow(pmpd->hDialog))
						EndDialog(pmpd->hDialog, LOWORD(wParam));
					PUDeletePopup(hDlg);
					break;

				case IDNO:
					if (IsWindow(pmpd->hDialog))
						EndDialog(pmpd->hDialog, LOWORD(wParam));
					PUDeletePopup(hDlg);
					break;
				}
			}
		}
		break;

	case UM_FREEPLUGINDATA:
		LPMSGPOPUPDATA pmpd = (LPMSGPOPUPDATA)PUGetPluginData(hDlg);
		if (pmpd > 0)
			mir_free(pmpd);
		return TRUE; //TRUE or FALSE is the same, it gets ignored.
	}
	return DefWindowProc(hDlg, uMsg, wParam, lParam);
}
Ejemplo n.º 2
0
LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch (msg) {
	case WM_CONTEXTMENU:
		PUDeletePopup(hWnd);
		break;

	case WM_COMMAND:
		switch ((INT_PTR)PUGetPluginData(hWnd)) {
		case 0:
			OpenAuthUrl("http://vi.miranda-ng.org/detail/%s");
			break;

		case 1:
			OpenAuthUrl("http://vi.miranda-ng.org/global/%s");
			break;

		case 3:
			TCHAR path[MAX_PATH];
			mir_sntprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
			ShellExecute(NULL, TEXT("open"), path, NULL, NULL, SW_SHOW);
			break;

		}
		PUDeletePopup(hWnd);
		break;

	case UM_FREEPLUGINDATA:
		IcoLib_ReleaseIcon((HICON)SendMessage(hWnd, WM_SETICON, ICON_BIG, 0));
		IcoLib_ReleaseIcon((HICON)SendMessage(hWnd, WM_SETICON, ICON_SMALL, 0));
		break;
	}

	return DefWindowProc(hWnd, msg, wParam, lParam);
}
Ejemplo n.º 3
0
static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message) {
	case WM_COMMAND:
		if (HIWORD(wParam) == STN_CLICKED) {
			SESSION_INFO *si = (SESSION_INFO*)PUGetPluginData(hWnd);
			CallFunctionAsync(ShowRoomFromPopup, si);

			PUDeletePopup(hWnd);
			return TRUE;
		}
		break;
	case WM_CONTEXTMENU:
		SESSION_INFO *si = (SESSION_INFO*)PUGetPluginData(hWnd);
		if (si->hContact)
			if (CallService(MS_CLIST_GETEVENT, (WPARAM)si->hContact, 0))
				CallService(MS_CLIST_REMOVEEVENT, (WPARAM)si->hContact, (LPARAM)GC_FAKE_EVENT);

		if (si->hWnd && KillTimer(si->hWnd, TIMERID_FLASHWND))
			FlashWindow(si->hWnd, FALSE);

		PUDeletePopup(hWnd);
		break;
	}
	return DefWindowProc(hWnd, message, wParam, lParam);
}
Ejemplo n.º 4
0
LRESULT CALLBACK MissYouPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message) {
	case WM_COMMAND:
		if (HIWORD(wParam) == STN_CLICKED) {
			CallServiceSync("BuddyExpectator/actionMissYou", (WPARAM)PUGetContact(hWnd), 0);
			if (!db_get_b(PUGetContact(hWnd), MODULENAME, "MissYouNotifyAlways", 0)) {
				db_set_b(PUGetContact(hWnd), MODULENAME, "MissYou", 0);
				ExtraIcon_Clear(hExtraIcon, PUGetContact(hWnd));
			}
			PUDeletePopup(hWnd);
		}
		break;

	case WM_CONTEXTMENU:
		PUDeletePopup(hWnd);
		break;

	case UM_POPUPACTION:
		if (wParam == 1) {
			db_set_b(PUGetContact(hWnd), MODULENAME, "MissYou", 0);
			ExtraIcon_Clear(hExtraIcon, PUGetContact(hWnd));
			PUDeletePopup(hWnd);
		}
		break;

	case UM_FREEPLUGINDATA:
		return TRUE;
	}
	return DefWindowProc(hWnd, message, wParam, lParam);
}
Ejemplo n.º 5
0
static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message) {
	case WM_COMMAND:
		if (HIWORD(wParam) == STN_CLICKED) {
			CallService(MS_MSG_SENDMESSAGET, (WPARAM)PUGetContact(hWnd), 0);
			PUDeletePopup(hWnd);
			return 1;
		}
		break;

	case WM_CONTEXTMENU:
		PUDeletePopup(hWnd);
		return 1;

	case UM_INITPOPUP:
		WindowList_Add(hPopupsList, hWnd, PUGetContact(hWnd));
		return 1;

	case UM_FREEPLUGINDATA:
		WindowList_Remove(hPopupsList, hWnd);
		return 1;
	}
	return DefWindowProc(hWnd, message, wParam, lParam);
}
Ejemplo n.º 6
0
// Handle to popup events
static LRESULT CALLBACK DumbPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message) {
		case WM_COMMAND:
		{
			PUDeletePopup(hWnd);
			return TRUE;
		}

		case WM_CONTEXTMENU:
		{
			PUDeletePopup(hWnd);
			return TRUE;
		}

		case UM_FREEPLUGINDATA:
		{
			PopupDataType* popup = (PopupDataType*)PUGetPluginData(hWnd);
			if ((INT_PTR)popup != CALLSERVICE_NOTFOUND)
			{
				DestroyIcon(popup->hIcon);
				mir_free(popup);
			}
			return FALSE; //the return value is ignored
		}
	}

	return DefWindowProc(hWnd, message, wParam, lParam);
}
Ejemplo n.º 7
0
// popup dialog pocess
// for selecting actions when click on the popup window
// use for displaying contact menu
LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) 
{
	DWORD ID = 0;
	MCONTACT hContact;
	hContact = PUGetContact(hWnd);

	switch(message) {
	case WM_COMMAND:
		ID = opt.LeftClickAction;
		if (ID != IDM_M7)  PUDeletePopup(hWnd);
		SendMessage(hPopupWindow, ID, hContact, 0);
		return TRUE;

	case WM_CONTEXTMENU:
		ID = opt.RightClickAction;
		if (ID != IDM_M7)  PUDeletePopup(hWnd);
		SendMessage(hPopupWindow, ID, hContact, 0);
		return TRUE;

	case UM_FREEPLUGINDATA:
		Skin_ReleaseIcon((HICON)PUGetPluginData(hWnd));
		return FALSE;
	}

	return DefWindowProc(hWnd, message, wParam, lParam);
}
Ejemplo n.º 8
0
//popup reactions
static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message) {
	case WM_COMMAND:
		if (HIWORD(wParam) == STN_CLICKED)//client clicked on popup with left mouse button
		{
			struct CONNECTION *conn = (struct CONNECTION*)mir_alloc(sizeof(struct CONNECTION));
			struct CONNECTION *mpd=(struct CONNECTION*) PUGetPluginData(hWnd);

			memcpy(conn,mpd,sizeof(struct CONNECTION));
			PUDeletePopup(hWnd);
			PostThreadMessage(FilterOptionsThreadId,WM_ADD_FILTER,(WPARAM)0, (LPARAM)conn);
		}
		break;

	case WM_RBUTTONUP:
		PUDeletePopup(hWnd);
		break;

	case UM_INITPOPUP:
		//struct CONNECTON *conn=NULL;
		//conn = (struct CONNECTION*)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd,(LPARAM)conn);
		//MessageBox(NULL,conn->extIp);
		//PUDeletePopUp(hWnd);
		break;

	case UM_FREEPLUGINDATA: 
		struct CONNECTION *mpd = (struct CONNECTION*)PUGetPluginData(hWnd);
		if (mpd > 0) mir_free(mpd);
		return TRUE; //TRUE or FALSE is the same, it gets ignored.
	}
	return DefWindowProc(hWnd, message, wParam, lParam);
}
Ejemplo n.º 9
0
LRESULT CALLBACK PopupWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch (msg)
    {
    case WM_COMMAND:
    {
        PopupData* puData = (PopupData*)PUGetPluginData(hWnd);
        if (puData != NULL)
        {
            if (puData->flags & GG_POPUP_MULTILOGON)
                puData->gg->sessions_view(0, 0);
        }
        PUDeletePopup(hWnd);
        break;
    }

    case WM_CONTEXTMENU:
        PUDeletePopup(hWnd);
        break;

    case UM_FREEPLUGINDATA:
    {
        PopupData* puData = (PopupData*)PUGetPluginData(hWnd);
        if (puData != NULL && puData != (PopupData*)CALLSERVICE_NOTFOUND)
        {
            mir_free(puData->title);
            mir_free(puData->text);
            mir_free(puData);
        }
        break;
    }
    }

    return DefWindowProc(hWnd, msg, wParam, lParam);
}
Ejemplo n.º 10
0
LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch(message)
    {
    case WM_COMMAND:
    {
        // After a click, destroy popup
        PUDeletePopup(hwnd);
    }
    break;

    case WM_CONTEXTMENU:
        PUDeletePopup(hwnd);
        break;

    case UM_FREEPLUGINDATA:
    {
        // After close, free
        TCHAR* url = (TCHAR*)PUGetPluginData(hwnd);
        if (url != NULL)
            mir_free(url);
    }
    return FALSE;

    default:
        break;
    }

    return DefWindowProc(hwnd, message, wParam, lParam);
};
Ejemplo n.º 11
0
LRESULT CALLBACK PopupWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message) 
	{
	case WM_COMMAND:
		if (HIWORD(wParam) == STN_CLICKED)
		{
			CAimPopupData* p = (CAimPopupData*)PUGetPluginData(hWnd);
			if (p->url != NULL)
				ShellExecuteA(NULL, "open", p->url, NULL, NULL, SW_SHOW);

			PUDeletePopup(hWnd);
			return 0;
		}
		break;

	case WM_CONTEXTMENU:
		PUDeletePopup(hWnd);
		break;

	case UM_FREEPLUGINDATA:
		CAimPopupData* p = (CAimPopupData*)PUGetPluginData(hWnd);
		ReleaseIconEx("aim");
		delete p;
		break;
	}
	return DefWindowProc(hWnd, message, wParam, lParam);
}
Ejemplo n.º 12
0
int CALLBACK CKLPopupDlgProc(HWND hWnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
{
    LPTSTR ptszPopupText = (LPTSTR)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd, (LPARAM)&ptszPopupText);

    switch (uiMessage) {
    case WM_COMMAND:
        if (HIWORD(wParam) == STN_CLICKED) {
            if (!IsBadStringPtr(ptszPopupText, MaxTextSize))
                CopyTextToClipboard(ptszPopupText);
            PUDeletePopup(hWnd);
        }
        break;

    case WM_CONTEXTMENU:
        PUDeletePopup(hWnd);
        break;

    case UM_POPUPACTION:
        if ((lParam == 0) && (!IsBadStringPtr(ptszPopupText, MaxTextSize)))
            CopyTextToClipboard(ptszPopupText);
        break;

    case UM_FREEPLUGINDATA:
        mir_free(ptszPopupText);
        return TRUE;
    }

    return DefWindowProc(hWnd, uiMessage, wParam, lParam);
}
Ejemplo n.º 13
0
LRESULT CALLBACK HidePopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message) {
	case WM_COMMAND:
		if (HIWORD(wParam) == STN_CLICKED) {
			db_set_b(PUGetContact(hWnd), "CList", "Hidden", 1);
			PUDeletePopup(hWnd);
		}
		break;

	case WM_CONTEXTMENU:
		db_set_b(PUGetContact(hWnd), MODULENAME, "NeverHide", 1);
		PUDeletePopup(hWnd);
		break;

	case UM_POPUPACTION:
		if (wParam == 2) {
			db_set_b(PUGetContact(hWnd), "CList", "Hidden", 1);
			PUDeletePopup(hWnd);
		}
		if (wParam == 3) {
			db_set_b(PUGetContact(hWnd), MODULENAME, "NeverHide", 1);
			PUDeletePopup(hWnd);
		}
		break;

	case UM_FREEPLUGINDATA:
		return TRUE;
	}
	return DefWindowProc(hWnd, message, wParam, lParam);
}
Ejemplo n.º 14
0
static LRESULT CALLBACK PopupAlarmDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message) {
	case WM_COMMAND: // snooze
		if (HIWORD(wParam) == STN_CLICKED) { //It was a click on the Popup.
			ALARM *mpd = (ALARM *)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd, 0);

			if (mpd->flags & ALF_NOSNOOZE)
				return TRUE;

			// add snooze minutes to current time
			FILETIME ft;
			GetLocalTime(&mpd->time);
			SystemTimeToFileTime(&mpd->time, &ft);
			ULARGE_INTEGER uli;
			uli.LowPart = ft.dwLowDateTime;
			uli.HighPart = ft.dwHighDateTime;

			uli.QuadPart += mult.QuadPart * options.snooze_minutes;

			ft.dwHighDateTime = uli.HighPart;
			ft.dwLowDateTime = uli.LowPart;

			FileTimeToSystemTime(&ft, &mpd->time);

			mpd->occurrence = OC_ONCE;
			mpd->snoozer = true;
			mpd->flags = mpd->flags & ~(ALF_NOSTARTUP);

			mpd->id = next_alarm_id++;

			append_to_list(mpd);
		}

		PUDeletePopup(hWnd);
		return TRUE;

	case WM_CONTEXTMENU: 
		PUDeletePopup(hWnd);
		return TRUE;

	case UM_FREEPLUGINDATA: 
		ALARM *mpd = (ALARM *)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd, 0);
		if (mpd > 0) {
			free_alarm_data(mpd);
			delete mpd;
		}
		return TRUE;
	}
	return DefWindowProc(hWnd, message, wParam, lParam);
}
Ejemplo n.º 15
0
static LRESULT CALLBACK PopupDlgProcRestart(HWND hPopup, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg) {
	case WM_CONTEXTMENU:
		PUDeletePopup(hPopup);
		break;
	case WM_COMMAND:
		PUDeletePopup(hPopup);
		CallFunctionAsync(RestartPrompt, 0);

		break;
	}

	return DefWindowProc(hPopup, uMsg, wParam, lParam);
}
Ejemplo n.º 16
0
LRESULT CALLBACK NullWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message) {
	case WM_COMMAND: {
		PUDeletePopup(hWnd);
		break;
	}

	case WM_CONTEXTMENU:
		PUDeletePopup(hWnd);
		break;
	}

	return DefWindowProc(hWnd, message, wParam, lParam);
}
Ejemplo n.º 17
0
BOOL CALLBACK EnumWindowsProc(HWND hWnd,LPARAM)
{
	DWORD dwWndPID;
	GetWindowThreadProcessId(hWnd,&dwWndPID);

	if ((g_dwMirandaPID == dwWndPID) && hWnd != g_hDlgPass && IsWindowVisible(hWnd))
	{
		TCHAR szTemp[32];
		GetClassName(hWnd,szTemp,32);

		if (lstrcmp(szTemp,_T("MirandaThumbsWnd")) == 0) // hide floating contacts
		{
			CallService("FloatingContacts/MainHideAllThumbs",0,0);
			g_bOldSetting |= OLD_FLTCONT;
		}
		else if (lstrcmp(szTemp,_T("PopupWnd2")) == 0 || lstrcmp(szTemp,_T("YAPPWinClass")) == 0) // destroy opened popups
			PUDeletePopup(hWnd);
		else
		{
			HWND_ITEM *node = new HWND_ITEM;
			node->hWnd = hWnd;
			// add to list
			node->next = g_pMirWnds;
			g_pMirWnds = node;
			ShowWindow(hWnd,SW_HIDE);
		}
	}
	return true;
}
Ejemplo n.º 18
0
void Popup_DoAction(HWND hWnd, BYTE Action, PLUGIN_DATA *pdata)
{
	MCONTACT hContact = (MCONTACT)CallService(MS_POPUP_GETCONTACT, (WPARAM)hWnd, 0);
	switch (Action) {
	case PCA_OPENMESSAGEWND: // open message window
		if (hContact && hContact != INVALID_CONTACT_ID)
			CallServiceSync(ServiceExists("SRMsg/LaunchMessageWindow") ? "SRMsg/LaunchMessageWindow" : MS_MSG_SENDMESSAGE, hContact, 0);
		break;

	case PCA_OPENMENU: // open contact menu
		if (hContact && hContact != INVALID_CONTACT_ID)
			QueueUserAPC(ShowContactMenu, g_hMainThread, (ULONG_PTR)hContact);
		break;

	case PCA_OPENDETAILS: // open contact details window
		if (hContact != INVALID_CONTACT_ID)
			CallServiceSync(MS_USERINFO_SHOWDIALOG, hContact, 0);
		break;

	case PCA_OPENHISTORY: // open contact history
		if (hContact != INVALID_CONTACT_ID)
			CallServiceSync(MS_HISTORY_SHOWCONTACTHISTORY, hContact, 0);
		break;

	case PCA_CLOSEPOPUP: // close popup
		PUDeletePopup(hWnd);
		break;

	case PCA_DONOTHING: // do nothing
		break;
	}
}
Ejemplo n.º 19
0
/**
 * Popup processing callback
 */
LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
	case WM_COMMAND:
	case WM_CONTEXTMENU:
	{
		// Get the plugin data (we need the Popup service to do it)
		popup_data *data = (popup_data *)PUGetPluginData(hwnd);
		if (data != NULL) {
			if (!data->notification_id.empty())
				data->proto->ForkThread(&FacebookProto::ReadNotificationWorker, new std::string(data->notification_id));

			if (message == WM_COMMAND && !data->url.empty())
				data->proto->OpenUrl(data->url);
		}

		// After a click, destroy popup
		PUDeletePopup(hwnd);
	} break;

	case UM_FREEPLUGINDATA:
	{
		// After close, free
		popup_data *data = (popup_data *)PUGetPluginData(hwnd);
		delete data;
	} return FALSE;

	default:
		break;
	}

	return DefWindowProc(hwnd, message, wParam, lParam);
};
Ejemplo n.º 20
0
static LRESULT CALLBACK PopupThreadManagerWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	PopupWnd2 *wnd = NULL;
	if (message == UTM_ADD_WINDOW || message == UTM_UPDATE_WINDOW || message == UTM_REMOVE_WINDOW || message == UTM_REQUEST_REMOVE)
		if (!(wnd = (PopupWnd2 *)lParam))
			return 0;

	switch (message) {
	case UTM_STOP_THREAD:
		gTerminating = true;
		if (db_get_b(NULL, MODULNAME, "FastExit", 0))
			for (int i = 0; i < popupList.getCount(); ++i)
				PUDeletePopup(popupList[i]->getHwnd());
		PostQuitMessage(0);
		break;

	case UTM_ADD_WINDOW:
		if (gTerminating)
			break;
		UpdatePopupPosition(popupList.getCount() ? popupList[popupList.getCount() - 1] : 0, wnd);
		popupList.insert(wnd);
		++nPopups;
		wnd->callMethodAsync(&PopupWnd2::m_show, 0);
		break;

	case UTM_UPDATE_WINDOW:
		RepositionPopups();
		break;

	case UTM_REQUEST_REMOVE:
		if ((PopupOptions.LeaveHovered && gLockCount) || (wnd && wnd->isLocked()))
			wnd->updateTimer();
		else
			PostMessage(wnd->getHwnd(), WM_CLOSE, 0, 0);
		break;

	case UTM_REMOVE_WINDOW:
	{
		for (int i = popupList.getCount() - 1; i >= 0; i--)
			if (popupList[i] == wnd)
				popupList.remove(i);
	}
	RepositionPopups();
	--nPopups;
	delete wnd;
	break;

	case UTM_LOCK_QUEUE:
		++gLockCount;
		break;

	case UTM_UNLOCK_QUEUE:
		if (--gLockCount < 0)
			gLockCount = 0;
		break;

	}
	return DefWindowProc(hwnd, message, wParam, lParam);
}
Ejemplo n.º 21
0
// Handle to popup events
static LRESULT CALLBACK DumbPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message) {
	case WM_COMMAND:
		PUDeletePopup(hWnd);
		return TRUE;

	case WM_CONTEXTMENU: 
		PUDeletePopup(hWnd);
		return TRUE;

	case UM_FREEPLUGINDATA: 
		return TRUE;
	}

	return DefWindowProc(hWnd, message, wParam, lParam);
}
Ejemplo n.º 22
0
LRESULT CALLBACK NudgePopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch (msg) {
	case WM_COMMAND:
		CallService(MS_MSG_SENDMESSAGET, (WPARAM)PUGetContact(hWnd), 0);
		PUDeletePopup(hWnd);
		break;

	case WM_CONTEXTMENU:
		PUDeletePopup(hWnd);
		break;
	case UM_FREEPLUGINDATA:
		//Here we'd free our own data, if we had it.
		return FALSE;
	}
	return DefWindowProc(hWnd, msg, wParam, lParam);
}
Ejemplo n.º 23
0
LRESULT CALLBACK PopupProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	POPUP_DATA_HEADER *ppdh = (POPUP_DATA_HEADER*)PUGetPluginData(wnd);
	LPCSTR acc;

	if (EVENT_DELETED_MSG == msg) {
		if ((MEVENT)lParam == ppdh->hDbEvent)
			ppdh->hDbEvent = NULL;
		return 0;
	}

	if (MESSAGE_CLOSEPOPUP == msg) {
		ppdh->MarkRead = TRUE;
		PUDeletePopup(wnd);
	}

	switch (msg) {
	case UM_INITPOPUP:
		SetProp(wnd, PLUGIN_DATA_PROP_NAME, (HANDLE)ppdh);
		SetProp(wnd, EVT_DELETED_HOOK_PROP_NAME,
			HookEventParam(ME_DB_EVENT_DELETED, OnEventDeleted, (LPARAM)wnd));
		return 0;

	case UM_FREEPLUGINDATA:
		{
			HANDLE hHook = GetProp(wnd, EVT_DELETED_HOOK_PROP_NAME);
			RemoveProp(wnd, EVT_DELETED_HOOK_PROP_NAME);
			UnhookEvent(hHook);
		}

		if (ppdh->MarkRead && ppdh->hDbEvent && (acc = GetJidAcc(ppdh->jid))) {
			ReadNotificationSettings(acc);
			MarkEventRead(ppdh->hContact, ppdh->hDbEvent);
			CallService(MS_CLIST_REMOVEEVENT, (WPARAM)ppdh->hContact, (LPARAM)ppdh->hDbEvent);
		}
		RemoveProp(wnd, PLUGIN_DATA_PROP_NAME);
		free(ppdh);
		return 0;

	case WM_LBUTTONUP:
		acc = NULL;
		__try {
			if (!(acc = GetJidAcc(ppdh->jid))) return 0;

			ReadNotificationSettings(acc);
			OpenUrl(acc, ppdh->jid, ppdh->url);
		}
		__finally {
			CloseNotifications(acc, ppdh->url, ppdh->jid, TRUE);
		}
		return 0;

	case WM_RBUTTONUP:
		SendMessage(wnd, MESSAGE_CLOSEPOPUP, 0, 0);
		return 0;
	}
	return DefWindowProc(wnd, msg, wParam, lParam);
}
Ejemplo n.º 24
0
void PopupAction(HWND hPopup, BYTE action)
{
	switch (action) {
	case PCA_CLOSEPOPUP:
		break;
	case PCA_DONOTHING:
		return;
	}
	PUDeletePopup(hPopup);
}
Ejemplo n.º 25
0
LRESULT CALLBACK MraPopupDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
	MraPopupData* dat = (MraPopupData*)PUGetPluginData(hWndDlg);

	switch (msg) {
	case UM_INITPOPUP:
		if (dat->iPopupType == MRA_POPUP_TYPE_EMAIL_STATUS) {
			// update/load avatar
			dat->ppro->MraAvatarsQueueGetAvatarSimple(dat->ppro->hAvatarsQueueHandle, GAIF_FORCE, PUGetContact(hWndDlg), 0);

			// delete old email popup
			if (dat->ppro->hWndEMailPopupStatus)
				PUDeletePopup(dat->ppro->hWndEMailPopupStatus);

			dat->ppro->hWndEMailPopupStatus = hWndDlg;
		}
		break;

	case WM_COMMAND:
		if (HIWORD(wParam) == STN_CLICKED) { //It was a click on the Popup.
			if (dat->iPopupType == MRA_POPUP_TYPE_EMAIL_STATUS) {
				CallProtoService(dat->ppro->m_szModuleName, MRA_GOTO_INBOX, 0, 0);
				dat->ppro->hWndEMailPopupStatus = NULL;
			}
		}
		PUDeletePopup(hWndDlg);
		break;

	case WM_CONTEXTMENU:
		if (dat->iPopupType == MRA_POPUP_TYPE_EMAIL_STATUS)
			dat->ppro->hWndEMailPopupStatus = NULL;
		PUDeletePopup(hWndDlg);
		break;

	case UM_FREEPLUGINDATA:
		if (dat->iPopupType == MRA_POPUP_TYPE_EMAIL_STATUS)
			dat->ppro->hWndEMailPopupStatus = NULL;
		mir_free(dat);
		break;
	}
	return DefWindowProc(hWndDlg, msg, wParam, lParam);
}
Ejemplo n.º 26
0
LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message) {
	case WM_COMMAND:
		// After a click, destroy popup
		PUDeletePopup(hwnd);
		break;

	case WM_CONTEXTMENU:
		PUDeletePopup(hwnd);
		break;

	case UM_FREEPLUGINDATA:
		// After close, free
		mir_free(PUGetPluginData(hwnd));
		return FALSE;
	}

	return DefWindowProc(hwnd, message, wParam, lParam);
};
Ejemplo n.º 27
0
static void TSAPI Chat_DismissPopup(const SESSION_INFO *si, HWND hwndPopup)
{
	if (si->hContact)
		if (CallService(MS_CLIST_GETEVENT, (WPARAM)si->hContact, 0))
			CallService(MS_CLIST_REMOVEEVENT, (WPARAM)si->hContact, (LPARAM)GC_FAKE_EVENT);

	if (si->hWnd && KillTimer(si->hWnd, TIMERID_FLASHWND))
		FlashWindow(si->hWnd, FALSE);

	PUDeletePopup(hwndPopup);
}
Ejemplo n.º 28
0
LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch (msg) {
    case WM_COMMAND:
    {
        TCHAR* ptszPath = (TCHAR*)PUGetPluginData(hWnd);
        if (ptszPath != 0)
            ShellExecute(0, _T("open"), ptszPath, NULL, NULL, SW_SHOW);

        PUDeletePopup(hWnd);
        break;
    }
    case WM_CONTEXTMENU:
        PUDeletePopup(hWnd);
        break;
    case UM_FREEPLUGINDATA:
        mir_free(PUGetPluginData(hWnd));
        break;
    }
    return DefWindowProc(hWnd, msg, wParam, lParam);
}
Ejemplo n.º 29
0
void facebook_client::clear_notifications()
{	
	for (std::map<std::string, facebook_notification*>::iterator it = notifications.begin(); it != notifications.end(); ) {
		if (it->second->hWndPopup != NULL)
			PUDeletePopup(it->second->hWndPopup); // close popup

		delete it->second;
		it = notifications.erase(it);
	}

	notifications.clear();
}
Ejemplo n.º 30
0
LRESULT CALLBACK PopupDlgProcNoSet(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message) {
	case WM_COMMAND:
		if (HIWORD(wParam) == STN_CLICKED) {
			g_clistApi.pfnRemoveEvent(PUGetContact(hWnd), 0);
			CallServiceSync("BuddyExpectator/actionStillAbsent", (WPARAM)PUGetContact(hWnd), 0);
			PUDeletePopup(hWnd);
		}
		break;

	case WM_CONTEXTMENU:
		g_clistApi.pfnRemoveEvent(PUGetContact(hWnd), 0);
		PUDeletePopup(hWnd);
		break;

	case UM_FREEPLUGINDATA:
		return TRUE;
	}
	return DefWindowProc(hWnd, message, wParam, lParam);
}