Detecting skin change in DLL frame

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #39260
    Support
    Keymaster

      Hello
      You can catch the SM_ALPHACMD message with AC_REFRESH parameter which gets in form WndProcedure (AC_GETSKINSTATE used for other purposes).
      Can you do that?

      #39284
      xeper
      Participant

        QUOTE (Support @ May 18 2009, 08:51 AM)
        Can you do that?

        I can, but it doesn't work: the one and only message that ever gets through (to frame's WindProc) is this AC_GETSKINSTATE. I don't get AC_REFRESH at all.

        Maybe it is so because the Frame is created with nil Owner? But controls on frame do work regardless… TsFrameProvider is created dynamically (in Create).

        WndProc looks like that

        CODE
        public
        procedure WndProc (var Message: TMessage); override;

        procedure TfrBaseMBS.WndProc(var Message: TMessage);
        begin
        // FIXME doesn't work too good: some skins never fire that; it is fired twice + when destroying
        if (Message.Msg = SM_ALPHACMD) And (Message.WParamHi = AC_GETSKINSTATE) then // AC_REFRESH doesn't work
        if Not (csDestroying in ComponentState) then begin
        SkinChanging;
        MessageBeep(MB_ICONASTERISK) // DEBUG
        end;
        inherited;
        end;

        I also noticed that AC_GETSKINSTATE sometimes doesn't fire at all: eg. when switching from 'Cold” to “Elegant” (works for “Gray Plastic”);

        Thanks anyway 🙂

        PS. I need a break. I end natural language sentences with “;”… 😀

        #39338
        Support
        Keymaster

          Hi again
          If you send me a project with example then I'll try to find a best solution and problem will be solved I think

          #39397
          xeper
          Participant

            Yo,

            I tried, but it's not so easy to replicate me thinks … Simple project works, and since I cannot send you my actual one, it's kinda hopeless. I did manage though: defined app-wide global interface to skinmanager which pings its clients when change occurs.

            Regards

            M.

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