Home > Software engineering >  The problem of standard mouse drag and drop
The problem of standard mouse drag and drop

Time:01-30

Assumes that there is a source window, referred to as "Win_S, to drag the left mouse button to the purpose of the window, referred to as" Win_D, other Windows on the desktop and location, referred to as "Win_O, shape of the mouse cursor (cursor), if it is window Win_D into the purpose, the cursor shape Cursor_OK for short, if it is other Windows Win_O Win_S) (include the source window, the cursor shape Cursor_NO for short, is no drag and drop the normal shape of the mouse cursor Cursor_Normal for short,
The question now is: after the occurrence of drag, 1, if not in the Win_S caught the mouse, then remove Win_S Win_S can't detect the mouse (including mouse to Win_D and Win_O) after the mouse left key release (pop) message, the cursor back to Cursor_Normal; 2, if caught the mouse in the Win_S, although this can be in the left mouse button in any position to release (pop) recovery after the cursor shape Cursor_Normal, but in this case, the drag during other Windows (Win_D and Win_O), is not in response to the mouse message, Win_D in also cannot respond to events, according to the drag and drop the
This dilemma should be a standard mouse drag across the window, put the typical problems in the operation, please friends provide some help to solve the problem of similar,

CodePudding user response:

Window with the mouse to leave message, just need to manually response

CodePudding user response:

reference 1st floor gz_qmc response:
message window has the mouse left, just need to manually response

For Win_S source window, in response to the mouse left message can't meet the requirements, because the mouse left Win_S, drag and drop action is not over yet, the mouse may be in the condition of drag into Win_D or Win_O, may also to Win_S, release (click pop-up) only in the mouse, drag the end of the event is,

CodePudding user response:

refer to the second floor of binary head response:
Quote: refer to 1st floor gz_qmc response:
message window has the mouse left, just need to manually response

For Win_S source window, in response to the mouse left message can't meet the requirements, because the mouse left Win_S, drag and drop action is not over yet, the mouse may be in the condition of drag into Win_D or Win_O, may also to Win_S, release (click pop-up) only in the mouse, drag the end of the event is,


You really need is a global variable operating
And reloading the main frame of PreTranslateMessage to manipulate

CodePudding user response:

reference gz_qmc reply: 3/f
Quote: refer to the second floor of binary head response:
Quote: refer to 1st floor gz_qmc response:
leave message window has the mouse, just need to manually response

For Win_S source window, in response to the mouse left message can't meet the requirements, because the mouse left Win_S, drag and drop action is not over yet, the mouse may be in the condition of drag into Win_D or Win_O, may also to Win_S, release (click pop-up) only in the mouse, drag the end of the event is,


You really need is a global variable operating
And reloading the main frame of PreTranslateMessage to manipulate


Overloading is a main frame PreTranslateMessage that feasible, the mouse drag and drop, there may be removed from the scope of the main frame window namely Win_O, in front of the release end (drag), drag the source window can still respond to the news release, of course, this is an unsuccessful drag and drop,

CodePudding user response:

OLE drag and drop


CodePudding user response:

reference 5 floor zgl7903 reply:
OLE drag and drop

Good, I also search the Internet to use OLE drag and drop, study, and see if I can meet the requirements of I,
  • Related