Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Minor Menu Problem
#1
I made a macro so that when I hit Ctrl+RightClick , a menu comes up with sites that I mostly go to, When I hit the hotkey #CR it works great on the desktop, but when I do it in another window, QM pops up, with no error messages and the menu still shows, I am just wondering why it does that and how do I stop Qm from coming up like that? :?

For Example :
If I go to a site like google and hit the hotkey while the google window is activated, Qm will pop up but the menu still shows, and no errors are found. Sorry if there is a post like this already but I tried the search button and couldn't find any matches.

Thanks,
~TwizzY~
#2
Could you post your menu code on here? It could have something to do with how you set up the menu.
Taking on Quick Macros one day at a time
#3
It shouldn't.

What web browser it is? How in other windows? How with other triggers (mouse triggers, hotkey triggers)? What Windows version? What QM version?

If QM window is hidden, does it pop up anyway?
#4
Assistant :

Code:
Copy      Help
>Video
&YouTube :run "iexplore.exe" "www.youtube.com"
<
&Google :run "iexplore.exe" "www.google.com"
I shortened the original code because I wanted to make it readable :wink:

Gintaras :

What web browser it is? IE 7

How in other windows? Acts like there is an error (Qm pops up and no errors are disaplyed)

How with other triggers (mouse triggers, hotkey triggers)? Combination of both (Ctrl+Right Click)

What Windows version? XP

What QM version? 2.1.8

If QM window is hidden, does it pop up anyway? Yes

*Now that I have tested it now shows, "Warning: If 'When released' is unchecked, the trigger may interfere with the macro. Read more in Help."*
Before it never showed that so I couldn't understand why I got that message.
-I'll try to read through the help file but please post a solution if any.. I'll use another hotkey instead if I have to-

Thanks for your help, sorry for posting something that I could have figured out, But I swear that message didn't show the last time! :twisted: :oops:

~TwizzY~

EDIT: There is goes again, not showing any warning message , Grr :!:
It's also only when a different window is focused or activated, I opened two windows, or folders and click the desktop and try the hotkey and it works great, when I click the folder or window first and try it, it pops up on me :roll: I wanna fix this just because, if I want to go to another site, while on a current site, it would pop up and I would be on my way, without having to deactivate the current window(s) and then trigger it once again, I appreciate all your help and time looking into this post and many other peoples post(s)
#5
Maybe some other macro runs then. Try to create new file (menu File -> Open/New File) and create the menu there. How then?
#6
:x That didn't work, what if I were to make a function trigger the macro, instead of having the menu trigger itself, The problem I am having though is triggering it with a hotkey and mouse button, Is this possible? I know that you can do.......

ifk © mac "Menu" (for ctrl)
ifk(®) mac "Menu" (for mouse)

Is it possible to combine into one ifk code?

If not i'll just use a different hotkey, because this is getting frustrating and I hate to bother you on a "simple" macro :?

~TwizzY~
#7
This function is a template for creating custom mouse triggers. Initially it only launches macro Macro522 (it also can be a menu etc) on Ctrl+MouseRightButton. Copy/paste it and run. To run when QM starts, assign 'QM file loaded' trigger.

Function AltMouseTriggers
Code:
Copy      Help
function [nCode] [wParam] [MSLLHOOKSTRUCT*m]

;User-defined mouse triggers.
;To add/delete triggers, edit this function.
;To start the trigger engine, run this function without arguments. For example click the Run button or use a trigger or mac.
;Runs all the time, but if you want to stop it, use the Threads dialog or Ctrl+Alt+Win+LeftMouseButton.
;Does not work on Windows 9x.



;------------------------------
;--- don't modify this code ---
;------------------------------



if(getopt(nargs)=0)
,int+ g_mhook=SetWindowsHookEx(WH_MOUSE_LL &AltMouseTriggers _hinst 0)
,opt waitmsg 1
,AddTrayIcon "mouse.ico" "My mouse triggers" ;;remove this line if tray icon is not needed
,wait -1 -V g_mhook
,ret

if(nCode<0) goto g1
if(m.flags&LLMHF_INJECTED) goto g1 ;;not user-generated


;------------------------------
;--- can modify this code -----
;------------------------------



;This code runs whenever a mouse button is clicked, wheel rotated or mouse moved.
;Edit this code to do whatever you need. You can edit while this function is running.
;Don't add here code that runs > 0.1 s or uses key/mouse commands. Rather put the code in a macro and use mac to launch it.
;Return 1 to "eat" the mouse event. Otherwise make sure that CallNextHookEx is executed.
;For reference, search for LowLevelMouseProc in the MSDN library on the internet.
;This is just example code. Launches Macro522 on Ctrl+MouseRightButton.



sel wParam
,case [WM_LBUTTONDOWN,WM_LBUTTONUP]
,sel GetMod ;;1 Shift, 2 Ctrl, 4 Alt, 8 Win
,,case 2|4|8 ;;Ctrl+Alt+Win
,,if(wParam=WM_LBUTTONDOWN)
,,,UnhookWindowsHookEx g_mhook
,,,g_mhook=0 ;;tell to end this thread
,,ret 1 ;;eat
,,;here you can add more case for other Ctrl/Shift/Alt/Win combinations
,,
,case [WM_RBUTTONDOWN,WM_RBUTTONUP]
,sel GetMod
,,case 2 ;;Ctrl
,,if(wParam=WM_RBUTTONDOWN)
,,,mac "Macro522"
,,,err out "there is no Macro522"
,,ret 1 ;;eat
,,;here you can add more case for other Ctrl/Shift/Alt/Win combinations
,
,;;below is commented barebone code for other mouse events
,;case [WM_MBUTTONDOWN,WM_MBUTTONUP]
,;;here you can add code similar to above
,
,;case [WM_XBUTTONDOWN,WM_XBUTTONUP]
,;sel m.mouseData>>16
,,;case XBUTTON1
,,;;here you can add code similar to above
,,;case XBUTTON2
,,;;here you can add code similar to above
,,
,;case WM_MOUSEWHEEL
,;if(m.mouseData>0) ;;forward
,,;;here you can add code similar to above
,;else if(m.mouseData<0) ;;backward
,,;;here you can add code similar to above
,,
,;case WM_MOUSEMOVE
,;;here you can add code



;------------------------------
;--- don't modify this code ---
;------------------------------


;g1
ret CallNextHookEx(g_mhook nCode wParam m)

Also disable or remove your old Ctrl+MouseRightButton trigger.
#8
Cry This is getting to be a hastle for me and i'm sure you hate to have to keep reading the same post and take your time away from others, but I copied the code into a function file and I went to run it and it's highlighting this [MSLLHOOKSTRUCT*m] and saying this "Error in Function1: unknown identifier." I looked at your code and my code and your MSLLHOOKSTRUCT is purple and I see that mine isn't, could I be missing something or is do I need to upgrade my Qm? :? This will be the last post\response you'll have to read\write, beacause I know you are busy with other peoples questions so thanks for your time and looking into this, I greatly appreciate it! :o


EDIT : After looking with the search button I found this,
Code to disable both keyboard and mouse temporarily Do I need to download a function file of some sort?

~TwizzY~
#9
You need QM 2.2.0.

Or insert declarations at the beginning:

type MSLLHOOKSTRUCT POINT'pt mouseData flags time dwExtraInfo
dll user32 [SetWindowsHookExA]#SetWindowsHookEx idHook lpfn hmod dwThreadId
def WH_MOUSE_LL 14
def LLMHF_INJECTED 0x00000001
dll user32 #UnhookWindowsHookEx hHook
dll user32 #CallNextHookEx hHook ncode wParam !*lParam
def XBUTTON1 0x0001
def XBUTTON2 0x0002

However GetMod probably will be unavailable. Replace it with code made from ifk. Can remove code that is executed on left button down/up.

---

Quote:... i'm sure you hate to have to keep reading the same post and take your time away from others, ... This will be the last post\response you'll have to read\write, beacause I know you are busy with other peoples questions ...

Please don't think this way. I'm glad to help you.
#10
Cool, thanks for all your help! :lol:
#11
Hi Gintaras,

Always looking over prior posts on the QM forum to learn new techniques and coding methods. I came across this recent post. I am not sure what the benefit is over the trigger menu native to QM.

Thanks,
Stuart
#12
1. Can be extended to add some features that don't exist in QM triggers.
2. This example of using low level mouse hook can be useful somewhere else too.


Forum Jump:


Users browsing this thread: 1 Guest(s)