Re: GTK+ PopUp Window make it Transparent...



Wolfman writes:
1.Do u know how to get the HWND(is there a way to get the HWND from
HGDIOBJ?)

I don't know about HGDIOBJ, but you can get the HWND for a Gdk window
by including <gdk/gdkwin32.h> and using the function
gdk_win32_drawable_get_handle().

Its looks quit easy under win32:

// Set WS_EX_LAYERED on this window 
SetWindowLong(hwnd, GWL_EXSTYLE,
        GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
// Make this window 70% alpha
SetLayeredWindowAttributes(hwnd, 0, (255 * 70) / 100, LWA_ALPHA);

Please do experiment an tell us what you find out. I have been
planning to hack on alpha windows for a long time, but never got
around to do it. I haven't done any actual tests, but if I recall
correctly, I got the impression that one would need to rethink lots of
the way stuff is drawn to windows if they are layered. But I might
have misunderstood something.

The problem is how to get this mechanism to GTK+ or better to cairo?

Target function: cairo_set_source_rgba
Is it possible to get the hwnd from cairo_t struct?

Hmm, you can get the HDC with cairo_win32_surface_get_dc(), but I
don't think there is any way to get the HWND from the HDC, oddly
enough.

--tml




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]