fb:porticula NoPaste
Osk_Test
Uploader: | Volta |
Datum/Zeit: | 25.07.2008 19:01:23 |
#Include Once "windows.bi"
Declare Sub AbNachVorn (Fenstername As String)
Screen 18,32
Dim a As String
Dim x As Integer
Dim hand As HANDLE
WindowTitle "Osk_Test"
hand= FindWindow(0,"Osk_Test")
If FindWindow(0,"Bildschirmtastatur") = 0 Then
Shell "start osk"
SetFocus hand
End If
Print"Auf der Bildschirmtastatur tippen! (mit ESC beenden)"
Do
a = InKey
If a = Chr(27) Then Exit Do 'mit ESC verlassen
If a <> "" Then Print a;
If x = 0 And FindWindow(0,"Bildschirmtastatur") = 0 Then
Print
Print"Auf der Tastatur tippen! (mit ESC beenden)"
x = 1
AbNachVorn ("Osk_Test")
End If
Sleep 1, 1
Loop
End
Function GetOSplatform () As UInteger
Dim OSV As OSVERSIONINFO
OSV.dwOSVersionInfoSize = SizeOf(OSV)'Laenge des UDT angeben
If GetVersionEx( @OSV ) Then 'Funktion aufrufen
Return OSV.dwPlatformId 'Rueckgabewert
'0 = ???
'1 = Win 95 | 98 | ME
'2 = NT | W2k| XP | Vista
End If
Function = 0
End Function
'Dank Sebastian - 25.07.2008 - www.freebasic-portal.de
Sub AbNachVorn (Fenstername As String)Sebastian
Dim As HANDLE Handle = FindWindow(0, Fenstername)
Dim As WINDOWPLACEMENT WndPlcmt
If GetOSplatform >=2 Then
SetWindowPos Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE
SetWindowPos Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE
End If
With WndPlcmt
.Length = SizeOf(WndPlcmt)
If GetWindowPlacement(Handle, @WndPlcmt) Then
If .showCmd = SW_SHOWMINIMIZED Then
.flags = 0
.showCmd = SW_SHOWNORMAL
SetWindowPlacement(Handle, @WndPlcmt)
Else
SetForegroundWindow(Handle)
BringWindowToTop(Handle)
SetFocus Handle
End If
End If
End With
End Sub