איך אני יכול לבדוק אם ה caps lock דלוק או מכובה ב- MFC. הבעיה היא לא אם לוחצים עליו כרגע, אלא גם איך אני בודק בכל רגע נתון? כמו כן, איך מריצים תוכנה ב background ב - mfc?
ישנה פקודת API שבעזרתה אפשר לדעת אם ה CAPS LOCK הוא on או off. שם הפקודה GetKeyState. דוגמא:
#include <windows.h> #include <iostream.h> int main() { SHORT s; s = GetKeyState(VK_CAPITAL); cout << s << endl; if (s == 0) cout << "CAPS LOCK is off" << endl; else cout << "CAPS LOCK is on " << endl; return 0; }