Re: [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 23:06:12
|
Thanks for everything...
I'm still in trouble with the TAB thing... I added WS_EX_CONTROLPARENT to
the parent window, but I don't know, for some reason it still won't go, I
haven't tested yet the disabling thing, I used to use
SendDlgItemMessage(blah, blah, WM_ENABLE, ...)
but it didn't work properly, wouldn't ti be the same?
and thanks the BitBlt is now working, stupid me, it was a momentary lapse=
,
thanks...
lkt153
----- Original Message -----
From: "OROSZI Bal=E1zs" <or...@vp...>
To: <dev...@li...>
Sent: Sunday, February 16, 2003 6:54 PM
Subject: Re: [Dev-C++] Questions on WS_TABSTOP, WS_DISABLED and BitBlt
> Hello!
>
> Lucas K. Tavares wrote:
> > 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!
> Hmm..., strange problem I encountered a long time ago. If your window,
> where the controls are is not a dialog box, but it is created with
> CreateWindow(), then you should create it with CreateWindowEx() and
> specify the first argument (dwExStyle) with WS_EX_CONTROLPARENT. Look i=
n
> the docs (Win32 API reference) for details on this.
>
> > 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 see=
m
to be
> > writeable at all, I was wondering if there was any way around this,
without
> > having to call SetWindowLong.
> Use EnableWindow(hButton,FALSE) to disable and
> EnableWindow(hButton,TRUE) to enable the button.
>
> > And last: I'm trying to make a game, and I create a static control wi=
th
> > WS_CHILD | WS_VISIBLE| SS_OWNERDRAW | SS_NOTIFY styles.... then I use=
d
this
> > as a handler for WM_DRAWITEM:
> >
> > case WM_DRAWITEM:
> > HBITMAP hBoardBmp, hOldBmp;
> > HDC hBoardDC;
> > LPDRAWITEMSTRUCT lpdis;
> lpdis is in lParam. So you probably need this here:
> lpdis =3D (LPDRAWITEMSTRUCT)lParam;
>
> > hBoardDC =3D CreateCompatibleDC(lpdis->hDC);
> > hBoardBmp =3D LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(RSBOR=
D));
> > hOldBmp =3D (HBITMAP)SelectObject(hBoardDC, hBoardBmp);
> > if (!BitBlt(lpdis->hDC, 0, 0, 93, 93, hBoardDC, 0, 0, SRCCOPY))
> Are you sure, it is 93*93? You should use the lpdis->rcItem rectangle,
> which specifies the boundaries of the control.
>
> > {
> > char a[50];
> > DWORD er;
> > er =3D GetLastError();
> > wsprintf(a, "%lu", er);
> > MessageBox(hWnd, a, NULL, 0);
> > }
> > SelectObject(hBoardDC, hOldBmp);
> > DeleteObject(hBoardBmp);
>
> This is not needed:
> > DeleteObject(hOldBmp);
> The old bitmap was not created by you.
>
> > DeleteDC(hBoardDC);
> > break;
>
> Hope I could help.
> --
> Greetings,
> Bal=E1zs
|