Felder in Anwendungen ausfüllen

Übersicht BlitzBasic Allgemein

Neue Antwort erstellen

blitzuser34

Betreff: Felder in Anwendungen ausfüllen

BeitragSo, Feb 10, 2008 13:59
Antworten mit Zitat
Benutzer-Profile anzeigen
Hi, kennt jemand eine Möglichkeit, z.B. im Browser bestimmte Felder auszufüllen und dann auf nen Button klicken zu lassen? Wollte nähmlich ein Programm zum Verwalten von Passwörtern machen.

BladeRunner

Moderator

BeitragSo, Feb 10, 2008 14:23
Antworten mit Zitat
Benutzer-Profile anzeigen
...und nebenbei bei deinen browsergames den computer für dich spielen lassen, hm ?
Zu Diensten, Bürger.
Intel T2300, 2.5GB DDR 533, Mobility Radeon X1600 Win XP Home SP3
Intel T8400, 4GB DDR3, Nvidia GF9700M GTS Win 7/64
B3D BMax MaxGUI

Stolzer Gewinner des BAC#48, #52 & #92

skey-z

BeitragSo, Feb 10, 2008 14:38
Antworten mit Zitat
Benutzer-Profile anzeigen
nimm Firefox, da ist es schon integriert und du kannst es mit einem Masterpasswort schützen
Awards:
Coffee's Monatswettbewerb Feb. 08: 1. Platz
BAC#57: 2. Platz
Twitter

pixelshooter

BeitragSo, Feb 10, 2008 15:04
Antworten mit Zitat
Benutzer-Profile anzeigen
Als ob nur Firefox das könnte… tzz. Welcher mainstream browser (darf man Opera dazu zählen?) kann das nicht. Btw, wenns selber gemacht werden soll, schau dir AutoHotkey an. Damit kannst du u.A. beliebige Eingaben an beliebige Programme senden.
>> Musikerstellung, Grafik und Design: http://www.pixelshooter.net.tc

Markus2

BeitragDi, Feb 12, 2008 15:00
Antworten mit Zitat
Benutzer-Profile anzeigen
Man kann alle Fenster auflisten und dazu alle Textboxen
und die befüllen bzw. auslesen .
Aber dafür muß man mit den APIs rumhantieren .
BlitzBasic ist da eher ungeeignet für .
 

ChristianK

BeitragDi, Feb 12, 2008 17:15
Antworten mit Zitat
Benutzer-Profile anzeigen
Man kann keine Controls von anderen Programmen ändern oder auslesen. Dazu muss das Browserfenster schon vom eigenen Programm erstellt werden.
AdvanceLcd
Intel Core 2 Duo 3.2 GHz, 4 GB RAM, GeForce 8800 GTX | MacBook Pro 15,4″ Intel Core 2 Duo 2.4 GHz, 2 GB RAM, GeForce 8600M GT

Markus2

BeitragDi, Feb 12, 2008 19:31
Antworten mit Zitat
Benutzer-Profile anzeigen
Beispiel in VB6 was dazu diente Textboxen mit Passwort Char
aus anderen Programmen wieder lesbar zu machen .

Zitat:

Private Declare Function GetForegroundWindow Lib "user32" () As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Private Declare Function FindWindow& Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String)
Private Declare Function GetWindow& Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long)
Private Declare Function Sendmessagebynum& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
Private Declare Function SendMessageByString& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String)
Private Declare Function GetCursorPos& Lib "user32" (lpPoint As POINTAPI)
Private Declare Function WindowFromPoint& Lib "user32" (ByVal x As Long, ByVal y As Long)
Private Declare Function ChildWindowFromPoint& Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long)
Private Declare Function SetWindowPos& Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)
Private Declare Function UpdateWindow& Lib "user32" (ByVal hwnd As Long)
Const SWP_NOACTIVATE = &H10
Const SWP_NOREDRAW = &H8
Const SWP_NOSIZE = &H1
Const SWP_NOZORDER = &H4
Const SWP_NOMOVE = &H2
Const HWND_TOPMOST = -1
Const HWND_BOTTOM = 1
Const SWP_HIDEWINDOW = &H80
Const WM_SETTEXT = &HC
Const WM_GETTEXT = &HD
Const WM_CHAR = &H102
Const WM_CLEAR = &H303
Const GW_CHILD = 5
Const GW_HWNDNEXT = 2
Const EM_SETPASSWORDCHAR = &HCC
Const EM_GETPASSWORDCHAR = &HD2
Const EN_CHANGE = &H300
Dim Abort, LastWindow&, LastCaption$
Private Type POINTAPI
x As Long
y As Long
End Type
Function GetCaption(hwnd) As String
'hwndlength% = GetWindowTextLength(hwnd)
'hwndTitle$ = String$(hwndlength%, 0)
'A% = GetWindowText(hwnd, hwndTitle$, (hwndlength% + 1))
'GetCaption = hwndTitle$
Capt$ = Space$(255)
TChars$ = GetWindowText(hwnd, Capt$, 255)
GetCaption = Left$(Capt$, TChars$)
End Function

Function GetText(hwnd) As String
GetTrim = Sendmessagebynum(hwnd, 14, 0&, 0&)
TrimSpace$ = Space$(GetTrim)
GetString = SendMessageByString(hwnd, 13, GetTrim + 1, TrimSpace$)

GetText = TrimSpace$
End Function

Private Sub Form_Load()
Call SetWindowPos(Form1.hwnd, HWND_TOPMOST, 0&, 0&, 0&, 0&, SWP_NOMOVE Or SWP_NOSIZE)
End Sub

Private Sub Form_Unload(Cancel As Integer)
Abort = 1
End Sub

Private Sub Timer1_Timer()
Dim mypoint As POINTAPI
Call GetCursorPos(mypoint)
A& = WindowFromPoint(mypoint.x, mypoint.y)
If LastWindow& <> A& And LastWindow& <> 0 Then Call Sendmessagebynum(LastWindow&, EM_SETPASSWORDCHAR, Asc("*"), 0&): DoEvents: Call SendMessageByString(LastWindow&, WM_SETTEXT, 0&, LastCaption$): LastWindow& = 0 ': LastWindow& = A&: LastCaption$ = GetText(A&)
B& = ChildWindowFromPoint(A&, mypoint.x, mypoint.y)
If A& = Form1.hwnd Then Exit Sub
Label2.Caption = GetCaption(A&)
Label3.Caption = GetText(A&)
If Sendmessagebynum(A&, EM_GETPASSWORDCHAR, 0&, 0&) <> 0 Then Call Sendmessagebynum(A&, EM_SETPASSWORDCHAR, 0&, 0&): LastWindow& = A&: LastCaption$ = GetText(A&): DoEvents: LastWindow& = A&: LastCaption$ = GetText(A&): Call SendMessageByString(A&, WM_SETTEXT, 0&, Label3.Caption)
End Sub
 

ChristianK

BeitragDi, Feb 12, 2008 20:30
Antworten mit Zitat
Benutzer-Profile anzeigen
Seltsam Confused

MSDN hat Folgendes geschrieben:
However, GetWindowText cannot retrieve the text of a control in another application.

http://msdn2.microsoft.com/en-...33520.aspx
AdvanceLcd
Intel Core 2 Duo 3.2 GHz, 4 GB RAM, GeForce 8800 GTX | MacBook Pro 15,4″ Intel Core 2 Duo 2.4 GHz, 2 GB RAM, GeForce 8600M GT

Markus2

BeitragDi, Feb 12, 2008 23:38
Antworten mit Zitat
Benutzer-Profile anzeigen
Dafür ist die Funktion ja auch nicht gemacht Wink
Code: [AUSKLAPPEN]

GetWindowText Function
The GetWindowText function copies the text of the specified window's title bar (if it has one) into a buffer.
If the specified window is a control, the text of the control is copied. However, GetWindowText cannot retrieve the text of a control in another application.
 

ChristianK

BeitragMi, Feb 13, 2008 0:07
Antworten mit Zitat
Benutzer-Profile anzeigen
Ich dachte zuerst, WM_GETTEXT und GetWindowText machen das gleiche.

MSDN hat Folgendes geschrieben:
If the target window is owned by the current process, GetWindowText causes a WM_GETTEXT message to be sent to the specified window or control.

Das gilt aber natürlich nur, solange das Fenster zum eigenen Prozess gehört, daher ist mir der Unterschied nie aufgefallen. Smile

PS: Das kann man eigentlich als Sicherheitslücke bezeichnen, oder? Confused
AdvanceLcd
Intel Core 2 Duo 3.2 GHz, 4 GB RAM, GeForce 8800 GTX | MacBook Pro 15,4″ Intel Core 2 Duo 2.4 GHz, 2 GB RAM, GeForce 8600M GT

Neue Antwort erstellen


Übersicht BlitzBasic Allgemein

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group