[Dev-C++] Questions on WS_TABSTOP, WS_DISABLED and BitBlt
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Lucas K. T. <lk...@bo...> - 2003-02-16 14:43:13
|
Ok, first of all, I'm using WinXP and for some reason when I define controls
with the WS_TABSTOP style they should receive tab input to lose/gain focus,
right? but for some reason, then don't! eheheh btw, I'm creating those
controls with WS_VISIBLE and WS_CHILD within the WS_CREATE message handler.
As for disabling a button, I've tried using WS_ENABLE with FALSE and then
turning it back on, but that way, the control simply gets grayed, but not
disabled, but then if I add the WS_DISABLED style flag it doesn't seem to be
writeable at all, I was wondering if there was any way around this, without
having to call SetWindowLong.
And last: I'm trying to make a game, and I create a static control with
WS_CHILD | WS_VISIBLE| SS_OWNERDRAW | SS_NOTIFY styles.... then I used this
as a handler for WM_DRAWITEM:
case WM_DRAWITEM:
HBITMAP hBoardBmp, hOldBmp;
HDC hBoardDC;
LPDRAWITEMSTRUCT lpdis;
hBoardDC = CreateCompatibleDC(lpdis->hDC);
hBoardBmp = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(RSBORD));
hOldBmp = (HBITMAP)SelectObject(hBoardDC, hBoardBmp);
if (!BitBlt(lpdis->hDC, 0, 0, 93, 93, hBoardDC, 0, 0, SRCCOPY))
{
char a[50];
DWORD er;
er = GetLastError();
wsprintf(a, "%lu", er);
MessageBox(hWnd, a, NULL, 0);
}
SelectObject(hBoardDC, hOldBmp);
DeleteObject(hBoardBmp);
DeleteObject(hOldBmp);
DeleteDC(hBoardDC);
break;
Anyway, after some time trying to debug it, I found out BitBlt was giving me
an error code 6, then I went to dos prompt and typed 'net help 6' and 'net
helpmsg 6" both give me error message, so Ican't really figure out what's
going on, anyone's got any idea what error code 6 is? and/or how do I fix
this?
Note: The LoadBitmap call is working perfectly, it has no errors... I've
checked the only faulty one is BitBlt or perhaps SelectObject which I
couldn't really check.
Thanks for any answers...
lkt153
|