I'm not sure if this is the only problem, but probably the "real" (mangles) method names are
SendMessageTimeoutA
and
SendMessageTimeoutW
for ANSI/Unicode. So, you should either use
SendMessageTimeoutW
explicitly, or use the parameter
CharSet=CharSet.Auto
. Such parameter value takes care of mangling automatically, effectively giving you the Unicode version. Please see:
http://www.pinvoke.net/default.aspx/user32.sendmessagetimeout[
^].
Your P/Invoke, without it, might be is incorrect, because the default is
CharSet.Unicode
, and it would require "W".
—SA