News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Little test

Started by donkey, April 09, 2011, 09:52:15 AM

Previous topic - Next topic

jj2007

Quote from: donkey on April 10, 2011, 12:12:48 AMthen slowly move it back on, are the corners still round ?

Hi Edgar,

No, they come back squared. Had not seen that before, sorry.

dedndave

it appears that part of the move problem is fixed, Edgar
i still get the remnants
when i open the program, it is against my desktop as a background
to see the remnants, i move it over a white area
it seems to drag desktop content with it   :bg



in this case, it opened over firefox with the forum showing - lol
that is the lower part of the right hand side

donkey

#17
Hi Dave,

The side stuff I hope is solved, I just wasn't going to attach the solution until I figure out the corners. I am certain that corner issue is a problem with erasing the background, there are many many places at MSDN that indicate that when using a NULL brush I have to erase the background myself but I can't seem to get how to do it so it stays transparent. Its frustrating because I think I have gone through all of the standard ROPs and am now using the non-standard ones.

Here's the solution (I hope) to the edge issue, still working on the corner problem...

"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

hutch--

Edgar,

There are still repaint issues with the last one on XP SP3. Fails the slow drag test from off the screen, also has problems with dragging another window over it in that the corners appear as a black reverse radius.

Overlap it with another window them click back onto part of it and the overlapped part repaints correctly.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

donkey

Hi Steve,

Yeah, there is a fundamental difference in the way XP handles background erasing that I can't seem to get a handle on, the edge issue I hope is fixed but the rounded corners are giving me fits. I could go the alpha blend route but that's normally a bigger can of worms and this way works so nicely in Vista and Win7 where apparently the problem is fixed. The problem appears to be that the window has a NULL brush so when Windows paints it it will use part of the desktop or object behind it, when its moved it should update the background but doesn't. I think that I will have to capture the desktop and paint the appropriate portion of it into the after the gradient fill with an inverted region. An incredibly complex paint process just to take care of something that is the responsibility of the OS.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

dedndave

that method is probably do-able, Edgar
but, i think it is much worse than you think
it wouldn't be too bad if it was just your window and the desktop
but, if you take into account the z-order of multiple windows - well - let's go back to an overlayed window - lol
keep in mind that the content of these other windows may change at any time
the dynamics of capturing would be terrible

donkey

Quote from: dedndave on April 10, 2011, 03:13:17 AM
well - let's go back to an overlayed window - lol

Well, at worst I can go back to the square window but I haven't given up yet, there has to be a way or I'll just have to use alpha blending which is what I was trying to avoid. The alpha blend API (what there is of it) seriously sucks and is so counter intuitive that I would rather spend a week trying to get it done my way.

BTW are the jaggies fixed on the sides and bottom of the window on your system ?
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

dedndave

yah - that part is fixed   :U
good luck with the corners   :P

MichaelW

Running the EXE from reply #10 under Windows 2000, the only problem I can see is what appears to be random garbage in the 1-pixel wide strips on the right and bottom edges of the window. I don't know if it's the same problem, but this reminds me of a problem with the same symptoms that I had with FillRect, where I found the solution in the remarks section:
Quote
When filling the specified rectangle, FillRect does not include the rectangle's right and bottom sides. GDI fills a rectangle up to, but not including, the right column and bottom row, regardless of the current mapping mode.

Once I extended the right and bottom coordinates by one, the random garbage disappeared.
eschew obfuscation

drizz

Quote from: donkey on April 10, 2011, 01:38:25 AM... the rounded corners are giving me fits.
Call SetWindowRgn (not in paint loop).

+ I would look into the border metrics for the current theme... GetSystemMetrics
+ UxTheme Api
The truth cannot be learned ... it can only be recognized.

donkey

Hi Drizz,

Thanks very much. I had figured it out shortly before going to bed last night but not yet modified the code. Stupid thing was I looked through some of my own example code and found the solution. Must be getting old or something because I found at least 20 apps that I wrote that used SetWindowRgn . I sometimes tend to over-complicate things even when the solution is right before my eyes.

At any rate, new test...
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

hutch--

Edgar,

This one works fine.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

donkey

Thanks Steve,

Its freaking embarrassing to have missed that API. Changed the program to set the height of the new title bar using a constant (TITLEBARHEIGHT), this is where it really comes in handy if you want say a drop-down combo in the title bar. Also added an icon that resizes based on the height.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Bill Cravener

Now thats damn cool Edgar! I used CreateRoundRectRgn followed by SetWindowRgn in my little example PasteIt to round the corners here: http://www.quickersoft.com/examples/PasteIt.zip

I did this:

                 ;------------------------------------------
                 ; Round the corners of our window space
                 ;------------------------------------------
                 invoke CreateRoundRectRgn,0,0,600,300,30,30
                 invoke SetWindowRgn,hWin,eax,TRUE
                 ;------------------------------------------
My MASM32 Examples.

"Prejudice does not arise from low intelligence it arises from conservative ideals to which people of low intelligence are drawn." ~ Isaidthat

donkey

Thanks Bill,

I have experimented a bit and found that using a straight dialog is pretty much the same, there is no need for the NULL brush or to change anything in the dialog class. Here's the result. There are a few advantages to using dialogs as opposed to windows since they are a bit easier to use and for the app I plan to use them in it won't take a rewrite.

"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable