Click here to Skip to main content
15,909,898 members
Home / Discussions / C#
   

C#

 
QuestionDll? Pin
SherKar12-Jun-04 12:36
SherKar12-Jun-04 12:36 
AnswerRe: Dll? Pin
Heath Stewart12-Jun-04 18:00
protectorHeath Stewart12-Jun-04 18:00 
GeneralAssemblies in .NET Pin
richard nixon12-Jun-04 10:13
richard nixon12-Jun-04 10:13 
GeneralRe: Assemblies in .NET Pin
Heath Stewart12-Jun-04 10:28
protectorHeath Stewart12-Jun-04 10:28 
Generalunhandled exeption in ListView Pin
Aron Henning12-Jun-04 5:23
Aron Henning12-Jun-04 5:23 
GeneralRe: unhandled exeption in ListView Pin
leppie12-Jun-04 5:41
leppie12-Jun-04 5:41 
GeneralCONTROLLING PROCESSES Pin
_Comet_Keeper_12-Jun-04 4:52
_Comet_Keeper_12-Jun-04 4:52 
GeneralRe: CONTROLLING PROCESSES Pin
Heath Stewart12-Jun-04 5:00
protectorHeath Stewart12-Jun-04 5:00 
That is not how an anti-virus application works. It doesn't monitor processes - it monitors file accesses so it will scan an executable before it's ever launched. Since you're not preventing a process from being launched, the chances are high that the machine was already infected.

I understand that you're not writing AV software (because if you were you really should understand how this stuff works first), but this is how the execution of the application is prevented - because it actually hasn't started yet. Once the application is started there's not a lot you can do that is *safe*.

A very simple way would be to display a system modal Form (set TopMost to true) that is the size of the desktop working area (see SystemInformation.WorkingArea) and that can't be moved (override WndProc in your Form, watch for the WM_SIZING message (0x0214), and set Message.Result to newIntPtr(1), then call base.WndProc). WndProc should look something like this:
protected override void WndProc(ref Message m)
{
  if (m.Msg == 0x0214 || m.Msg == 0x0216) // WM_SIZING || WM_MOVING
    m.Result = new IntPtr(1);
  base.WndProc(ref m);
}
This would prevent users from resizing or moving the window.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: CONTROLLING PROCESSES Pin
_Comet_Keeper_12-Jun-04 10:07
_Comet_Keeper_12-Jun-04 10:07 
GeneralRe: CONTROLLING PROCESSES Pin
Heath Stewart12-Jun-04 10:34
protectorHeath Stewart12-Jun-04 10:34 
GeneralBandwidth usage info Pin
Liskl12-Jun-04 2:19
Liskl12-Jun-04 2:19 
GeneralRe: Bandwidth usage info Pin
Heath Stewart12-Jun-04 4:47
protectorHeath Stewart12-Jun-04 4:47 
GeneralNewbish Question on Child/Parent Issues Pin
Anonymous11-Jun-04 23:39
Anonymous11-Jun-04 23:39 
GeneralRe: Newbish Question on Child/Parent Issues Pin
bneacetp12-Jun-04 0:45
bneacetp12-Jun-04 0:45 
GeneralRe: Newbish Question on Child/Parent Issues Pin
Heath Stewart12-Jun-04 5:10
protectorHeath Stewart12-Jun-04 5:10 
GeneralTimeZone problem Pin
Andy *M*11-Jun-04 23:34
Andy *M*11-Jun-04 23:34 
GeneralRe: TimeZone problem Pin
Dave Kreskowiak12-Jun-04 2:08
mveDave Kreskowiak12-Jun-04 2:08 
GeneralRe: TimeZone problem Pin
Andy *M*12-Jun-04 2:58
Andy *M*12-Jun-04 2:58 
GeneralRe: TimeZone problem Pin
Heath Stewart12-Jun-04 5:07
protectorHeath Stewart12-Jun-04 5:07 
GeneralSending message to a window Pin
DavidR_r11-Jun-04 21:50
DavidR_r11-Jun-04 21:50 
GeneralRe: Sending message to a window Pin
Anonymous11-Jun-04 23:33
Anonymous11-Jun-04 23:33 
GeneralRe: Sending message to a window Pin
Heath Stewart12-Jun-04 5:03
protectorHeath Stewart12-Jun-04 5:03 
GeneralRFID - Capturing Data Pin
Tarakeshwar11-Jun-04 21:24
Tarakeshwar11-Jun-04 21:24 
GeneralRe: RFID - Capturing Data Pin
Andy *M*11-Jun-04 23:22
Andy *M*11-Jun-04 23:22 
GeneralRe: RFID - Capturing Data Pin
Heath Stewart12-Jun-04 4:51
protectorHeath Stewart12-Jun-04 4:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.