Home > Back-end >  How to implement password box capital prompt function
How to implement password box capital prompt function

Time:10-12

Like when landing QQ, if open the Caps Look key when prompted "Caps lock has been opened", etc., in c + + builder how to implement the excuse me, thank you!

CodePudding user response:

 if (! GetKeyState (VK_CAPITAL)))//if the caps lock key is not to press the 
{
ShowMessage (" caps lock key is not pressed ");
}
The else
{
ShowMessage (" caps lock key press ");
}

CodePudding user response:

reference 1st floor guanchaoyi response:
 if (! GetKeyState (VK_CAPITAL)))//if the caps lock key is not to press the 
{
ShowMessage (" caps lock key is not pressed ");
}
The else
{
ShowMessage (" caps lock key press ");
}

This is not what I want, what I need is when the mouse to click Edit to enter, there is a bubble shows that the "caps lock has open... "

CodePudding user response:

 void __fastcall TForm1: : Edit1Enter (TObject * Sender) 
{
If (GetKeyState (VK_CAPITAL))
{
Hw THintWindow *;
TRect the rect (
Mouse - & gt; CursorPos. X,
Mouse - & gt; CursorPos. J y,
Mouse - & gt; CursorPos. X + 200,
Mouse - & gt; CursorPos. Y + 30
);

Hw=new THintWindow (Application);
Hw - & gt; The Font - & gt; Style=hw - & gt; The Font - & gt; Style & lt; Hw - & gt; ActivateHint (the rect, "capital");
Sleep (500);
The delete hw.
}
}


Try this

CodePudding user response:

The
reference 3 floor ksrsoft response:
 void __fastcall TForm1: : Edit1Enter (TObject * Sender) 
{
If (GetKeyState (VK_CAPITAL))
{
Hw THintWindow *;
TRect the rect (
Mouse - & gt; CursorPos. X,
Mouse - & gt; CursorPos. J y,
Mouse - & gt; CursorPos. X + 200,
Mouse - & gt; CursorPos. Y + 30
);

Hw=new THintWindow (Application);
Hw - & gt; The Font - & gt; Style=hw - & gt; The Font - & gt; Style & lt; Hw - & gt; ActivateHint (the rect, "capital");
Sleep (500);
The delete hw.
}
}


Try this

Error: [BCC32 Error] Unit1. CPP (42) : E2451 Undefined symbol 'THintWindow, THintWindow is how to define, please?

CodePudding user response:

The elder brothers, like QQ, you want to make a frame diagram, to control in the IMAGE, press the caps will show, not to eliminate, both beautiful and simple, or CB controls do not QQ that controls with triangle index,

Don't have to code, themselves to do just write it,

CodePudding user response:

 # include & lt; Controls. Hpp> 

Include the header file

CodePudding user response:

Is learning...

CodePudding user response:

#include

If (GetKeyState (VK_CAPITAL))
{
EDITBALLOONTIP ebt.
Ebt. CbStruct=sizeof (EDITBALLOONTIP);
Ebt. PszText=L "locking capital may lead to enter the password wrong \ n if you want to close the Lock, please press " Caps Lock \ "";
Ebt. PszTitle=L "caps lock open";
Ebt. TtiIcon=TTI_WARNING;
Edit_ShowBalloonTip (hWnd, & amp; Ebt);
}
The else
{
Edit_HideBalloonTip (hWnd);
}

Specific can consult Edit_ShowBalloonTip MSDN.
Note: Edit_ShowBalloonTip is a macro definition

CodePudding user response:

Since the picture window

CodePudding user response:

reference 4 floor u010687066 response:
Quote: reference ksrsoft reply: 3/f

 void __fastcall TForm1: : Edit1Enter (TObject * Sender) 
{
If (GetKeyState (VK_CAPITAL))
{
Hw THintWindow *;
TRect the rect (
Mouse - & gt; CursorPos. X,
Mouse - & gt; CursorPos. J y,
Mouse - & gt; CursorPos. X + 200,
Mouse - & gt; CursorPos. Y + 30
);

Hw=new THintWindow (Application);
Hw - & gt; The Font - & gt; Style=hw - & gt; The Font - & gt; Style & lt; Hw - & gt; ActivateHint (the rect, "capital");
Sleep (500);
The delete hw.
}
}


Try this

Error: [BCC32 Error] Unit1. CPP (42) : E2451 Undefined symbol 'THintWindow, THintWindow is how to define, please?


Learning can be implemented, but is not very beautiful,

CodePudding user response:

Good post, mark

CodePudding user response:

With three party controls
  • Related