Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Context Menu Trigger in QM
#7
After adding the timer code, the trigger menu items can no longer be executed.
Test: Execute "Copy" in the main menu, then execute the menu item in the trigger menu.

Function AAA
Trigger !v"" "#32768" /EXPLORER     Help - how to add the trigger to the macro
Code:
Copy      Help
int hwnd=TriggerWindow

ARRAY(int) a; win("" "#32768" "explorer" 0 0 0 a); if(a.len>1) ret

int timer=SetTimer(0 0 100 &sub._Timer)

int h=win
str ext f fs=sub.GetPathsOfSelectedFiles(h)
str docxFs; int hasDocx
foreach f fs
,ext.GetFilenameExt(f)
,if(ext="docx") hasDocx=1; docxFs.addline(f)

if hasDocx
,sub.docx(docxFs)

#sub docx
function str'docxFs
_s=
;1 open docx
_i=ShowMenu(_s 0 0 0 8)
sel _i
,case 1
,foreach _s docxFs
,,run _s

#sub GetPathsOfSelectedFiles
function~ int'hwnd
if(!hwnd) end "folder window not found"

SHDocVw.ShellWindows sw._create
SHDocVw.ShellBrowserWindow b
foreach(b sw)
,int hwnd2=b.HWND; err continue
,if(hwnd=hwnd2) goto g1
ret
;g1
Shell32.ShellFolderView sfw=b.Document ;;get shell folder view document
Shell32.FolderItem fi
str ss
foreach fi sfw.SelectedItems
,ss.addline(fi.Path 1)
ret ss

#sub _Timer v
function g h j k
if !IsWindowVisible(a[0])
,KillTimer 0 timer
,EndMenu


Messages In This Thread
Context Menu Trigger in QM - by Davider - 08-17-2026, 11:11 PM
RE: Context Menu Trigger in QM - by Gintaras - 08-18-2026, 07:13 AM
RE: Context Menu Trigger in QM - by Davider - 08-18-2026, 09:45 AM
RE: Context Menu Trigger in QM - by Davider - 08-19-2026, 02:32 AM
RE: Context Menu Trigger in QM - by Gintaras - 08-19-2026, 03:43 AM
RE: Context Menu Trigger in QM - by Davider - 08-19-2026, 03:49 AM
RE: Context Menu Trigger in QM - by Davider - 08-19-2026, 05:19 AM
RE: Context Menu Trigger in QM - by Gintaras - 08-19-2026, 06:57 AM
RE: Context Menu Trigger in QM - by Davider - 08-19-2026, 11:43 PM
RE: Context Menu Trigger in QM - by Gintaras - 08-20-2026, 03:57 AM
RE: Context Menu Trigger in QM - by Davider - 08-20-2026, 11:48 AM
RE: Context Menu Trigger in QM - by Davider - 08-21-2026, 12:00 AM
RE: Context Menu Trigger in QM - by Davider - 08-21-2026, 10:25 PM
RE: Context Menu Trigger in QM - by Gintaras - 08-22-2026, 03:28 AM
RE: Context Menu Trigger in QM - by Davider - 08-22-2026, 04:20 AM
RE: Context Menu Trigger in QM - by Gintaras - 08-22-2026, 04:30 AM
RE: Context Menu Trigger in QM - by Davider - 08-22-2026, 04:50 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)