0

i've searched for a solution but I didn't find any solution. In native Win32 it is possible to make the clientarea of a framedwindow transparent:

HWND hwnd = (HWND)GetHandle();
SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED|WS_EX_TOOLWINDOW);
SetLayeredWindowAttributes(hwnd, RGB(255,255,255), 0, LWA_COLORKEY);
Refresh();

This works with wxwidgets too. It makes the clientarea transparent too. But now the windows form isn't clickable. I've tried to put this code in the paint-event-method "TestFrame::OnPaint(wxPaintEvent& event)" and in the method "TestFrame::TestFrame(wxWindow* parent,wxWindowID id)".

I only need to make the titlebar clickable to move the window around.

Thank you in advance.

2 Answers2

0

It is probably a bad idea to mix windows API calls in with wxWidgets code.

Have you tried wxWindow::SetTransparent ( wxByte alpha ) ?

http://docs.wxwidgets.org/trunk/classwx_window.html#ac8cf4398cec50ac36634760f45a0656f

ravenspoint
  • 19,093
  • 6
  • 57
  • 103
0

try

HWND hwnd = (HWND)GetHandle();
SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED|WS_EX_TOOLWINDOW);
SetLayeredWindowAttributes(hwnd, RGB(255,255,0), 0, LWA_COLORKEY);

and set the backgroundcolor=yellow

Maybe the problem was your choice to use rgb(255,255,255). If you use RGB(255,255,0). It works.

wieschoo
  • 1
  • 1