- This topic has 4 replies, 2 voices, and was last updated 15 years, 6 months ago by xeper.
-
AuthorPosts
-
May 17, 2009 at 2:31 pm #32967xeperParticipant
Hi,
How exactly do I detect that the global (EXE) skin has changed in a DLL? I have a complex application, that uses a lot of frames from DLLs. Controls in those frame react properly, but I do regretfully have some TCharts also. And while I finally managed to make them look like something (marks/legend colors were particulary painful), I have no way of updating TChart colors when skin changes.
After some experimentation I overriden WndProc of all those frames ancestor so it fires my own event:
CODEif (Message.Msg = SM_ALPHACMD) And (Message.WParamHi = AC_GETSKINSTATE) then
SkinChanging; //
Inherited;But this is obviously lame, since this AC_GETSKINSTATE is send twice when skin changes. So?
TIA
Michal
PS. SkinManager.AfterChange is not a viable solution.
May 18, 2009 at 7:51 am #39260SupportKeymasterHello
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?May 18, 2009 at 3:19 pm #39284xeperParticipantCan 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
CODEpublic
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 “;”… 😀
May 25, 2009 at 12:43 pm #39338SupportKeymasterHi again
If you send me a project with example then I'll try to find a best solution and problem will be solved I thinkMay 29, 2009 at 10:43 pm #39397xeperParticipantYo,
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.
-
AuthorPosts
- You must be logged in to reply to this topic.