Programación General > Visual C++
Desabilitar Tecla Enter
(1/1)
Vierko:
Bueno el tema es que no tengo ningun boton en mi aplicacion pero cuando la abro y apreto el "enter" la aplicacion se cierra
--- Código: Text ---LRESULT CALLBACK LaserInjectorDialog( HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam ){ switch ( Msg ) { case WM_INITDIALOG: return TRUE; case WM_SYSCOMMAND: if ( wParam == SC_MINIMIZE ) { trayIcon.hWnd = hDlg; Shell_NotifyIcon( NIM_ADD, &trayIcon ); ShowWindow( hDlg, SW_HIDE ); return TRUE; } break; case WM_TRAY: TrayIcon( (WPARAM)(hDlg), lParam ); break; } return FALSE;}
aclaro que no tengo ningun VK_ENTER
Diodo:
Quizas tengas el foco en el boton de cerrar el dialogo
Para cambiar el foco a un control que no te afecte usa SetFocus de la clase CWnd
http://msdn2.microsoft.com/en-us/library/0...db4(VS.80).aspx
salu2 :hola:
diego.martinez:
tambien podrias cazar en el Procedure el WM_KEY del VK_ENTER y devolver 0;
ivancp:
Intenta con agregarle esta linea atu codigo:
--- Código: Text ---case WM_KEYDOWN: if(wParam == VK_RETURN) return TRUE; break;
Navegación
Ir a la versión completa