hi
I am building a windows application in .net 2.0 framework.
The main characterstic of the application will be that it will installes and run in the background of any client machine and get all keystrokes and mouse clicks by the user.
Then these keystrokes are converted from Ansi characters to devnagari script unicode characters. While the application is running in the background if user open a text editor as notepad, MS Word, WordPad etc. and types "k" then it should be "ka" of devnagari script.
I have done all the initial stuff to get the keystroke and run the application in the background.
Now my main problem is that how to convert that ascii letter 'k' to unicode "ka" and get it printed in the foreground applications.
In additon I am getting the virtual key code of the key but not able to convert it accordingly..
Please help me there is being a month or more while I am searching the answer of the problem.
I realy be highly thankful...
Swati SharmaPosted Oct 4, 2008, 4:15 AM
Thanks for the answer Ayan
But I think u had not understood properly what I asked.
Actually my application run in the background so I do not know which type of editor user had opened.
Secondly I want to convert my keystrokes to Unicode Devnagari letters.
As if there is "k" it would be "ka" or "m" to "ma".
In my opinion the Ascii or Ansi code provided by the keystroke should be checked and convert according to the character of the Devanagari script.
But I do not know how to do it.
So I am in great fuss. I just need help Please
AlanPosted Oct 2, 2008, 2:27 PM
These two Wikipedia articles may help with both the transliteration of Roman to Devanagari letters and the unicode character numbers for the latter:
http://en.wikipedia.org/wiki/Devan%C4%81gar%C4%AB
http://en.wikipedia.org/wiki/Devanagari_transliteration
I see from the table that 'ka' is character '\u0915' in unicode.
I thought I'd just try these out by opening Wordpad and sending a range of Devanagari letters to it. The following console application worked fine:
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows.Forms;
class Test
{
[DllImport("user32.dll")]
static extern bool SetForegroundWindow(IntPtr hWnd);
static void Main()
{
Process[] procs = Process.GetProcessesByName("Wordpad");
IntPtr hWnd = procs[0].MainWindowHandle;
SetForegroundWindow(hWnd);
for (char c = '\u0905'; c <= '\u0939'; c++)
SendKeys.SendWait(c.ToString());
}
}