Hey Jose,
On my machine, using Control-A in the "Code TAB" edit control will beep.
Also Control-E is assigned to "è" on my keyboard making the character to be inserted.
All seem's fine if I use the modified code, except that, of course, the code for "è" is not a valid solution
Is Control-E is standard for selection in Spanish?
Pierre
' ========================================================================================
' Code text box window procedure
' ========================================================================================
FUNCTION FBWS_Edit_CodeView_WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT
SELECT CASE uMsg
#If 0 'Genuine Jose code
CASE WM_KEYDOWN
' // If Ctrl+A or Ctrl+E pressed, select all the text
IF wParam = VK_A OR wParam = VK_E THEN
IF GetAsyncKeyState(VK_CONTROL) THEN
PostMessage hwnd, EM_SETSEL, 0, -1
END IF
END IF
' // Eat the Escape key to avoid the page being destroyed
IF wParam = VK_ESCAPE THEN EXIT FUNCTION
#Else 'Modified code
CASE WM_CHAR
SELECT CASE wParam
CASE 1, 232 '1 = Control-A, 232 = è
'Using WM_CHAR/1 instead of WM_KEYDOWN/VK_A will not beep
'On my keyboard Control-e give "è". So it add "è" to the text before selection
SendMessage(hWnd, EM_SETSEL, 0, - 1) 'Select everything
EXIT FUNCTION
END SELECT
CASE WM_KEYDOWN
IF wParam = VK_ESCAPE THEN EXIT FUNCTION
#EndIf
CASE WM_DESTROY
' // REQUIRED: Remove control subclassing
SetWindowLongPtrW hwnd, GWLP_WNDPROC, CAST(LONG_PTR, RemovePropW(hwnd, "OLDWNDPROC"))
END SELECT
' // Default processing of Windows messages
FUNCTION = CallWindowProcW(GetPropW(hwnd, "OLDWNDPROC"), hwnd, uMsg, wParam, lParam)
END FUNCTION
' ========================================================================================