Print screen Vista Business problem 
Author Message
 Print screen Vista Business problem

Hi,

I am using "Copy the contents of the screen or the active window"
from http://www.*-*-*.com/

When I print the picture to a printer with 98, XP and Vista Home
I get the correct printout.

With Vista Business I get the printout of the previous print screen
command.  The first print screen request after the program loads,
I get a blank piece of paper printed out.  Every print screen request
after that prints the previous screen.  Print twice and throw out the
first copy is unacceptable to our users.

This routine is used in many of our forms and programs.

Any suggestions?

Thanks,
John



Mon, 13 Dec 2010 03:58:11 GMT  
 Print screen Vista Business problem

The "vb" in this newsgroup's name is for Visual Basic (the programming
language), not Vista Business. The Vista newsgroups all have "vista" in
their names.



Mon, 13 Dec 2010 04:06:08 GMT  
 Print screen Vista Business problem

Quote:
> The "vb" in this newsgroup's name is for Visual Basic (the programming
> language), not Vista Business. The Vista newsgroups all have "vista" in
> their names.

Never mind, I now see that you are asking a VB6 question. Hope you get an
answer.

(For reference, people HAVE posted Vista Business questions here thinking
that's what this group was for.)



Mon, 13 Dec 2010 04:07:25 GMT  
 Print screen Vista Business problem

Quote:



> The "vb" in this newsgroup's name is for Visual Basic (the programming
> language), not Vista Business. The Vista newsgroups all have "vista" in
> their names.

You just read the Subject, didn't you?  ;-)
--
.NET: It's About Trust!
 http://vfred.mvps.org


Mon, 13 Dec 2010 04:14:17 GMT  
 Print screen Vista Business problem

Quote:

> I am using "Copy the contents of the screen or the active window"
> from http://www.devx.com/vb2themax/Tip/18341

> When I print the picture to a printer with 98, XP and Vista Home
> I get the correct printout.

> With Vista Business I get the printout of the previous print screen
> command.  The first print screen request after the program loads,
> I get a blank piece of paper printed out.  Every print screen request
> after that prints the previous screen.  Print twice and throw out the
> first copy is unacceptable to our users.

> This routine is used in many of our forms and programs.

> Any suggestions?

Wow, besides "Upgrade to XP!"?  I dunno.

Looking at that code, it isn't actually printing anything.  It just captures (or
attempts to, at any rate) an image to the clipboard, and returns that as a Picture
object.  How are you actually sending this to the printer?  I'd tend to suspect that
more than this.

Barring more to go on, you might also want to try fiddling with the SendInput API
rather than keybd_event.  I have a Vista ready sample at
http://vb.mvps.org/samples/SendInput.  Never tried it in Win98 - MSDN doesn't appear
to indicate it's supported there, so you may need to test the platform if you end up
using this for Vista.
--
.NET: It's About Trust!
 http://vfred.mvps.org



Mon, 13 Dec 2010 04:20:10 GMT  
 Print screen Vista Business problem

Quote:


> The "vb" in this newsgroup's name is for Visual Basic (the programming
> language), not Vista Business. The Vista newsgroups all have "vista" in
> their names.

But.... the link he gave goes to DevX, showing VB Code. I kinda think it
/is/ a VB question.

He might also want to post in miscrosoft.public.vista.compatibility, as it
is a Vista version apparently causing the problem.

--
-
Regards,

Rick Raisley
heavymetal-A-T-bellsouth-D-O-T-net



Mon, 13 Dec 2010 04:27:05 GMT  
 Print screen Vista Business problem


Quote:
>> The "vb" in this newsgroup's name is for Visual Basic (the programming
>> language), not Vista Business. The Vista newsgroups all have "vista" in
>> their names.

> You just read the Subject, didn't you?  ;-)

No, in truth I read it all, but I have a tendency to gloss over URLs and
therefore didn't notice the reference to a VB site. I caught that in a
re-read.


Mon, 13 Dec 2010 21:33:41 GMT  
 Print screen Vista Business problem
On Jun 25, 4:27?pm, "Rick Raisley" <heavymetal-A-T-bellsouth-D-O-Tnet>

Quote:




> > The "vb" in this newsgroup's name is for Visual Basic (the programming
> > language), not Vista Business. The Vista newsgroups all have "vista" in
> > their names.

> But.... the link he gave goes to DevX, showing VB Code. I kinda think it
> /is/ a VB question.

> He might also want to post in miscrosoft.public.vista.compatibility, as it
> is a Vista version apparently causing the problem.

> --
> -
> Regards,

> Rick Raisley
> heavymetal-A-T-bellsouth-D-O-T-net

Thanks,

I am using http://support.microsoft.com/kb/q161299/ to print the
captured picture.

Public Sub PrintPictureToFitPage(Prn As Printer, Pic As Picture)
         Const vbHiMetric As Integer = 8
         Dim PicRatio As Double
         Dim PrnWidth As Double
         Dim PrnHeight As Double
         Dim PrnRatio As Double
         Dim PrnPicWidth As Double
         Dim PrnPicHeight As Double

         ' Determine if picture should be printed in landscape or
portrait
         ' and set the orientation.
         If Pic.Height >= Pic.Width Then
            Prn.Orientation = vbPRORPortrait   ' Taller than wide.
         Else
            Prn.Orientation = vbPRORLandscape  ' Wider than tall.
         End If

         ' Calculate device independent Width-to-Height ratio for
picture.
         PicRatio = Pic.Width / Pic.Height

         ' Calculate the dimentions of the printable area in HiMetric.
         PrnWidth = Prn.ScaleX(Prn.ScaleWidth, Prn.ScaleMode,
vbHiMetric)
         PrnHeight = Prn.ScaleY(Prn.ScaleHeight, Prn.ScaleMode,
vbHiMetric)
         ' Calculate device independent Width to Height ratio for
printer.
         PrnRatio = PrnWidth / PrnHeight

         ' Scale the output to the printable area.
         If PicRatio >= PrnRatio Then
            ' Scale picture to fit full width of printable area.
            PrnPicWidth = Prn.ScaleX(PrnWidth, vbHiMetric,
Prn.ScaleMode)
            PrnPicHeight = Prn.ScaleY(PrnWidth / PicRatio, vbHiMetric,
_
               Prn.ScaleMode)
         Else
            ' Scale picture to fit full height of printable area.
            PrnPicHeight = Prn.ScaleY(PrnHeight, vbHiMetric,
Prn.ScaleMode)
            PrnPicWidth = Prn.ScaleX(PrnHeight * PicRatio, vbHiMetric,
_
               Prn.ScaleMode)
         End If

         ' Print the picture using the PaintPicture method.
         Prn.PaintPicture Pic, 0, 0, PrnPicWidth, PrnPicHeight
      End Sub

I have tried:
   Set Picture1.Picture = GetScreenBitmap
   Set Picture1.Picture = GetScreenBitmap
then print picture and still prints the previous screen.

Thanks,
John



Mon, 13 Dec 2010 22:39:53 GMT  
 Print screen Vista Business problem

Quote:
> He might also want to post in miscrosoft.public.vista.compatibility, as it
> is a Vista version apparently causing the problem.

Did you mean miscrosoft.public.VB.vista.compatibility?


Mon, 13 Dec 2010 23:16:58 GMT  
 Print screen Vista Business problem

Quote:


>> He might also want to post in miscrosoft.public.vista.compatibility, as
>> it is a Vista version apparently causing the problem.

> Did you mean miscrosoft.public.VB.vista.compatibility?

Yes, I did. Sorry.

--
Regards,

Rick Raisley
heavymetal-A-T-bellsouth-D-O-T-net



Tue, 14 Dec 2010 02:21:40 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. VB6 printing problems on Vista

2. VB Screen Object Bug in Vista

3. VB6 under Vista - won't allow printing of more than 1 copy

4. PROBLEM PRINTING SCREEN

5. Read/Write INI on Program File Vista Problem

6. Problem changing wallpaper on Vista

7. Problem with vista and form appearance

8. VB6 on Vista Home Premium problem

9. Problem with Vista and VB6, will run under user but not administra

10. Problem in Vista with ActiveX cannot create object for Word.Application

11. Problem in Vista

12. Problems installing on Vista - Win2003

 

 
Powered by phpBB® Forum Software