Search results for 'SuppressKeyPress'

노트북 도난방지 0929

2008. 9. 29. 22:58

 private void ScreenSaver_KeyDown(object sender, KeyEventArgs e)
 {

            if (e.KeyCode == Keys.F4)
                e.SuppressKeyPress = true;

            // 이거 안되네 젠장할
            if (e.KeyCode == Keys.LWin)
                e.SuppressKeyPress = true;

            if (e.KeyCode == Keys.Menu)
                e.SuppressKeyPress = true;

            // 탭키가 왜 후킹이 안되지 망할
            if (e.KeyValue == 9)
                e.SuppressKeyPress = true;
}

ALT + TAB 이랑 ALT+F4 랑 windows키 를 막으려고
e.KeyCode=null 을 했더니만 읽기전용속성이라는...ㅠ_ㅠ

그래서 어찌 어찌 지속적인 삽질끝에
e.SuppressKeyPress=true 를 했더니 성공 ㅋㅋ

그런데 이상하게 windows 키랑 tab 키는 안막아진다.
탭키를 KeyCode가 아닌 KeyValue로 해서 조건 잡아도
그냥 탭키는 잘 작동하고만다.

왜일까...

쩝, 그래도 ALT+F4 는 막았다.

한단계씩~

박상근 프로그래밍/Laptop Guard