can i apply a event system wide.
actually i want to apply the function activatekeyboardlayout() on the whole system.
don't have any idea of it in windows programming.
To make your function be executed by every process on the system put it in a dll (actually 2 dll's if you want also to target 64-bit windows) and inject it into every process.
You either use assembly code for that, CreateRemoteThread() API or SetWindowHookEx() API. Either technique has it's own issues and the antivirus program could block your program.