Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Context menu in specific window
#1
I would like to know the equivalent code of the following QM code in LA.
This involves a lot of things, and as a sample, it would be very helpful for those who already have a grasp of QM.
Thank you in advance

Feature description:
In the notepad2(https://www.flos-freeware.ch/notepad2.html) window, depending on whether text is selected or not, right-clicking will display different menus

Function FFS_NP_Editor
Trigger #R //FFS_NP_Editor     Help - how to add the trigger to the macro
 
Code:
Copy      Help
;/
function# iid FILTER&f

if(wintest(f.hwnd "" "Notepad*"))
,if(childtest(f.hwnd2 "" "Scintilla"))
,,if !SendMessageW(f.hwnd2 SCI.SCI_GETSELECTIONEMPTY 0 0)
,,,ret "Select_NP" ;;Text selected
,,else
,,,ret "Empty_NP" ;;No text selected

ret -2

Menu Select_NP
 
Code:
Copy      Help
S_test1 :sub.Sub1 * findacc.ico
|
>S_test2 * findacc.ico
,S_test21 :sub.Sub2 * findacc.ico
<

#sub Sub1 m
paste "S_test1"

#sub Sub2 m
key "S_test21"

Menu Empty_NP
Code:
Copy      Help
E_test1 :sub.Sub1 * findacc.ico
|
>E_test2 * findacc.ico
,E_test21 :sub.Sub2 * findacc.ico
<

#sub Sub1 m
paste "E_test1"

#sub Sub2 m
key "E_test21"


Attached Files
.qml   Menu_NP.qml (Size: 3 KB / Downloads: 25)


Messages In This Thread
Context menu in specific window - by Davider - 03-14-2024, 11:01 PM
RE: Context menu in specific window - by Gintaras - 03-16-2024, 06:50 AM
RE: Context menu in specific window - by Gintaras - 03-16-2024, 07:08 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)