المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : trouble with Form.Activate(); FormSelect(); Form.BringToFront();



C# Programming
04-29-2009, 01:54 PM
hi , I created a fullscreen form, setting its topmost prperty to true and provide 2 textboxes in it (for username and password)
so i create a lock screen program usin this way.
i use a Timer that ticks every 500msec:
it causes the form stays on top even if user press ALT-CNTRL-DLT

void aTimer_Tick(object sender, EventArgs e )
{

try
{
this.Activate();
this.Select();
this.BringToFront();
}
catch
{

}

}

then i put the address of my program as a startup program, and it will run each time i login
but the problem is when i log in!! if i quicly run a program(beform my (Lock)form open) then i can hack the lock screen and it won't come to top,unless i click it!

it seems that
this.Activate();
this.Select();
this.BringToFront();
doesn't work when first the form is not active!
any suggestions?