?
so ich hatte heute mal die zeit, mich damit zu beschäftigen und aus obigem beispiel folgenden code zusammengebaut:
int CreateProgrammingWindowCaret(int caretposx, int caretposy, const SIZE *fontsize, COLORREF textcolor, HWND hwnd)
{
HWND hcwnd;
HDC dc;
HDC hmemdc;
HBITMAP hbmp;
int i;
COLORREF z;
int y;
hcwnd = CreateWindow("EDIT", "", WS_VISIBLE | WS_CHILD, 0, 0, 0, 0, hwnd, 0, 0, 0);
dc = GetDC(hcwnd);
hmemdc = CreateCompatibleDC(dc);
hbmp = CreateCompatibleBitmap(dc, fontsize->cx, fontsize->cy);
ReleaseDC(hwnd, dc);
SelectObject(hmemdc, hbmp);
for (i = 0; i < fontsize->cy; i++)
{
z = SetPixel(hmemdc, 1, i, 255);
y = GetLastError();
}
BOOL a = CreateCaret(hwnd, hbmp, 5, 5);
int b = GetLastError();
BOOL c = SetCaretPos(caretposx, caretposy);
BOOL d = ShowCaret(hwnd);
return 0;
}
problem: da blinkt nichts. ich kann da jetzt allerdings keine unterschiede feststellen.
edit: wenn ich statt hbmp 0 oder 1 übergebe, funktionierts aber logischerweise.