Youssef,
I understand you use AppWizard or something like that to make an MFC application. (I don't so I do not know anything of ONPRETRANSLATEMESSAGE, which is MFC I suppose). But if you use AppWizard, you can do this using resources. Insert a new resource, type Accelerator. Choose an unique ID, at the Key field, fill in VK_F1 .. VK_F12, uncheck Ctrl, Alt and Shift and choose Type VirtKey. Do this 12 times, one for each function key.
If you press one of the function keys while the program is running, a WM_COMMAND message is generated, where LOWORD(wParam) == the unique ID-value you have chosen. AT that point you must take the action you have in mind for the function key.
Marcel