الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

ممكن التكرم الافادة لنا عن هذه الدالتين

بدأه FastCode2010 في 15 فبراير 2009 · 2 رد · 1,103 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكــم ورحمـة الله وبركاتــه

تحياتي الى اعضاء المنتدى

اتمنى من الاخوه الاعزاء خبراء السي بلاس الافاده

انا ابحث عن درس بسيط عن الدالتين

ToUnicodeEx

ToAscii

متى يتم استخدام وماهي فائدتهما

مع التكرم بذكر مثال بسيط لتطبيق

والشكر مقدما لكل من لا يبخل لاخوانه المسلمين بعلمه

#2

From MSDN

ToUnicodeEx

ToAscii

  • ToUnicodeEx

    UINT wVirtKey,
    UINT wScanCode,
    const PBYTE lpKeyState,
    LPWSTR pwszBuff,
    int cchBuff,
    UINT wFlags,
    HKL dwhkl
    );
    int ToUnicodeEx(


    LEFT TO RIGHT


    Parameters
    wVirtKey
    [in] Specifies the virtual-key code to be translated.
    wScanCode
    [in] Specifies the hardware scan code of the key to be translated. The high-order bit of this value is set if the key is up.
    lpKeyState
    [in] Pointer to a 256-byte array that contains the current keyboard state. Each element (byte) in the array contains the state of one key. If the high-order bit of a byte is set, the key is down.
    pwszBuff
    [out] Pointer to the buffer that receives the translated Unicode character or characters. However, this buffer may be returned without being null-terminated even though the variable name suggests that it is null-terminated.
    cchBuff
    [in] Specifies the size, in wide characters, of the buffer pointed to by the pwszBuff parameter.
    wFlags
    [in] Specifies the behavior of the function. If bit 0 is set, a menu is active. Bits 1 through 31 are reserved.
    dwhkl
    [in] Input locale identifier used to translate the specified code. This parameter can be any input locale identifier previously returned by the LoadKeyboardLayout function.

  • ToAscii

    UINT uVirtKey,
    UINT uScanCode,
    PBYTE lpKeyState,
    LPWORD lpChar,
    UINT uFlags
    );
    int ToAscii(



    Parameters
    uVirtKey
    [in] Specifies the virtual-key code to be translated.
    uScanCode
    [in] Specifies the hardware scan code of the key to be translated. The high-order bit of this value is set if the key is up (not pressed).
    lpKeyState
    [in] Pointer to a 256-byte array that contains the current keyboard state. Each element (byte) in the array contains the state of one key. If the high-order bit of a byte is set, the key is down (pressed).
    The low bit, if set, indicates that the key is toggled on. In this function, only the toggle bit of the CAPS LOCK key is relevant. The toggle state of the NUM LOCK and SCROLL LOCK keys is ignored.
    lpChar
    [out] Pointer to the buffer that receives the translated character or characters.
    uFlags
    [in] Specifies whether a menu is active. This parameter must be 1 if a menu is active, or 0 otherwise.


#3

اشكرك اخي ولكن شو الفرق بينهم

مواضيع مشابهة