My girlfriend used to like playing "bubble Bubbles" very much. Later, I had to play with my scalp and gradually get used to playing with her. The time when I lost her was naturally very painful. However, I just don't like to do anything. I have always been "passive", so I can face her departure rationally.
It's too far away. Don't drop the eggs!
The following code is compiled in vc6.0 + XP SP2. If you have any questions, contact me via email or QQ to enhance mutual communication!
1. Search for the window first
Hwndhwnd =: findwindow (null, _ T ("bubble Hall"); <br/> If (! Hwnd) <br/>{< br/> MessageBox ("Run the main program"); <br/> return; <br/>}
2. Use postmessage
Postmessage is used only because the message is put into the message queue. If you are not sure when and whether to process the message, the message will be returned immediately after execution;
The sendmessage will not continue until the return code (DWORD type) is processed by the message. It will not return until the message is processed.
Simulate keyboard buttons and mouse clicking events (go offline in the background without activating the window)
The code for kicking people in the bubble room is as follows:
Void cmfcdlg: clickall () <br/>{< br/> // todo: add your control notification handler code here <br/> hwnd =: findwindow (null, _ T ("bubble Hall"); <br/> If (hwnd) <br/>{< br/> // location 1 <br/> :: postmessage (hwnd, wm_mousemove, mk_lbutton, makelong (75,140); <br/>: postmessage (hwnd, wm_lbuttondown, mk_lbutton, makelparam (75,140); <br/> :: postmessage (hwnd, wm_lbuttonup, mk_lbutton, makelparam (75,140); </P> <p> // Location 2 <br/>: postmessage (hwnd, wm_mousemove, mk_lbutton, makelong (180,140); <br/>: postmessage (hwnd, wm_lbuttondown, mk_lbutton, makelparam (180,140); <br/>: postmessage (hwnd, wm_lbuttonup, mk_lbutton, makelparam (180,140); <br/>: postmessage (hwnd, wm_mousemove, mk_lbutton, makelong (350,400); <br/>: postmessage (hwnd, wm_lbuttondown, mk_lbutton, makelparam (350,400); <br/>: postmessage (hwnd, wm_lbuttonup, mk_lbutton, makelparam (350,400 )); </P> <p> // location 3 <br/>: postmessage (hwnd, wm_mousemove, mk_lbutton, makelong (285,140); <br/> :: postmessage (hwnd, wm_lbuttondown, mk_lbutton, makelparam (285,140); <br/>: postmessage (hwnd, wm_lbuttonup, mk_lbutton, makelparam (285,140 )); </P> <p> // location 4 <br/>: postmessage (hwnd, wm_mousemove, mk_lbutton, makelong (390,140); <br/> :: postmessage (hwnd, wm_lbuttondown, mk_lbutton, makelparam (390,140); <br/>: postmessage (hwnd, wm_lbuttonup, mk_lbutton, makelparam (390,140 )); </P> <p> // Location 5 <br/>: postmessage (hwnd, wm_mousemove, mk_lbutton, makelong (75,280); <br/> :: postmessage (hwnd, wm_lbuttondown, mk_lbutton, makelparam (75,280); <br/>: postmessage (hwnd, wm_lbuttonup, mk_lbutton, makelparam (75,280 )); </P> <p> // Location 6 <br/>: postmessage (hwnd, wm_mousemove, mk_lbutton, makelong (180,280); <br/> :: postmessage (hwnd, wm_lbuttondown, mk_lbutton, makelparam (180,280); <br/>: postmessage (hwnd, wm_lbuttonup, mk_lbutton, makelparam (180,280 )); </P> <p> // location 7 <br/>: postmessage (hwnd, wm_mousemove, mk_lbutton, makelong (285,280); <br/> :: postmessage (hwnd, wm_lbuttondown, mk_lbutton, makelparam (285,280); <br/>: postmessage (hwnd, wm_lbuttonup, mk_lbutton, makelparam (285,280 )); </P> <p> // Location 8 <br/>: postmessage (hwnd, wm_mousemove, mk_lbutton, makelong (390,280); <br/> :: postmessage (hwnd, wm_lbuttondown, mk_lbutton, makelparam (390,280); <br/>: postmessage (hwnd, wm_lbuttonup, mk_lbutton, makelparam (390,280 )); <br/>}< br/>
3. The above is the code for automatically kicking people. The key is to simulate the code for mouse clicks. Makelong (x, y)
This is the relative position of the mouse in the window. It was also found after I checked it on msdn for a long time and consulted many friends.
As a result, I made an auxiliary tool (the window does not need to be activated offline). The main functions include automatic kicking and advertisement screen flushing, as shown below:
Gadgets. You can use them yourself .....
Postscript: for example, for the popular overseas shopping box and hot323, this is a relatively old script plug-in. It is enough to think about this function, so if you really want to write such plug-ins, you can imagine the amount of code .........