The call to ScreenToClient() changes the content of the 'pt' variable,

so it can't be used for the following ShellFolderContextMenu() call.
This commit is contained in:
Martin Fuchs 2005-05-19 14:22:51 +00:00 committed by Alexandre Julliard
parent 34d3049360
commit 0ba99b10e6
1 changed files with 6 additions and 6 deletions

View File

@ -3953,17 +3953,17 @@ LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam
#ifdef _SHELL_FOLDERS
case WM_CONTEXTMENU: {
POINT pt, pt_clnt;
Pane* pane;
int idx;
/* first select the current item in the listbox */
HWND hpanel = (HWND) wparam;
POINT pt;
pt.x = (short)LOWORD(lparam);
pt.y = (short)HIWORD(lparam);
ScreenToClient(hpanel, &pt);
SendMessage(hpanel, WM_LBUTTONDOWN, 0, MAKELONG(pt.x, pt.y));
SendMessage(hpanel, WM_LBUTTONUP, 0, MAKELONG(pt.x, pt.y));
pt_clnt.x = pt.x = (short)LOWORD(lparam);
pt_clnt.y = pt.y = (short)HIWORD(lparam);
ScreenToClient(hpanel, &pt_clnt);
SendMessage(hpanel, WM_LBUTTONDOWN, 0, MAKELONG(pt_clnt.x, pt_clnt.y));
SendMessage(hpanel, WM_LBUTTONUP, 0, MAKELONG(pt_clnt.x, pt_clnt.y));
/* now create the popup menu using shell namespace and IContextMenu */
pane = GetFocus()==child->left.hwnd? &child->left: &child->right;