Função Tab por Enter em toda aplicação com UserControl ...
Há algum problema com a função descrita abaixo ?
Pois com ela o controle de tempo em uma sessão (da suíte UserControl) passa a não funcionar, ou seja, ele passa a não entender movimentos de mouse !!
Alguém poderia me dar alguma informação a respeito !?
ps. Estou usando a versão 2.20 Final do UserControl.
(sem utilizar esta função funciona corretamente)
Obrigado.
Francisco.
No onCreate do frmP:
Application.OnMessage := ProcessaMsg;
\\ Essa é a função
procedure TfrmP.ProcessaMsg(var Msg: TMsg; var Handled: Boolean);
begin
if not (Screen.ActiveControl = nil) then
begin
if not ((Screen.ActiveControl is TCustomMemo) or
(Screen.ActiveControl is TTreeView) or
(Screen.ActiveControl is TButtonControl) or
(Screen.ActiveControl is TCustomControl) or
(Screen.ActiveForm.ClassName = ´TMessageForm´)) then
begin
if Msg.message = WM_KEYDOWN then
begin
if (Msg.wParam = VK_RETURN) or (Msg.wParam = VK_DOWN) then
begin
Msg.wParam := VK_CLEAR;
Keybd_event(VK_TAB,0,0,0);
end
else if (Msg.wParam = VK_UP) then
begin
keybd_event(VK_SHIFT, 0, KEYEVENTF_EXTENDEDKEY or 0, 0);
keybd_event(VK_TAB, 0, 0, 0);
keybd_event(VK_SHIFT , $45, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0);
end;
end;
end;
end;
end;
Pois com ela o controle de tempo em uma sessão (da suíte UserControl) passa a não funcionar, ou seja, ele passa a não entender movimentos de mouse !!
Alguém poderia me dar alguma informação a respeito !?
ps. Estou usando a versão 2.20 Final do UserControl.
(sem utilizar esta função funciona corretamente)
Obrigado.
Francisco.
No onCreate do frmP:
Application.OnMessage := ProcessaMsg;
\\ Essa é a função
procedure TfrmP.ProcessaMsg(var Msg: TMsg; var Handled: Boolean);
begin
if not (Screen.ActiveControl = nil) then
begin
if not ((Screen.ActiveControl is TCustomMemo) or
(Screen.ActiveControl is TTreeView) or
(Screen.ActiveControl is TButtonControl) or
(Screen.ActiveControl is TCustomControl) or
(Screen.ActiveForm.ClassName = ´TMessageForm´)) then
begin
if Msg.message = WM_KEYDOWN then
begin
if (Msg.wParam = VK_RETURN) or (Msg.wParam = VK_DOWN) then
begin
Msg.wParam := VK_CLEAR;
Keybd_event(VK_TAB,0,0,0);
end
else if (Msg.wParam = VK_UP) then
begin
keybd_event(VK_SHIFT, 0, KEYEVENTF_EXTENDEDKEY or 0, 0);
keybd_event(VK_TAB, 0, 0, 0);
keybd_event(VK_SHIFT , $45, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0);
end;
end;
end;
end;
end;
Francisco.riva1
Curtidas 0