Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Limitation of WM_PAINT & WM_PRINT & WM_PRINTCLIENT

244 views
Skip to first unread message

myaso

unread,
Nov 17, 2006, 4:41:20 AM11/17/06
to
Hi!

I want receive screen shot. But I see some limitation. My question.
Why?

My steps
- Enlarge window size. (Window without scrollbar)
- GetDC, CreateCompatibleDC, CreateDIBSection, SelectObject
- Then! I send message WM_PAINT. Also I send WM_PRINT and
WM_PRINTCLIENT but result the same.
SendMessage(m_hTree, WM_PAINT, (WPARAM)m_memDC, 0);//PRF_CHILDREN |
PRF_CLIENT | PRF_ERASEBKGND | PRF_NONCLIENT | PRF_OWNED);
- Use BitBlt

if height window dues not more then ~32700, it is ok
But if more I receive black area after ~32700.

Why?

Thanks In Advance.

John Carson

unread,
Nov 17, 2006, 5:22:32 AM11/17/06
to
"myaso" <mya...@gmail.com> wrote in message
news:1163756480....@m7g2000cwm.googlegroups.com


Because that limit exists by design (I believe you will find that the
problem starts at 32768 pixels).

--
John Carson


myaso

unread,
Nov 17, 2006, 5:37:46 AM11/17/06
to

> Because that limit exists by design (I believe you will find that the
> problem starts at 32768 pixels).

It is terrible.
Maybe you know where I can read about this limitation(exactly)?

Ok. If limitation exists, maybe you know, how can I resolve this
problem?

Thanks!

John Carson

unread,
Nov 17, 2006, 5:48:38 AM11/17/06
to
"myaso" <mya...@gmail.com> wrote in message
news:1163759866.7...@j44g2000cwa.googlegroups.com


Why is it terrible? Why is it that you must deal with windows this big,
given that most screens are less than 2000 pixels in width and height?

--
John Carson


John Carson

unread,
Nov 17, 2006, 6:07:47 AM11/17/06
to
"myaso" <mya...@gmail.com> wrote in message
news:1163759866.7...@j44g2000cwa.googlegroups.com

>> Because that limit exists by design (I believe you will find that the
>> problem starts at 32768 pixels).
>
> It is terrible.
> Maybe you know where I can read about this limitation(exactly)?

No, I don't know where you can read about it. However, a signed short has a
maximum value of 32,767. This can't be coincidence. Presumably somewhere in
its internals, Windows is using a short to store window dimensions.

--
John Carson


myaso

unread,
Nov 17, 2006, 6:19:41 AM11/17/06
to
Of course maybe you are right. This can't be coincidence. But! There
and everywhere used DWORD.

Grzegorz Wróbel

unread,
Nov 17, 2006, 7:01:15 AM11/17/06
to

This is common limitation in many Windows APIs. For some there are
workarounds (like for scrollbars).

In case of window size, though most APIs take integer as width and
height, WM_SIZE and alike messages reads width and height from lParam,
where low order word is width and high order word is height.

--
Grzegorz Wróbel
http://www.4neurons.com/
677265676F727940346E6575726F6E732E636F6D

myaso

unread,
Nov 17, 2006, 7:45:32 AM11/17/06
to
> In case of window size, though most APIs take integer as width and
> height, WM_SIZE and alike messages reads width and height from lParam,
> where low order word is width and high order word is height.

Yes. I agree. We are right.

myaso

unread,
Nov 20, 2006, 5:53:46 AM11/20/06
to
Hi

How can I execute something like
SendMessage(m_hTree, WM_PAINT, (WPARAM)m_memDC, (LPARAM)&rect);
where rect is rectangle
If exists limitation, I specifying next coordinates
rect.top = 32751
rect.left = 0
rect.button = height window
rect.right = width window

is it really?

John Carson

unread,
Nov 20, 2006, 8:31:18 AM11/20/06
to
"myaso" <mya...@gmail.com> wrote in message
news:1164020026....@h54g2000cwb.googlegroups.com


How about you tell us what you are really trying to do and why it involves
such enormous windows.

--
John Carson


myaso

unread,
Nov 20, 2006, 9:34:16 AM11/20/06
to
> How about you tell us what you are really trying to do and why it involves
> such enormous windows.

Because I have big window. This is tree control. I must send this to
printer.
So, I need way for obtain specified window's part.

Paul Baker [MVP, Windows - Networking]

unread,
Nov 20, 2006, 9:48:49 AM11/20/06
to

"myaso" <mya...@gmail.com> wrote in message
news:1164033256.5...@b28g2000cwb.googlegroups.com...

myaso,

Do you understand the question? I just don't see why you seem to be avoiding
it.

Noone needs a window that is more than 32,767 pixels wide or high. How is
anyone going to view that window?

Paul


Grzegorz Wróbel

unread,
Nov 20, 2006, 10:58:27 AM11/20/06
to

Time for redesigning. Make the client area smaller, sent the client area
to the printer, scroll the window, send client area to the printer
again, and so on, until you printed entire tree.

Paul Baker [MVP, Windows - Networking]

unread,
Nov 20, 2006, 11:05:26 AM11/20/06
to
Yes. Is the window so large because you want the client area to cover the
entire tree view without scrolling?

Perhaps you should query each item using the tree view window handle and
using your own custom printing code.

What is the purpose of the printout? I imagine that there may actually be a
format that is more useful than the on-screen format anyway. For example, on
the printout you may want to see all nodes expanded and you may not want to
see shadows, selection and focus rectangles, etc.

Paul

"Grzegorz Wróbel" </dev/nu...@localhost.localdomain> wrote in message
news:ejsjg0$881$1...@atlantis.news.tpi.pl...

myaso

unread,
Nov 20, 2006, 5:32:15 PM11/20/06
to
I really have a tree with the big sizes.
Unfortunately I badly can speak on englesh, so I can't explain this
situation clearly.
It is no my project, I just add printing.
At this moment I try scroll and get screen shot.

0 new messages