![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
|
|
#1
|
|||
|
|||
|
Por si le interesa a alguno en esta pagina
http://www.ajpdsoft.com/modules.php?...rticle&sid=261 explica con detalle el tema de crear una dll Voy a crear la dll y a ver si consigo anular el boton derecho del mouse. Gracias |
|
#2
|
|||
|
|||
|
He seguido paso a paso lo que indica la web siguiente para detectar el boton derecho del mouse.
http://www.eksperten.dk/spm/840406 Lo he ejecutado en delphi y cuando pulso el boton derecho hace un beep tal y como indica el codigo de programa if Msg = WM_RBUTTONDOWN then MessageBeep(1); Ahora bien, lo que deseo no es un beep sino que no muestre el desplegable de las opciones del menú cuando se presione boton derecho del mouse. He intentado poner result:=-1; e incluso result:=-1; exit; y tambien comentando la linea Result := CallNextHookEx(HookHandle, Code, Msg, MouseHook); y no me resulta. Se me queda el PC colgado y el reloj del mouse dando vueltas indefinidamente. El trozo de código que debería modificar seria : begin { If the value of Code is less than 0, we are not allowed to do anything except pass it on to the next hook procedure immediately. } if Code >= 0 then begin { This example does nothing except beep when the right mouse button is pressed. } if Msg = WM_RBUTTONDOWN then MessageBeep(1); { If you handled the situation, and don't want Windows to process the message, do *NOT* execute the next line. Be very sure this is what want, though. If you don't pass on stuff like WM_MOUSEMOVE, you will NOT like the results you get. } Result := CallNextHookEx(HookHandle, Code, Msg, MouseHook); end else Result := CallNextHookEx(HookHandle, Code, Msg, MouseHook); end; Alguien sabe que debo hacer ![]() Graciass |
|
#3
|
|||
|
|||
|
he intentado hacerlo simulando un click de raton para que desapareciera el menú que sale cuando pulsamos boton iderecho pero no funciona ya que me hace constantes clicks automaticos y se me termina bloqueando.
if Code >= 0 then begin { This example does nothing except beep when the right mouse button is pressed. } if Msg = WM_RBUTTONDOWN then MessageBeep(1); // simular pulsar boton izquierdo mouse mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); { If you handled the situation, and don't want Windows to process the message, do *NOT* execute the next line. Be very sure this is what want, though. If you don't pass on stuff like WM_MOUSEMOVE, you will NOT like the results you get. } Result := CallNextHookEx(HookHandle, Code, Msg, MouseHook); end else Result := CallNextHookEx(HookHandle, Code, Msg, MouseHook); |
|
#4
|
|||
|
|||
|
Lo solucione sacando un messagebox. No es como yo queria....pero buenoooo.
if Code >= 0 then begin { This example does nothing except beep when the right mouse button is pressed. } if Msg = WM_RBUTTONDOWN then // MessageBeep(1); ShowMessage('Boton derecho del ratón deshabilitado'); // simular pulsar boton izquierdo mouse //mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); //mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); { If you handled the situation, and don't want Windows to process the message, do *NOT* execute the next line. Be very sure this is what want, though. If you don't pass on stuff like WM_MOUSEMOVE, you will NOT like the results you get. } Result := CallNextHookEx(HookHandle, Code, Msg, MouseHook); end else Result := CallNextHookEx(HookHandle, Code, Msg, MouseHook); |
![]() |
|
|
|