I'm sorry, I had already posted this thread in the C++ forum. But since I still don't have a really satifying solution yet and I have a great confidence in the vb-winapi forum members, I'll ask you guys.
One suggestion I got, is to use the "Microsoft Agent" system. I guess that would work, but I see that as the last option.
Anyway, this was my original question (the only real difference with my vb code is that I didn't repaint the window, but just used the Form.Picture property to add an background image):
I've got a graphical problem using a window region. The application I'm making is a sort of screenmate. It's a ball (the elliptic rgn) with a "3d-picture" that bounches on the window's taskbar. You can pick it up en throw it around.
This all works fine, the only problem is that it flickers.
It makes the image blurry and sometimes you can see the window's original rectangle.
The code is really simple (in order of execution):
- winmain, register wnd class, create wnd etc.
- create & apply region (80x80 px), show window
- main loop:
- update position (based on velocity, gravity etc.)
- move window to new position
and in windowproc
- WM_PAINT: bitblt bmp (dc created using createcompatible dc & select bmp into new dc, no rocket science here..)
I first wrote it in vb, but I ended up using so many winapi calls and subclassing my own window, I decided to switch to c++. The vb-code didn't work much better anyway.
I hope someone can give some advice or tips..
(and please tell me if you need more information about the code).
(thread207-403527)
One suggestion I got, is to use the "Microsoft Agent" system. I guess that would work, but I see that as the last option.
Anyway, this was my original question (the only real difference with my vb code is that I didn't repaint the window, but just used the Form.Picture property to add an background image):
I've got a graphical problem using a window region. The application I'm making is a sort of screenmate. It's a ball (the elliptic rgn) with a "3d-picture" that bounches on the window's taskbar. You can pick it up en throw it around.
This all works fine, the only problem is that it flickers.
It makes the image blurry and sometimes you can see the window's original rectangle.
The code is really simple (in order of execution):
- winmain, register wnd class, create wnd etc.
- create & apply region (80x80 px), show window
- main loop:
- update position (based on velocity, gravity etc.)
- move window to new position
and in windowproc
- WM_PAINT: bitblt bmp (dc created using createcompatible dc & select bmp into new dc, no rocket science here..)
I first wrote it in vb, but I ended up using so many winapi calls and subclassing my own window, I decided to switch to c++. The vb-code didn't work much better anyway.
I hope someone can give some advice or tips..
(and please tell me if you need more information about the code).
(thread207-403527)