Page 1 of 1

(SOLVED) How make transpatent window and see my desktop?

Posted: Mon Apr 03, 2006 3:00 pm
by Lev_a
I want create my game in window, not standart rectangular form - without red box with cross in right top (close window).
I want apply my skin - without standart windows system buttons and, for example, round shape.
When I tryed to do that, but

Code: Select all

driver->beginScene(true, true, irr::video::SColor(10, 150, 150, 150));
draw window with color(10, 150, 150, 150) not transparent.

All my idea:

Code: Select all

irr::IrrlichtDevice *device = createDevice(EDT_DIRECT3D8, irr::core::dimension2d<s32>(300, 300), 16, false, false, true, &receiver);

IVideoDriver *driver = device->getVideoDriver();
IGUIEnvironment *env = device->getGUIEnvironment();

irr::gui::IGUIImage *Title = env->addImage("TransparentImage.tga", irr::core::position2d<s32>(0,0), true); 

while(device->run())
{
  driver->beginScene(true, true, irr::video::SColor(10, 150, 150, 150));
  env->drawAll();
  driver->endScene();
}
And I want see through window and see my desktop.
Any idea???

Posted: Mon Apr 03, 2006 6:37 pm
by Lev_a
I found solution:

Code: Select all

 LONG Style = GetWindowLong(hwnd, GWL_STYLE);
 Style &= ~WS_CAPTION;     // reset bit to 0
 SetWindowLong(hwnd, GWL_STYLE, Style);
 RECT clientSize;
 clientSize.top = 0;
 clientSize.left = 0;
 clientSize.right = 300;
 clientSize.bottom = 300;
 HRGN hRgn;
 GetWindowRect(hwnd, &clientSize);
 OffsetRect(&clientSize,  -clientSize.left+1,  -clientSize.top+1);
 hRgn = CreateRoundRectRgn(
  clientSize.left+2, clientSize.top+2, clientSize.right-2, clientSize.bottom-2, 
  (clientSize.right-clientSize.left)/3, (clientSize.bottom-clientSize.top)/2);
  SetWindowRgn(hwnd, hRgn, TRUE);

You can see it http://msdn.microsoft.com/library/defau ... s_6o6r.asp