Help !! Three problems that make me crazy !!...

Could someone help me on this 3 problems, related to Win32 functions ?...

Problem 1:
I want to know if an application's main window (not my Delphi application
but I have the handle of the window) is active, on top of desktop, and be
able to set it active if it is not...

Problem 2:
Using EnumWindows function, I can get the list of handles of all running
windows. But how can I know, for each handle, if it's handling an
application's main window, and how can I get then the Exe-name of the
application ?...

Problem 3:
Please tell me, if you know, how to shutdown Windows 95 (without any
shutdown dialog box) from a Delphi 2 application. I tried to use
InitiateSystemShutdown, but it didn't work. Actually I know that I have to
set SE_SHUTDOWN_NAME privilege for my process, but the OpenProcessToken
function didn't work, so the LookupPrivilegeValue, and
AdjustTokenPrivileges functions either ... I think my problem is coming
from that I use bad function parameters...

If you could also send me your help at my Email address, it would be kind
from you, coz I really need this help and I dont want to miss it !
Thanx in advance !!

Petifred !