Solved

unmask asterix

Posted on 2004-10-24
1,538 Views
Last Modified: 2011-04-14
Hi, ok, this is what I need, I need some code, so when I hover ur mouse over any asterix text box on 'any' program or form, it will display the password eaither within the same box or in another box in ur program.

I've lost my password behide some asterix, I need to unmask the asterix to display the password.

does anyone know the code 2 do this?

500points if u do it,  another 500points if u do it within 2days.

this is very important, very urgent probly so urgent its crazy, and stupid at the same time.. lol

so it any of u can make this happen u can have 1k points.

Sal.
0
Question by:SaLz
    23 Comments
     
    LVL 11

    Expert Comment

    by:calinutz
    Did you try to get your password with some password recovery software? What exact password do you need? From what software exactly? Is it from your messenger? Your XP User password ? Which one? What OS do you have?
    You should be more specific
    0
     
    LVL 14

    Assisted Solution

    by:DragonSlayer
    also, what OS are you using? If it's <Win2K, check out http://www.undu.com/Articles/990618d.html
    Otherwise, you will need to inject your process into the target process before you can call WM_GETTEXT and retrieve the right information.
    0
     
    LVL 2

    Author Comment

    by:SaLz
    2 be honest its been over a yr since I formatted and since then, I've forgot my adsl password :S and I don't really want 2 use someone else program 2 retreave this information, I know its silly, I should trust these exe, lol, but its something u probly understand, why I want 2 make my own program 2 do this.

    I will check out that link.

    wile I'm checking that link, I would need some solid code.

    sal.
    0
     
    LVL 2

    Author Comment

    by:SaLz
    its winxp, and that link code doesn't work :S
    0
     
    LVL 2

    Author Comment

    by:SaLz
    500 after the jobs done, 500 now, 500points after. 1000 in total, u got any useful info for the question kretz?
    0
     
    LVL 27

    Assisted Solution

    by:kretzschmar
    0
     
    LVL 14

    Assisted Solution

    by:DragonSlayer
    Like I said, if you are using XP, then you will need to use injection to inject into the target process, and then you can proceed on with the method described in the UNDU link.

    More info on DLL injecting http://help.madshi.net/DllInjecting.htm or http://help.madshi.net/madCodeHook.htm
    0
     
    LVL 2

    Author Comment

    by:SaLz
    been there kretz, lol, damn I aint a noob 2 google, I wouldn't be coming 2 a delphi exchange if I was goin 2 use someone else program, I came here 2 find info on how 2 get that stuff in delphi, and give points for there efforts.

    the only person here whos showed some skill was DragonSlayer, lol. am after code, not an exe.

    u on level Genius for delphi kretz and u used a search engine to send me a link that I said I didn't want 2 use, and u come and change the title of the page, bloody admins, u know what they say about admins right..
    0
     
    LVL 14

    Assisted Solution

    by:DragonSlayer
    Here's a more long-winded version of some explanation on code-injecting, with some passing remarks about WM_GETTEXT http://www.codeguru.com/Cpp/W-P/system/processesmodules/article.php/c5767/

    However, it is in plain C++, and again, using madshi's libraries simplify things a lot.

    BTW, meikl is a much respected expert here, and well, if you don't like google links, perhaps you should just mention it, without rude shouts of "Bloody admins" ;-)

    Cheers,
    DragonSlayer.

    PS: Just found out that the WM_GETTEXT method would most likely not work on the next-gen Windows, using Avalon as the presentation subsytem: http://msdn.microsoft.com/longhorn/default.aspx?pull=/library/en-us/dnavalon/html/avalon07072004.asp
    0
     
    LVL 27

    Expert Comment

    by:kretzschmar
    >u on level Genius for delphi kretz and u used a search engine to send me a link
    there was no need to use a serchengine, i know this link for years

    usual i don't provide any code which is able to spy any password

    meikl ;-)
    0
     
    LVL 2

    Author Comment

    by:SaLz
    the bloody admins was for changing the title of the page, lol admins all they do is edit lol, was a joke ffs, doh! being sark about admins, we all know what admins are like lol
    0
     
    LVL 2

    Author Comment

    by:SaLz
    ok, if ur not going 2 talk about spy, lets do something else that u can do, lol

    u go 2 www.google.com page and see if u can get some code to display in the program some text from that search box on that page :D could u do that?

    so if u type something in the search box, see if u can retreive that text from that box and display it in ur program, if is possible?

    Sal.
    0
     
    LVL 2

    Author Comment

    by:SaLz
    boo this is so anoyin, that site u gived me the, kretz, it don't work, bloody hell, how am I gonna get my password now lol, this questions almost dead.
    0
     
    LVL 2

    Author Comment

    by:SaLz
    do u know how I can export my internet connection dialup thingy, that should make a little file that has my password in and all the settings
    0
     
    LVL 27

    Assisted Solution

    by:kretzschmar
    phew, usual dragonslayer gave you all, i have no additional info

    for standardcontrols you can use wm_gettext to retrieve the text within the control (control-handle is needed)

    in case of the xp password, the input is internal the output are just these chars,
    so wm_gettext won't work there

    about the link i gave, this solution resets the admin-password to a new value.
    after logging in as admin you can reset the userpasswords to a new value,
    it does not retrieve any passwords. btw the link is working for me

    >do u know how I can export my internet connection dialup thingy
    well don't know this, interent communication is not my favourite

    meikl ;-)
    0
     
    LVL 7

    Assisted Solution

    by:DavidBirch2dotCom
    0
     
    LVL 11

    Assisted Solution

    by:calinutz
    If your problem is really "your" forgotten password... isn't your internet provider (ISP) able to change your ADSL password at your request? Do you really need to hack it? Is it really yours? Or do you just want to build a spying application?
    ;)
    0
     
    LVL 11

    Assisted Solution

    by:calinutz
    // This does only work for win98 and all you have to do is place a panel on a form and drag the panel over the editbox that contains asterix and drop it there. A message will show up telling you what is under the mask.

    unit Unit1;

    interface

    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, ExtCtrls;

    type
      TForm1 = class(TForm)
        Panel1: TPanel;
        procedure Panel1MouseUp(Sender: TObject; Button: TMouseButton;
          Shift: TShiftState; X, Y: Integer);
        procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton;
          Shift: TShiftState; X, Y: Integer);
      private
        { Private declarations }
      public
        { Public declarations }
      end;

    var
      Form1: TForm1;
    PrevCursor:TCursor;
    implementation

    {$R *.dfm}

    procedure TForm1.Panel1MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    var sz:Array[0..255] of char;
    begin
      FillChar(sz, SizeOf(sz), 0);
      SendMessage(WindowFromPoint( Panel1.ClientToScreen( Point(X, Y) )),
          WM_GETTEXT, SizeOf(sz), LongInt(@sz[0]));
      Screen.Cursor:=PrevCursor;
      ShowMessage(StrPas(sz))
    end;


    procedure TForm1.Panel1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    begin
      PrevCursor:=Screen.Cursor;
      Screen.Cursor:=crDrag;
    end;

    end.




    /// and here is your form just in case:

    object Form1: TForm1
      Left = 192
      Top = 107
      Width = 239
      Height = 78
      Caption = 'Form1'
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      OldCreateOrder = False
      PixelsPerInch = 96
      TextHeight = 13
      object Panel1: TPanel
        Left = 0
        Top = 0
        Width = 231
        Height = 51
        Align = alClient
        Caption = ''
        TabOrder = 0
        OnMouseDown = Panel1MouseDown
        OnMouseUp = Panel1MouseUp
      end
    end







    0
     
    LVL 17

    Assisted Solution

    by:mokule

    You can use WinDowse from Greatis Software
    0
     
    LVL 26

    Accepted Solution

    by:
    Sal,

    Here is some actual code that can do what you are after <g>

    I don't take any credit for the code, as it comes from a C++ example on the Code Project site. Link to the project is:

    http://www.codeproject.com/dll/pwdspy.asp

    I do take credit for converting it over to delphi though. It is a little dummied down to  make it easier for pasting here, but it does provide the hooking dll and an example project (click and hold the mouse down on the form, then move the mouse over the window that has the password edit) that uses the hooking dll.

    I am providing the library (dll) code first (its all self contained), then the sample project code. Compile the dll, then create a new project and replace the form unit code with what is supplied below.

    If you have any problems just "yell"

    Russell


    ---

    library PwdHook;

    uses
      Windows,
      Messages,
      SysUtils,
      Classes;

    {$R *.RES}

    const
      IPCSharedMMF:     PChar       =  '{34F673E0-878F-11D5-B98A-00B0D07B8C7C}';
      IPCMutex:         PChar       =  '{34F673E1-878F-11D5-B98A-00B0D07B8C7C}';

    type
      TIPC              =  class(TObject)
      private
         // Private declarations
         FFileMap:      THandle;
         FMutex:        THandle;
      protected
         // Protected declarations
      public
         // Public declarations
         constructor    Create;
         destructor     Destroy; override;
             function       CreateIPCMMF: Boolean;
             function       OpenIPCMMF: Boolean;
         procedure      CloseIPCMMF;
             function       IsOpen: Boolean;
         function       ReadIPCMMF(lpBuffer: Pointer; var Size: DWORD): Boolean;
         function       WriteIPCMMF(lpBuffer: Pointer; Size: DWORD): Boolean;
         function       Lock: Boolean;
         procedure      Unlock;
      end;

    function TIPC.CreateIPCMMF: Boolean;
    begin

      // Check file mapping
      if (FFileMap = 0) then
      begin
         // Create an in-memory 4KB memory mapped file to share data
         FFileMap:=CreateFileMapping(THandle($FFFFFFFF), nil, PAGE_READWRITE, 0, 4096, IPCSharedMMF);
         // Set result
         result:=(FFileMap <> 0);
      end
      else
         // Already created
         result:=False;

    end;

    function TIPC.OpenIPCMMF: Boolean;
    begin

      // Check file mapping
      if (FFileMap <> 0) then
         // Already open
         result:=True
      else
      begin
         // Open file mapping
         FFileMap:=OpenFileMapping(FILE_MAP_READ or FILE_MAP_WRITE, False, IPCSharedMMF);
         // Set result
         result:=(FFileMap <> 0);
      end;

    end;

    procedure TIPC.CloseIPCMMF;
    begin

      // Check file mapping
      if (FFileMap <> 0) then
      begin
         try
            // Close handle
                      CloseHandle(FFileMap);
         finally
            // Set handle to zero
            FFileMap:=0;
         end;
      end;

    end;

    function TIPC.ReadIPCMMF(lpBuffer: Pointer; var Size: DWORD): Boolean;
    var  lpBaseMMF:     Pointer;
         dwSizeofInBuf: DWORD;
    begin

      // Check handle
      if(FFileMap = 0) then
         // Not open
         result:=False
      else
      begin
         // Map view
                lpBaseMMF:=MapViewOfFile(FFileMap, FILE_MAP_READ or FILE_MAP_WRITE, 0, 0, 0);
         // Pointer check
         if Assigned(lpBaseMMF) then
         begin
            // Save off size
                   dwSizeofInBuf:=Size;
            // Get stored size
                   CopyMemory(@Size, lpBaseMMF, SizeOf(DWORD));
            // Check size to read
                   if (dwSizeofInBuf <> 0) then
            begin
               // Check size to stored size
                         if (Size > dwSizeofInBuf) then
                  // Size to read is smaller than stored size
                               result:=False
                         else
               begin
                  // Read stored data
                               CopyMemory(lpBuffer, Pointer(PChar(lpBaseMMF)+SizeOf(DWORD)), Size);
                  result:=True;
               end
                   end
            else
               // Read zero bytes
               result:=False;
            // Unmap view
                   UnmapViewOfFile(lpBaseMMF);
         end
         else
            // Failed to map view
            result:=False;
      end;

    end;

    function TIPC.WriteIPCMMF(lpBuffer: Pointer; Size: DWORD): Boolean;
    var  lpBaseMMF:     Pointer;
    begin

      // Check handle
      if(FFileMap = 0) then
         // Not open
         result:=False
      else
      begin
         // Map view
                lpBaseMMF:=MapViewOfFile(FFileMap, FILE_MAP_READ or FILE_MAP_WRITE, 0, 0, 0);
         // Pointer check
         if Assigned(lpBaseMMF) then
         begin
            // Store size
                   CopyMemory(lpBaseMMF, @Size, SizeOf(DWORD));
            // Write buffer
                   CopyMemory(Pointer(PChar(lpBaseMMF)+SizeOf(DWORD)), lpBuffer, Size);
            // Unmap view
                   UnmapViewOfFile(lpBaseMMF);
            result:=True;
         end
         else
            // Failed to map
            result:=False;
      end;

    end;

    function TIPC.Lock: Boolean;
    begin

      // First get the handle to the mutex
      FMutex:=CreateMutex(nil, False, IPCMutex);

      // Check handle
      if (FMutex <> 0) then
         // Aquire
         result:=(WaitForSingleObject(FMutex, INFINITE) = WAIT_OBJECT_0)
      else
         // Failed to create mutex
         result:=False;

    end;

    procedure TIPC.Unlock;
    begin

      // Check handle
      if (FMutex <> 0) then
      begin
         // Resource protection
         try
            // Release mutex
            ReleaseMutex(FMutex);
            // Close handle
            CloseHandle(FMutex);
         finally
            // Zero out handle
            FMutex:=0;
         end;
      end;

    end;

    function TIPC.IsOpen: Boolean;
    begin

      // Determine if open
      result:=(FFileMap <> 0);

    end;

    constructor TIPC.Create;
    begin

      // Perform inherited
      inherited Create;

      // Set defaults
      FFileMap:=0;
      FMutex:=0;

    end;

    destructor TIPC.Destroy;
    begin

      // Resource protection
      try
         // Close
         CloseIPCMMF;
         // Unlock
         Unlock;
      finally
         // Perform inherited
         inherited Destroy;
      end;

    end;

    // Global variables
    var
      g_hHook:          HHOOK       =  0;    // Handle to the hook
      g_dwThreadId:     DWORD       =  0;         // Hooked thread
      g_objIPC:         TIPC        =  nil;  // Shared resources used to transfer data
      g_wmScanPassword: UINT        =  0;    // Custom window message

    // Library constants
    const
      IPCCustomMsg:     PChar       = '{34F673E2-878F-11D5-B98A-00B0D07B8C7C}';

    procedure ExtractPassword(hWindow: HWND; hPwdSpy: HWND);
    var  cdsData:       COPYDATASTRUCT;
         lpBuffer:      Array [0..1023] of Char;
    begin

      // This function is called from the HOOKED process only
      if IsWindow(hWindow) and IsWindow(hPwdSpy) then
      begin
         // Clear the buffer
         ZeroMemory(@lpBuffer, SizeOf(lpBuffer));
         // Send WM_GETTEXT to window containing password
         SendMessage(hWindow, WM_GETTEXT, SizeOf(lpBuffer), Integer(@lpBuffer));
                // Use a WM_COPYDATA message to send the password back to the calling password spy
                cdsData.dwData:=hWindow;
                cdsData.cbData:=Succ(StrLen(@lpBuffer));
                cdsData.lpData:=@lpBuffer;
         // Send back to password spy
                SendMessage(hPwdSpy, WM_COPYDATA, hWindow, Integer(@cdsData));
      end;

    end;

    function GetMsgProc(nCode: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; export;
    var  dwData:        DWORD;
         dwSize:        DWORD;
         hWindow:       HWND;
         hPwdSpy:       HWND;
         lpMsg:         PMsg;
    begin

      // Check hook handle
      if (g_hHook = 0) then
      begin
         // Read the data from the shared resources
         dwData:=0;
         dwSize:=SizeOf(DWORD);
         g_objIPC.Lock;
         try
            g_objIPC.OpenIPCMMF;
            g_objIPC.ReadIPCMMF(@dwData, dwSize);
         finally
            g_objIPC.Unlock;
         end;
         g_hHook:=dwData;
      end;

      // Ignore the message if the nCode is less than zero
      if (nCode >= 0) then
      begin
         // Get the message
         lpMsg:=PMsg(lParam);
         // Is the message our custom registered message?
         if (lpMsg^.message = g_wmScanPassword) then
         begin
            hWindow:=lpMsg^.wParam;
            hPwdSpy:=lpMsg^.lParam;
            ExtractPassword(hWindow, hPwdSpy);
         end;
      end;

          // Always call the next hook in the chain
          result:=CallNextHookEx(g_hHook, nCode, wParam, lParam);

    end;

    function RemoveHook: BOOL; stdcall; export;
    begin

      // Check hook handle
      if (g_hHook <> 0) then
      begin
         // Resource protection
         try
            result:=UnhookWindowsHookEx(g_hHook);
         finally
            // Clear the hook handle and thread id
                      g_hHook:=0;
                      g_dwThreadId:=0;
         end;
      end
      else
         // Not hooked
         result:=False;

    end;

    function InstallHook(dwThreadId: DWORD): BOOL; stdcall; export;
    var  dwData:        DWORD;
    begin

      // Check thread id
      if (dwThreadId = 0) then
         // Failure
         result:=False
      else
      begin
         // Are we already hooked on that thread?
                if (g_dwThreadId = dwThreadId) then
            // Success
            result:=True
         else
         begin
                   // If we're hooked on a different thread, unhook first
                   if (g_dwThreadId <> dwThreadId) and (g_hHook <> 0) then RemoveHook;
                   // Save the threadId
            g_dwThreadId:=dwThreadId;
                      // Lock the shared resources
                      g_objIPC.Lock;
            try
                         g_objIPC.CreateIPCMMF;
                         g_hHook:=SetWindowsHookEx(WH_GETMESSAGE, GetMsgProc, hInstance, g_dwThreadId);
                         if (g_hHook <> 0) then
               begin
                  // Into the shared resource, store the handle to the hook.
                               dwData:=g_hHook;
                               g_objIPC.WriteIPCMMF(@dwData, SizeOf(DWORD));
                               // Force a benign message to the thread's queue
                               // so that the hook function gets called.
                               PostThreadMessage(dwThreadId, WM_NULL, 0, 0);
                  // Success
                  result:=True;
               end
               else
                  // Failed to set hook
                  result:=False;
            finally
                   // Ensure that we unlock the shared resources
                   g_objIPC.Unlock();
            end;
         end;
      end;

    end;

    function ScanPassword(hWindow: HWND; hPwdSpy: HWND): BOOL; stdcall; export;
    begin

      // Check thread id and window handles
      if (g_dwThreadId <> 0) and IsWindow(hWindow) and IsWindow(hPwdSpy) then
      begin
         // Post thread message
         PostThreadMessage(g_dwThreadId, g_wmScanPassword, hWindow, hPwdSpy);
         // Success
         result:=True;
      end
      else
         // Failure
         result:=False;

    end;

    procedure DllMain(Reason: Integer);
    begin

      // Handle pvkiw initialization
      case Reason of
         // Finalization
         DLL_PROCESS_DETACH   :
         begin
            // Free the IPC message
            FreeAndNil(g_objIPC);
         end;
         // Initialization
         DLL_PROCESS_ATTACH   :
         begin
            // Disable thread calls
            DisableThreadLibraryCalls(hInstance);
            // Register windows message
            g_wmScanPassword:=RegisterWindowMessage(IPCCustomMsg);
            // Create IPC object
            g_objIPC:=TIPC.Create;
         end;
      end;

    end;

    // Exports
    exports
      InstallHook,
      RemoveHook,
      ScanPassword;

    // Library initialization (called on process attach)
    begin

      // Insert library handler and call with attach
      DLLProc:=@DLLMain;

      // Notify the handler of the attach
      DLLMain(DLL_PROCESS_ATTACH);

    end.

    ------------------------------------------------------

    Form unit code:

    ------------------------------------------------------


    uses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

    type
      TOsType           =  (osWin95, osWin98, osWinME, osWinNT, osWin2K, osWinXP, osWin2003);

    type
      TForm1        =  class(TForm)
         procedure      FormCreate(Sender: TObject);
         procedure      FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
         procedure      FormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
         procedure      FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
      private
         // Private declarations
         FOS:           TOsType;
         FIsTracking:   Boolean;
         FTracking:     HWND;
      protected
         // Protected declarations
         procedure      WMCopyData(var Message: TWMCopyData); message WM_COPYDATA;
      public
         // Public declarations

      end;

    // Imported functions
    function   RemoveHook: BOOL; stdcall; external 'pwdhook.dll';
    function   InstallHook(dwThreadId: DWORD): BOOL; stdcall; external 'pwdhook.dll';
    function   ScanPassword(hWindow: HWND; hPwdSpy: HWND): BOOL; stdcall; external 'pwdhook.dll';

    // Utility function
    function GetOSType: TOsType;

    // Global variables
    var
      Form1:        TForm1;

    implementation
    {$R *.DFM}

    function GetOSType: TOsType;
    var  osviType:      OSVERSIONINFO;
         Major:         DWORD;
         Minor:         DWORD;
         Platform:      DWORD;
    begin

      // Set buffer size
      osviType.dwOSVersionInfoSize:=SizeOf(OSVERSIONINFO);

      // Get version info
      if GetVersionEx(osviType) then
      begin
         // Get variables
         Major:=osviType.dwMajorVersion;
         Minor:=osviType.dwMinorVersion;
         Platform:=osviType.dwPlatformId;
         // Win 95 check
         if (Major = 4) and (Minor = 0) and (Platform <> VER_PLATFORM_WIN32_NT) then
            result:=osWin95
         // Win ME check
         else if (Major = 4) and (Minor = 90) and (Platform <> VER_PLATFORM_WIN32_NT) then
            result:=osWinME
         // Win 98 check
         else if (Major >= 4) and (Minor > 0) and (Platform <> VER_PLATFORM_WIN32_NT) then
            result:=osWin98
         // Win NT check
         else if (Major = 4) and (Minor = 0) and (Platform = VER_PLATFORM_WIN32_NT) then
            result:=osWinNT
         // Win 2000 check
         else if (Major = 5) and (Minor = 0) and (Platform = VER_PLATFORM_WIN32_NT) then
            result:=osWin2K
         // Win xp check
         else if (Major = 5) and (Minor = 1) and (Platform = VER_PLATFORM_WIN32_NT) then
            result:=osWinXP
         // Win 2003 check
         else if (Major = 5) and (Minor = 2) and (Platform = VER_PLATFORM_WIN32_NT) then
            result:=osWin2003
         // Have no idea
         else
            result:=osWin95;

      end
      else
         result:=osWin95;

    end;

    procedure TForm1.WMCopyData(var Message: TWMCopyData);
    begin

      // Set the caption
      Caption:=Format('HWND %d: %s', [Message.From, PChar(Message.CopyDataStruct^.lpData)]);

    end;

    procedure TForm1.FormCreate(Sender: TObject);
    begin

      // Working defaults
      FIsTracking:=False;
      FTracking:=0;
      FOS:=GetOSType;

    end;

    procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    begin

      // Resource protection
      try
         // Set capture
         SetCapture(Handle);
         // Clear tracking handle
         FTracking:=0;
      finally
         // Tracking
         FIsTracking:=True;
      end;

    end;

    procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    begin

      // Resource protection
      try
         // Release the capture
         ReleaseCapture;
         // Remove any installed hook
         RemoveHook;
      finally
         // Stop tracking
         FIsTracking:=False;
      end;

    end;

    procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
    var  hwndMouse:     HWND;
         dwStyle:       DWORD;
         ptScreen:      TPoint;
         lpBuffer:      Array [0..1023] of Char;
    begin

      // Check tracking
      if FIsTracking then
      begin
         // Convert point to screen coord
         ptScreen:=ClientToScreen(Point(X, Y));
         // Get the window from point
         hwndMouse:=WindowFromPoint(ptScreen);
         // Check handle
         if (hwndMouse <> 0) and (hwndMouse <> FTracking) then
         begin
            // Update tracking window handle
            FTracking:=hwndMouse;
            // Check the window style
            dwStyle:=GetWindowLong(FTracking, GWL_STYLE);
            // Check for password style
            if ((dwStyle and ES_PASSWORD) = ES_PASSWORD) then
            begin
               // Check window versions
               if (FOS in [osWin95, osWin98, osWinME, osWinNT]) then
               begin
                  // We can just use the WM_GETTEXT
                  ZeroMemory(@lpBuffer, SizeOf(lpBuffer));
                  SendMessage(FTracking, WM_GETTEXT, SizeOf(lpBuffer), Integer(@lpBuffer));
                  // Set caption
                  Caption:=Format('HWND %d: %s', [FTracking, lpBuffer]);
               end
               else
               begin
                  // Need to hook the window's thread
                  if InstallHook(GetWindowThreadProcessId(FTracking, nil)) then
                  begin
                     // Attempt to scan for the password (we will get a WM_COPYDATA message back)
                     ScanPassword(FTracking, Handle);
                  end;
               end;
            end;
         end;
      end;

    end;








    0
     
    LVL 7

    Expert Comment

    by:DavidBirch2dotCom
    thanks for the points
    0
     
    LVL 2

    Author Comment

    by:SaLz
    np, the points where split to how much users put towards the question, so if someone looks here and has the same problem they will look down at what really matters in the event of losing ur password, which could be the worst thing u could think about at the time lol

    its just like a bag of sweets on a table, the password are the sweets, u can't reach them, u could ask someone 2 pick up the sweets and hand them 2 u, i.e. contacting ur isp, but it does take time for them 2 listen and 2 pick them up and send them u, i.e. they will post u a new password in time, or u could ask the ee members to give u the materials to make a stick and I would make the stick out of the materials, so I could reach for them sweets/password my self, sooner than later :D

    its crazy, last month I didn't need the password, this month I needed it and when I found out I didn't have it, I was backin up ready for formatting at the time, then it hit me like a ton of bricks, whats my password for my isp, I can't format with out the pw, lol, I can laugh about it now, but at the time I was in that "worry zone" lol

    I thank u all for helping me :D feels like a big weight has been lifted off me, I would of had 2 wait weeks for them 2 send me the password by post.


    rllibby, u did good, u given me solid code, that works on winxp, and probly all winos lol, thxu, my word is my honor, cos this question was more than urgent, they should have a very urgent radio box for a 1000pts lol

    I've done another question for u rllibby, u did it in less than 1day, which classifies for the extra points :D
    http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_21183443.html

    Thanks,
    Sal.
    0
     
    LVL 26

    Expert Comment

    by:Russell Libby
    Glad to have helped ;-)

    And thank you,
    Russell
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Suggested Solutions

    This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
    Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    933 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now