Page 4 of 6
Posted: Tue Feb 05, 2013 1:52 pm
Is it possible that AutoIt fails setting a window active and getting control IDs when running in Virtualbox?
I tried with exactly the same OS (Win7 x64) and it works fine in the real one but not in the virtual.
Instead of using XP detection I made an ini setting "AlternateSendMethod" so users can switch modes to make PasteColor work. In my tests PasteColor works fine on Win7 too with MS Paint and MS-like color pickers but fails on others. Using the alternative send method fixes that.
So I strongly hope this malfunction is only present when running in Virtualbox
Posted: Tue Feb 05, 2013 3:28 pm
Can't say I've come across any problems myself. Could you provide a reproducer perhaps?
Posted: Wed Feb 06, 2013 12:33 am
In my tests when launching PasteColor with a hotkey (default usage) the Win taskbar gets activated first when running in VirtualBox (instead of the last active window). I will try to fix that somehow.
Posted: Wed Feb 06, 2013 2:37 am
If you use SciTE you should check out my SciTE Jump application.
Now back to your issue...please provide me with your test scripts so I can debug them. Thanks.
Posted: Wed Feb 06, 2013 4:17 am
Thanks. I will try solving it myself but if nothing helps I'll apply for some help
Posted: Wed Feb 06, 2013 4:26 am
OK, actually that's good to hear, sign of a true developer.
Posted: Tue Feb 12, 2013 10:06 pm
I figured out that AutoIt cannot grab the active window's title (or handle) if the exe is launched via a hotkey.
So the scenario:
- create a desktop shortcut to PasteColor.exe
- set a hotkey for this shortcut
- execute the hotkey: PasteColor may or may not show the window title in the message box
The problem is that it is not consistent - for me it works in the real OS but not in Virtualbox. I have sent PasteColor to others and it neither worked on their real OS.
I have included two screen captures in the zip below. You can see that in virtualbox there is no window title string in the message box.
Here is a very simple test case:
Unless you know a simple fix to this I can only think about altering how PasteColor is activated. I guess if it would run in the background and use an internal hotkey instead of Windows' then it would run properly.
Posted: Wed Feb 13, 2013 2:11 am
After fixing the error in your source code I ran it and it provided the title. If this doesn't help then please provide a smaller reproducer.
Posted: Wed Feb 13, 2013 3:14 am
May I know what was that error?
Only the "Test" function was called in the source, basically only WinGetTitle() and a message box.
Did you test it via a hotkey?
Posted: Wed Feb 13, 2013 3:27 am
QuitApp was missing. All I did was drag into SciTE and selected Run.
Posted: Wed Feb 13, 2013 3:31 am
It does return the window title when running directly. The problem occurs only when launched via a hotkey.
Posted: Wed Feb 13, 2013 3:44 am
OK I just saw your scenario. The reproducer was a little overcomplicated. This is enough to reproduce the issue.
Code: Select all
MsgBox($MB_SYSTEMMODAL, WinGetTitle(WinGetHandle('[ACTIVE]')), WinGetHandle('[ACTIVE]'))
I'm sure the issue is down to Windows hotkey invoker UI. Oh and how do I remove the shortcut assignment as now Ctrl + Alt + P is in use and I can't re-assign it.
Posted: Wed Feb 13, 2013 5:51 am
Thanks. So you say I would better try another way of using PasteColor? (e.g. run in the background and register an own hotkey?)
Perhaps you need to assign another useless hotkey (win-ctrl-alt-shift-9) and delete the shortcut. Windows shortcuts are pita
Posted: Wed Feb 13, 2013 9:00 am
I read I have to restart, which I do when I install Windows updates every "patch Tuesday." Have you thought about asking on the AutoIt Forum?
Posted: Wed Feb 13, 2013 9:16 am
Not yet, but perhaps I will. I did search several times in the forums but no luck.
http://www.autohotkey.com/board/topic/1 ... ve-window/
Here they say it is a known issue among AutoIt users too:
BTW, it seems that this problem is well known in scripting environments. I got AU3 solution on SysInternals forum. AutoIt users had the very same problem.
I think I will give a try to the other activation method first.