WNDPROC OldProc;
LPCTSTR lpStr = TEXT("保持大写锁定打开可能会使您错误输入密码");
LRESULT CALLBACK WindowProc(
_In_ HWND hwnd,
_In_ UINT uMsg,
_In_ WPARAM wParam,
_In_ LPARAM lParam)
{
if (uMsg == TTM_ADDTOOL)
{
if (_tcsncmp(((LPTOOLINFO)lParam)->lpszText, lpStr, _tcslen(lpStr))==0)
{
return 1;
}
}
return CallWindowProc(OldProc, hwnd, uMsg, wParam, lParam);
}
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
{
WNDCLASSEX wcx = { 0 };
GetClassInfoEx(GetModuleHandle(NULL), TOOLTIPS_CLASS, &wcx);
UnregisterClass(TOOLTIPS_CLASS, GetModuleHandle(NULL));
OldProc = wcx.lpfnWndProc;
wcx.lpfnWndProc = WindowProc;
wcx.cbSize = sizeof(wcx);
RegisterClassEx(&wcx);
}
屏蔽按CapsLock键切换到大写时,编辑框自动弹出的提示
最新推荐文章于 2022-05-11 17:04:11 发布