Who is "MY"?
Posted: 23 Jun 2022, 12:35
Many comments in the AutoHotkey source code are signed "MY". Just curious to know who that is?
JB
JB
Let's help each other out
https://www.autohotkey.com/boards/
https://www.autohotkey.com/boards/viewtopic.php?f=81&t=105694
Code: Select all
// even when you use TimerProc instead of processing WM_TIMER." My: This is why all TimerProc type timers
// My: This also applies to mouse events, so use it for them too:
// My: Though it seems okay, for now, just to set it to be blank if the user omitted the 2nd param or
// MY: Full filename is required, even if it's the main file, because some editors (EditPlus)
// My: This does more harm that good (it causes the cursor to warp from the right side to the left
// My: It seems best to use SW_FORCEMINIMIZE on OS's that support it because I have
// My: In addition, this is probably better for some large controls (e.g. SysListView32) because
// My: Probably not too much overhead to do this, though it probably would perform better to resize and
// My: Seems safest to keep the limit just below 64K in case Win95 has problems with larger values.
// My: Seems safest to keep the limit just below 64K in case Win95 has problems with larger values.
// MY: It is definitely possible for GetForegroundWindow() to return NULL, even on XP.
// MY: The AttachThreadInput method, when used by itself, seems to always
// MY: Normally, it's suggested that you only need to attach the thread of the
// does not have a message queue (My: ok here, since any window's thread MUST have a
// My: And since 32767 is what AutoIt3 passes to the API functions as the size (not the length, i.e.
Code: Select all
// even when you use TimerProc instead of processing WM_TIMER." My: This is why all TimerProc type timers
// My: This also applies to mouse events, so use it for them too:
// My: Though it seems okay, for now, just to set it to be blank if the user omitted the 2nd param or
// MY: Full filename is required, even if it's the main file, because some editors (EditPlus)
// My: This does more harm that good (it causes the cursor to warp from the right side to the left
// My: It seems best to use SW_FORCEMINIMIZE on OS's that support it because I have
// My: In addition, this is probably better for some large controls (e.g. SysListView32) because
// My: Probably not too much overhead to do this, though it probably would perform better to resize and
// MY: It is definitely possible for GetForegroundWindow() to return NULL, even on XP.
// MY: The AttachThreadInput method, when used by itself, seems to always
// MY: Normally, it's suggested that you only need to attach the thread of the
// does not have a message queue (My: ok here, since any window's thread MUST have a
// My: And since 32767 is what AutoIt3 passes to the API functions as the size (not the length, i.e.
Code: Select all
case ACT_ENVSET:
// MSDN: "If [the 2nd] parameter is NULL, the variable is deleted from the current process’s environment."
// My: Though it seems okay, for now, just to set it to be blank if the user omitted the 2nd param or
// left it blank (AutoIt3 does this too). Also, no checking is currently done to ensure that ARG2
// isn't longer than 32K, since future OSes may support longer env. vars. SetEnvironmentVariable()
// might return 0(fail) in that case anyway. Also, ARG1 may be a dereferenced variable that resolves
// to the name of an Env. Variable. In any case, this name need not correspond to any existing
// variable name within the script (i.e. script variables and env. variables aren't tied to each other
// in any way). This seems to be the most flexible approach, but are there any shortcomings?
// The only one I can think of is that if the script tries to fetch the value of an env. var (perhaps
// one that some other spawned program changed), and that var's name corresponds to the name of a
// script var, the script var's value (if non-blank) will be fetched instead.
// Note: It seems, at least under WinXP, that env variable names can contain spaces. So it's best
// not to validate ARG1 the same way we validate script variables (i.e. just let\
// SetEnvironmentVariable()'s return value determine whether there's an error). However, I just
// realized that it's impossible to "retrieve" the value of an env var that has spaces (until now,
// since the EnvGet command is available).
return g_ErrorLevel->Assign(SetEnvironmentVariable(ARG1, ARG2) ? ERRORLEVEL_NONE : ERRORLEVEL_ERROR);
Australian English is more or less the same as UK English, but we use US keyboards.... the comment uses the US spelling of 'realized', Jonathan Bennett is from the UK.
Cool sleuthing, Emile! I at least am convinced.Emile HasKey wrote: ↑02 Jul 2022, 20:02I thought I'd take a crack at solving the MYstery.
...
MYstery solved?