Greetings.
I find this one from time to time and figure out a possible way to generate it:
Open EasyCode, load any project.
Let it open for a very long time.
Suspend the computer for several hours.
If you are lucky, the result will be as the attached example. The only solution is to close EasyCode and reopen it.
Regards.
Hi,
Sorry for this issue and thanks for reporting it.
Please give some time to see whether I can find the bug and fix it.
Regards!
Thank you Ramon, and please don't be; we are only human ;) :t
The two most interesting elements are:
* Only the background color changes, not the letters.
* So far it only seems to happen is you suspend the computer.
A humble theory: Does EasyCode read the background color from some Windows variable/structure that may change after suspending ??
Best regards.
Hi again,
Actually, the only thing I can think of is that Easy Code processes de WM_SYSCOLORCHANGE message, which is only sent by Windows when a system color changes. The point is I do not know whether the windows background system color changes when Windows is suspended. I will try to find it out.
Regards,
Ramon
Hi AssemblyChallenge,
Would you please do me a favor?
I attach a slightly modified version of EC. It will show a message box if the WM_SYSCOLORCHANGE has been sent to Easy Code, so that I can know if it is the responsible of the "whiteness".
Please replace your EasyCode.exe file, in the \EasyCode.Ms\Bin folder with the one attached to this post.
Thanks for your help,
Ramon
Hi,
Testing in progress, will let you know ASAP. :biggrin:
Regards.
Thank you very much!
So far, not so good :(
For several days with no luck. Still waiting for changes or messages.
Still trying, Master.
Thanks for your help :t
Finally! After so many days trying the new exe I got some movement :lol:
Loaded two different projects and both failed (color changed) without messages or errors.
Attached images from both.
Thank you very much! I really appreciate your help!
However, I have no idea why color changes but I will try to find it out.
Regards,
Ramon
Ok.
The projects with the new exe were open (and failed) at the same time, just in case it may be useful to know about it.
More humble ideas: The editor part (Edit control, right?) is mounted on MDI window. Is there any chance this could be related? How about WMPaint or something AFTER resuming from standby? Is it only the Edit's background color who is changing and, so far, never on runtime.
Even more ideas!
Please take a look at this this (http://stackoverflow.com/questions/17941527/changing-the-background-of-an-edit-control-on-getting-focus). It doesnt looks like our case but, who knows :lol:
Whatever, as long as it gives you some light/inspiration ;)
Feedback continues:
* Took note from background colors before and after the bug.
* In Preferences, Editor, there is no change (it's default, Background, System colors). Even after bug, Preferences are fine.
* With affected EasyCode still open, opened new instance: It does with normal colors.
What else:
* Just in case will keep bugged EasyCode opened (as it is hard to replicate problem). If you need any info let me know (ej. attach Ollydbg, look into memory, etc) :bgrin:
* Will make a simple experiment with very small project checking background colors. Who knows, maybe it's Windows Policies the problem's source.
Regards, Master.
Hi AssemblyChallenge,
Once again thank you very much! I really appreciate your useful help.
I will study all this informatio to see whether I can find the problem.
Regards,
Ramon
By the way, the editor part is not an Edit control, it's a complete editor programmed by me. Actually it is an Easy Code module because the EC IDE is just a visual project, that is, Easy Code is a visual project built by itself.
Roger that.
What I mean is: the "native" Windows component where you write the text.
My wild guessing was: EC is a Main window with MDI childs (Editor, Designer, etc) and inside that Editor child, maybe some enlarged Edit Control :lol: where you actually type the code.
The idea is to understand how is made so I can help you searching for a similar problem in someone else's project. :bgrin:
Hi,
I am sorry if I misunderstanding you.
The Easy Code Editor is a Windows window, of course, but anything else, no Windows controls. I paint the background and the text according to the settings for the colors and font, so if the background color is not changed I do not understand why you get a white background.
I will try to redraw the background when the editor gets the focus, maybe it will solve the problem.
Regards :t
A color changed EC is still opened. If I attach Ollydbg to it, is there any chance we can get some useful info (address, structure, whatever) ?
Well I am not sure, but I am affraid it will be difficult.
I will send you the sources of the editor module.
A mini-update:
* Last week finished a small program. For the very first time and out of the blue, the color changed while editing the project, doing normal stuff. I'm guessing this piece of info could help you.
* Still reading the code you sent (by the way, thank you , I still feel humble about it).
Sorry for the delay, I've been outside for a pair of days.
Thanks for your help once again.
I am really sorry but I am not able to fire the color change problem.
Hi AssemblyChallenge,
I think I could solve the color changing bug. Please try the attached executable.
Replace your EasyCode.exe file, in the \EasyCode.Ms\Bin folder with the one attached to this post.
Thanks for your help,
Ramon
Hi,
Downloaded and testing in progress. Will let you know :t
Great!
Thanks.
Well, so far so good :bgrin:
Or at least for now. Generally it changed after several hours or from one day to another.
Still missing the suspend part; that one will be today in the afternoon.
Any info about the possible cause ?? This is, by far, my favourite bug in EC :lol:
Hi,
Well, in fact I do not know why it happens. What I did is processing the WM_POWERBROADCAST message. When Windows "wakes up" and the POWERBROADCAST message is received, the editor is redrawn.
It seems to work!
Damn, version 0.8 not fixed yet :(
It didn't survive the suspend test (for several days). On the bright side, now we get the worst from both worlds :lol: :lol: so take a look at the attachment for a mix of a color changed - line number damaged beast :lol:
Greetings.
Thanks once again for your help!
Damn, each time it's worse. It seems I'll have to work hard to find out the problem.
I'll be in touch.
Ramon
Hum, very interesting.
I was checking the other bug with INI files and got this... hunch. In the sense that maybe, just maybe could be related with Windows's internal color constants. Please, take a look at the attached PDF; as a programmer you surely know must part of that stuff. Still, I see my background color (black) set as 0x80000001 (which is also Desktop Color) in EC.
Not sure if this helps but, who knows, give it a try :bgrin:
Yes, 0x80000001 is the Desktop color in Windows, and yes I will read the pdf file you attached.
Thanks,
Ramon
Hi.
EC 0.9 just color failed on me today, so, a quick recap:
* Only text background changes.
* Color settings in options do not change (or gets modified) after the bug.
* You don't have to suspend the computer, just leave EC open for long periods of time.
* It can change out of the blue while you work on it.
* If you open several instances of EC, they all get color changed :dazzled:
Greetings, Master.
Well, thanks for the report. I will try to find the bug.
Wait!
As soon as I clicked the "Send" button and opened EC, was greeted by a pink background.
Do you know what that means ??? BINGOOOOO :greenclp: :greenclp:
Take a look at the attachments please.
Steps to reproduce (I use Win7 Pro SP1 x64):
- Set background color in EC settings (attach-2)
- Set background color in Windows options. (attach-1)
- Enjoy the bug :lol: (attach-3)
So my previous idea about system colors were not so far from reality, right ? :shock:
That means EC should set the background color as "reference" from Windows but maybe not set the system color itself because then EC will be changing its colors at the same time as Windows. This is, of course, if you want to keep them separate. Maybe some other EC colors based on system could be affected too. Also, maybe is my background who changes with corporate Policies.
Regards.
PD: Finally, that pink color can make you go blind in seconds :lol:
Meh, maybe I got excited too soon :icon_redface:
I touched nothing and left EC open, just to see how it would look like. It changed, of course, but I still have the ugly theme and eye burning pink as Windows background color. EC also shows the pink as background. The change, as usual, is white.
Anyway, I still feel we are getting close to the cause. My next experiment will be using a background color not defined by system.
Regards
Yes, that is exactly what I meant. To set a solid color for editor background (not the desktop).
Thanks for your help (and your patience)!
;)
Well, as before: So far so good.
Defined an ugly blue color for background and no change. Created a black color too and no signs of the bug :bgrin:
Today in the afternoon will come the suspending part. There is strong evidence now to assume this problem discovered if everything goes fine. All of that in a hurry as my main PC will be migrated to Windows 10 Pro x64 in the coming days.
Regards.
Good news! However I still do not know why it fails with the Desktop system color. It shoud not.
There is no need to choose an ugly color, you could choose the same color that the Desktop but as a "solid color", not as the system desktop color (0x80000001).
:icon14:
Ok. After two days in a row with no errors including the dreaded suspend, I think we have enough evidence:
Avoid at all cost picking a color from System Colors's dialog box for your text background and instead define your own from the palette.
In any case, if you can't find the reason for this behavior, just keep it in mind for EC v2 (ie. do not show that dialog for picking colors, create your own or something) and put the footnote on the last oficial 1.X as this weird problem seems -so far- confined to my system.
The good news, as I said before, is that my computer will be Windows 10 soon and you can expect regular feedback from me :t :t
Hi AssemblyChallenge,
Well, these are (relatively) good news. I still do not understand why your text background changes. I will try to find the reason but it will not be easy if it does not happen to me.
Thank you very much for your help!
Best regards.
Hi again,
I don't want to be a real pain :icon_redface:, but I'm trying to find the bug.
Would you please test the attached executable (EasyCode.Ms) choosing the system desktop color as the text background? Thanks.
If for any reason a system color is changed, this new exe will display a dialog box. Besides, it re-reads the text background every time the editor needs to be repainted.
Thanks in advance!
Consider it done, Master :bgrin:
Once again, thank you very much indeed!
:t
Hi.
Guess what: Not a single error in all this days :dazzled:
I even made a copy -and reopened- the old EC just to be sure and zero, nada.
:shock:
I don't understand anything (:shock:), but thanks again for your patience!
I will release a new version of EC v1 one of these days (probably the last one).
:t
Ok then.
The reason I uploaded the PDF file was that, a couple of years ago, I had a case somehow resembling our problem, with a twist.
A legacy app programmed with VB6. They forced a color in several form's components and as result, if you changed Windows theme, then those components remained black -and obviously unreadable for the final users-. The solution for them was changing the form's colors with those from system so when you change Windows's colors, app colors changed too (ie, the same way that Calc, etc, does).
Since I found this weird bug, just can't stop thinking about that case but I'm not sure how to correlate it into EC.
:bgrin: :t
Well, thanks for the information anyway!
:t