Jump to content

limelect

Members
  • Content Count

    924
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by limelect


  1. Just now, Jud said:

    I need one that verifies that the program is still running

    I do not know of a component to do that,

    If a program is still running that means what?

    showing? calculating? finished closed?


  2. 2 hours ago, Jud said:

    ProgressGuage, where I update it periodically to show that a loop is still executing

    @Uwe Raabe the above is what he needs

    no numbers. There are times when you do not know your process's time(size), so there are times like the above. it is active until you stop it.

    This program of mine does exactly his needs. turn until you stop

    https://limelect.com/downloads/youtube_downloader_shell/

    or

    https://limelect.com/downloads/kml-reader/


  3. TAdvCircularProgress does it . It turns until you stop it.

    There are quite a few like it that work until you stop them.


  4. @Uwe Raabe I know the problem but could not find a solution

    On the horizontal arrow, you need to move in SyncLink by character

    I tried 

        MyChar := Perform(EM_POSFROMCHAR, 0, 0);
        LinkChar:= LinkedMemo.Perform(EM_POSFROMCHAR, 0, 0);
       if LinkChar<>MyChar then
          LinkedMemo.Perform(EM_SCROLLCARET, 0, ?);

    but the char position is not correct one has to find the char position from the line?

    Any idea?

     

    Furthermore if one scrolls by char he does not scroll by line

     

    P.S. I computerize large companies but this little piece of software helps stay in shape of mind.


  5. will this help?

     

     
     
    function MouseHook (Code: integer; wParam: WPARAM; lParam: LPARAM): LRESULT; 
    stdcall;
    var
      ClientPt : TPoint;
    begin
      {------------------------}
      { Handle Mouse Movements }
      {------------------------}
      if (GlobData <> nil) and
         (Code = HC_ACTION) and
         ((wParam = WM_MOUSEMOVE) or (wParam = WM_NCMOUSEMOVE)) then
      begin
        with PMouseHookStruct(lParam)^ do
        begin
          {-----------------------------}
          { Send the screen coordinates }
          {-----------------------------}
          PostMessage(GlobData^.ActiveHandle, WM_APP+2, Pt.X, Pt.Y);
    
          {-----------------------------}
          { Send the window coordinates }
          {-----------------------------}
          ClientPt := Pt;
          ScreenToClient(hwnd, ClientPt);
          PostMessage(GlobData^.ActiveHandle, WM_APP+3, ClientPt.X, ClientPt.Y);
        end;
      end;
      {-----------------------------------------------}
      { Call the next hook in the chain }
      {-----------------------------------------------}
      Result := CallNextHookEx(0, Code, wParam, lParam);
    end;
    
    function InstallMouseHook (Wnd: HWND): Boolean; stdcall;
    begin
      Result := False;
      if (GlobData = nil) then Exit;
      if (GlobData^.THook = 0) then
      begin
        GlobData^.THook := SetWindowsHookEx(WH_MOUSE, @MouseHook, HInstance, 0);
        if GlobData^.THook = 0 then Exit;
      end;
      GlobData^.ActiveHandle := Wnd;
      Result := True;
    end;
    
    function UninstallMouseHook: Boolean; stdcall;
    begin
      Result := True;
      if (GlobData = nil) then Exit;
      if (GlobData^.THook <> 0) then
      begin
        if not UnhookWindowsHookEx(GlobData^.THook) then Exit;
        GlobData^.THook = 0;
      end;
      GlobData^.ActiveHandle := 0;
      Result := True;
    end;

     


  6. I use the scroll bars,Home,end,all arrows ,Page up and down ALL WORK ON MY LAST ZIP

    In All your software guys all keys did not work but mouse weel did.

    In my case all keys work except mouse weel.

    I tested all your versions.

    So may be you can take my solution and fix it for the mous weel?

     

    I guss windows version do give a problem but why my version work?


  7. I do not know what to say see moving horizontally

    Obviously, something is fishy

     

    unit Unit1;

    interface

    uses
      Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
      System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
      Vcl.StdCtrls;

    type
      TLinkMemo = class(TMemo)
      private
        FLinkedMemo: TLinkMemo;
        procedure SyncLink;
      protected
        procedure WndProc(var Message: TMessage); override;
      public
        property LinkedMemo: TLinkMemo read FLinkedMemo write FLinkedMemo;
      end;

      TMemo = class(TLinkMemo);

      TForm1 = class(TForm)
        Memo1: TMemo;
        Memo2: TMemo;
        procedure FormCreate(Sender: TObject);
      private
      public
      end;

    var
      Form1: TForm1;

    implementation

    {$R *.dfm}

    procedure TLinkMemo.WndProc(var Message: TMessage);
    begin
      inherited;
      if (LinkedMemo = nil)
        or not LinkedMemo.HandleAllocated
      then
        Exit;
      case Message.Msg of
        WM_HSCROLL, WM_VSCROLL, WM_KEYDOWN, WM_MOUSEFIRST..WM_MOUSELAST: SyncLink;
      end;
    end;

    procedure TLinkMemo.SyncLink;

      procedure UpdateScrollBar(BarFlag: Integer; Msg: Cardinal);
      var
        scrollInfo: TScrollInfo;
      begin
        scrollInfo.cbSize := SizeOf(scrollInfo);
        scrollInfo.fMask  := SIF_POS;
        if GetScrollInfo(Handle, BarFlag, scrollInfo) then
          LinkedMemo.Perform(Msg, MAKEWPARAM(SB_THUMBPOSITION, scrollInfo.nPos), 0);
      end;

    var
      savedLink: TLinkMemo;
    begin
      savedLink := LinkedMemo.LinkedMemo;
      try
        LinkedMemo.LinkedMemo := nil;
        UpdateScrollBar(SB_HORZ, WM_HSCROLL);
        UpdateScrollBar(SB_VERT, WM_VSCROLL);
      finally
        LinkedMemo.LinkedMemo := savedLink;
      end;
    end;

    procedure TForm1.FormCreate(Sender: TObject);
    begin
      Memo1.LinkedMemo := Memo2;
      Memo2.LinkedMemo := Memo1;
    end;
    
    end.

    image.thumb.png.fbe07191dd5f8cd640ffd173f315b0fc.png

     


  8. @Uwe Raabe

    In my case I tried to add

    procedure WndProc(var Message: TMessage);message WM_MOUSEWHEEL;

     

    procedure TLinkMemo.WndProc(var Message: TMessage);
    var
    i:Integer;

    begin
     inherited;
        if Message.Msg=WM_MOUSEWHEEL then begin
        begin
        disable2:=True;
       SyncLink(true,TWMMouseWheel(Message).Pos);

        end;
     //  i:=  TWMMouseWheel(Message).WheelDelta;
       end

    end;

     

    and disable carpos in SyncLink;

    if disable2 then

        saveLink.CaretPos := p<< came from mouse wheel
        else
        saveLink.CaretPos := CaretPos;

    calling

    SyncLink(true,TWMMouseWheel(Message).Pos);

     

    but I found out that SyncLink; came before the mouse wheel (because of CNCommand)

    I tried to detect if the mouse wheel inside SyncLink;

    but could not.


  9. Ok all keys work

    1. While using the page up or down there was a need to disable

       DoScroll . while using SyncLink do not use DoScroll

    2. I had to add    saveLink.Perform(EM_SETSEL, 0, myLine - linkLine);

      otherwise, the page up or down was not synchronized and text was not shown correctly

    I hope I did a good job while enjoying to play with it

     

    Who said he wants to move to AI. So let AI do this job

    P.S. Mouse weel dose not work on this program.

    If anyone wants to keep playing with this I finished

     

    MemoScrol.zip


  10. Ok guys this zip tested On all keys

    Home, end, arrow up down left and right, scroll up scroll down, and left and right

    ALL WORK But 

    Someone fix the Page up or down

    I mixed the 2 versions and now lastly needed to fix the above

    I think it would be nice if the cursor position were shown on both memos

    MemoScrol.zip

×