06-23-2008, 06:14 AM
I looked a little closer:
out
ARRAY(int) a; int i; str sc sn
out "[][9]ALL VISIBLE WINDOWS"
win("" "" "" 0 0 0 a)
for(i 0 a.len)
sc.getwinclass(a[i])
sn.getwintext(a[i])
out "%i '%s' '%s'" a[i] sc sn
if (matchw(sn "hours.xls*"))
out _s.from("YES: " a[i])
act a[i]
err
out _s.from(" error: " win " " sn.getwintext(win))
Generates:
ALL VISIBLE WINDOWS
131332 'Shell_TrayWnd' ''
66280 'QM_toolbar' 'QM TOOLBAR'
65894 'QM_Editor' 'Quick Macros - Main - [ListWindows]'
1771744 'XLMAIN' 'Microsoft Excel - hours.xls [Compatibility Mode]'
1443532 'MS-SDIb' 'hours.xls [Compatibility Mode]'
YES: 1443532
error: 1771744 Microsoft Excel - hours.xls [Compatibility Mode]
1508358 'HH Parent' 'QM Help'
330866 'MS-SDIb' 'test.xls [Compatibility Mode]'
2360296 'MozillaUIWindowClass' 'Quick Macros Forum • View forum - Programming - Mozilla Firefox'
396396 'MS-SDIb' 'Tasks Core.xls [Compatibility Mode]'
1312986 'rctrl_renwnd32' 'Inbox - Microsoft Outlook'
721034 'CabinetWClass' '\\s01'
2754560 'CabinetWClass' 'D:\'
1247808 'ExploreWClass' 'My Computer'
1837250 'ConsoleWindowClass' 'C:\WINDOWS\system32\cmd.exe'
264490 'ConsoleWindowClass' 'C:\WINDOWS\system32\cmd.exe'
527272 'TSSHELLWND' 'administrator-corepn - s34.corepn.local - Remote Desktop'
201188 'TSSHELLWND' 'administrator-corepn - s33.corepn.local - Remote Desktop'
790094 'IrfanView' 'Clipboard01 - IrfanView'
852788 'rctrl_renwnd32' 'RE: New versions of Boris and Aviarc - Message (HTML) '
131378 'Progman' 'Program Manager'
It looks like Excel activates its main window, causing QM to think the window did not activate.
Any suggestions for how I should code this to work without QM errors?
out
ARRAY(int) a; int i; str sc sn
out "[][9]ALL VISIBLE WINDOWS"
win("" "" "" 0 0 0 a)
for(i 0 a.len)
sc.getwinclass(a[i])
sn.getwintext(a[i])
out "%i '%s' '%s'" a[i] sc sn
if (matchw(sn "hours.xls*"))
out _s.from("YES: " a[i])
act a[i]
err
out _s.from(" error: " win " " sn.getwintext(win))
Generates:
ALL VISIBLE WINDOWS
131332 'Shell_TrayWnd' ''
66280 'QM_toolbar' 'QM TOOLBAR'
65894 'QM_Editor' 'Quick Macros - Main - [ListWindows]'
1771744 'XLMAIN' 'Microsoft Excel - hours.xls [Compatibility Mode]'
1443532 'MS-SDIb' 'hours.xls [Compatibility Mode]'
YES: 1443532
error: 1771744 Microsoft Excel - hours.xls [Compatibility Mode]
1508358 'HH Parent' 'QM Help'
330866 'MS-SDIb' 'test.xls [Compatibility Mode]'
2360296 'MozillaUIWindowClass' 'Quick Macros Forum • View forum - Programming - Mozilla Firefox'
396396 'MS-SDIb' 'Tasks Core.xls [Compatibility Mode]'
1312986 'rctrl_renwnd32' 'Inbox - Microsoft Outlook'
721034 'CabinetWClass' '\\s01'
2754560 'CabinetWClass' 'D:\'
1247808 'ExploreWClass' 'My Computer'
1837250 'ConsoleWindowClass' 'C:\WINDOWS\system32\cmd.exe'
264490 'ConsoleWindowClass' 'C:\WINDOWS\system32\cmd.exe'
527272 'TSSHELLWND' 'administrator-corepn - s34.corepn.local - Remote Desktop'
201188 'TSSHELLWND' 'administrator-corepn - s33.corepn.local - Remote Desktop'
790094 'IrfanView' 'Clipboard01 - IrfanView'
852788 'rctrl_renwnd32' 'RE: New versions of Boris and Aviarc - Message (HTML) '
131378 'Progman' 'Program Manager'
It looks like Excel activates its main window, causing QM to think the window did not activate.
Any suggestions for how I should code this to work without QM errors?