Unit unit1;
Interface
Uses
Windows, Sysutils, Classes, Forms, Shellapi, Controls, stdctrls;
Type
TFORM1 = Class (TFORM)
Groupbox1: TgroupBox;
Listbox: tlistbox;
Label1: TLABEL;
Label2: TLABEL;
Procedure label1click (sender: TOBJECT);
Procedure FormShow (Sender: TOBJECT);
Private
{Private Declarations}
public
HMPR: THANDLE;
END;
VAR
FORM1: TFORM1;
Const
COUNT: INTEGER = 0;
Function WNETENUMCACHEDPASSWORDS (LP: LPSTR; W: Word; B: BYTE; PC: PCHAR; DW: DWORD): Word; stdcall;
IMPLEMENTATION
{$ R * .dfm}
Function WneetenumcachedPasswords (LP: LPSTR; W: Word; B: BYTE; PC: PCHAR; DW: DWORD): Word; External MPR Name 'WneetenumCachedPasswords'
Type
Pwinpassword = ^ twinpassword;
Twinpassword = Record
ENTRYSIZE: WORD;
Resources: Word;
Passwordsize: Word;
EntryIndex: Byte;
EntryType: byte;
Passwordc: char;
END;
VAR
WinPassword: Twinpassword;
Function AddPassword (WinPassword: PWINPASSWORD; DW: DWORD): LongBool; stdcall;
VAR
Password: String;
PC: array [0 .. $ ff] of char;
Begin
Inc.
Move (WinPassword.Passwordc, PC, WinPassword.ResourceSize);
PC [WinPassword.ResourceSize]: = # 0;
Chartooem (PC, PC);
Password: = STRPAS (PC);
Move (WinPassword.Passwordc, PC, WinPassword.Passwordsize WinPassword.Resources;
Move (PC [WinPassword.ResourceSize], PC, WinPassword.Passwordsize;
PC [WinPassword.passwordsize]: = # 0;
Chartooem (PC, PC);
Password: = Password ':' STRPAS (PC);
Form1.listbox.Items.add (password);
RESULT: = TRUE;
END;
Procedure TFORM1.Label1click (Sender: TOBJECT);
Begin
Shellexecute (getDesktopWindow, 'open', 'http://www.utilmind.com', nil, nil, 0);
END;
Procedure TFORM1.FORMSHOW (Sender: TOBJECT);
Beginif Wneetenumcachedpasswords (NIL, 0, $ FF, @addpassword, 0) <> 0 THEN
Begin
Application.MessageBox ('Can''t load passwords: user is not logon.', 'Error', MB_OK or MB_ICONWARNING);
Application.Terminate;
end
Else
If count = 0 THEN
Listbox.Items.add ('NO Passwords Found ...');
END;
End.