Actually it's lParam of a keyboard hook (should be equal though). I want to get key name for a key I saved to an .ini file. On user input lParam has the scan code of the key that I send to GetKeyNameText. I tried OemKeyScan with ascii value of the key and left-shifted the result(cause lParam got scan code in bit 16) it works for normal keys. Extended Keys like F1 don't come out right (eg. F1 results in Q). Also I have

invoke ImageList_Create,16,16,ILC_COLOR16,10,0
It does return a value >0 but GetLastError returns 'not enough memory for this command and follow-up calls to the list fail with invalid handle. This message was edited by goofee, on 6/16/2001 1:02:20 PM
Posted on 2001-06-16 11:20:00 by goofee
Hi goofee, If I get it right, GetKeyNameText requires the *whole* lparam value of a notification message such as WM_KEYDOWN to retrieve the ascii name of the key pressed, but it only processes the OEM scan code in bits 16-23 and the extended key flag in bit 24. If you're only passing the low-order word of the return value from OemKeyScan, which contains the scan code of the given OEM character, to GetKeyNameText then it might not be in the right format for the function to interpret it properly. Maybe try it with the full lparam value of your keyboard hook? As for converting the wparam result (virtual-key code) to the lparam result in WM_KEYDOWN, it sounds like MapVirtualKey will at least give you the scan code portion of what's in lparam. Cheers, Kayaker
Posted on 2001-06-17 04:17:00 by Kayaker
Thanks Kayaker, Well, I don't have lParam value. MapVirtualKey did it though. Converted my previously saved virtual key code straight to scan code. This message was edited by goofee, on 6/19/2001 2:43:33 PM
Posted on 2001-06-19 14:42:00 by goofee
Anyone an idea about ImageList_Create ? First function in a procedure right after the locals.
Posted on 2001-06-19 14:47:00 by goofee