I'd love to have yagmark be more internationalized. I did try to use button codes rather than english strings in wisotool, but sometimes it wasn't possible, and sometimes I didn't try hard enough. Not sure if I tried at all in yagmark yet.
According to http://www.autohotkey.com/docs/commands/SetTitleMatchMode.htm Autohotkey supports regular expressions, so for the matching strings that can't be changed to button codes, we could list a bunch of alternatives, e.g. Save As|Enregistrer Sous Then the remaining mess is when we have to send a keystroke, we might need a switch statement to decide which keystroke to send based on the language.
For the purposes of benchmarking wine, just setting LANG=en_US.UTF-8 solves the problem, but that doesn't help when you're trying to benchmark Windows. - Dan
On Tue, Jun 22, 2010 at 9:42 AM, Dan Kegel dank@kegel.com wrote:
I'd love to have yagmark be more internationalized. I did try to use button codes rather than english strings in wisotool, but sometimes it wasn't possible, and sometimes I didn't try hard enough. Not sure if I tried at all in yagmark yet.
According to http://www.autohotkey.com/docs/commands/SetTitleMatchMode.htm Autohotkey supports regular expressions, so for the matching strings that can't be changed to button codes, we could list a bunch of alternatives, e.g. Save As|Enregistrer Sous Then the remaining mess is when we have to send a keystroke, we might need a switch statement to decide which keystroke to send based on the language.
For the purposes of benchmarking wine, just setting LANG=en_US.UTF-8 solves the problem, but that doesn't help when you're trying to benchmark Windows.
The proper way to do it with AutoHotKey is either to use the button ID, if available, or define the resource name for each language. Most of the time button ID's are available and work well. There was a bug for some of them being different in windows and wine that AJ recently fixed.
On Thu, 24 Jun 2010, Austin English wrote: [...]
The proper way to do it with AutoHotKey is either to use the button ID, if available,
At that point we're not trying to click on a button but waiting for a window.
or define the resource name for each language. Most of the time button ID's are available and work well. There was a bug for some of them being different in windows and wine that AJ recently fixed.
I fixed the problem by replacing 'winwait, Save' with 'winwait, ahk_class #32770'. Based on my reading it appears to be an acceptable solution if we assume that the 'Save As' dialog will be the only dialog open at that point in the script.
The problem is it does not work in Wine. In Wine the class of 3DMark2000's 'Save As' dialog is #32769 which corresponds to a desktop window!
I also checked notepad's 'Save As' dialog and this one does have a class of #32770.
http://msdn.microsoft.com/en-us/library/ms633574%28VS.85%29.aspx
On Mon, Jul 5, 2010 at 2:25 AM, Francois Gouget fgouget@free.fr wrote:
I fixed the problem by replacing 'winwait, Save' with 'winwait, ahk_class #32770'. Based on my reading it appears to be an acceptable solution if we assume that the 'Save As' dialog will be the only dialog open at that point in the script.
The problem is it does not work in Wine. In Wine the class of 3DMark2000's 'Save As' dialog is #32769 which corresponds to a desktop window!
I also checked notepad's 'Save As' dialog and this one does have a class of #32770.
http://msdn.microsoft.com/en-us/library/ms633574%28VS.85%29.aspx
Sadly, I've found window class IDs to not be very unique (though I've looked mostly in Wine and not Windows).
Can you try using a regular expression? - Dan
On Mon, Jul 5, 2010 at 8:03 AM, Dan Kegel dank@kegel.com wrote:
... Sadly, I've found window class IDs to not be very unique (though I've looked mostly in Wine and not Windows).
A long time ago (Win2K era) I wrote an application for Windows that replaced the text everywhere (that wouldn't crash the OS) with "All Your Base Are Belong To Us." At least at the time, you could rely on the window class to differentiate between different types of windows (dialogs vs. menus vs. different types of controls). Taking advantage of this behavior was especially important in IE, which would crash the whole OS if you changed the text of any of its menus.
Erich Hoover ehoover@mines.edu
On Mon, Jul 5, 2010 at 7:15 AM, Erich Hoover ehoover@mines.edu wrote:
A long time ago (Win2K era) I wrote an application for Windows that replaced the text everywhere (that wouldn't crash the OS) with "All Your Base Are Belong To Us." At least at the time, you could rely on the window class to differentiate between different types of windows (dialogs vs. menus vs. different types of controls). Taking advantage of this behavior was especially important in IE, which would crash the whole OS if you changed the text of any of its menus.
Cool :-) I guess I'll go back and check on Windows now. - Dan
On Monday 05 July 2010 05:15:50 pm Erich Hoover wrote:
On Mon, Jul 5, 2010 at 8:03 AM, Dan Kegel dank@kegel.com wrote: [...] A long time ago (Win2K era) I wrote an application for Windows that replaced the text everywhere (that wouldn't crash the OS) with "All Your Base Are Belong To Us." At least at the time, you could rely on the window class to differentiate between different types of windows (dialogs vs. menus vs. different types of controls). Taking advantage of this behavior was especially important in IE, which would crash the whole OS if you changed the text of any of its menus.
Erich Hoover ehoover@mines.edu
Cool!
... but does it run in wine?
On Mon, Jul 5, 2010 at 8:48 AM, Paul Chitescu paulc@voip.null.ro wrote:
On Monday 05 July 2010 05:15:50 pm Erich Hoover wrote:
On Mon, Jul 5, 2010 at 8:03 AM, Dan Kegel dank@kegel.com wrote: [...] A long time ago (Win2K era) I wrote an application for Windows that
replaced
the text everywhere (that wouldn't crash the OS) with "All Your Base Are Belong To Us." At least at the time, you could rely on the window class
to
differentiate between different types of windows (dialogs vs. menus vs. different types of controls). Taking advantage of this behavior was especially important in IE, which would crash the whole OS if you changed the text of any of its menus.
Erich Hoover ehoover@mines.edu
Cool!
... but does it run in wine?
I highly doubt that I've retained that application anywhere (I'd have to look, but I believe the drive with those old test programs failed), and I'm a tad bit too busy right now to attempt to recreate it. However, if Wine doesn't use a different class for dialogs than for normal windows then I doubt it. If I remember correctly, I had to use the window class to detect file dialogs and not change the text of some of the controls.
You may not even be able to do this kind of thing in Windows anymore with all the new security-minded stuff they've supposedly added. I may not have even tested it on Win2K, though I know I tested on 98 and Me. I remember thinking at the time that allowing a user-level application to send messages to other apps like that was a bad idea. The thing that really struck me was that you could identify the taskbar by its window class and then inject your own buttons onto it, which you could conceivably use to really mess with the user. I didn't take it any further than that though, at that point I got bored with it and I'm not particularly interested in screwing with people. The AYBABTU thing was more of a curiosity thing, it was a popular meme at the time and I was experimenting with how far you could really go with telling other applications what to do.
Erich Hoover ehoover@mines.edu
On Mon, 5 Jul 2010, Dan Kegel wrote: [...]
http://msdn.microsoft.com/en-us/library/ms633574%28VS.85%29.aspx
Sadly, I've found window class IDs to not be very unique (though I've looked mostly in Wine and not Windows).
They are not unique at all. In particular,
According to the above page, #32770 is the system class for all dialogs. So not unique at all but it seems sufficient (or upon winwait triggering we could enumerate the windows, check their parent, sleep and loop back if none of them match).
Can you try using a regular expression?
A regular expression will need to be manually expanded for every other language.
On Mon, Jul 5, 2010 at 11:41 AM, Francois Gouget fgouget@free.fr wrote:
Can you try using a regular expression?
A regular expression will need to be manually expanded for every other language.
Right. It's better than nothing, though. And most games don't support that many languages, so it's probably acceptable. Can you think of a better way? - Dan