//QM v2.8. Do not edit with text editor!!! //
8     6
w N?8B!/0*E}
  QM output triggers help  0 310B9B61 0
 Watches QM output pane for new text. On a QM run-time
 error, launches OU_OnRtError. To watch for other strings
 too, edit OU_Wndproc.

 Run OU_Main. To run automatically at startup, insert this
 in function init2 (if init2 does not exist, create):

mac "OU_Main"

 Be careful when editing OU_Wndproc and functions launched
 by it. OU_Wndproc runs in QM main thread. Incorrect
 programming can make QM unstable. Avoid endless recursion,
 which occurs when out in a macro causes the macro to run
 again.

  OU_Main  8 310B975C 0
int+ g_ou_pwndproc
if(g_ou_pwndproc) ret
if(GetCurrentThreadId!=GetWindowThreadProcessId(_hwndqm 0)) ;;this is not QM main thread
	atend OU_End
	SendMessage _hwndqm WM_SETTEXT 3 "''OU_Main''" ;;run OU_Main in QM main thread
	wait -1 ;;wait indefinitely, because finally must be called OU_End

 this is QM main thread, and we can subclass QM output window
g_ou_pwndproc=SetWindowLong(id(2201 _hwndqm) GWL_WNDPROC &OU_Wndproc)

  OU_End  8 310B7F36 0
if(g_ou_pwndproc)
	SetWindowLong(id(2201 _hwndqm) GWL_WNDPROC g_ou_pwndproc)
	g_ou_pwndproc=0

  OU_Wndproc  8 310B9CD0 0
 /
function# hwnd message wparam lparam

 This function is called on each message sent to QM output window.

if(message=EM_REPLACESEL) ;;text added
	lpstr ss=+lparam; str s
	foreach s ss ;;for each line, because several output strings may be collected for better performance
		if(s.beg("Error ")) ;;if line begins with "Error "
			if(find(s "OU_OnError")<0) ;;prevent triggering from errors in itself
				if(s.beg("Error (RT) ")) ;;if line begins with "Error (RT) "
					mac "OU_OnRtError" "" s
				 else mac "OU_OnError" s
			 case "some other string" ...

ret CallWindowProc(g_ou_pwndproc hwnd message wparam lparam)

  macros  1114112 310B9125 0

  OU_OnRtError  8 310B9E03 5
function str's
mes s

 This is a sample function. Edit it to do whatever you need.

  file  268500992 0

  