In an app I'm coding I would like to make an alert message to appear that displays a large semi-transparent warning message without affecting the users work. Basically I will fade in the message but never set it's opacity to 1 and I want the user to be able to click 'through' the message as if it isn't there.
I have started by using an always on top window and setting the window style to none and setting the background and transparency key to white. On this window there is a label with a large font which contains the alert message (later I'll probably override the paint event and paint the message using GDI). I use a timer to fade in the message by dialling up it's opacity before dialling it back down again. It works OK in that the focus isn't stolen from any apps but the transparent form captures the mouse events, not the form below it (actually most of the form which is transparent doesn't capture the mouse events, only the label text does).
Also I'm not sure it's the optimal approach, maybe I should be painting straight to the screen somehow.
How should I improve things.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…