Click here to Skip to main content
15,911,646 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionGet "Created" date from and Access table Pin
chuckf1-Jul-08 9:37
chuckf1-Jul-08 9:37 
AnswerRe: Get "Created" date from and Access table Pin
jzonthemtn1-Jul-08 11:19
jzonthemtn1-Jul-08 11:19 
GeneralRe: Get "Created" date from and Access table Pin
chuckf2-Jul-08 2:19
chuckf2-Jul-08 2:19 
GeneralRe: Get "Created" date from and Access table Pin
jzonthemtn2-Jul-08 5:59
jzonthemtn2-Jul-08 5:59 
QuestionProgress bar help Pin
Cory Kimble1-Jul-08 7:12
Cory Kimble1-Jul-08 7:12 
AnswerRe: Progress bar help Pin
jzonthemtn1-Jul-08 7:52
jzonthemtn1-Jul-08 7:52 
QuestionHow to Set Security? Pin
Trupti Mehta1-Jul-08 4:21
Trupti Mehta1-Jul-08 4:21 
QuestionHow to maximize third party app [modified] Pin
JLTBDY1-Jul-08 2:47
JLTBDY1-Jul-08 2:47 
Scenerio: predecessor built a screencapture VB applet to call from a shortcut in third-party app...but I need to modify it to maximize the app before snapshot.
Hints? how do I maximaize an already open app?

Another option wwould be to capture just the active window instead of full screen...

Public Class Form1
    Dim memoryImage As Bitmap 'The bitmap of the screen
    Dim srcWidth As Int16 'The width of the usable screen
    Dim srcHeight As Int16 'The height of the usable screen
    Dim tmr As New System.Windows.Forms.Timer


    Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
        Dim dstWidth As Int16 'Destination width
        Dim dstRect As Rectangle 'Destination height
        Dim srcRect As New Rectangle(0, 0, srcWidth, srcHeight) 'Source Rectangle

        'Set the dstWidth to the printable height of the document. The height is used
        'because the document is printed in landscape
        dstWidth = PrintDocument1.DefaultPageSettings.PrintableArea.Height
        dstRect.Width = dstWidth ' Set the width of the destination rectangle

        'Scale the height in relation to the width and the source rectangle
        dstRect.Height = (dstWidth / srcWidth * srcHeight)

        'Draw the image scaling from the srcRect to the dstRect
        e.Graphics.DrawImage(memoryImage, dstRect, srcRect, GraphicsUnit.Pixel)
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        PrintDocument1.DocumentName = "Screen Print" 'Name the document
        PrintDocument1.DefaultPageSettings.Landscape = True 'Swith to landscape
        PrintPreviewDialog1.ShowDialog() 'Show the print preview dialog
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.Visible = False 'Hide the form

        tmr.Enabled = True
        tmr.Interval = 1500
        AddHandler tmr.Tick, AddressOf Me.TimerTick
        tmr.Start()





    End Sub

    Private Sub TimerTick(ByVal Sender As Object, ByVal e As EventArgs)
        Dim myGraphics As Graphics
        Dim s As Size
        tmr.Enabled = False
        tmr.Stop()

        'Set the srcWidth and srcHeight to the working dimensions of the screen
        srcWidth = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width
        srcHeight = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height
        s.Width = srcWidth 'Set the width of the size object
        s.Height = srcHeight 'Set the height of the size object


        myGraphics = Me.CreateGraphics
        'Create a bitmap based on the size of the screen
        memoryImage = New Bitmap(srcWidth, srcHeight, myGraphics)

        'Create a graphics object to paint the bitmap
        Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage)

        'Get a capture of the screen
        memoryGraphics.CopyFromScreen(200, 0, 0, 0, s)

        'PictureBox1.Image() = memoryImage
        Button1_Click(Sender, e)
        Application.Exit()
    End Sub
End Class


modified on Tuesday, July 1, 2008 9:33 AM

AnswerRe: How to maximize third party app Pin
jzonthemtn1-Jul-08 4:54
jzonthemtn1-Jul-08 4:54 
GeneralRe: How to maximize third party app Pin
JLTBDY1-Jul-08 5:19
JLTBDY1-Jul-08 5:19 
GeneralRe: How to maximize third party app Pin
jzonthemtn1-Jul-08 5:34
jzonthemtn1-Jul-08 5:34 
GeneralRe: How to maximize third party app Pin
JLTBDY7-Jul-08 7:28
JLTBDY7-Jul-08 7:28 
GeneralRe: How to maximize third party app Pin
jzonthemtn7-Jul-08 8:11
jzonthemtn7-Jul-08 8:11 
GeneralRe: How to maximize third party app Pin
JLTBDY8-Jul-08 12:00
JLTBDY8-Jul-08 12:00 
GeneralRe: How to maximize third party app Pin
jzonthemtn8-Jul-08 12:19
jzonthemtn8-Jul-08 12:19 
AnswerRe: How to maximize third party app Pin
JLTBDY9-Jul-08 6:07
JLTBDY9-Jul-08 6:07 
GeneralRe: How to maximize third party app Pin
jzonthemtn10-Jul-08 3:17
jzonthemtn10-Jul-08 3:17 
Questionsql datareader Pin
Ebube1-Jul-08 2:45
Ebube1-Jul-08 2:45 
AnswerRe: sql datareader Pin
paas1-Jul-08 3:26
paas1-Jul-08 3:26 
GeneralRe: sql datareader Pin
Ebube1-Jul-08 5:05
Ebube1-Jul-08 5:05 
GeneralRe: sql datareader Pin
paas1-Jul-08 5:18
paas1-Jul-08 5:18 
GeneralRe: sql datareader Pin
Ebube1-Jul-08 5:33
Ebube1-Jul-08 5:33 
GeneralRe: sql datareader Pin
Ebube1-Jul-08 6:04
Ebube1-Jul-08 6:04 
GeneralRe: sql datareader Pin
paas1-Jul-08 7:03
paas1-Jul-08 7:03 
GeneralRe: sql datareader Pin
Ebube1-Jul-08 16:09
Ebube1-Jul-08 16:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.