Click here to Skip to main content
15,891,852 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi all guru,

I'm working with new project and it make me confuse. My project is a windows service, such as a Gamguard program. It find and kill processes of hack, spam programs by execute file name, keywords. But when users rename executing file, process name also is changed therefore my windows service purpose is unsuccessful. I replace it by catching title of hack executing file. But it's only ok when i make it with windows form. Why cannot windows service catch windows title? How to catch windows title by windows service???

Pls help me!!!
Posted
Comments
tiggerc 2-Jul-10 7:25am    
you can enumerate list of open windows and get a handle to the window, from the handle you can get the window title, heuristics is a big field and thats why antivirus software is complex. I wish you luck, as It was quite some time ago way back in VB6 that I did something similar,
danghieunhoc 5-Jul-10 6:24am    
Tks you!
I tried to get windows handle by Process class but it's not ok. I will retry to use by [DllImport("user32.dll")] with GetForegroundWindow() function. I have just found on Internet. But i worry its compatibility and operation ability on Operation Systems. I'm trying it on Windows XP now.

1 solution

In Vista and Windows 7, services execute in a different session from the user's applications. This means they cannot interact with any windows from the user's apps.
 
Share this answer
 
Comments
danghieunhoc 5-Jul-10 6:26am    
Tks you!
I'm working on Windows XP now. But it cannot catch windows title. T_T

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900