Esempio n. 1
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);
};
Esempio n. 2
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);
}
Esempio n. 3
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)
                gg_sessions_view(puData->gg, 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);
}
//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);
}
Esempio n. 5
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);
}
Esempio n. 6
0
static int CALLBACK PopupWindowProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam )
{
	switch( message ) {
	case WM_COMMAND:
		DebugLog("[PopupWindowProc] WM_COMMAND");
		if ( HIWORD( wParam ) == STN_CLICKED) {
			char *szURL = (char *)PUGetPluginData( hWnd );
			if ( szURL != NULL ) 
				CallService( MS_UTILS_OPENURL, TRUE, ( LPARAM )szURL );    

			PUDeletePopUp( hWnd );
			return 0;
		}
		break;

	case WM_CONTEXTMENU:
		DebugLog("[PopupWindowProc] WM_CONTEXTMENU");
		PUDeletePopUp( hWnd ); 
		return TRUE;

	case UM_FREEPLUGINDATA:
		DebugLog("[PopupWindowProc] UM_FREEPLUGINDATA");
		{
			char *szURL = (char *)PUGetPluginData( hWnd );
			if ( szURL != NULL ) 
				free(szURL);
		}

		return TRUE;
	}

	return DefWindowProc(hWnd, message, wParam, lParam);
}
Esempio n. 7
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);
}
Esempio n. 8
0
LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	PLUGINDATA *pdp = NULL;

	switch(message) {
	case WM_MEASUREITEM: //Needed by the contact's context menu
		return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);

	case WM_DRAWITEM: //Needed by the contact's context menu
		return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam);

	case WM_COMMAND:
		//This one returns TRUE if it processed the menu command, and FALSE if it did not process it.
		if (CallServiceSync(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)PUGetContact(hwnd)))
			break;

		PopupAction(hwnd, opt.LeftClickAction);
		break;

	case WM_CONTEXTMENU:
		PopupAction(hwnd, opt.RightClickAction);
		break;

	case UM_FREEPLUGINDATA:
		pdp = (PLUGINDATA *)PUGetPluginData(hwnd);
		if (pdp != NULL) {
			if (pdp->hAwayMsgHook != NULL) {
				UnhookEvent(pdp->hAwayMsgHook);
				pdp->hAwayMsgHook = NULL;
			}

			mir_free(pdp);
		}
		return FALSE;

	case UM_INITPOPUP:
		pdp = (PLUGINDATA *)PUGetPluginData(hwnd);
		if (pdp != NULL) {
			char *szProto = GetContactProto( PUGetContact(hwnd));
			if (szProto && opt.ReadAwayMsg && StatusHasAwayMessage(szProto, pdp->newStatus)) {
				WORD myStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
				if (myStatus != ID_STATUS_INVISIBLE)
					QueryAwayMessage(hwnd, pdp);
			}
		}

		return FALSE;
	}

	return DefWindowProc(hwnd, message, wParam, lParam);
}
Esempio n. 9
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);
}
Esempio n. 10
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);
}
Esempio n. 11
0
static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	SESSION_INFO *si = (SESSION_INFO*)PUGetPluginData(hWnd);

	switch (message) {
	case WM_COMMAND:
		if ( HIWORD(wParam) == STN_CLICKED) {
			if (si) {
				if (nen_options.maskActL & MASK_OPEN)
					Chat_OpenPopup(si, hWnd);
				else
					Chat_DismissPopup(si, hWnd);
			}
			return TRUE;
		}
		break;

	case WM_CONTEXTMENU:
		if (si && si->hContact) {
			if (nen_options.maskActR & MASK_OPEN)
				Chat_OpenPopup(si, hWnd);
			else
				Chat_DismissPopup(si, hWnd);
		}
		break;
	}
	return DefWindowProc(hWnd, message, wParam, lParam);
}
Esempio n. 12
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);
};
Esempio n. 13
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: 
		{
			PopupData *pd = (PopupData *) PUGetPluginData(hWnd);
			HistoryEvents_ReleaseIcon(pd->hIcon);
			delete pd;
			return TRUE;
		}
	}

	return DefWindowProc(hWnd, message, wParam, lParam);
}
Esempio n. 14
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);
}
Esempio n. 15
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);
}
Esempio n. 16
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);
}
Esempio n. 17
0
// Handle to popup events
static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message) {
		case WM_COMMAND:
		{
			PopupData *pd = (PopupData *) PUGetPluginData(hWnd);
			int action = opts[pd->type].popup_left_click_action;

			SendMessage(hPopupWindow, WMU_ACTION, (WPARAM) pd->hContact, action);

			if (action != POPUP_ACTION_DONOTHING)
				PUDeletePopUp(hWnd);

			return TRUE;
		}

		case WM_CONTEXTMENU: 
		{
			PopupData *pd = (PopupData *) PUGetPluginData(hWnd);
			int action = opts[pd->type].popup_right_click_action;

			SendMessage(hPopupWindow, WMU_ACTION, (WPARAM) pd->hContact, action);

			if (action != POPUP_ACTION_DONOTHING)
				PUDeletePopUp(hWnd);

			return TRUE;
		}

		case UM_FREEPLUGINDATA: 
		{
			PopupData *pd = (PopupData *) PUGetPluginData(hWnd);
			HistoryEvents_ReleaseIcon(pd->hIcon);
			delete pd;
			return TRUE;
		}
	}

	return DefWindowProc(hWnd, message, wParam, lParam);
}
Esempio n. 18
0
// Handle to popup events
static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message) {
		case WM_COMMAND:
		{
			PopupDataType* popup = (PopupDataType*)PUGetPluginData(hWnd);
			PostMessage(hPopupWindow, WMU_ACTION, (WPARAM)popup->plugin_data, opts.popup_left_click_action);

			if (opts.popup_left_click_action != POPUP_ACTION_DONOTHING)
				PUDeletePopup(hWnd);

			return TRUE;
		}

		case WM_CONTEXTMENU:
		{
			PopupDataType* popup = (PopupDataType*)PUGetPluginData(hWnd);
			PostMessage(hPopupWindow, WMU_ACTION, (WPARAM)popup->plugin_data, opts.popup_right_click_action);

			if (opts.popup_right_click_action != POPUP_ACTION_DONOTHING)
				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);
}
Esempio n. 19
0
/**
* This is the message procedure for popup
*
* @param	hDlg		- window handle
* @param	uMsg		- message to handle
* @param	wParam		- message specific parameter
* @param	lParam		- message specific parameter
*
* @return	TRUE, FALSE, IDOK, IDYES, IDALL, IDNO or IDCANCEL
**/
LRESULT CALLBACK PopupProc(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 IDOK:
				case IDCANCEL:
				case IDABORT:
				case IDRETRY:
				case IDIGNORE:
				case IDYES:
				case IDNO:
				case IDALL:
				case IDNONE:
					if (IsWindow(pmpd->hDialog))
						EndDialog(pmpd->hDialog, LOWORD(wParam));
					break;

				default:
					if (IsWindow(pmpd->hDialog))
						EndDialog(pmpd->hDialog, IDCANCEL);
				}
			}
			PUDeletePopup(hDlg);
		}
		break;

	case UM_FREEPLUGINDATA:
		LPMSGPOPUPDATA pmpd = (LPMSGPOPUPDATA)PUGetPluginData(hDlg);
		if (pmpd > 0)
			MIR_FREE(pmpd);
		return TRUE;
	}
	return DefWindowProc(hDlg, uMsg, wParam, lParam);
}
Esempio n. 20
0
LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message) {
	case WM_COMMAND:
	case WM_CONTEXTMENU:
		{
			CVkSendMsgParam *pd = (CVkSendMsgParam *)PUGetPluginData(hwnd);
			if (pd != NULL && pd->hContact != NULL)
				CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)pd->hContact, 0);	
			PUDeletePopup(hwnd);
		} 
		break;
	case UM_FREEPLUGINDATA:
		{
			CVkSendMsgParam *pd = (CVkSendMsgParam *)PUGetPluginData(hwnd);
			delete pd;
		} 
		return FALSE;
	default:
		break;
	}

	return DefWindowProc(hwnd, message, wParam, lParam);
}
Esempio n. 21
0
static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	PLUGIN_DATA *pdata = (PLUGIN_DATA*)PUGetPluginData(hWnd);
	if (pdata == NULL)
		return FALSE;

	switch (message) {
	case WM_COMMAND:
		PopupAct(hWnd, pdata->pluginOptions->maskActL, pdata);
		break;
	case WM_CONTEXTMENU:
		PopupAct(hWnd, pdata->pluginOptions->maskActR, pdata);
		break;
	case UM_FREEPLUGINDATA:
		PopupCount--;
		mir_free(pdata);
		return TRUE;
	case UM_INITPOPUP:
		pdata->hWnd = hWnd;
		SetTimer(hWnd, TIMER_TO_ACTION, pdata->iSeconds * 1000, NULL);
		break;
	case WM_MOUSEWHEEL:
		if ((short)HIWORD(wParam) > 0 && pdata->firstShowEventData->prev &&
			(pdata->pluginOptions->bShowON || pdata->firstShowEventData->number >= pdata->pluginOptions->iNumberMsg))
		{
			pdata->firstShowEventData = pdata->firstShowEventData->prev;
			PopupUpdate(pdata->hContact, NULL);
		}
		if ((short)HIWORD(wParam) < 0 && pdata->firstShowEventData->next && 
			(!pdata->pluginOptions->bShowON || pdata->countEvent - pdata->firstShowEventData->number >= pdata->pluginOptions->iNumberMsg))
		{
			pdata->firstShowEventData = pdata->firstShowEventData->next;
			PopupUpdate(pdata->hContact, NULL);
		}
		break;
	case WM_SETCURSOR:
		SetFocus(hWnd);
		break;
	case WM_TIMER:
		if (wParam != TIMER_TO_ACTION)
			break;
		PopupAct(hWnd, pdata->pluginOptions->maskActTE, pdata);
		break;
	}
	return DefWindowProc(hWnd, message, wParam, lParam);
}
Esempio n. 22
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);
}
Esempio n. 23
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);
};
Esempio n. 24
0
static INT_PTR CALLBACK PopupDlgProc2(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg) {
	case WM_COMMAND:
		PopupAction(hDlg, MyOptions.LeftClickAction);
		break;

	case WM_CONTEXTMENU:
		PopupAction(hDlg, MyOptions.RightClickAction);
		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);
}
Esempio n. 25
0
LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch (msg) {
	case WM_COMMAND:
		switch (HIWORD(wParam)) {
		case STN_CLICKED:
			{
				int count = (int) PUGetPluginData(hWnd);
				ShowEmailsWindow(count);
				PUDeletePopup(hWnd);
				break;
			}
		}
		break;

	case WM_CONTEXTMENU:
		PUDeletePopup(hWnd);
		break;
	}
	return DefWindowProc(hWnd, msg, wParam, lParam);
}
Esempio n. 26
0
LRESULT CALLBACK NullWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	PopupData *tData = (PopupData*)PUGetPluginData(hWnd);

	switch (msg) {
	case WM_COMMAND:
		if (tData != NULL) {
			if (tData->flags & MSN_HOTMAIL_POPUP) {
				MCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL);
				if (hContact) CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM) 1);
				if (tData->flags & MSN_ALLOW_ENTER)
					tData->proto->MsnInvokeMyURL(true, tData->url);
			}
			else if (tData->url != NULL)
				CallService(MS_UTILS_OPENURL, 1, (LPARAM)tData->url);
		}
		PUDeletePopup(hWnd);
		break;

	case WM_CONTEXTMENU:
		if (tData != NULL && tData->flags & MSN_HOTMAIL_POPUP) {
			MCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL);
			if (hContact)
				CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM) 1);
		}
		PUDeletePopup(hWnd);
		break;

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

	return DefWindowProc(hWnd, msg, wParam, lParam);
}
Esempio n. 27
0
LRESULT CALLBACK PopupWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch (msg) {
	case WM_COMMAND:
		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);
}