Home > database >  How to use the send function to trigger the display images in the PB powertiptext
How to use the send function to trigger the display images in the PB powertiptext

Time:09-19

In the original concept picture controls, there is a powertiptext properties, when the mouse moves to the image to stay for a few seconds, the system will automatically display in the form of tip powertiptext attributes defined in the content, want to ask you, if you don't move the mouse to the picture, but by other code, click on another button, for example, triggers the clicked event, in the clicked event programming to realize the above effect, how to do things, send function or is there any way to achieve this, hope everybody glad, qian er thanks ~ \ (≧ ≦)/~ la la la

CodePudding user response:

Can realize ` because Windows is message mechanism drive ` pb is certainly `
Corresponding which message id you want to check the specific ` through the handle to get photo, send a message in the past.

CodePudding user response:

Simulate the mouse button, mouse_event, was used to simulate mouse go up with respect to Ok?

CodePudding user response:

reference 1st floor jornye response:
can realize ` because Windows is message mechanism drive ` pb is certainly `
Corresponding which message id you want to check the specific ` through the handle to get photo, send a message in the past.

Just don't know is which, which parameters, to consult, master looked glad

CodePudding user response:

refer to the second floor lzp_lrp response:
simulate mouse buttons, use mouse_event, don't simulate mouse with respect to Ok?

Hope ace glad, said the detailed specifically, how to write code

CodePudding user response:

reference 4 floor scyawz response:
Quote: refer to the second floor lzp_lrp response:

Simulate the mouse button, mouse_event, was used to simulate mouse go up with respect to Ok?

Hope ace glad, said the detailed specifically, how to write code


You put the mouse on the button manually, will display powertiptext, you study mouse_event, simulation of moving the mouse to the button, and then and manual shift effect is the same, no?

CodePudding user response:

Mouse_event () to simulate mouse operation

In test automation development, there are some controls ID are hard to find, so some time, we set the location of the mouse directly, and then use the click event, will receive a very good effect, a mouse_event the Windows API function ready for us all,
This function in user32. DLL this library file, we can in the C: \ WINDOWS \ system32 (XP) this directory to find the file, he is the own system, we use the API in C # call this file directly for example of how the mouse operation, the first statement in our C # reference, if it is a program based on the From, the location of the statement written in the From of your class can
[System. The Runtime. InteropServices. DllImport (" user32 ")]
Private static extern int mouse_event (int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
The parameter meaning
DwFlags Long, one of the symbols in the table below, or a combination of them
Dx, dy Long, according to the MOUSEEVENTF_ABSOLUTE logo, specify the x, y direction of the absolute or relative location
CButtons Long, don't use the
DwExtraInfo Long, don't use the
DwFlags constant meaning
Const int MOUSEEVENTF_MOVE=0 x0001; Move the mouse
Const int MOUSEEVENTF_LEFTDOWN=0 x0002; Simulate the left mouse button press
Const int MOUSEEVENTF_LEFTUP=0 x0004; Simulation of mouse lift
Const int MOUSEEVENTF_RIGHTDOWN=0 x0008; To simulate the right mouse button press
Const int MOUSEEVENTF_RIGHTUP=0 x0010; Simulate the right mouse button to lift
Const int MOUSEEVENTF_MIDDLEDOWN=0 x0020; To simulate the middle mouse button press
Const int MOUSEEVENTF_MIDDLEUP=0 x0040; To simulate the middle mouse button up the
Const int MOUSEEVENTF_ABSOLUTE=0 x8000; Marked using the absolute coordinates
We can directly call mouse_event function in the program of
Mouse_event (MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, 500, 500, 0, 0).
1, here is the left mouse button press and release the combination of the two events is a single click:
Mouse_event (MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
Vb use
Mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
2, to simulate the right mouse button click event:
Mouse_event (MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0)
VB use
Mouse_event MOUSEEVENTF_RIGHTDOWN Or MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0
3, two consecutive mouse the left key click constitute a mouse click events:
Mouse_event (MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
Mouse_event (MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
4, the use of absolute coordinates
MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, 500, 500, 0, 0
To be sure, if there is no use MOUSEEVENTF_ABSOLUTE, function of default is relative to the current mouse position, if dx, dy, and expressed with 0, 0, the function that is presently the mouse point,
5, set the absolute coordinates directly and click
Mouse_event (65536/768, 65536/1024 MOUSEEVENTF_LEFTDOWN, X * Y *, 0, 0).
Mouse_event (65536/768, 65536/1024 MOUSEEVENTF_LEFTUP, X * Y *, 0, 0).
The X, Y are you want to click on the point of abscissa and ordinate

CodePudding user response:

reference 5 floor lzp_lrp reply:
Quote: refer to 4th floor scyawz response:

Quote: refer to the second floor lzp_lrp response:

Simulate the mouse button, mouse_event, was used to simulate mouse go up with respect to Ok?

Hope ace glad, said the detailed specifically, how to write code


You put the mouse on the button manually, will display powertiptext, you study mouse_event, simulation of moving the mouse to the button, and then and manual shift effect is the same, no?


Thanks for ace patient directions, you give methods can be solved using setcursorpos such an API function, but the problem is, I think in the mouse to click tree graph nodes, the automatic display on the picture beside tip, the cursor position is still in I click on the tree graph node position, don't make any move, especially, how to

CodePudding user response:

Oneself use API function to draw a like tip box in that location
  • Related