spcl Posted February 29, 2012 Report Share Posted February 29, 2012 Eu estou a desenvolver uma aplicacao em vb for desktop e estou com um problema Eu coloquei o janela em full screen e queria desativar todos os atalhos e teclas a nao ser que seja nas inputs eu usei o seguinte codigo: If (Asc(e.KeyChar()) > 0) Then e.KeyChar = Chr(0) End If E as teclas sao desativadas, o unico problema é que ao precionar ctrl+f4, ctrl+shift+esc e ctrl+alt+del e executado e respetivo atalho e e possivel sair do programa, o que eu nao queria, pois ao colocar em full screen eu criei 3 bts (fechar, minimizar, diminuir). E por isso que eu queria desativar as teclas Link to comment Share on other sites More sharing options...
Super Oliks Posted April 24, 2012 Report Share Posted April 24, 2012 Isso vai ser impossível, pois não é apenas a sua "aplicação" que está com processo ativo, para desativar "todos os atalhos e teclas" terá que declara: BlockInput True, e fecha-las pela chave de registro (quando a aplicação estiver em execução), e BlockInput False, quando fechar a aplicação, assim as teclas voltaram a funcionar normalmente. Private Sub Form_Open(Cancel As Integer) BlockInput True Dim Tatalhos As Object Set Tatalhos = CreateObject("Wscript.Shell") Tatalhos.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr", 1, "REG_DWORD" End Sub Private Sub Form_Close() Dim Tatalhos As Object Set Tatalhos = CreateObject("Wscript.Shell") Tatalhos.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr", 0, "REG_DWORD" BlockInput False End Sub Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now