Avatar of RAFAAJ
 asked on

Semi-Transparent Button created by "CreateWindowEx" !!

I have created  a "Button" class window via "CreateWindowEx" API.

what I want is to have this newly created button to be Semi-Transparent  by setting its WS_EX_LAYERED Window Style and then using the "SetLayeredWindowAttributes" API.

I am not sure if the button needs to be subclassed or or maybe I should capture the WM_CREATE Message in its window procedure and if that's the case can anyone show me how.

Anyway, I have tried many things but without any luck.

Can anybody show me a working code snippet to solve this  ?

Visual Basic Classic

Avatar of undefined
Last Comment
Dana Seaman

8/22/2022 - Mon
Dana Seaman

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Dana Seaman

BTW, SetLayeredWindowAttributes will only run on OS Win2000 or above.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck