diff options
49 files changed, 173 insertions, 198 deletions
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp index efcc1c4071..d64ec5c093 100644 --- a/plugins/AutoShutdown/src/frame.cpp +++ b/plugins/AutoShutdown/src/frame.cpp @@ -397,27 +397,28 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA  			SendMessage(hwndFrame,M_UPDATE_COUNTDOWN,0,0);
  			return 0;
  		case WM_CONTEXTMENU:
 -		{	HMENU hContextMenu;
 -			POINT pt;
 -			if (dat->flags&FWPDF_COUNTDOWNINVALID) return 0;
 -			POINTSTOPOINT(pt,MAKEPOINTS(lParam));
 -			if (pt.x==-1 && pt.y==-1) { /* invoked by keyboard */
 -				RECT rc;
 -				/* position in middle above rect */
 -				if (!GetWindowRect(hwndFrame, &rc)) return 0;
 -				pt.x=rc.left+((int)(rc.right-rc.left)/2);
 -				pt.y=rc.top+((int)(rc.bottom-rc.top)/2);
 -			}
 -			hContextMenu=CreatePopupMenu();
 -			if (hContextMenu != NULL) {
 -				AppendMenu(hContextMenu,MF_STRING,MENUITEM_PAUSECOUNTDOWN,(dat->flags&FWPDF_PAUSED)?TranslateT("&Unpause Countdown"):TranslateT("&Pause Countdown"));
 -				SetMenuDefaultItem(hContextMenu,MENUITEM_PAUSECOUNTDOWN,FALSE);
 -				AppendMenu(hContextMenu,MF_STRING,MENUITEM_STOPCOUNTDOWN,TranslateT("&Cancel Countdown"));
 -				TrackPopupMenuEx(hContextMenu,TPM_LEFTALIGN|TPM_TOPALIGN|TPM_HORPOSANIMATION|TPM_VERPOSANIMATION|TPM_RIGHTBUTTON,pt.x,pt.y,hwndFrame,NULL);
 -				DestroyMenu(hContextMenu);
 +			{
 +				if (dat->flags & FWPDF_COUNTDOWNINVALID)
 +					return 0;
 +
 +				POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
 +				if (pt.x==-1 && pt.y==-1) { /* invoked by keyboard */
 +					RECT rc;
 +					/* position in middle above rect */
 +					if (!GetWindowRect(hwndFrame, &rc)) return 0;
 +					pt.x=rc.left+((int)(rc.right-rc.left)/2);
 +					pt.y=rc.top+((int)(rc.bottom-rc.top)/2);
 +				}
 +				HMENU hContextMenu = CreatePopupMenu();
 +				if (hContextMenu != NULL) {
 +					AppendMenu(hContextMenu,MF_STRING,MENUITEM_PAUSECOUNTDOWN,(dat->flags&FWPDF_PAUSED)?TranslateT("&Unpause Countdown"):TranslateT("&Pause Countdown"));
 +					SetMenuDefaultItem(hContextMenu,MENUITEM_PAUSECOUNTDOWN,FALSE);
 +					AppendMenu(hContextMenu,MF_STRING,MENUITEM_STOPCOUNTDOWN,TranslateT("&Cancel Countdown"));
 +					TrackPopupMenuEx(hContextMenu,TPM_LEFTALIGN|TPM_TOPALIGN|TPM_HORPOSANIMATION|TPM_VERPOSANIMATION|TPM_RIGHTBUTTON,pt.x,pt.y,hwndFrame,NULL);
 +					DestroyMenu(hContextMenu);
 +				}
  			}
  			return 0;
 -		}
  		case WM_LBUTTONDBLCLK:
  			if (!(dat->flags&FWPDF_COUNTDOWNINVALID))
  				SendMessage(hwndFrame,M_PAUSE_COUNTDOWN,0,0);
 diff --git a/plugins/AutoShutdown/src/stdafx.h b/plugins/AutoShutdown/src/stdafx.h index 03a39e306d..f557ed810f 100644 --- a/plugins/AutoShutdown/src/stdafx.h +++ b/plugins/AutoShutdown/src/stdafx.h @@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  #include <time.h>   /* for mktime(),time() */
  #include <windows.h>
 +#include <windowsx.h>
  #include <Uxtheme.h>
  #include <Shlwapi.h>
  #include <PowrProf.h>
 diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index 1ddb14c113..d94c292e82 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -180,10 +180,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l  			int pos;
  			if ((HANDLE)wParam == hwndList) {
 -				POINT p;
 -				p.x = LOWORD(lParam); 
 -				p.y = HIWORD(lParam); 
 -
 +				POINT p = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  				ScreenToClient(hwndList, &p);
  				pos = SendMessage(hwndList, LB_ITEMFROMPOINT, 0, MAKELONG(p.x, p.y));
 diff --git a/plugins/AvatarHistory/src/popup.cpp b/plugins/AvatarHistory/src/popup.cpp index 07810669c9..a43da24ef1 100644 --- a/plugins/AvatarHistory/src/popup.cpp +++ b/plugins/AvatarHistory/src/popup.cpp @@ -203,39 +203,32 @@ LRESULT CALLBACK PopupWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam  // Handle to popup events
  static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
  {
 +	PopupDataType *popup = (PopupDataType*)PUGetPluginData(hWnd);
 +
  	switch(message) {
 -		case WM_COMMAND:
 -		{
 -			PopupDataType* popup = (PopupDataType*)PUGetPluginData(hWnd);
 -			PostMessage(hPopupWindow, WMU_ACTION, (WPARAM)popup->plugin_data, opts.popup_left_click_action);
 +	case WM_COMMAND:
 +		PostMessage(hPopupWindow, WMU_ACTION, (WPARAM)popup->plugin_data, opts.popup_left_click_action);
 -			if (opts.popup_left_click_action != POPUP_ACTION_DONOTHING)
 -				PUDeletePopup(hWnd);
 +		if (opts.popup_left_click_action != POPUP_ACTION_DONOTHING)
 +			PUDeletePopup(hWnd);
 -			return TRUE;
 -		}
 +		return TRUE;
 -		case WM_CONTEXTMENU:
 -		{
 -			PopupDataType* popup = (PopupDataType*)PUGetPluginData(hWnd);
 -			PostMessage(hPopupWindow, WMU_ACTION, (WPARAM)popup->plugin_data, opts.popup_right_click_action);
 +	case WM_CONTEXTMENU:
 +		PostMessage(hPopupWindow, WMU_ACTION, (WPARAM)popup->plugin_data, opts.popup_right_click_action);
 -			if (opts.popup_right_click_action != POPUP_ACTION_DONOTHING)
 -				PUDeletePopup(hWnd);
 +		if (opts.popup_right_click_action != POPUP_ACTION_DONOTHING)
 +			PUDeletePopup(hWnd);
 -			return TRUE;
 -		}
 +		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
 +	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);
 @@ -246,28 +239,21 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA  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
 +	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);
 diff --git a/plugins/AvatarHistory/src/stdafx.h b/plugins/AvatarHistory/src/stdafx.h index f01d314e9d..2c294ccda7 100644 --- a/plugins/AvatarHistory/src/stdafx.h +++ b/plugins/AvatarHistory/src/stdafx.h @@ -1,4 +1,5 @@  #include <windows.h>
 +#include <windowsx.h>
  #include <time.h>
  #include <ShObjIdl.h>
  #include <ShlGuid.h>
 diff --git a/plugins/Clist_nicer/src/Include/commonheaders.h b/plugins/Clist_nicer/src/Include/commonheaders.h index dfa289636b..a3b7759d7a 100644 --- a/plugins/Clist_nicer/src/Include/commonheaders.h +++ b/plugins/Clist_nicer/src/Include/commonheaders.h @@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  #define FASTCALL __fastcall
  #include <windows.h>
 +#include <windowsx.h>
  #include <shlwapi.h>
  #include <Richedit.h>
 diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 051a803f9b..3900e1770b 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -659,7 +659,6 @@ LBL_Def:  	case WM_CONTEXTMENU:
  		{
  			HMENU hMenu = NULL;
 -			POINT pt;
  			DWORD hitFlags;
  			pcli->pfnEndRename(hwnd, dat, 1);
 @@ -670,8 +669,8 @@ LBL_Def:  				SetFocus(hwnd);
  			dat->iHotTrack = -1;
  			dat->szQuickSearch[0] = 0;
 -			pt.x = (short) LOWORD(lParam);
 -			pt.y = (short) HIWORD(lParam);
 +
 +			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  			if (pt.x == -1 && pt.y == -1) {
  				dat->selection = pcli->pfnGetRowByIndex(dat, dat->selection, &contact, NULL);
  				if (dat->selection != -1)
 diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index ea83885538..dab1bcb663 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -1613,12 +1613,10 @@ buttons_done:  	case WM_CONTEXTMENU:  		{  			RECT rc; -			POINT pt; +			GetWindowRect(pcli->hwndContactTree, &rc); -			pt.x = (short)LOWORD(lParam); -			pt.y = (short)HIWORD(lParam);  			// x/y might be -1 if it was generated by a kb click -			GetWindowRect(pcli->hwndContactTree, &rc); +			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  			if (pt.x == -1 && pt.y == -1) {  				// all this is done in screen-coords!  				GetCursorPos(&pt); diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp index d11cbcb3a4..73fcba99e9 100644 --- a/plugins/ContactsPlus/src/receive.cpp +++ b/plugins/ContactsPlus/src/receive.cpp @@ -405,14 +405,17 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara  	case WM_CONTEXTMENU:
  		{
  			HWND hLV = GetDlgItem(hwndDlg, IDC_CONTACTS);
 -			LVHITTESTINFO lvh;
  			RECT rt;
  			wndData->iPopupItem = -1;
 -			if ((HWND)wParam != hLV) break;  // if not our ListView go away
 -			lvh.pt.x = LOWORD(lParam);
 -			lvh.pt.y = HIWORD(lParam);
 -			if (GetWindowRect(hLV, &rt)==0) return FALSE; // ?? why this, some check ??
 +			if ((HWND)wParam != hLV)
 +				break;  // if not our ListView go away
 +			
 +			LVHITTESTINFO lvh;
 +			lvh.pt.x = GET_X_LPARAM(lParam);
 +			lvh.pt.y = GET_Y_LPARAM(lParam);
 +			GetWindowRect(hLV, &rt);
 +			
  			ScreenToClient(hLV, &lvh.pt); // convert to ListView local coordinates
  			int ci = ListView_HitTest(hLV, &lvh);
  			if (ci==-1) break; // mouse is not over any item
 diff --git a/plugins/ContactsPlus/src/stdafx.h b/plugins/ContactsPlus/src/stdafx.h index 0d52891be5..a6e99bc3d6 100644 --- a/plugins/ContactsPlus/src/stdafx.h +++ b/plugins/ContactsPlus/src/stdafx.h @@ -22,6 +22,7 @@  // ---------------------------------------------------------------------------
  #include <windows.h>
 +#include <windowsx.h>
  #include <commctrl.h>
  #include <malloc.h>
  #include <time.h>
 diff --git a/plugins/CrashDumper/src/stdafx.h b/plugins/CrashDumper/src/stdafx.h index ff77ceff81..a99afa3317 100644 --- a/plugins/CrashDumper/src/stdafx.h +++ b/plugins/CrashDumper/src/stdafx.h @@ -17,6 +17,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
  #include <windows.h>
 +#include <windowsx.h>
  #include <richedit.h>
  #include <delayimp.h>
 diff --git a/plugins/CrashDumper/src/ui.cpp b/plugins/CrashDumper/src/ui.cpp index 7050771388..b96870a9ea 100644 --- a/plugins/CrashDumper/src/ui.cpp +++ b/plugins/CrashDumper/src/ui.cpp @@ -102,12 +102,12 @@ INT_PTR CALLBACK DlgProcView(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara  		break;
  	case WM_GETMINMAXINFO:
 -	{
 -		LPMINMAXINFO mmi = (LPMINMAXINFO)lParam;
 -		mmi->ptMinTrackSize.x = 400; // The minimum width in points
 -		mmi->ptMinTrackSize.y = 300; // The minimum height in points
 -	}
 -	break;
 +		{
 +			LPMINMAXINFO mmi = (LPMINMAXINFO)lParam;
 +			mmi->ptMinTrackSize.x = 400; // The minimum width in points
 +			mmi->ptMinTrackSize.y = 300; // The minimum height in points
 +		}
 +		break;
  	case WM_COMMAND:
  		switch (LOWORD(wParam)) {
 @@ -126,44 +126,42 @@ INT_PTR CALLBACK DlgProcView(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara  		break;
  	case WM_CONTEXTMENU:
 -	{
 -		HWND hView = GetDlgItem(hwndDlg, IDC_VIEWVERSIONINFO);
 -		GetWindowRect(hView, &rc);
 -
 -		POINT pt;
 -		pt.x = LOWORD(lParam);
 -		pt.y = HIWORD(lParam);
 -		if (PtInRect(&rc, pt)) {
 -			static const CHARRANGE all = { 0, -1 };
 -
 -			HMENU hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT));
 -			HMENU hSubMenu = GetSubMenu(hMenu, 0);
 -			TranslateMenu(hSubMenu);
 -
 -			CHARRANGE sel;
 -			SendMessage(hView, EM_EXGETSEL, 0, (LPARAM)&sel);
 -			if (sel.cpMin == sel.cpMax)
 -				EnableMenuItem(hSubMenu, IDM_COPY, MF_BYCOMMAND | MF_GRAYED);
 -
 -			switch (TrackPopupMenu(hSubMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL)) {
 -			case IDM_COPY:
 -				SendMessage(hView, WM_COPY, 0, 0);
 -				break;
 -
 -			case IDM_COPYALL:
 -				SendMessage(hView, EM_EXSETSEL, 0, (LPARAM)&all);
 -				SendMessage(hView, WM_COPY, 0, 0);
 -				SendMessage(hView, EM_EXSETSEL, 0, (LPARAM)&sel);
 -				break;
 -
 -			case IDM_SELECTALL:
 -				SendMessage(hView, EM_EXSETSEL, 0, (LPARAM)&all);
 -				break;
 +		{
 +			HWND hView = GetDlgItem(hwndDlg, IDC_VIEWVERSIONINFO);
 +			GetWindowRect(hView, &rc);
 +
 +			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
 +			if (PtInRect(&rc, pt)) {
 +				static const CHARRANGE all = { 0, -1 };
 +
 +				HMENU hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT));
 +				HMENU hSubMenu = GetSubMenu(hMenu, 0);
 +				TranslateMenu(hSubMenu);
 +
 +				CHARRANGE sel;
 +				SendMessage(hView, EM_EXGETSEL, 0, (LPARAM)&sel);
 +				if (sel.cpMin == sel.cpMax)
 +					EnableMenuItem(hSubMenu, IDM_COPY, MF_BYCOMMAND | MF_GRAYED);
 +
 +				switch (TrackPopupMenu(hSubMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL)) {
 +				case IDM_COPY:
 +					SendMessage(hView, WM_COPY, 0, 0);
 +					break;
 +
 +				case IDM_COPYALL:
 +					SendMessage(hView, EM_EXSETSEL, 0, (LPARAM)&all);
 +					SendMessage(hView, WM_COPY, 0, 0);
 +					SendMessage(hView, EM_EXSETSEL, 0, (LPARAM)&sel);
 +					break;
 +
 +				case IDM_SELECTALL:
 +					SendMessage(hView, EM_EXSETSEL, 0, (LPARAM)&all);
 +					break;
 +				}
 +				DestroyMenu(hMenu);
  			}
 -			DestroyMenu(hMenu);
  		}
 -	}
 -	break;
 +		break;
  	case WM_DESTROY:
  		hViewWnd = NULL;
 diff --git a/plugins/HTTPServer/src/Glob.h b/plugins/HTTPServer/src/Glob.h index f64d28d950..2b5fe8e8c3 100644 --- a/plugins/HTTPServer/src/Glob.h +++ b/plugins/HTTPServer/src/Glob.h @@ -21,6 +21,7 @@  #define _CRT_SECURE_NO_DEPRECATE
  #include <windows.h>
 +#include <windowsx.h>
  #include <commctrl.h>
  #include <time.h>
  #include <string>
 diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index 6d092f2251..593b5aa0fd 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -817,9 +817,7 @@ static INT_PTR CALLBACK DlgProcStatsticView(HWND hwndDlg, UINT msg, WPARAM wPara  			if (hMainMenu) {
  				HMENU hMenu = GetSubMenu(hMainMenu, 0);
 -				POINT pt;
 -				pt.x = (short)LOWORD(lParam);
 -				pt.y = (short)HIWORD(lParam);
 +				POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  				if (pt.x == -1 && pt.y == -1) {
  					HWND hMapUser = GetDlgItem(hwndDlg, IDC_CURRENT_SHARES);
  					int nFirst = ListView_GetNextItem(hMapUser, -1, LVNI_FOCUSED);
 @@ -1393,27 +1391,19 @@ void CALLBACK OpenStatisticViewFromPopupProc(ULONG_PTR /* dwParam */) {  	nShowStatisticsView(0, 0);
  }
 -LRESULT CALLBACK PopupWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
 +LRESULT CALLBACK PopupWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 +{
  	PUGetPluginData(hWnd);
 -	//HANDLE hData = (HANDLE)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd, (LPARAM)&hData);
 -	
 -	switch (message) {
 -		//case WM_LBUTTONUP:
 -		//case WM_LBUTTONDBLCLK: // These don't work I can't undestande why !!
 -		case WM_LBUTTONDOWN:
 -			//nShowStatisticsView(0,0);
 -			// has to be called from the right thread
 -			//QueueUserAPC(OpenStatisticViewFromPopupProc, hMainThread, 0);
 -
 -			QueueUserAPC(OpenStatisticViewFromPopupProc, hMainThread, 0);
 -			PUDeletePopup( hWnd );
 -			return 0;
 +	switch (message) {
 +	case WM_LBUTTONDOWN:
 +		QueueUserAPC(OpenStatisticViewFromPopupProc, hMainThread, 0);
 +		PUDeletePopup( hWnd );
 +		return 0;
 -		case WM_CONTEXTMENU: {
 -				PUDeletePopup( hWnd );
 -				return 0;
 -			}
 +	case WM_CONTEXTMENU:
 +		PUDeletePopup( hWnd );
 +		return 0;
  	}
  	return DefWindowProc(hWnd, message, wParam, lParam);
  }
 diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp index bd8e0cdfde..c17b1c5a75 100755 --- a/plugins/Msg_Export/src/FileViewer.cpp +++ b/plugins/Msg_Export/src/FileViewer.cpp @@ -771,7 +771,7 @@ LRESULT CALLBACK EditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa  	{
  		HMENU nMenu = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_FV_EDIT));
  		HMENU nSubMenu = GetSubMenu(nMenu, 0);
 -		POINT pt = { (short)LOWORD(lParam), (short)HIWORD(lParam) };
 +		POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  		if (pt.x == -1 && pt.y == -1) {
  			DWORD dwStart, dwEnd;
 diff --git a/plugins/Msg_Export/src/Glob.h b/plugins/Msg_Export/src/Glob.h index 5b2d9baaa4..e63481959f 100755 --- a/plugins/Msg_Export/src/Glob.h +++ b/plugins/Msg_Export/src/Glob.h @@ -22,6 +22,7 @@  #define _CRT_SECURE_NO_WARNINGS
  #include <Windows.h>
 +#include <windowsx.h>
  #include <Richedit.h>
  using namespace std;
  #include <Shlobj.h>
 diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 50b41fc0cf..299ff0b2dd 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -983,9 +983,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar  		{
  			HMENU hMenu = GetSubMenu(hMainMenu, 0);
 -			POINT pt;
 -			pt.x = (short)LOWORD(lParam);
 -			pt.y = (short)HIWORD(lParam);
 +			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  			if (pt.x == -1 && pt.y == -1)
  			{
  				HWND hMapUser = GetDlgItem(hwndDlg, IDC_MAP_USER_LIST);
 diff --git a/plugins/MyDetails/src/commons.h b/plugins/MyDetails/src/commons.h index f01193972d..735b1751ae 100644 --- a/plugins/MyDetails/src/commons.h +++ b/plugins/MyDetails/src/commons.h @@ -24,6 +24,7 @@ Boston, MA 02111-1307, USA.  #define _CRT_SECURE_NO_WARNINGS
  #include <windows.h>
 +#include <windowsx.h>
  #include <commctrl.h>
  #include <newpluginapi.h>
 diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index 498846efd5..b7718e5048 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -1702,10 +1702,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar  	case WM_CONTEXTMENU:
  		proto = protocols->Get(data->protocol_number);
  		if (proto != NULL) {
 -			POINT p;
 -			p.x = LOWORD(lParam);
 -			p.y = HIWORD(lParam);
 -
 +			POINT p = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  			ScreenToClient(hwnd, &p);
  			data->showing_menu = true;
 diff --git a/plugins/NewAwaySysMod/src/Common.h b/plugins/NewAwaySysMod/src/Common.h index 2c47901ef1..b254e292b9 100644 --- a/plugins/NewAwaySysMod/src/Common.h +++ b/plugins/NewAwaySysMod/src/Common.h @@ -26,6 +26,7 @@  #define MIRANDA_VER 0x0A00
  #include <windows.h>
 +#include <windowsx.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include <malloc.h>
 diff --git a/plugins/NewAwaySysMod/src/ContactList.cpp b/plugins/NewAwaySysMod/src/ContactList.cpp index bdf5564e9a..4d998293d8 100644 --- a/plugins/NewAwaySysMod/src/ContactList.cpp +++ b/plugins/NewAwaySysMod/src/ContactList.cpp @@ -294,9 +294,7 @@ static LRESULT CALLBACK ContactListSubclassProc(HWND hWnd, UINT Msg, WPARAM wPar  	case WM_CONTEXTMENU:
  		{
 -			POINT pt;
 -			pt.x = (short)LOWORD(lParam);
 -			pt.y = (short)HIWORD(lParam);
 +			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  			HTREEITEM hItem = NULL;
  			if (pt.x == -1 && pt.y == -1) {
  				if (dat->SelectedItems.GetSize() == 1) {
 diff --git a/plugins/NewAwaySysMod/src/MsgTree.cpp b/plugins/NewAwaySysMod/src/MsgTree.cpp index 2d4ca2216f..7cc7c12fc8 100644 --- a/plugins/NewAwaySysMod/src/MsgTree.cpp +++ b/plugins/NewAwaySysMod/src/MsgTree.cpp @@ -342,8 +342,8 @@ static LRESULT CALLBACK MsgTreeSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam,  	case WM_CONTEXTMENU:
  		{
  			TVHITTESTINFO ht;
 -			ht.pt.x = (short)LOWORD(lParam);
 -			ht.pt.y = (short)HIWORD(lParam);
 +			ht.pt.x = GET_X_LPARAM(lParam);
 +			ht.pt.y = GET_Y_LPARAM(lParam);
  			TVITEM tvi = { 0 };
  			if (ht.pt.x == -1 && ht.pt.y == -1) { // use selected item 
  				if (tvi.hItem = TreeView_GetSelection(hWnd)) {
 diff --git a/plugins/Ping/src/common.h b/plugins/Ping/src/common.h index 69853c41bd..2bcf3b286a 100644 --- a/plugins/Ping/src/common.h +++ b/plugins/Ping/src/common.h @@ -5,6 +5,7 @@  #define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
  #include <windows.h>
 +#include <windowsx.h>
  #include <winsock.h>
  #include <shellapi.h>
  #include <commdlg.h>
 diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index 050c81f587..49b689b56c 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -452,7 +452,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar  		HMENU menu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_MENU1)),
  			submenu = GetSubMenu(menu, 0);
 -		POINT pt = { LOWORD(context_point), HIWORD(context_point) };
 +		POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  		RECT r;
  		GetClientRect(list_hwnd, &r);
 diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index 9c0d2e7c6a..a66f2b3398 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -681,8 +681,8 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR  			ClientToScreen(hwnd, &pt);
  		}
  		else {
 -			pt.x = (short)LOWORD(lParam);
 -			pt.y = (short)HIWORD(lParam);
 +			pt.x = GET_X_LPARAM(lParam);
 +			pt.y = GET_Y_LPARAM(lParam);
  		}
  		ptl.x = (LONG)pt.x;
  		ptl.y = (LONG)pt.y;
 @@ -873,8 +873,8 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,  			int height = 0;
  			TVHITTESTINFO hti;
 -			hti.pt.x = (short)LOWORD(lParam);
 -			hti.pt.y = (short)HIWORD(lParam);
 +			hti.pt.x = GET_X_LPARAM(lParam);
 +			hti.pt.y = GET_Y_LPARAM(lParam);
  			if (hti.pt.x == -1 && hti.pt.y == -1) {
  				int index = SendMessage(hwnd, LB_GETCURSEL, 0, 0);
  				int top = SendMessage(hwnd, LB_GETTOPINDEX, 0, 0);
 @@ -1560,8 +1560,8 @@ LABEL_SHOWWINDOW:  		break;
  	case GC_SHOWCOLORCHOOSER:
 -		pci->ColorChooser(si, lParam == IDC_CHAT_COLOR, hwndDlg, GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), GetDlgItem(hwndDlg, lParam)); -		break; +		pci->ColorChooser(si, lParam == IDC_CHAT_COLOR, hwndDlg, GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), GetDlgItem(hwndDlg, lParam));
 +		break;
  	case GC_SCROLLTOBOTTOM:
  		if ((GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CHAT_LOG), GWL_STYLE) & WS_VSCROLL) != 0) {
 diff --git a/plugins/Scriver/src/commonheaders.h b/plugins/Scriver/src/commonheaders.h index 159a5b9f45..bd5432906c 100644 --- a/plugins/Scriver/src/commonheaders.h +++ b/plugins/Scriver/src/commonheaders.h @@ -29,6 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  #define COMPILE_MULTIMON_STUBS
  #include <windows.h>
 +#include <windowsx.h>
  #include <shellapi.h>
  #include <shlobj.h>
  #include <shlwapi.h>
 diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp index 2d9ffc91bc..81c3b5c8d7 100644 --- a/plugins/Scriver/src/input.cpp +++ b/plugins/Scriver/src/input.cpp @@ -59,8 +59,8 @@ void InputAreaContextMenu(HWND hwnd, WPARAM, LPARAM lParam, MCONTACT hContact)  		ClientToScreen(hwnd, &pt);
  	}
  	else {
 -		pt.x = (short)LOWORD(lParam);
 -		pt.y = (short)HIWORD(lParam);
 +		pt.x = GET_X_LPARAM(lParam);
 +		pt.y = GET_Y_LPARAM(lParam);
  	}
  	// First notification
 diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index d63998067b..acb56dad6c 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -318,8 +318,8 @@ static LRESULT CALLBACK LogEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,  			ClientToScreen(hwnd, &pt);
  		}
  		else {
 -			pt.x = (short)LOWORD(lParam);
 -			pt.y = (short)HIWORD(lParam);
 +			pt.x = GET_X_LPARAM(lParam);
 +			pt.y = GET_Y_LPARAM(lParam);
  		}
  		POINTL ptl = { (LONG)pt.x, (LONG)pt.y };
 diff --git a/plugins/SimpleStatusMsg/src/commonheaders.h b/plugins/SimpleStatusMsg/src/commonheaders.h index 150982a42f..be3c7fc63a 100644 --- a/plugins/SimpleStatusMsg/src/commonheaders.h +++ b/plugins/SimpleStatusMsg/src/commonheaders.h @@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,  #define _CRT_SECURE_NO_WARNINGS
  #include <windows.h>
 +#include <windowsx.h>
  #include <time.h>
  #include <newpluginapi.h>
 diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index ca7ef4f2b0..ade1d75271 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -501,7 +501,7 @@ static LRESULT CALLBACK EditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L  	switch (uMsg) {  	case WM_CONTEXTMENU:  		{ -			POINT pt = {(LONG)LOWORD(lParam), (LONG)HIWORD(lParam)}; +			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  			RECT rc;  			GetClientRect(hwndDlg, &rc); diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index d3e4b3be7b..002390a220 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -30,7 +30,7 @@ static LRESULT CALLBACK OptEditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam  	switch (uMsg) {
  	case WM_CONTEXTMENU:
  		{
 -			POINT pt = {(LONG)LOWORD(lParam), (LONG)HIWORD(lParam)};
 +			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  			RECT rc;
  			GetClientRect(hwndDlg, &rc);
 diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index b65c6b9c76..917c3266c3 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -1527,8 +1527,8 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,  			SESSION_INFO *parentdat = dat->si;  			int height = 0; -			hti.pt.x = (short)LOWORD(lParam); -			hti.pt.y = (short)HIWORD(lParam); +			hti.pt.x = GET_X_LPARAM(lParam); +			hti.pt.y = GET_Y_LPARAM(lParam);  			if (hti.pt.x == -1 && hti.pt.y == -1) {  				int index = SendMessage(hwnd, LB_GETCURSEL, 0, 0);  				int top = SendMessage(hwnd, LB_GETTOPINDEX, 0, 0); diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 9ac5c0578a..2367fc9d6c 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -540,8 +540,8 @@ static LRESULT CALLBACK MessageLogSubclassProc(HWND hwnd, UINT msg, WPARAM wPara  			ClientToScreen(hwnd, &pt);
  		}
  		else {
 -			pt.x = (short)LOWORD(lParam);
 -			pt.y = (short)HIWORD(lParam);
 +			pt.x = GET_X_LPARAM(lParam);
 +			pt.y = GET_Y_LPARAM(lParam);
  		}
  		ShowPopupMenu(mwdat, IDC_LOG, hwnd, pt);
 @@ -790,8 +790,8 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar  			ClientToScreen(hwnd, &pt);
  		}
  		else {
 -			pt.x = (short)LOWORD(lParam);
 -			pt.y = (short)HIWORD(lParam);
 +			pt.x = GET_X_LPARAM(lParam);
 +			pt.y = GET_Y_LPARAM(lParam);
  		}
  		ShowPopupMenu(mwdat, IDC_MESSAGE, hwnd, pt);
 diff --git a/plugins/WhenWasIt/src/commonheaders.h b/plugins/WhenWasIt/src/commonheaders.h index 3434e38223..a0435abcc1 100644 --- a/plugins/WhenWasIt/src/commonheaders.h +++ b/plugins/WhenWasIt/src/commonheaders.h @@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  #define _CRT_NON_CONFORMING_SWPRINTFS
  #include <windows.h>
 +#include <windowsx.h>
  #include <time.h>
  #include <math.h>
  #include <commctrl.h>
 diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index c07570e24b..1f9ae0e06f 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -640,7 +640,6 @@ int UpdateBirthdayEntry(HWND hList, MCONTACT hContact, int entry, int bShowAll,  static LRESULT CALLBACK BirthdaysListSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
  {
  	LVITEM item = { 0 };
 -	POINT pt = { 0 };
  	MCONTACT hContact;
  	int i, count;
 @@ -670,8 +669,7 @@ static LRESULT CALLBACK BirthdaysListSubclassProc(HWND hWnd, UINT msg, WPARAM wP  		break;
  	case WM_CONTEXTMENU:
 -		pt.x = (short)LOWORD(lParam);
 -		pt.y = (short)HIWORD(lParam);
 +		POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  		count = ListView_GetItemCount(hWnd);
  		item.mask = LVIF_PARAM;
  		for (i = 0; i < count; i++) {
 diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index 9170ca9af2..f08a71bcf3 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -1599,8 +1599,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR  		if (GetWindowLongPtr((HWND)wParam, GWLP_ID) == IDC_LISTHEADERS)	{  			//MessageBox(0,"LISTHEADERS","Debug",0);  			HWND hList = GetDlgItem(hDlg, IDC_LISTHEADERS); -			POINT pt = { (signed short)LOWORD(lParam), (signed short)HIWORD(lParam) }; -			HTREEITEM hItem = 0; +			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  			if (pt.x == -1) pt.x = 0;  			if (pt.y == -1) pt.y = 0;  			if (int numRows = ListView_GetItemCount(hList)) { @@ -2385,8 +2384,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR  		if (GetWindowLongPtr((HWND)wParam, GWLP_ID) == IDC_LISTMAILS)	{  			//MessageBox(0,"LISTHEADERS","Debug",0);  			HWND hList = GetDlgItem(hDlg, IDC_LISTMAILS); -			POINT pt = { (signed short)LOWORD(lParam), (signed short)HIWORD(lParam) }; -			HTREEITEM hItem = 0; +			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  			if (pt.x == -1) pt.x = 0;  			if (pt.y == -1) pt.y = 0;  			if (int numRows = ListView_GetItemCount(hList)) { diff --git a/plugins/YAMN/src/yamn.h b/plugins/YAMN/src/yamn.h index b3c85d73d4..5e3f80b0f9 100644 --- a/plugins/YAMN/src/yamn.h +++ b/plugins/YAMN/src/yamn.h @@ -6,6 +6,7 @@  #define VC_EXTRALEAN
  #include <windows.h>
 +#include <windowsx.h>
  #include <commctrl.h>
  #include <win2k.h>
 diff --git a/plugins/YAPP/src/common.h b/plugins/YAPP/src/common.h index fa72b992d5..f1305489f0 100644 --- a/plugins/YAPP/src/common.h +++ b/plugins/YAPP/src/common.h @@ -10,6 +10,7 @@  #define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
  #include <windows.h>
 +#include <windowsx.h>
  #include <commctrl.h>
  #include <time.h>
  #include <malloc.h>
 diff --git a/plugins/YAPP/src/yapp_history_dlg.cpp b/plugins/YAPP/src/yapp_history_dlg.cpp index 5b3b8d7bf9..04d9eae3a3 100644 --- a/plugins/YAPP/src/yapp_history_dlg.cpp +++ b/plugins/YAPP/src/yapp_history_dlg.cpp @@ -518,15 +518,14 @@ static LRESULT CALLBACK PopupsListSubclassProc(HWND hWnd, UINT msg, WPARAM wPara  	switch (msg) {
  	case WM_CONTEXTMENU:
  		{
 -			int x = LOWORD(lParam);
 -			int y = HIWORD(lParam);
 +			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  			int selection;		
  			HMENU hMenu = CreatePopupMenu();
  			AppendMenu(hMenu, MF_STRING, POPUPMENU_TITLE, TranslateT("Copy title to clipboard"));
  			AppendMenu(hMenu, MF_STRING, POPUPMENU_MESSAGE, TranslateT("Copy message to clipboard"));
  			AppendMenu(hMenu, MF_STRING, POPUPMENU_TIMESTAMP, TranslateT("Copy timestamp to clipboard"));
 -			selection = TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, x, y, 0, hWnd, NULL);
 +			selection = TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, hWnd, NULL);
  			DestroyMenu(hMenu);
  			if (selection)
  			{
 diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index e15a37a8c5..db1e38287b 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -1030,7 +1030,7 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)  	case WM_CONTEXTMENU:
  		if (GetWindowLongPtr((HWND)wParam, GWL_ID) == IDC_TREE_DISCO) {
  			HWND hwndList = (HWND)wParam;
 -			POINT pt = { (signed short)LOWORD(lParam), (signed short)HIWORD(lParam) };
 +			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  			if ((pt.x == -1) && (pt.y == -1)) {
  				LVITEM lvi = { 0 };
 diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index fd26224e29..68a08b7449 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -498,7 +498,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa  	case WM_CONTEXTMENU:  		if (GetWindowLongPtr((HWND)wParam, GWL_ID) == IDC_TV_INFO) {  			HWND hwndTree = GetDlgItem(hwndDlg, IDC_TV_INFO); -			POINT pt = { (signed short)LOWORD(lParam), (signed short)HIWORD(lParam) }; +			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  			HTREEITEM hItem = 0;  			if ((pt.x == -1) && (pt.y == -1)) { diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h index 2c28b7e3aa..2cb3572586 100644 --- a/protocols/JabberG/src/stdafx.h +++ b/protocols/JabberG/src/stdafx.h @@ -37,6 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.   * Global header files
   *******************************************************************/
  #include <windows.h>
 +#include <windowsx.h>
  #include <commctrl.h>
  #include <uxtheme.h>
  #include <richedit.h>
 diff --git a/src/core/stdchat/src/chat.h b/src/core/stdchat/src/chat.h index 463b56061b..61ddc2bd03 100644 --- a/src/core/stdchat/src/chat.h +++ b/src/core/stdchat/src/chat.h @@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  #include <shlobj.h>
  #include <windows.h>
 +#include <windowsx.h>
  #include <commctrl.h>
  #include <richedit.h>
  #include <ole2.h>
 diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index 3e486387a2..3a7969746e 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -1075,8 +1075,8 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,  	case WM_CONTEXTMENU:
  		TVHITTESTINFO hti;
  		{
 -			hti.pt.x = (short)LOWORD(lParam);
 -			hti.pt.y = (short)HIWORD(lParam);
 +			hti.pt.x = GET_X_LPARAM(lParam);
 +			hti.pt.y = GET_Y_LPARAM(lParam);
  			if (hti.pt.x == -1 && hti.pt.y == -1) {
  				int index = SendMessage(hwnd, LB_GETCURSEL, 0, 0);
  				int top = SendMessage(hwnd, LB_GETTOPINDEX, 0, 0);
 diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index 044e579b1a..6e10794f1e 100644 --- a/src/modules/clist/clc.cpp +++ b/src/modules/clist/clc.cpp @@ -1234,7 +1234,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,  		if (!dat->filterSearch)
  			dat->szQuickSearch[0] = 0;
  		{
 -			POINT pt = { (short)LOWORD(lParam), (short)HIWORD(lParam) };
 +			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  			if (pt.x == -1 && pt.y == -1) {
  				dat->selection = cli.pfnGetRowByIndex(dat, dat->selection, &contact, NULL);
  				if (dat->selection != -1)
 diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index c330fdc95f..50a3b3f8d6 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -921,9 +921,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM  	case WM_CONTEXTMENU:
  		{
  			// x/y might be -1 if it was generated by a kb click
 -			POINT pt;
 -			pt.x = (short) LOWORD(lParam);
 -			pt.y = (short) HIWORD(lParam);
 +			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  			RECT rc;
  			GetWindowRect(cli.hwndContactTree, &rc);
 diff --git a/src/modules/findadd/findadd.cpp b/src/modules/findadd/findadd.cpp index 9ac78eee80..f031259d37 100644 --- a/src/modules/findadd/findadd.cpp +++ b/src/modules/findadd/findadd.cpp @@ -801,7 +801,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP  	case WM_CONTEXTMENU:  		{ -			POINT pt = { LOWORD(lParam), HIWORD(lParam) }; +			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  			LVHITTESTINFO lvhti;  			lvhti.pt = pt; diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp index 7e1c34b770..10968a73b2 100644 --- a/src/modules/protocols/protoopts.cpp +++ b/src/modules/protocols/protoopts.cpp @@ -688,10 +688,10 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM  	case WM_CONTEXTMENU:
  		if (GetWindowLongPtr((HWND)wParam, GWL_ID) == IDC_ACCLIST) {
 -			POINT pt = { (signed short)LOWORD(lParam), (signed short)HIWORD(lParam) };
 +			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  			int iItem = ListBox_GetCurSel(hwndList);
 -			if ((pt.x == -1) && (pt.y == -1)) {
 +			if (pt.x == -1 && pt.y == -1) {
  				if (iItem != LB_ERR) {
  					RECT rc;
  					ListBox_GetItemRect(hwndList, iItem, &rc);
 diff --git a/src/modules/skin/hotkey_opts.cpp b/src/modules/skin/hotkey_opts.cpp index 6a71702630..4c04405e09 100644 --- a/src/modules/skin/hotkey_opts.cpp +++ b/src/modules/skin/hotkey_opts.cpp @@ -664,7 +664,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,  	case WM_CONTEXTMENU:  		if (GetWindowLongPtr((HWND)wParam, GWL_ID) == IDC_LV_HOTKEYS) {  			HWND hwndList = (HWND)wParam; -			POINT pt = { (signed short)LOWORD(lParam), (signed short)HIWORD(lParam) }; +			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
  			LVITEM lvi = {0};  			THotkeyItem *item = NULL;  | 
