- This topic has 11 replies, 2 voices, and was last updated 11 years, 9 months ago by Beherit.
-
AuthorPosts
-
February 19, 2013 at 10:59 am #32764BeheritParticipant
I try to set transparency for window with active AlphaControls and ExtendedBorders by code below (I use SetLayeredWindowAttributes because finally I want to set transparency from another thread/application):
Code:SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE)|WS_EX_LAYERED);
SetLayeredWindowAttributes(hwnd, 0, 205, LWA_ALPHA);After executing this code the form have transparency but frame not.
[attachment=6231:2013-02-19_115653.png]
Redrawing window not work, I don't know have to get transparency in window frame.
February 19, 2013 at 11:06 am #38385SupportKeymasterTry add this code :
if nil <> sSkinProvider1.BorderForm then sSkinProvider1.BorderForm.UpdateExBordersPos(205);
February 19, 2013 at 11:09 am #38376BeheritParticipantThis solution is not for me because as I say finally I want to set transparency from another thread/application so I can't change sSkinProvider1.BorderForm.UpdateExBordersPos.
February 19, 2013 at 11:13 am #38377BeheritParticipantAnother problem – transparency disappears when I minimize and restore form. It's not a normal behavior of the forms.
February 19, 2013 at 1:37 pm #38375SupportKeymaster'Beherit' wrote:This solution is not for me because as I say finally I want to set transparency from another thread/application so I can't change sSkinProvider1.BorderForm.UpdateExBordersPos.
Try this code :
Code:uses sVCLUtils, sMessages;procedure TForm1.sButton2Click(Sender: TObject);
var
sp : TsSkinProvider;
begin
SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
SetLayeredWindowAttributes(Handle, 0, 205, LWA_ALPHA);sp := TsSkinProvider(SendAMessage(Handle, AC_GETPROVIDER));
if (sp <> nil) and (nil <> sp.BorderForm) then sp.BorderForm.UpdateExBordersPos(True, 205);
end;As a quick solution for minimizing issue – disable the sSKinManager1.AnimEffects.Minimizing.Active property.
I'll check why it happens soon.
February 19, 2013 at 8:28 pm #38369BeheritParticipantThis code is not working. I writing in C++ and my code looks:
Code:TsSkinProvider *sp;
sp = (TsSkinProvider*)SendAMessage(Application->MainForm->Handle, AC_GETPROVIDER);
if((sp)&&(sp->BorderForm)) sp->BorderForm->UpdateExBordersPos(true,205); //this line is executed properly, “if” was “true”
delete sp;February 19, 2013 at 9:02 pm #38370BeheritParticipantOk, I gave wrong handle. But now frame are disappeared from main form and frames on children form does not repaint.
Even when I try to use TaSk Provider from children form I have a lot of bug (no skinned frame, it looks like Windows 2k frame).
February 21, 2013 at 6:06 pm #38359BeheritParticipantI still waiting for some solution…
February 26, 2013 at 8:34 am #50238SupportKeymasterHello!
Can you prepare and give me a small demo?
I will research it and maybe I will found a solution.
TIA
February 26, 2013 at 5:49 pm #50253BeheritParticipantDemo? 🙂 Just use WinAPI in application to add transparency to other application with AlphaControls by this code:
Code:SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE)|WS_EX_LAYERED);
SetLayeredWindowAttributes(hwnd, 0, 205, LWA_ALPHA);This code should add transparency to frames without looking for TsSkinProvider in application's forms. Even I used TsSkinProvider (I created DLL file to AQQ IM where in SDK of this application this code is executed with adding transparency to frames by using TsSkinProvider), transparency disappear when form is restored afher minimized and on many other events.
February 26, 2013 at 6:01 pm #50254SupportKeymasterIt's difficult to make a test app?
February 26, 2013 at 6:12 pm #50255BeheritParticipantI'll make it when I'll have some free time.
-
AuthorPosts
- You must be logged in to reply to this topic.