Transparency problem

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #32764
    Beherit
    Participant

    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.

    #38385
    Support
    Keymaster

    Try add this code :

    if nil <> sSkinProvider1.BorderForm then sSkinProvider1.BorderForm.UpdateExBordersPos(205);

    #38376
    Beherit
    Participant

    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.

    #38377
    Beherit
    Participant

    Another problem – transparency disappears when I minimize and restore form. It's not a normal behavior of the forms.

    #38375
    Support
    Keymaster
    '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.

    #38369
    Beherit
    Participant

    This 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;
    #38370
    Beherit
    Participant

    Ok, 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).

    #38359
    Beherit
    Participant

    I still waiting for some solution…

    #50238
    Support
    Keymaster

    Hello!

    Can you prepare and give me a small demo?

    I will research it and maybe I will found a solution.

    TIA

    #50253
    Beherit
    Participant

    Demo? 🙂 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.

    #50254
    Support
    Keymaster

    It's difficult to make a test app?

    #50255
    Beherit
    Participant

    I'll make it when I'll have some free time.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.