I wrote a program who paints widget on desktop wallpaper, under desktop icons, and all was good. But I reveal a strange bug - my program was not works on some other computers - they displays the same desktop without widget after start.
So, have anybody any expirience, some knowledge in this area? Please, help me! :)
(I can't find any computers near, where widget not works, in my computer all works well. I wrote a lot of test programs, whose tries draw anything on desktop with rather methods, but test displays nothing too in my friends computers.)
Drawing method:
I wrote a dll, who finds desktop window (progman->child->child )) and creates a hook and install own window procedure for desktop. In window procedure i hook WM_ERASEBKGND:
case WM_ERASEBKGND:
HDC hdc = (HDC)wparam;
PaintDesktop(hdc);
WidgetPaint(hdc);
return 1;
// I skip in this code getting and setting clipping areas for fast drawing. (I tried all combinations with clipping and without clipping)
And in tests I also trying to paint widget in WM_PAINT message with same results -- all already works at me, but works not at all my friends.
upd: I solved it! :)
Now: When you login to Windows and OneDrive has problems connecting to the OneDrive servers on the Internet it will show that Minus icon to indicate the file/folder couldn't be synced. You will see a green check-mark icon if the sync is succesfull.
I solved it! It's simple was a 64-bit machines) So I compile my code for 64-bit and widget start work pretty good!
And, also -
PaintDesktop(hdc);
will produce very bright wallpaper in Windows7 (and Vista) with Aero. (User's wallpaper comes brighten). Must be
CallWindowProc(OldWndProc, WM_ERASEBKGND, wparam, lparam);
Cause of this - Aero treats PaintDesktop() as usual paint (over virtual screen wallpaper, that is the same as on desktop) with color summation.
Regards! :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With