oWnd:bKeyDown := { | nKey | StdKey( nKey ) }
FUNCTION StdKey( nKey )
DO CASE
CASE nKey == 65 .AND. GetKeyState( VK_CONTROL ) // Crtl + A
CreateInfoArticulo()
CASE nKey == 38 .AND. GetKeyState( VK_CONTROL ) // Ctrl + Down
NextEmpresa()
CASE nKey == 40 .AND. GetKeyState( VK_CONTROL ) // Ctrl + Up
PriorEmpresa()
CASE nKey == 48 .AND. GetKeyState( VK_CONTROL ) // Ctrl + 0
dbDialog()
END CASE
RETURN NIL
SendMessage( hWn, WM_KEYDOWN, 8, 0) //left ctrl
SendMessage( hWn, WM_KEYDOWN, asc("V"), 0)
SendMessage( hWn, WM_KEYUP, 8, 0) //left ctrl
SendMessage( hWn, WM_KEYUP, asc("V"), 0)
oCbx1:bKeydown := {| nkey | COM_KEY( nKey ) }
FUNCTION COM_KEY_U( nKey )
IF nKey = VK_RETURN
QKeyboard( Chr( VK_TAB ), oCbx2:hWnd )
ENDIF
RETURN NIL
FUNCTION QKeyboard( TECLA, hWndCtl )
IF hWndCtl == Nil
hWndCtl := getactivewindow()
END
SetFocus( hWndCtl )
Postmessage( hWndCtl, WM_KEYDOWN, Asc( TECLA ) )
RETURN NIL
lc_oShell := tOleAuto():New( "WScript.Shell" )
lc_oShell:SendKeys("^V")
Natter wrote:How to emulate CTRL+V ?
oDlg:PostMsg(WM_KEYDOWN,ASC("V"),0)
Giovany Vecchi wrote:Try using WScript
- Code: Select all Expand view
lc_oShell := tOleAuto():New( "WScript.Shell" )
lc_oShell:SendKeys("^V")
#include "fivewin.ch"
#define WM_PASTE 770
function Main()
local oDlg, oBar, oGet
local cText := Space( 100 )
SetGetColorFocus()
DEFINE DIALOG oDlg SIZE 400,200 PIXEL TRUEPIXEL
DEFINE BUTTONBAR oBar OF oDlg SIZE 100,40 2007
DEFINE BUTTON OF oBar PROMPT "CtrlV" CENTER ;
ACTION ( oGet:SetFocus(), ;
TOleAuto():New( "WScript.Shell" ):SendKeys( "^V" ) )
DEFINE BUTTON OF oBar PROMPT "Paste" CENTER ;
ACTION SendMessage( oGet:hWnd, WM_PASTE, 0, 0 )
DEFINE BUTTON OF oBar PROMPT "Clear" CENTER ;
ACTION oGet:cText := Space( 100 )
//
@ 100,20 GET oGet VAR cText SIZE 360,24 PIXEL OF oDlg
ACTIVATE DIALOG oDlg CENTERED
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 28 guests