Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Declare Sub keybd_event Lib "user32" (Byval bVk As Integer, Byval _
bScan As Integer, Byval dwFlags As Long, Byval dwExtraInfo As Long)
Public Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Public Declare Function GetVersionEx Lib "kernel32" Alias _
"GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Public Const VER_PLATFORM_WIN32_NT = 2
Public Const VER_PLATFORM_WIN32_WINDOWS = 1
Public Const VER_PLATFORM_WIN32s = 0
Public Const KEYEVENTF_KEYUP = &H2
Public Const VK_SNAPSHOT = &H2C
Public Const VK_MENU = &H12
Public Function fGetWinMajorVer() As Integer
'--- Returns the major version of Windows as an integer
'--- or zero if an error occurs.
'--- returns 4 or greater for W2000 or later
Dim pudtOSI As OSVERSIONINFO
Dim plngRtn As Long
pudtOSI.szCSDVersion = Space$(128)
pudtOSI.dwOSVersionInfoSize = Len(pudtOSI)
plngRtn = GetVersionEx(pudtOSI)
If Not plngRtn = 0 Then
fGetWinMajorVer = Cint(pudtOSI.dwMajorVersion)
End If
End Function
Public Sub sCopyScreenToClip
'--- simulates PrintScreen
If fGetWinMajorVer > 4 Then
'Windows 2000
keybd_event VK_SNAPSHOT, 0, 0, 0
Else
'All other versions of Windows
keybd_event VK_SNAPSHOT, 1, 0, 0
End If
End Sub
Public Sub sCopyActiveWindowToClip
'--- simulates Alt + PrintScreen
If fGetWinMajorVer > 4 Then
'Windows 2000
keybd_event VK_SNAPSHOT, 1, 0, 0
Else
'All other versions of Windows
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