Fala povão!
Segue ai para estudos (Ou uso, se você tiver coragem
) um programinha para screenshots.
Tentei fazer ele menor possivel, assim dá pra tirar fotos sem atrapalhar a imagem.
Sem mais delongas, vamos ao programa e seus códigos:
Screenshot .FRM
VERSION 5.00
Begin VB.Form Form1
Caption = "Screenshot 1.0"
ClientHeight = 1050
ClientLeft = 165
ClientTop = 735
ClientWidth = 2760
Icon = "screenshot.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 1050
ScaleWidth = 2760
StartUpPosition = 3 'Windows Default
Begin VB.PictureBox Picture1
Height = 15
Left = 1440
ScaleHeight = 15
ScaleWidth = 975
TabIndex = 4
Top = 1080
Width = 975
End
Begin VB.CommandButton Command2
Caption = "Salvar"
Height = 255
Index = 1
Left = 1440
TabIndex = 3
Top = 720
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "Capturar"
Height = 255
Index = 0
Left = 120
TabIndex = 2
Top = 720
Width = 1215
End
Begin VB.TextBox txtname
Height = 285
Left = 120
TabIndex = 1
Top = 360
Width = 2535
End
Begin VB.Label Label1
Caption = "Digite o nome do arquivo:"
BeginProperty Font
Name = "Comic Sans MS"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 0
Top = 0
Width = 2775
End
Begin VB.Menu Menu
Caption = "Menu"
WindowList = -1 'True
Begin VB.Menu Visualizar
Caption = "Visualizar"
End
Begin VB.Menu Configurar
Caption = "Configurar"
End
Begin VB.Menu Sair
Caption = "Sair"
End
End
Begin VB.Menu Ajuda
Caption = "Ajuda"
Begin VB.Menu usar
Caption = "Como usar"
End
Begin VB.Menu Sobre
Caption = "Sobre"
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Sub Command1_Click(Index As Integer)
keybd_event vbKeySnapshot, 0, 0&, 0&
End Sub
Private Sub Command2_Click(Index As Integer)
SavePicture Clipboard.GetData(vbCFBitmap), "C:\Documents and Settings\Screenshot\" & txtname.Text & ".jpg"
End Sub
Private Sub Configurar_Click()
MkDir "C:\Documents and Settings\Screenshot"
MsgBox "Pasta Screenshot criada!" & vbCrLf & "C:\Documents and Settings\Screenshot", vbOKOnly, "Configuração do Screenshot 1.0"
End Sub
Private Sub Sair_Click()
End
End Sub
Private Sub Sobre_Click()
MsgBox "Desenvolvido por André", vbOKOnly, "Screenshot 1.0"
End Sub
Private Sub usar_Click()
MsgBox "Na primeira utilização acesse MENU > CONFIGURAR " & vbCrLf & "Para capturar a tela clique em CAPTURAR" & vbCrLf & "O caminho é:C:\Documents and Settings\Screenshot", vbOKOnly, "Ajuda do Screenshot 1.0"
End Sub
Configurei ele para criar dentro da pasta C:\Documents and Settings uma pasta chamada Screenshot. Para tal, é preciso roda o "Configurar" na primeira vez que for rodar o programa.
Criei uma ajuda simples (Só com msgbox)
É legal para estudo, eu não sabia as funções de teclado, e como tirar SS simulando um printscreen. O bom é que não precisa ficar abrindo o paint =P
Ah, usando:
keybd_event vbKeySnapshot, 1, 0&, 0&
Você tira somente da tela ativa.
Abraços



















