Dear All,
I am using May-2006 build. In multi line Get Insert mode always on. Even if I press Ins key, there is no effect.
How to enter Overwrite mode ?
TIA
Milan.
bGotFocus := {|| lOldKey:= SetNumLock() }
bLostFocus := {|| SetNumLock( lOldKey ) }
dtussman wrote:Thats all too complicated for me. I need a simple solution, LOL
// C:\FWH..\SAMPLES\NUM_CAPS.PRG
#include "fivewin.ch"
*#include "Dll.ch"
*----------------------------------------------------------------------
* Vejam como funciona
*----------------------------------------------------------------------
* SETCAPSLOCK( .T. ou .F. ) = Liga e desliga o Capslock
* SETNUMLOCK( .T. ou .F. ) = Liga e desliga o NumLock
* SETSCROLLOCK( .T. ou .F. ) = Liga e desliga o ScrollLock
* SETINSERT( .T. ou .F. ) = Liga e desliga o Insert
*----------------------------------------------------------------------
* VERCAPSLOCK() = Sem parametros retorna o estado do Capslock
* VERNUMLOCK() = Sem parametros retorna o estado do NumLock
* VERSCROLLOCK() = Sem parametros retorna o estado do ScrollLock
* VERINSERT() = Sem parametros retorna o estado do Insert
*----------------------------------------------------------------------
/*
*************
function MAIN
*************
? SETCAPSLOCK( .F. )
? "Desligando o CapsLock"
SETCAPSLOCK( .T. )
? "Ligando o CapsLock"
SETCAPSLOCK( .F. )
? "Desligando o CapsLock"
SETCAPSLOCK( .T. )
? "Ligando o CapsLock"
SETCAPSLOCK( .F. )
? "Desligando o CapsLock"
? "O Capslock esta' " + iif( VERCAPSLOCK(), "Ligado", "Desligado" )
SETNUMLOCK( .F. )
? "Desligando o NumLock"
SETNUMLOCK( .T. )
? "Ligando o NumLock"
SETNUMLOCK( .F. )
? "Desligando o NumLock"
SETNUMLOCK( .T. )
? "Ligando o NumLock"
SETNUMLOCK( .F. )
? "Desligando o NumLock"
? "O Numlock esta' " + iif( VERNUMLOCK(), "Ligado", "Desligado" )
SETSCROLLOCK( .F. )
? "Desligando o ScrollLock"
SETSCROLLOCK( .T. )
? "Ligando o ScrollLock"
SETSCROLLOCK( .F. )
? "Desligando o ScrollLock"
SETSCROLLOCK( .T. )
? "Ligando o ScrollLock"
SETSCROLLOCK( .F. )
? "Desligando o ScrollLock"
? "O ScrollLock esta' " + iif( VERSCROLLOCK(), "Ligado", "Desligado" )
SETINSERT( .T. )
? "Ligando o Insert"
SETINSERT( .F. )
? "Desligando o Insert"
? "O Insert esta' " + iif( VERINSERT(), "Ligado", "Desligado" )
return NIL
*/
*------------------------------------------------------------*
* FUNCAO PARA ATIVAR A TECLA CAPSLOCK *
*------------------------------------------------------------*
#pragma begindump
#define _WIN32_IE 0x0500
#define HB_OS_WIN_32_USED
#define _WIN32_WINNT 0x0400
#include <windows.h>
#include "hbapi.h"
HB_FUNC ( SETCAPSLOCK )
{
BYTE keyState[256];
GetKeyboardState((LPBYTE)&keyState);
if( (hb_parl(1) && !(keyState[VK_CAPITAL] & 0)) || (!hb_parl(1) && (keyState[VK_CAPITAL] & 1)) )
{
keybd_event( VK_CAPITAL, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0 );
keybd_event( VK_CAPITAL, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
}
}
#pragma enddump
*-----------------------------------------------------------*
* FUNCAO PARA ATIVAR A TECLA NUMLOCK *
*-----------------------------------------------------------*
#pragma begindump
#define _WIN32_IE 0x0500
#define HB_OS_WIN_32_USED
#define _WIN32_WINNT 0x0400
#include <windows.h>
#include "hbapi.h"
HB_FUNC ( SETNUMLOCK )
{
BYTE keyState[256];
GetKeyboardState((LPBYTE)&keyState);
if( (hb_parl(1) && !(keyState[VK_NUMLOCK] & 0)) || (!hb_parl(1) && (keyState[VK_NUMLOCK] & 1)) )
{
keybd_event( VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0 );
keybd_event( VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
}
}
#pragma enddump
*-----------------------------------------------------------*
* FUNCAO PARA ATIVAR A TECLA SCROLLOCK *
*-----------------------------------------------------------*
#pragma begindump
#define _WIN32_IE 0x0500
#define HB_OS_WIN_32_USED
#define _WIN32_WINNT 0x0400
#include <windows.h>
#include "hbapi.h"
HB_FUNC ( SETSCROLLOCK )
{
BYTE keyState[256];
GetKeyboardState((LPBYTE)&keyState);
if( (hb_parl(1) && !(keyState[VK_SCROLL] & 0)) || (!hb_parl(1) && (keyState[VK_SCROLL] & 1)) )
{
keybd_event( VK_SCROLL, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0 );
keybd_event( VK_SCROLL, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
}
}
#pragma enddump
*-----------------------------------------------------------*
* FUNCAO PARA ATIVAR A TECLA SCROLLOCK *
*-----------------------------------------------------------*
#pragma begindump
#define _WIN32_IE 0x0500
#define HB_OS_WIN_32_USED
#define _WIN32_WINNT 0x0400
#include <windows.h>
#include "hbapi.h"
HB_FUNC ( SETINSERT )
{
BYTE keyState[256];
GetKeyboardState((LPBYTE)&keyState);
if( (hb_parl(1) && !(keyState[VK_INSERT] & 0)) || (!hb_parl(1) && (keyState[VK_INSERT] & 1)) )
{
keybd_event( VK_INSERT, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0 );
keybd_event( VK_INSERT, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
}
}
#pragma enddump
#pragma begindump
#define _WIN32_IE 0x0500
#define HB_OS_WIN_32_USED
#define _WIN32_WINNT 0x0400
#include <windows.h>
#include "hbapi.h"
HB_FUNC ( VERCAPSLOCK )
{
BYTE keyState[256];
GetKeyboardState((LPBYTE)&keyState);
hb_retl( keyState[VK_CAPITAL] );
}
#pragma enddump
*-----------------------------------------------------------*
* FUNCAO PARA VERIFICAR A TECLA NUMLOCK *
*-----------------------------------------------------------*
#pragma begindump
#define _WIN32_IE 0x0500
#define HB_OS_WIN_32_USED
#define _WIN32_WINNT 0x0400
#include <windows.h>
#include "hbapi.h"
HB_FUNC ( VERNUMLOCK )
{
BYTE keyState[256];
GetKeyboardState((LPBYTE)&keyState);
hb_retl( keyState[VK_NUMLOCK] );
}
#pragma enddump
*-----------------------------------------------------------*
* FUNCAO PARA VERIFICAR A TECLA SCROLLOCK *
*-----------------------------------------------------------*
#pragma begindump
#define _WIN32_IE 0x0500
#define HB_OS_WIN_32_USED
#define _WIN32_WINNT 0x0400
#include <windows.h>
#include "hbapi.h"
HB_FUNC ( VERSCROLLOCK )
{
BYTE keyState[256];
GetKeyboardState((LPBYTE)&keyState);
hb_retl( keyState[VK_SCROLL] );
}
#pragma enddump
*-----------------------------------------------------------*
* FUNCAO PARA VERIFICAR A TECLA SCROLLOCK *
*-----------------------------------------------------------*
#pragma begindump
#define _WIN32_IE 0x0500
#define HB_OS_WIN_32_USED
#define _WIN32_WINNT 0x0400
#include <windows.h>
#include "hbapi.h"
HB_FUNC ( VERINSERT )
{
BYTE keyState[256];
GetKeyboardState((LPBYTE)&keyState);
hb_retl( keyState[VK_INSERT] );
}
#pragma enddump
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 36 guests