1.用EnumWindowsProc获得进程中每个窗口的handle.
2.用RegisterServiceProcess()来达到您的要求.
const
RSP_SIMPLE_SERVICE = $00000001;
RSP_UNREGISTER_SERVICE = $00000000;
// Parameter dwProcessId can be 0, same effect as GetCurrentProcessId
// Return Values: True(1) means success
function RegisterServiceProcess(dwProcessId, dwServiceType: DWord): Bool; stdcall;
// Place in "implementation" session
function RegisterServiceProcess; external 'Kernel32.dll' Name 'RegisterServiceProcess';
// Example:
// RegisterServiceProcess(0, RSP_SIMPLE_SERVICE);
// RegisterServiceProcess(0, RSP_UNREGISTER_SERVICE);
ps: 这样也很好呀!
将程序的窗口样式设为TOOL窗口,可避免在任务条上出现
SetWindowLong(Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
看看<a href="http://www.gislab.ecnu.edu.cn/delphibbs/DispQ.asp?LID=93590">这里</a>吧.