예제 #1
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);
}
예제 #2
0
파일: popups.c 프로젝트: raoergsls/miranda
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);
}
예제 #3
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 ((unsigned)popup != CALLSERVICE_NOTFOUND)
			{
				DestroyIcon(popup->hIcon);
				mir_free(popup);
			}
			return FALSE; //the return value is ignored
		}
	}

	return DefWindowProc(hWnd, message, wParam, lParam);
}
예제 #4
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);
}
예제 #5
0
/*
std::string trim_string(const std::string &in) {
	std::string out;

	int i = 0;
	while(i < in.size() && in[i] == ' ')
		i++;
	for(; i < in.size(); i++) {
		out += in[i];
	}

	while(out.size() && out[out.size() - 1] == ' ') {
		out = out.substr(0, out.size() - 1);
	}


	return out;
}

void capitalize(std::string &in) {
	for(int i = 0; i < in.length(); i++) {
		if(in[i] >= 'a' && in[i] <= 'z')
			in[i] = 'A' + (in[i] - 'a');
	}
}
*/
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);
}
예제 #6
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);
}
예제 #7
0
/**
 * Message procedure for popup messages
 *
 * @param	hWnd			- handle to the popupwindow
 * @param	uMsg			- message to handle
 * @param	wParam			- message specific parameter
 * @param	lParam			- message specific parameter
 *
 * @return	message specific
 **/
static INT_PTR CALLBACK PopupWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg)
    {
    case WM_COMMAND:
    {
        if (HIWORD(wParam) == STN_CLICKED)
        {
            PUDeletePopUp(hWnd);
            return TRUE;
        }
        break;
    }

    case WM_CONTEXTMENU:
    {
        PUDeletePopUp(hWnd);
        return TRUE;
    }
    }
    return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
예제 #8
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 ((unsigned)popup != CALLSERVICE_NOTFOUND)
			{
				DestroyIcon(popup->hIcon);
				mir_free(popup);
			}
			return FALSE; //the return value is ignored
		}
	}

	return DefWindowProc(hWnd, message, wParam, lParam);
}
예제 #9
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);
}
예제 #10
0
void PopupAction(HWND hWnd, BYTE action)
{
	HANDLE hContact = PUGetContact(hWnd);
	if (hContact && hContact != INVALID_HANDLE_VALUE)
	{
		switch (action)
		{
			case PCA_OPENMESSAGEWND:
			{
				CallServiceSync(ServiceExists("SRMsg/LaunchMessageWindow") ? "SRMsg/LaunchMessageWindow" : MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0);
				break;
			}
			case PCA_OPENMENU:
			{		
				POINT pt = {0};
				HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)hContact, 0);
				GetCursorPos(&pt);
				TrackPopupMenu(hMenu, 0, pt.x, pt.y, 0, hWnd, NULL);
				DestroyMenu(hMenu);
				return;
			}
			case PCA_OPENDETAILS:
			{	
				CallServiceSync(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0);
				break;
			}
			case PCA_OPENHISTORY:
			{
				CallServiceSync(MS_HISTORY_SHOWCONTACTHISTORY, (WPARAM)hContact, 0);
				break;
			}
			case PCA_CLOSEPOPUP: 
				break;
			case PCA_DONOTHING:
				return;
		}

		PUDeletePopUp(hWnd);
	}
}