News:

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

GUI console

Started by Michael, July 29, 2009, 09:22:40 AM

Previous topic - Next topic

Michael

Thanks for letting me know! - I will check on another machine to sort it out. I'm on (32-bit) XP and
it doesn't do that...

dedndave

32-bit XP Pro MCE2005 sp2
P4 prescott dual core
screen resolution setting: 1280 x 1024

Michael

#17
I've fixed it - there were actually two errors...
The integer exception thingy hopefully was a missing "mov edx, 0" before the (only) div opcode in the source.

The main error was that my WM_SIZING handler called GetWindowRectangle.
But the window size is actually only changed during sizing, when the following windows option is enabled:
"Show window contents while dragging" - right click on desktop, choose properties, appearance, effects.

If that option is disabled, GetWindowRectangle always returns the same value during WM_SIZING, and
that's why my code didn't work. I now track the previous sizing rectangle in a RECT structure instead of calling
GetWindowRectangle to get it.

What I haven't found a fix for is the "wobbling" when the top border of the window is dragged, rather
than the bottom (only occurs when "Show window contents while dragging" is enabled) ...

dedndave

not so fast
still get the same integer overflow
i don't think that error is caused by division
if it were, it would be "divide overflow error"

Michael

 :eek oops, the version I posted was missing the "mov edx, 0" line.
I really think it's that because I've run the exe in OllyDbg, and the DIV caused the exception.
Bizarre exception, when dividing by very large/small integers I think.

Sorry I posted trash earlier - I've modified the attached file of my previous post with the fixed
version. I'm posting now mainly in case anyone has
an idea regarding the "wobble" :P

dedndave

overflow error gone
i am trying to see the wobble - lol
ohhhhhhhhhhhhhh
that - lol
i think i would ignore that
all windows do the same thing

Michael

Thanks for testing the error :U
I would have thought they all do it, too... the silly thing is my first prototype
didn't do it - you could push down the top border and the bottom stayed smooth
as baby skin.
I just can't see when/how I botched it.... Will post once I got it...

Astro

That is awesome!   :thumbu

I too see the "wobble" when resizing the window. I get it on other windows, too.

EDIT: Would help if I stated the OS! Win XP Pro SP3. Screen res: 1600x1200.

Best regards,
Astro.

Michael

It's the WS_EX_LAYERED style for translucent windows.
Once I took it off, top border resizing is smooth...

dedndave

i never cared for the translucent thing
i mean, it was cool to see a couple times, then you find out it is slow and, when in that mode, hard to see what you want
i went to great lengths to make my machine run fast
when i open something i want it to - BANG - pop up on the screen
and when i close it - BANG - disappear

Michael

Right on! :U
I will take WM_EX_LAYERED out of it. I sort of liked it, but it would have been cooler if only the client area was translucent.
Always wondered what the reasoning was to make the caption bar / window frame see-through?

Now I've removed LAYERED, I need to work on WM_PAINT, the layered style covered up some inaccuracy
in the handler for that method...

Michael

In my debugging efforts  :boohoo: I've replaced the WM_PAINT handler by a trivial version, that just blits a bitmap
square onto the client DC, figuring that should update the client region irrespective
of the actual paint rectangle, to see if the bare essentials work.

But it doesn't, there are occasional white stripes when I cover/uncover the window
with another, as if occasionally I were skipping a WM_PAINT message...

I found a posting where someone using the win32 api in C is having a similar problem:
http://www.codeguru.com/forum/showthread.php?t=283638

Is it not OK to paint the client region of the main window directly for some reason, instead of
painting on a child window client region? :red



Michael

#27
I followed the external posting I mentioned and did the same thing as the other person,
namely invaliding the client region on entering WM_PAINT.

That works nicely and at least to me, it's just as quick as before.
So I'm posting this clean version of phos featuring vertical resizing here for completeness.


JayPee

Hi

Works well for me, keep p the good work

Cheers
John
Greetings From New Zealand
(Land of the Long White Cloud)

Michael

#29
Many thanks, John!
I've cleaned it up some more and added code to the user thread function to show how
the command line can actually be used/processed quite easily.

I've replaced the file attachment to my previous posting with the updated file.

To not bore everyone with insignificant updates, the following links will always point to the
most recent versions.

Standalone version: http://ok-schalter.typepad.com/phos-win32-standalone.zip
DLL + test app version: http://ok-schalter.typepad.com/phos-win32-dll.zip