+bool ScintillaWX::CreateSystemCaret() {
+#ifdef __WXMSW__
+ sysCaretWidth = vs.caretWidth;
+ if (0 == sysCaretWidth) {
+ sysCaretWidth = 1;
+ }
+ sysCaretHeight = vs.lineHeight;
+ int bitmapSize = (((sysCaretWidth + 15) & ~15) >> 3) * sysCaretHeight;
+ char *bits = new char[bitmapSize];
+ memset(bits, 0, bitmapSize);
+ sysCaretBitmap = ::CreateBitmap(sysCaretWidth, sysCaretHeight, 1,
+ 1, reinterpret_cast<BYTE *>(bits));
+ delete [] bits;
+ BOOL retval = ::CreateCaret(GetHwndOf(stc), sysCaretBitmap,
+ sysCaretWidth, sysCaretHeight);
+ ::ShowCaret(GetHwndOf(stc));
+ return retval != 0;
+#else
+ return false;
+#endif
+}