Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than user32, prefix the name with the module name and a period.
CreateCaret (user32)
.
C# Signature:
[DllImport("user32.dll")]
static extern bool CreateCaret(IntPtr hWnd, IntPtr hBitmap, int nWidth,
int nHeight);
VB.NET:
<DllImport("user32.dll")> _
Function CreateCaret(ByVal hWnd As IntPtr, _
ByVal hBitmap As IntPtr, _
ByVal nWidth As Integer, _
ByVal nHeight As Integer) As Boolean
End Function
User-Defined Types:
None.
Notes:
Windows allows only one caret per message queue. To add a caret to a control, handle the WM_SETFOCUS message, or the GotFocus event, or override OnGotFocus if you're writing a custom control, and call CreateCaret from the message or event handler. You should also handle WM_KILLFOCUS, LostFocus or OnLostFocus and call DestroyCaret. You will also need to call ShowCaret to make the caret visible, and SetCaretPos to set its position.
Tips & Tricks:
Please add some!
Sample Code:
//C# Example. This will create and show the caret in textBox1 when button1 is clicked.
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).