Главная страница | назад





Article #19241: SetForegroundWindow in Win98/WinNT/Win95

 Question and Answer Database
FAQ4241C.txt :SetForegroundWindow in Win98/WinNT/Win95
Category :Windows API
Platform :Win95/NT
Product :BC++5.x, C++Builder1.0, C++Builder3.x,
Question:
SetForegroundWindow doesn't work under Windows 98! How/why?
Answer:
In my experience, using BC 5.02 patched and compiling both under
Windows 98, 95, and NT, SetForegroundWindow does not work when
BC 5.02 is used to COMPILE under Windows 98. If Windows 98 is
used as the development system, the resulting EXE file will not
run correctly on Windows 98, 95, or NT. SetForegroundWindow will
return that it succeeded, but the window which is supposed to be
set to the foreground will not take focus. However, if the same
code utilizing SetForegroundWindow is compiled on a Windows NT or
95 system, the resulting EXE file will work correctly on all
3 Win32 platforms, 98, 95, and NT.
While both EXE files have, in my experience, the same size,
they are not binary duplicates, as I have confirmed with a
number of binary comparison utilities. This occurs despite
the programs being linked statically and not dynamically.
Hence, for some unknown reason under Win98 BC 5.02 manages to
create two different binary files of the same size, but not the
same machine code....??
12/16/1998 9:01:57 AM

Last Modified: 01-SEP-99