vermaashish_mca 0 Newbie Poster

Hi

I need to input data into the keyboard buffer; so that the input data will be written to the application which currently has the keyboard focus.

I have written the following code to input the unicode characters into the key board buffer but the output is not the desired Kanji Shift Jis character.

KEYBDINPUT kb={0};
INPUT Input={0};

INPUT input_down;
    input_down.type = INPUT_KEYBOARD;          
    input_down.ki.wVk = 0;
    input_down.ki.wScan = 0x93FA;
    input_down.ki.dwFlags = KEYEVENTF_UNICODE;                                 
    INPUT input_up/* = new INPUT()*/;
    input_up.type = INPUT_KEYBOARD;          
    input_up.ki.wVk = 0;
    input_up.ki.wScan = 0x93FA;
    input_up.ki.dwFlags = KEYEVENTF_KEYUP | KEYEVENTF_UNICODE;
    INPUT pINPUT[] = {input_down, input_up};
    UINT res = SendInput(2, pINPUT, sizeof(input_down));

SendInput Returns 2 which means all the events are successful.

Output is not the Kanji 日 (0x93FA); can you please suggest what we need to do so that we will be able to get the output as desired 日.

In the kanji table (0x93FA) is 日.
http://www.rikai.com/library/kanjitables/kanji_codes.sjis.shtml

As the above code is not be able to output 日; do we need to set some keyboard layout or something else so that while Input the 0x93FA with SendInput API 日 will be output.

Thank You

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.