Challenging question for any expert

Does anybody in the world have codings for this in either vb6 or vc++ so that it can be implemented in any windows OS on a system wide basis. IS this a very difficult process, for no experts in any sight have answered this question.?
               -----------------------------                        
                       Keyboard INPUT                        
               ------------------------------
                            | Ascii character(Say A)
                  |
      ---------------------------------------------        
                      Change toExteded Ascii (SayÜ)    
        ------------------------------------------------
                            |
                  |
      ---------------------------------------------        
                      Display in any active Application(System wide)    
        ------------------------------------------------                                              

 say if a user type A from the keyboard it should be converted to say € irrespective of whatever the application is running may be it is visual studio or word or notepad or photshop u name it.

 i need the codings of intercepting that message and load that message with extended ascii character(system wide and not for any single application)

thanks in advance
vimalpercyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NBrownohCommented:
this wont be too hard, you just need a program that watches keyboard event messages, gimme a few minutes and ill post some code for you.
0
NBrownohCommented:
ok, a little of what i found was that you can use win API call
Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
to tell if a key is being pressed such as...

Function GetPressedKey() As String
    For Cnt = 32 To 128
        If GetAsyncKeyState(Cnt) <> 0 Then
            GetPressedKey = ChrW$(Cnt)
            CurhWnd = GetActiveWindow
        End If
    Next Cnt
End Function

but this is a little weird, it only returns the absolute value of the key, like if i press a without pressing shift it returns that A was pressed, so youd have to detect if shift was down also.

you would then either send a keyboard event to the active program, like send backspace, then send the charactere you want it to be.  thats a bit junky and you need to use a timer to watch the GetKeyPressed function.

So i decided to look into hooks, you can hook your own threads keyboard calls but i couldnt get it to hook other threads messages so i figured that wouldnt be much of an option, unless someone else can determine what i was doing wrong for the hooking proc.

Public Function KeyboardProc(ByVal idHook As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    If idHook < 0 Then
        KeyboardProc = CallNextHookEx(hHook, idHook, wParam, 0)
    Else
        frmServer.Label1 = GetPressedKey
        KeyboardProc = CallNextHookEx(hHook, idHook, wParam, 0)
    End If
End Function

that worked pretty well for the application that created the thread, but it wont work outside that.  one good thing is that the hooking doesnt require any timers.  So i hope this helps direct you a little better, sorry i couldnt nail it down.

0
WorkingJourneymanCommented:
Adding to NBrownoh's excellent info...

It is possible to install a system-wide keyboard hook if the hooking code is packaged into a DLL. There is also a low-level keyboard hook (WH_KEYBOARD_LL) available which must be system-wide and seems to be the best match for your requirements. The documentation for these hooks should start you off on the right track.

MSDN links:
Hooks - http://msdn.microsoft.com/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/Hooks.asp
SetWindowsHookEx - http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/hooks/hookreference/hookfunctions/setwindowshookex.asp
KeyboardProc: http://msdn.microsoft.com/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/Hooks/HookReference/HookFunctions/KeyboardProc.asp
LowLevelKeyboardProc: http://msdn.microsoft.com/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/Hooks/HookReference/HookFunctions/LowLevelKeyboardProc.asp
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

AzraSoundCommented:
"Subclass Keyboard and Mouse Events in Other Applications (Version 2.0)"
http://www.freevbcode.com/ShowCode.Asp?ID=1610
0
vimalpercyAuthor Commented:
Thank you experts  and all the link what you have given has effectively dont meet my requirement for i have implemented those ideas to get to certain point in my project. I have given where my problem is and i really looking for a really talented expert who can challenge this question and come up with some ideas or codings

Project Description

________________________

Keyboard
________________________
|
V
--------------------------------------------

Keyboard Hook (I have done this part)
--------------------------------------------
|
V
--------------------------------------------
Getting the Key Pressed or
combination of the key pressed(I have done this part)
---------------------------------------------
|
V
___________________________
problem i have is changing this
character into extended Ascii
character and sending to the
active application (system Wide)      ( <<<<<<<<I want Help from you in this area>>>>>>>>)
???????????????????????
???????????????????????
___________________________

Is any expert there who can help me on this???
0
AzraSoundCommented:
'assume original hooked character is stored in strChar

'convert to Unicode
strChar = StrConv(strChar, vbUnicode)

'send new character
SendKeys strChar
0
vimalpercyAuthor Commented:
I have found the answer my self and so i like to post this question here
will i get all the 250 points though my available point is 60

Here the answers which i got is not the one i am looking for

so i like to close this question myself

thanks and regards
vimal
0
amp072397Commented:
PAQed, with points refunded (250)

amp
Community Support Moderator amp~at~experts-exchange.com
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.