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:
parent
34d3049360
commit
0ba99b10e6
@ -3953,17 +3953,17 @@ LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam
|
|||||||
|
|
||||||
#ifdef _SHELL_FOLDERS
|
#ifdef _SHELL_FOLDERS
|
||||||
case WM_CONTEXTMENU: {
|
case WM_CONTEXTMENU: {
|
||||||
|
POINT pt, pt_clnt;
|
||||||
Pane* pane;
|
Pane* pane;
|
||||||
int idx;
|
int idx;
|
||||||
|
|
||||||
/* first select the current item in the listbox */
|
/* first select the current item in the listbox */
|
||||||
HWND hpanel = (HWND) wparam;
|
HWND hpanel = (HWND) wparam;
|
||||||
POINT pt;
|
pt_clnt.x = pt.x = (short)LOWORD(lparam);
|
||||||
pt.x = (short)LOWORD(lparam);
|
pt_clnt.y = pt.y = (short)HIWORD(lparam);
|
||||||
pt.y = (short)HIWORD(lparam);
|
ScreenToClient(hpanel, &pt_clnt);
|
||||||
ScreenToClient(hpanel, &pt);
|
SendMessage(hpanel, WM_LBUTTONDOWN, 0, MAKELONG(pt_clnt.x, pt_clnt.y));
|
||||||
SendMessage(hpanel, WM_LBUTTONDOWN, 0, MAKELONG(pt.x, pt.y));
|
SendMessage(hpanel, WM_LBUTTONUP, 0, MAKELONG(pt_clnt.x, pt_clnt.y));
|
||||||
SendMessage(hpanel, WM_LBUTTONUP, 0, MAKELONG(pt.x, pt.y));
|
|
||||||
|
|
||||||
/* now create the popup menu using shell namespace and IContextMenu */
|
/* now create the popup menu using shell namespace and IContextMenu */
|
||||||
pane = GetFocus()==child->left.hwnd? &child->left: &child->right;
|
pane = GetFocus()==child->left.hwnd? &child->left: &child->right;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user