Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Printing/Scrolling Checkboxes

Posted on 1998-08-17
1
Medium Priority
?
213 Views
Last Modified: 2013-12-03
Windows 3.1 'C' program using Borland 4.5
When processing WM_PAINT messages I call a function
that determines the X,Y coordinates and then writes
out some text/graphics and also uses a MoveWindow
to properly place some Checkboxes.  These Checkboxes
were created during the WM_CREATE message and arbritarily
placed at the top left corner at a size of 1 pixel.
To implement scrolling I basically used an example from
the Petzold book that setsthe scroll pos/range while
processing the scrollbar messages, and a SetWindowOrg
while processing the WM_PAINT.
This seems a little slow to me since each checkbox
must be moved via the MoveWindow.  Is there another
method to scroll the text/graphics/checkboxes that looks
more fluid.
Also, when I print I simply pass the HDC of the printer in to the function.  Everything pronts but the CheckBoxes
(not that I expected them to) How does one print Window
controls such as checkboxes?
0
Comment
Question by:cpirrita
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 8

Accepted Solution

by:
Answers2000 earned 400 total points
ID: 1413576
For smoother scrolling
1. Create a modeless dialog covering the surface of your whole window.  This should have no caption and WS_CHILD style.  All controls except scroll bars should be children of this window.
2. Make sure the container for the modeless dialog has WS_CLIPCHILDREN style
3. Move the modeless dialog rather than the individual controls, this way you can do the move with one op.

To print
1. Create a memory bitmap (CreateCompatibleBitmap), and DC (CreateCompatibleDC).  Select the bitmap into the DC
2. GetDC on the modeless dialog
3. BitBlt from #2 to #1
4. ReleaseDC on the modeless dialog
5. Send the bitmap to the printer
6. Clear up #1

0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question