????????? ????? ??????? ?? ?????? ????? ?? ?????????? ?? ??? Visual Basic ?? ???? ????

???? ?????? ???? ??????
???? ID: 240653 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
??? ?? ??????? ???? | ??? ?? ??????? ????

?? ????? ??

??????

?? ???? ????????? ???? ?? ?? ????????? ?????? ????? ?? ???? ??????? ?? ?????????? ?? ????????? ????? ?? ????? ??????? ???? ?? ??? ???? ?????

???? ???????

??? ???????? ???? ??? ????? ??:
161299?????? ?? ???????, ???? ??????? ?? ???? ????? ?? ?????? ???? ????
???? ??????? ?? ????? ??????? ??, ?????? ?????? ?? ???? Visual Basic ????? ???????? ??? ???? ?? ??? ???? ?????? ??? ?????? ????? ?? ??????? ?? ?????????? ?? ????????? ????? ?? ??? ???? ?? ???????? ??, ??? keybd_event API ?? ???? ?? lower overhead much approach. ????? ?????? ???? ???? ?? ??? ??? ???? ??????????? achieves keybd_event API ???PRINTSCRN(?????????? ?? ??? ??????? ?? ????????? ?????) ??ALT + PRINTSCRN(????????? ?????? ????? ?????????? ?? ???)? ??? ?? ???? ??? ??????? ???? ?? ???, ???? ???? PictureBox ?? ??????????? ?????? ?? ???? ????

??? ?? ??? ??????

  1. ?? ?? ???? EXE Visual Basic ????????? ??????? ????? Form1 ???????? ??? ?? ???? ??..
  2. Form1 ?? ??? ??? CommandButtons ?? ?? PictureBox ???????
  3. Form1 ?? ??????? Declarations ??? ??? ????? ??? ?? ??????:
    Option Explicit
    
    Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal _
       bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
    
    Private Declare Function GetVersionExA Lib "kernel32" _
          (lpVersionInformation As OSVERSIONINFO) As Integer
    
    Private Type OSVERSIONINFO
        dwOSVersionInfoSize As Long
        dwMajorVersion As Long
        dwMinorVersion As Long
        dwBuildNumber As Long
        dwPlatformId As Long
        szCSDVersion As String * 128
    End Type
    
    Private Const KEYEVENTF_KEYUP = &H2
    Private Const VK_SNAPSHOT = &H2C
    Private Const VK_MENU = &H12
    
    Dim blnAboveVer4 As Boolean
    
    Private Sub Command1_Click()
        If blnAboveVer4 Then
            keybd_event VK_SNAPSHOT, 0, 0, 0
        Else
            keybd_event VK_SNAPSHOT, 1, 0, 0
        End If
    End Sub
    
    Private Sub Command2_Click()
        If blnAboveVer4 Then
            keybd_event VK_SNAPSHOT, 1, 0, 0
        Else
            keybd_event VK_MENU, 0, 0, 0
            keybd_event VK_SNAPSHOT, 0, 0, 0
            keybd_event VK_SNAPSHOT, 0, KEYEVENTF_KEYUP, 0
            keybd_event VK_MENU, 0, KEYEVENTF_KEYUP, 0
        End If
    End Sub
    
    Private Sub Command3_Click()
        ' Load the captured image into a PictureBox and print it
        Picture1.Picture = Clipboard.GetData()
        Printer.PaintPicture Picture1.Picture, 0, 0
        Printer.EndDoc
    End Sub
    
    Private Sub Form_Load()
        Dim osinfo As OSVERSIONINFO
        Dim retvalue As Integer
       
        osinfo.dwOSVersionInfoSize = 148
        osinfo.szCSDVersion = Space$(128)
        retvalue = GetVersionExA(osinfo)
        If osinfo.dwMajorVersion > 4 Then blnAboveVer4 = True
    
        Picture1.Visible = False
        Command1.Caption = "Print Screen"
        Command2.Caption = "Alt+Print Screen"
        Command3.Caption = "Print Image"
    End Sub
    					
  4. Microsoft ???? ?? ?????, ?? ??? ????????? ?? ??????
  5. ????? ??????????? ?? ??????? ???????, ???? ??? ???? ?? ?????CTRL+V:?????????? ?? ??????? ?? ???? ??? ??????? ????? ??????? ??????? ??????? ???? ???
  6. ????? ????ALT + ?????? ??????????, ???? ???? ?? ??? before ?? ??? ??? ????, ?? ?????CTRL+V:???:? ???? ?????? ????? ?? ??????? ???? ???
  7. ????? ??????? ??????? ??????? ?? ?????? ?? ?? ??? ??????? ???? (??? ???? ??? PictureBox ?? ????? ????)?

??????

???????? ??????? ?? ???, ????? ?????? ?? Microsoft ???????? ??? ????? ?? ??? ????? ???? ?????? ????? ????:
161299?????? ?? ???????, ???? ??????? ?? ???? ????? ?? ?????? ???? ????

189249??? 32-??? Windows ??????? ????? ??? ?? ???????? ???? ????

???

???? ID: 240653 - ????? ???????: 02 ?????? 2010 - ??????: 2.0
???? ???? ???? ??:
  • Microsoft Visual Basic 5.0 Learning Edition
  • Microsoft Visual Basic 5.0 Professional Edition
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic 5.0 Enterprise Edition
??????: 
kbapi kbclipboard kbhowto kbprint kbmt KB240653 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:240653

??????????? ???

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com