The MASM Forum

General => The Laboratory => Topic started by: PushPop on June 26, 2020, 05:12:17 PM

Title: Trasparent Clock
Post by: PushPop on June 26, 2020, 05:12:17 PM
Good morning guys
I'm here again to ask you for help.
Someone explains to me why this doesn't work.
Thanks for your help
Title: Re: Trasparent Clock
Post by: jj2007 on June 26, 2020, 08:55:29 PM
Please avoid this: #include "D:/masm32/include/RESOURCE.h"
Not everybody has D: as the Masm32 drive. So use #include "/masm32/include/RESOURCE.h" instead.

Otherwise, your code builds and works fine. The only problem is that the background doesn't get erased. So you should maybe send a message to the underlying windows that it needs repainting...
Title: Re: Trasparent Clock
Post by: Greenhorn on June 28, 2020, 02:56:10 AM
Works fine on my system. Otherwise you should explain what exactly does not work.

Kind regards
Greenhorn
Title: Re: Trasparent Clock
Post by: hutch-- on June 28, 2020, 03:01:38 AM
Works OK on my Win 10 64 1909. What OS are you testing on ?

A couple of suggestions, make the grab area a lot bigger so its easier to move around. I can close it with ALT F4 but a simpler key combination would be easier. Display is good, shows up on light and dark backgrounds.
Title: Re: Trasparent Clock
Post by: TouEnMasm on June 28, 2020, 04:29:31 PM

On windows 10,It work but I couldn't stop it  ?
Title: Re: Trasparent Clock
Post by: TouEnMasm on June 28, 2020, 06:08:35 PM

I have study your source files.Some PROC don't preserve the EBX ESI EDI.
ClockSetup proc uses ebx edi esi hWin:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD
You need to verify others proc to avoid problems.
Title: Re: Trasparent Clock
Post by: Vortex on June 28, 2020, 07:00:36 PM
Hi PushPop,

Nice work. I noticed another problem, the application's CPU demand is between %34-36 on my system.
Title: Re: Trasparent Clock
Post by: PushPop on June 30, 2020, 05:31:34 PM
Good morning again
Everything works, the only problem is that it does not clean the background, after a short time everything becomes one color. Maybe my computer is having problems
Title: Re: Trasparent Clock
Post by: TouEnMasm on June 30, 2020, 06:06:04 PM

I have re-build your source (after added the uses) with different headers,Test it,and see if you have the same problem.
Title: Re: Trasparent Clock
Post by: jj2007 on June 30, 2020, 09:13:54 PM
The only problem is that the background doesn't get erased. So you should maybe send a message to the underlying windows that it needs repainting...

There are two techniques:
1. inform the underlying window that it needs repainting
2. before painting the dials, get a bitmap of the current state; then BitBlt that bitmap as the background before painting new dials.

If I had time to waste, I would try sending a WM_PAINT message, or using InvalidateRect to force a paint (no idea if that can be done with a window outside the own process) :cool:
Title: Re: Trasparent Clock
Post by: PushPop on June 30, 2020, 11:57:42 PM
Here I am again
Good morning
I send you the image of how it works on my machine
Thank you
Title: Re: Trasparent Clock
Post by: TouEnMasm on July 01, 2020, 12:24:01 AM
You are on Windows X ? (XP,7,8....)
Did you try the executable I have Build ?
You can also run DXDIAG and save file,it made a test for the screen ,do it
Title: Re: Trasparent Clock
Post by: jj2007 on July 02, 2020, 02:49:57 AM
Salut Yves, what happened to your nick? Google still sees you as ToutEnMasm :cool:
Title: Re: Trasparent Clock
Post by: PushPop on July 03, 2020, 08:13:46 PM
Hello
I am using windows 7 ultimate, but unfortunately I still have the same problem
Greetings to all
Title: Re: Trasparent Clock
Post by: TouEnMasm on July 04, 2020, 06:35:24 AM

test this one,he used a different type of paint message,clic on to quit
Title: Re: Trasparent Clock
Post by: Adamanteus on July 31, 2020, 04:37:07 AM
 Looks excellent, but unproperly setled icons for tray - such better :
Code: (asm) [Select]
.if eax==WM_INITDIALOG
push hWin
pop hWnd
invoke GetWindowLong, hWnd, GWL_EXSTYLE
or eax, WS_EX_TOOLWINDOW
invoke SetWindowLong, hWnd, GWL_EXSTYLE, eax
...
invoke  SendMessage, hWnd, WM_SETICON, ICON_BIG, node.hIcon
invoke  SendMessage, hWnd, WM_SETICON, ICON_SMALL, node.hIcon


And background in setup dialog, no need to all views. ClockSetup :
Code: (asm) [Select]

.elseif eax==IDC_HORS
mov eax, hPEN_H
ret
.else
mov eax, FALSE
ret
.endif

P. S.
And save/load parameters - profile module, as and configuration dialog - config module, better to have in special files as it could later became very big in size, for example as this :