Welcome to WebmasterWorld Guest from 126.96.36.199
Forum Moderators: open
I've never seen either of these functions in VBScript. I tried flashWindow() and got errors. That doesn't mean it's not possible, just that I can't make it work.
I've never seen either of these functions in VBScript.
You mean JScript?
No, I did mean VBScript.
if(VBS==VB)canBeJS = true :)
To your question.
Abbreviated story = I don't think it can be done.
Long story =
new ActiveXObject('WScript.Shell').AppActivate('app title')
causes any application to flash in the taskbar. Unfortunately, htas are processes, not applications. Open an hta then press Ctrl + Alt + Del and you'll see your hta under Processes (mshta.exe), not Applications.
AppActivate() takes either the app title or the process id. This will give AppActivate() the process id:
var htas=new Enumerator(GetObject('winmgmts:\\\\.\\root\\cimv2').ExecQuery('select * from Win32_Process where Name="mshta.exe"')),
After all that, it can't distinguish between multiple instances of the hta and it doesn't flash the hta in the taskbar. It brings the hta to the top. I have created an incredibly complex alternative to window.focus().
On an unrelated but more positive note, Win32_Process exposes lots of properties [msdn.microsoft.com]