leftoccupy.blogg.se

Mfc blinkk
Mfc blinkk










MFC BLINKK HOW TO

The following code sample shows how to have your application hide the caret while drawing a character on the screen and while processing the WM_CHAR message. If your application processes the WM_PAINT message, it is not necessary to hide and redisplay the caret, because this function does this automatically. When your application is finished drawing, redisplay the caret by using the ShowCaret function. Whenever your application redraws a screen while processing a message other than WM_PAINT, it must make the caret invisible by using the HideCaret function. The bitmap defines the size of the caret. If your application specifies a bitmap handle, CreateCaret ignores the width and height parameters. For more information about bitmaps, see Bitmaps. HCaret = LoadBitmap(hinst, MAKEINTRESOURCE(120)) Īlternatively, you can use the CreateBitmap or CreateDIBitmap function to retrieve the handle of the caret bitmap. Load the application-defined caret resource.

mfc blinkk

For example, you could replace the CreateCaret line in the preceding example with the following lines to create a bitmap caret. Your application can then use the LoadBitmap function to load the bitmap handle. You can use a graphics application to create the bitmap and a resource compiler to add the bitmap to your application's resources. To create a caret based on a bitmap, you must specify a bitmap handle when using CreateCaret. Adjust the caret position, in client coordinates. Int x // horizontal coordinate of cursorĬreateCaret(hwnd, (HBITMAP) NULL, nWidth, nHeight) The system sends the WM_SETFOCUS message to the window receiving keyboard focus therefore, an application should create and display the caret while processing this message. You can then call SetCaretPos to set the current position of the caret and ShowCaret to make the caret visible. Use the CreateCaret function to create a caret in the given window.

mfc blinkk

Upon receiving the keyboard focus, the window should create and display the caret.

mfc blinkk

This section has code samples for the following tasks:










Mfc blinkk