Code: Alles auswählen
; German forum: http://www.purebasic.fr/german/archive/viewtopic.php?t=906&highlight=
; Author: Volker (updated for PB 4.00 by Andre)
; Date: 06. May 2003
; OS: Windows
; Demo: No
; Klartext
;
; ändert die EM_SETPASSWORDCHAR-Eigenschaft eines Textfeldes via API,
; so dass das Auslesen des Passwortes im Klartext möglich wird.
; Nach dem Start den Cursor über ein Passwort-Textfeld bewegen.
;
; 06.05.2003 Volker
; Change for PB5Beta8 and Windows 8 , 31.10.2012
#SWP_NOMOVE = $2
#SWP_NOSIZE = $1
#HWND_TOPMOST = -1
#HWND_NOTOPMOST = -2
#EM_SETPASSWORDCHAR = $CC
#Text1 = 1
#Label2 = 2
Structure POINTAPI
X.l
Y.l
EndStructure
Global hwnd.l, Title.s
;///////////////////////////////////////////////////////////
Procedure getWindowUM()
;///////////////////////////////////////////////////////////
Global Dim P.POINTAPI(1)
lo.l
;Cursorposition auslesen
GetCursorPos_(P(0))
;Das entsprechende Fenster finden
;lo = WindowFromPoint_(P(0)\X , P(0)\Y)
lo = WindowFromPoint_(P(0)\X | P(0)\Y << 32)
;Den Titel auslesen
Title = Str(GetWindowTextLength_(lo))
GetWindowText_ (lo, Title, 100)
;Ergebnis anzeigen
SetGadgetText (#Text1, Title)
;Den Passwortcharacter entfernen
SendMessage_ (lo, #EM_SETPASSWORDCHAR, 0, "")
EndProcedure
;///////////////////////////////////////////////////////////
Procedure Open_Window()
;///////////////////////////////////////////////////////////
hwnd = OpenWindow(#Label2, 352, 182, 270, 98, "Klartext", #PB_Window_MinimizeGadget |#PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
;If CreateGadgetList(WindowID(#Label2))
StringGadget(#Text1, 10, 10, 250, 30, "")
;EndIf
EndProcedure
;-Main ////////////////////////////////////////////////////////////////////////////////
Open_Window()
;Formular immer oben halten
SetWindowPos_ (hwnd, #HWND_TOPMOST, 0, 0, 0, 0, #SWP_NOMOVE | #SWP_NOSIZE)
Repeat
Event = WaitWindowEvent()
getWindowUM()
Until Event = #PB_Event_CloseWindow
End
; IDE Options = PureBasic v4.00 (Windows - x86)
; Folding = -
; EnableAsm
Im Foglendem mit Structure:
Code: Alles auswählen
; German forum: http://www.purebasic.fr/german/archive/viewtopic.php?t=906&highlight=
; Author: Volker (updated for PB 4.00 by Andre)
; Date: 06. May 2003
; OS: Windows
; Demo: No
; WindowFromPoint neu angepasst von Falko
; Klartext
;
; ändert die EM_SETPASSWORDCHAR-Eigenschaft eines Textfeldes via API,
; so dass das Auslesen des Passwortes im Klartext möglich wird.
; Nach dem Start den Cursor über ein Passwort-Textfeld bewegen.
;
; 06.05.2003 Volker
; Source von Volker here: http://www.purearea.net/pb/CodeArchiv/Encode+Decode/Password-Finder.pb
; 24.07.2011 Falko (change WindowFromPoint) PB5B7 http://www.purebasic.fr/german/viewtopic.php?f=6&t=23458
; Change for PB5Beta8 and Windows 8 , 31.10.2012
EnableExplicit
#SWP_NOMOVE = $2
#SWP_NOSIZE = $1
#HWND_TOPMOST = -1
#HWND_NOTOPMOST = -2
#EM_SETPASSWORDCHAR = $CC
#Text1 = 1
#Label2 = 2
Global hwnd.l
Define Event.l
Structure Point64
StructureUnion
p.POINT
q.q
EndStructureUnion
EndStructure
Global Title.s
;///////////////////////////////////////////////////////////
Procedure getWindowUM()
;///////////////////////////////////////////////////////////
Protected cursor.POINT64, lo.l;, Title.s
GetCursorPos_(@cursor.POINT64)
lo = WindowFromPoint_( cursor\q );Den Titel auslesen
Title = Str(GetWindowTextLength_(lo))
GetWindowText_ (lo, Title, 100)
;Ergebnis anzeigen
SetGadgetText(#Text1, Title)
;Den Passwortcharacter entfernen
SendMessage_ (lo, #EM_SETPASSWORDCHAR, 0, "")
EndProcedure
;///////////////////////////////////////////////////////////
Procedure Open_Window()
;///////////////////////////////////////////////////////////
hwnd = OpenWindow(#Label2, 352, 182, 270, 98, "Klartext", #PB_Window_MinimizeGadget |#PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
StringGadget(#Text1, 10, 10, 250, 30, "")
EndProcedure
;-Main ////////////////////////////////////////////////////////////////////////////////
Open_Window()
;Formular immer oben halten
SetWindowPos_ (hwnd, #HWND_TOPMOST, 0, 0, 0, 0, #SWP_NOMOVE | #SWP_NOSIZE)
Repeat
Event.l = WaitWindowEvent()
getWindowUM()
Until Event = #PB_Event_CloseWindow