Limitation of WM_PAINT & WM_PRINT & WM_PRINTCLIENT

Win32 Programming

    Next

  • 1. Creating a window on second display from second graphics card
    Hi, Can somebody please tell me how to create a window on a secondary display (not primary display) coming from a secondari graphics card ? I asked about this a few months ago on this newsgroup, got a reply, but somehow the thread disappeared. Thanks, Celios
  • 2. how to use DrawFocusRect ?
    How to use CDC::DrawFocusRect and CDC::DrawDragRect, and so on? Is there any articles about them? -- There is a will, there is a way!
  • 3. Width of scrollbar?
    How can I programmatically findout the size of the scrollbar of a window?
  • 4. SetStretchBltMode HALFTONE problems
    Hi All I am using SetStretchBltMode() on the target DC before calling StretchBlt() on it, COLORONCOLOR gives me low quality bitmap but HALFTONE performs great, gives me exact quality what I want but takes longer to compute. Is there any way to resize the bitmap which gives me good quality like HALFTONE but takes less time. Thanks, Ajay

Limitation of WM_PAINT & WM_PRINT & WM_PRINTCLIENT

Postby myaso » Sat, 18 Nov 2006 18:41:20 GMT

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.


Re: Limitation of WM_PAINT & WM_PRINT & WM_PRINTCLIENT

Postby John Carson » Sat, 18 Nov 2006 19:22:32 GMT






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

-- 
John Carson 



Re: Limitation of WM_PAINT & WM_PRINT & WM_PRINTCLIENT

Postby myaso » Sat, 18 Nov 2006 19:37:46 GMT


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!


Re: Limitation of WM_PAINT & WM_PRINT & WM_PRINTCLIENT

Postby John Carson » Sat, 18 Nov 2006 19:48:38 GMT






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 



Re: Limitation of WM_PAINT & WM_PRINT & WM_PRINTCLIENT

Postby John Carson » Sat, 18 Nov 2006 20:07:47 GMT





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 



Re: Limitation of WM_PAINT & WM_PRINT & WM_PRINTCLIENT

Postby myaso » Sat, 18 Nov 2006 20:19:41 GMT

Of course maybe you are right. This can't be coincidence. But! There
and everywhere used DWORD.


Re: Limitation of WM_PAINT & WM_PRINT & WM_PRINTCLIENT

Postby Grzegorz Wrel » Sat, 18 Nov 2006 21:01:15 GMT







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 Wrel
 http://www.**--****.com/ 
677265676F727940346E6575726F6E732E636F6D

Re: Limitation of WM_PAINT & WM_PRINT & WM_PRINTCLIENT

Postby myaso » Sat, 18 Nov 2006 21:45:32 GMT

> In case of window size, though most APIs take integer as width and

Yes. I agree. We are right.


Re: Limitation of WM_PAINT & WM_PRINT & WM_PRINTCLIENT

Postby myaso » Tue, 21 Nov 2006 19:53:46 GMT

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?


Re: Limitation of WM_PAINT & WM_PRINT & WM_PRINTCLIENT

Postby John Carson » Tue, 21 Nov 2006 22:31:18 GMT






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

-- 
John Carson 



Re: Limitation of WM_PAINT & WM_PRINT & WM_PRINTCLIENT

Postby myaso » Tue, 21 Nov 2006 23:34:16 GMT

> How about you tell us what you are really trying to do and why it involves

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.


Re: Limitation of WM_PAINT & WM_PRINT & WM_PRINTCLIENT

Postby Paul Baker [MVP, Windows - Networking] » Tue, 21 Nov 2006 23:48:49 GMT






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 



Re: Limitation of WM_PAINT & WM_PRINT & WM_PRINTCLIENT

Postby Grzegorz Wrel » Wed, 22 Nov 2006 00:58:27 GMT



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.

-- 
Grzegorz Wrel
 http://www.**--****.com/ 
677265676F727940346E6575726F6E732E636F6D

Re: Limitation of WM_PAINT & WM_PRINT & WM_PRINTCLIENT

Postby Paul Baker [MVP, Windows - Networking] » Wed, 22 Nov 2006 01:05:26 GMT

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










Re: Limitation of WM_PAINT & WM_PRINT & WM_PRINTCLIENT

Postby myaso » Wed, 22 Nov 2006 07:32:15 GMT

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.



Return to Win32 Programming

 

Who is online

Users browsing this forum: No registered users and 26 guest