PasteColor
Re: PasteColor
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
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
Re: PasteColor
Can't say I've come across any problems myself. Could you provide a reproducer perhaps?
Re: PasteColor
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.
Re: PasteColor
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.
Now back to your issue...please provide me with your test scripts so I can debug them. Thanks.
Re: PasteColor
Thanks. I will try solving it myself but if nothing helps I'll apply for some help
Re: PasteColor
OK, actually that's good to hear, sign of a true developer.
Re: PasteColor
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:
http://rolandtoth.hu/files/PasteColor-test.zip
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.
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:
http://rolandtoth.hu/files/PasteColor-test.zip
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.
Re: PasteColor
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.
Re: PasteColor
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?
Only the "Test" function was called in the source, basically only WinGetTitle() and a message box.
Did you test it via a hotkey?
Re: PasteColor
QuitApp was missing. All I did was drag into SciTE and selected Run.
Re: PasteColor
It does return the window title when running directly. The problem occurs only when launched via a hotkey.
Re: PasteColor
OK I just saw your scenario. The reproducer was a little overcomplicated. This is enough to reproduce the issue.
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.
Code: Select all
#include <Constants.au3>
MsgBox($MB_SYSTEMMODAL, WinGetTitle(WinGetHandle('[ACTIVE]')), WinGetHandle('[ACTIVE]'))
Re: PasteColor
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
Perhaps you need to assign another useless hotkey (win-ctrl-alt-shift-9) and delete the shortcut. Windows shortcuts are pita
Re: PasteColor
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?
Re: PasteColor
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:
I think I will give a try to the other activation method first.
http://www.autohotkey.com/board/topic/1 ... ve-window/
Here they say it is a known issue among AutoIt users too:
http://forum.sysinternals.com/topic10793_page1.htmlBTW, 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.