Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Toolbars sometimes don't launch
#1
We are using QM 2.3.4.8 on Win7 Pro SP1, and while things work great 99% of the time, sometimes when a user logs in to Windows, QM runs, but none of the toolbars get launched on IE or any of our other applications which are supposed to get QM toolbars. Fully exiting QM and starting it again doesn't help. Only reboot solves the problem. What part of Windows do the Toolbars depend on? Is there a Windows service I can restart to try to fix this?
#2
And all window triggers stop working? Please test the same trigger type with a macro or function. If it does not work, try menu Tools -> Output -> Log -> Window events. What text it adds in QM output when you activate a window? Should be like this:
Quote:active 11731346 "Notepad" "Untitled - Notepad"
When you run a program, should be like this (or more lines):
Quote:created 11796882 "Notepad" ""
name 11796882 "Notepad" "Untitled - Notepad"
visible 11796882 "Notepad" "Untitled - Notepad"
active 11796882 "Notepad" "Untitled - Notepad"
If window trigger is "Created and active", try to replace to "Active".

Possibly upgrading to QM 2.4.2 would fix it.
#3
I see what you mean. When things are working, the output is as expected. I will try to capture this during one of the rare times when they fail to launch, and let you know what I find. Thanks.
#4
Also, if window triggers don't work, try to check:
Options -> Triggers -> Use low-level hook -> Other.
#5
OK, it just happened again. I turned on logging of window events, and all I saw was:

Window event logging started.

I then clicked back and forth on multiple different windows, and it had no effect. No window events were picked up by QM at all.

I did the same thing on another machine that was working normally and saw:

created 33950700 "WindowsForms10.Window.0.app.0.3ce0bb8_r18_ad1" "TimerNativeWindow"
created 34016236 "WindowsForms10.Window.0.app.0.3ce0bb8_r18_ad1" "TimerNativeWindow"
active 263956 "WindowsForms10.Window.8.app.0.3ce0bb8_r18_ad1" "PowerScribe 360 | Reporting"
active 460818 "IEFrame" "Radiologist last known locations - Windows Internet Explorer"
created 34081772 "WindowsForms10.Window.0.app.0.3ce0bb8_r18_ad1" "TimerNativeWindow"
name 265252 "SunAwtDialog" "Work Modes USER: Argle, Bargle Server IP Address: 10.20.2.50 Current Time: 4:22:04 PM "

Looks like when this problem occurs, QM sees no window events at all.
And the low level hook setting did not help either.
#6
Function Hook_SetWinEventHook3724
Code:
Copy      Help
;Run this function, it should show "window activated" events in QM output.
;It uses the same type of hooks that QM uses for window triggers.
;If there is no output:
;;;Maybe hooks don't work only in QM process. To test it:
;;;;;Make exe from this function. Double click it in Windows Explorer to run. If events work, it should show in QM output. If no output:
;;;;;;;Test events with accessibility testing/debugging tools. One is attached to this post. It should show events, no setup required. Test its options "in context" and "out of context".
;Note that events may not work with windows of programs that run as administrator. Test with non-admin program windows, eg with Windows Explorer folder windows.

;If events work in this function, I'll create a function that replaces QM window triggers. Until QM triggers will be fixed. Maybe already fixed, try to download QM 2.4.2 if you have an older version.
;If events will not work in this function and in the attached program, it means that something wrong is with your Windows. I tried to find something about on the internet, unsuccessfully. Try to disable antivirus, close as many running programs as possible, maybe then events will work, then maybe you can find the reason.


function hHook event hwnd idObject idChild dwEventThread dwmsEventTime
if(hHook) goto gHook

out
int hh=SetWinEventHook(EVENT_SYSTEM_FOREGROUND EVENT_SYSTEM_FOREGROUND 0 &Hook_SetWinEventHook3724 0 0 WINEVENT_OUTOFCONTEXT)
if(!hh) end F"{ERR_FAILED}. {_s.dllerror}"
mes "Now activate several windows and see QM output. Don't close this message box until you finish testing."
UnhookWinEvent hh
ret


;gHook
str sc.getwinclass(hwnd); err
str sn.getwintext(hwnd); err
out "event=%i hwnd=%i idObject=%i idChild=%i dwEventThread=%i    window class=''%s'', name=''%s''" event hwnd idObject idChild dwEventThread sc sn


Attached Files
.zip   AccEvent.zip (Size: 12.24 KB / Downloads: 330)
#7
Thanks, I will give it a try.
#8
Thanks again for your detailed response. I ran the function you gave me on a machine where the toolbars stopped showing up, and it *DID* give output, as below.

Do you want to give me a new function to replace QM triggers, or should we just plan on upgrading to 2.4.2? We are now at 2.3.4.8.

event=3 hwnd=459012 idObject=0 idChild=0 dwEventThread=205592 window class="#32770", name="QM Message"
event=3 hwnd=198946 idObject=0 idChild=0 dwEventThread=196660 window class="QM_Editor", name="Quick Macros - Main - [Hook_SetWinEventHook3724]"
event=3 hwnd=196806 idObject=0 idChild=0 dwEventThread=204452 window class="IEFrame", name="Radiologist Worklist - Windows Internet Explorer provided by NSLIJHS"
event=3 hwnd=132164 idObject=0 idChild=0 dwEventThread=188488 window class="WindowsForms10.Window.8.app.0.3ce0bb8_r18_ad1", name="PowerScribe 360 | Reporting"
event=3 hwnd=196806 idObject=0 idChild=0 dwEventThread=204452 window class="IEFrame", name="Radiologist Worklist - Windows Internet Explorer provided by NSLIJHS"
event=3 hwnd=196806 idObject=0 idChild=0 dwEventThread=204452 window class="IEFrame", name="Radiologist Worklist - Windows Internet Explorer provided by NSLIJHS"
event=3 hwnd=132164 idObject=0 idChild=0 dwEventThread=188488 window class="WindowsForms10.Window.8.app.0.3ce0bb8_r18_ad1", name="PowerScribe 360 | Reporting"
event=3 hwnd=196806 idObject=0 idChild=0 dwEventThread=204452 window class="IEFrame", name="Radiologist Worklist - Windows Internet Explorer provided by NSLIJHS"
event=3 hwnd=459012 idObject=0 idChild=0 dwEventThread=205592 window class="#32770", name="QM Message"
event=3 hwnd=854650 idObject=0 idChild=0 dwEventThread=205592 window class="QM_default", name=""
event=3 hwnd=132164 idObject=0 idChild=0 dwEventThread=188488 window class="WindowsForms10.Window.8.app.0.3ce0bb8_r18_ad1", name="PowerScribe 360 | Reporting"
#9
Function toolbar_triggers
Code:
Copy      Help
;Edit the sel/case code. Add cases for your windows.
;Then run this function. For example assign trigger "QM file loaded" (don't check Synchronous).
;Its thread runs all the time. Watches for "window activated" events and runs your code.
;To end this thread, run this function again.
;To apply your new sel/case code without ending thread, click Compile button in QM toolbar.
;Your code can use mac to run toolbars and other macros. Your code must be as fast as possible.


function hHook event hwnd idObject idChild dwEventThread dwmsEventTime
if(hHook) goto gHook

if(getopt(nthreads)>1) EndThread "toolbar_triggers"; ret

int hh=SetWinEventHook(EVENT_SYSTEM_FOREGROUND EVENT_SYSTEM_FOREGROUND 0 &toolbar_triggers 0 0 WINEVENT_OUTOFCONTEXT)
if(!hh) end F"{ERR_FAILED}. {_s.dllerror}"
opt waitmsg 1
wait -1
UnhookWinEvent hh
ret


;gHook
str sClass.getwinclass(hwnd) sText.getwintext(hwnd) sProgram
;sProgram.getwinexe(hwnd) ;;this is slow, use only when really need

;examples
sel _s.from(sClass "[]" sText) 3
,case "Notepad[]*" mac "Notepad toolbar" hwnd ;;note: the second argument must be hwnd, it attaches the toolbar to the window. Subsequent window activations will not create more instances of this toolbar.
,
,case "#32770[]Options" mac "Options toolbar" hwnd
,
,;more cases ...


Forum Jump:


Users browsing this thread: 1 Guest(s)