Jump to content

Ian Branch

  • Content Count

  • Joined

  • Last visited

  • Days Won


Ian Branch last won the day on August 8 2019

Ian Branch had the most liked content!

Community Reputation

48 Excellent

Technical Information

  • Delphi-Version
    Delphi 10.4 Sydney

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Ian Branch

    Transparent Activity Indicator??

    Hi aehimself, My experience over a new project/form/TMemo.
  2. Ian Branch

    Transparent Activity Indicator??

    Hi Team, D10.4.2. Is there any way to make the Win 10 Activity Indicator background transparent? It looks silly running in a grey box hiding everything behind it. Regards & TIA, Ian
  3. Ian Branch

    caFree & ,Free??

    Hi Team, FWIW, I have gotten rid of all the caFrees in my code. Sticking with the Try.....Finally xxxx.Free end construct. No more issues. Thank you all for your input/feedback. Ian
  4. Ian Branch

    Delete a Registry Key...

    Hmmmm. Looking into winapi.windows, there is no RegDeleteTree. :-(
  5. Ian Branch

    Delete a Registry Key...

    Hi Remy, Happy to try RegDeleteTree() but I can't get Delphi to recognise it. Obviously I need something in the Uses but I can't find what. I have Winapi.windows in the uses att. Ian.
  6. Ian Branch

    Delete a Registry Key...

    Ahh. Excellent! Thanks Uwe. Works fine now. Regards, Ian
  7. Ian Branch

    Delete a Registry Key...

    Hi Team, D10.4.2, 32 bit App. I am trying to implement this on a Win 10 PC. procedure TMainForm.Button1Click(Sender: TObject); var reg: TRegistry; begin // MessageBeep(MB_ICONINFORMATION); // reg := TRegistry.Create(KEY_WRITE); reg.RootKey := HKEY_CURRENT_USER; // if reg.DeleteKey('Software\MyKey') then showmessage('MyKey registry key deleted.') else begin showmessage('MyKey registry key was NOT deleted.'+#13#10+'Error message is - '+reg.LastErrorMsg); end; // reg.CloseKey(); // end; The key is most assuredly there. I get an access denied error. Maybe not surprising with Win 10 these day. I tried running the App with Admin privileges but same issue. Has anybody got a work around/solution for this please? Regards & TIA, Ian
  8. Ian Branch

    Can't load LivePreview270.bpl

    Ahhh. Thanks Vincent. I don't do FM either so No it is. Cheers. Ian
  9. Ian Branch

    Can't load LivePreview270.bpl

    Hi Team, D10.4.2. I have just removed all the apparent 'Indy' related files per the 'Indy 10 Installation Instructions', and installed the current Indy 10 from GitHub. That all went well. I may have deleted something that looked like an Indy file but either wasn't, or was but is needed by LivePreview. LivePreview.bpl is present in the indicated directory. When I go to start D10.4.2 now I get the attached error message. I click Yes so I can keep it in my mind. I have no idea what it is for. Can anybody make an educated guess as to what LivePreview might now be missing? All the files are either in my Recycle bin or in a .rar file, depending. Regards & TIA, Ian
  10. Ian Branch

    Using Events when creating a component??

    Remy, Thank you very much. I had sussed it out to a degree but your code is more refined than mine. Thank you for pointing out TIdCalculateSizeStream. All working as desired now. Regards & Tks again. Ian
  11. Ian Branch

    Using Events when creating a component??

    Hmmm. Given the following snippet.. Codesite.Send('IdMessage1.SaveToStream(TmpStream, False);'); IdMessage1.SaveToStream(TmpStream, False); Codesite.Send('IdSMTP1.Send(IdMessage1);'); IdSMTP1.Send(IdMessage1); I never see the second Codesite message, suggesting that it is falling over at the IdMessage1.SaveToStream.....
  12. Hi Team, D10.4.2, Parnassus Bookmarks v 1.6.2. I thought I was imagining things and now I think it is just a D10.4.2 thing. IIRC, in D10.4.1, Bookmarks would be saved between sessions, so, after closing a project and Delphi, reopening Delphi & the Project would find the bookmarks still present. This doesn't seem to be the case with D10.4.2. Is it just me? Is there a setting I have missed? Anybody else seeing this? I do have GExperts & cnPack installed as well. Regards & TIA, Ian
  13. Ian Branch

    Using Events when creating a component??

    Hi Team, Can someone offer some assistance/advice here? I still can't get the code to work.. procedure TForm1.btnSendClick(Sender: TObject); var Attachmentfile: TIdAttachmentFile; sSendReportTo, sSendReportCC: string; begin // IdSMTP1 := TIdSMTP.Create(nil); // try // IdSSLIOHandlerSocketOpenSSL1 := TIdSSLIOHandlerSocketOpenSSL.Create(IdSMTP1); IdMessage1 := TIdMessage.Create(IdSMTP1); // // IO HANDLER SETTINGS // with IdSSLIOHandlerSocketOpenSSL1 do begin MaxLineAction := maException; SSLOptions.Method := sslvTLSv1; SSLOptions.Mode := sslmUnassigned; SSLOptions.VerifyMode := []; SSLOptions.VerifyDepth := 0; SSLOptions.Mode := sslmClient; end; // // SETTING SMTP COMPONENT DATA // IdSMTP1.Host := 'smtp-server.somewhere.com'; IdSMTP1.Port := 587; IdSMTP1.Username := 'MyName@somewhere.com'; // please change to your gmail address // IdSMTP1.Password := 'Abc123456'; IdSMTP1.IOHandler := IdSSLIOHandlerSocketOpenSSL1; IdSMTP1.AuthType := satDefault; IdSMTP1.UseTLS := utUseExplicitTLS; // IdSMTP1.OnWork := IdSMTP1Work; IdSMTP1.OnWorkBegin := IdSMTP1WorkBegin; IdSMTP1.OnWorkEnd := IdSMTP1WorkEnd; // try IdSMTP1.Connect; except on E: Exception do begin MessageDlg('Connection to Mail Server unsuccessful! The following information was returned..: ' + E.Message, mtWarning, [mbOK], 0); Exit; end; end; // // SETTING email MESSAGE DATA // IdMessage1.Clear; // IdMessage1.Recipients.EMailAddresses := 'ToAddress@somewhere.com'; IdMessage1.CCList.EMailAddresses := 'CCAddress@somewhere.com'; // add Attachment to mail // Attachmentfile := TIdAttachmentFile.Create(IdMessage1.MessageParts, 'E:\IndySMTPEmailTest\ReadMe.txt'); // IdMessage1.From.Address := 'myname@somewhere.com'; IdMessage1.Subject := 'Test Email Subject'; IdMessage1.Body.Text := 'Test Email Body'; IdMessage1.Priority := mpHigh; // with TIdText.Create(IdMessage1.MessageParts, nil) do begin Body.Text := '<p style="color: #5e9ca0;">This is a test&nbsp;<strong>message</strong> for <span style="color: #ff0000;"><strong>emailing</strong></span>.</p><h1 style="color: #5e9ca0;">&nbsp;</h1>'; ContentType := 'text/html'; end; // IdMessage1.ContentType := 'multipart/mixed'; // try IdMessage1.SaveToStream(TmpStream, False); IdSMTP1.Send(IdMessage1); ShowMessage('Email sent'); IdSMTP1.Disconnect(); except on e: Exception do begin ShowMessage('Error message is - ' + e.Message); IdSMTP1.Disconnect(); end; end; // Attachmentfile.Free; // finally IdSMTP1.Free; end // end; procedure TForm1.IdSMTP1Work(ASender: TObject; AWorkMode: TWorkMode; AWorkCount: Int64); var nPer: Currency; begin // nPer := 0.0; // try nPer := (AWorkCount / ProgressBar1.Max) * 100; except end; // ProgressBar1.Position := AWorkCount; Label1.Caption := CurrToStrF(nPer, ffFixed, 0) + ' %'; Form1.Update; end; procedure TForm1.IdSMTP1WorkBegin(ASender: TObject; AWorkMode: TWorkMode; AWorkCountMax: Int64); var sStreamSize: string; iValue: Int64; begin Label1.Caption := '0 %'; ProgressBar1.Position := 0; iValue := TmpStream.Size; sStreamSize := iValue.ToString; ShowMessage('Stream Size = ' + sStreamSize); ProgressBar1.Max := TmpStream.Size; Form1.Update; end; procedure TForm1.IdSMTP1WorkEnd(ASender: TObject; AWorkMode: TWorkMode); begin ProgressBar1.Position := ProgressBar1.Max; Label1.Caption := '100 %'; Form1.Update; end; It seemingly errors out with "Error message is - Connection Closed Gracefully", there is no apparent 'progress indication and no email is sent. 😞 If I comment out the assignment of the Events and the "IdMessage1.SaveToStream(TmpStream, False);", the email is sent, which indicates the basics are fine. Help! Regards & TIA, Ian
  14. Ian Branch

    Automatic spacing of buttons on a panel??

    Hi haentschman Thank you. Does the job admirably. Took me a little to figure out how to drive it but I got there. Tks again, Ian
  15. Hi Team, I have 4 buttons evenly spaced across a panel on a form. The form width can be manually expanded at run time. I can set the left and right buttons (1 & 4) using the Anchors. How can I adjust the position of the two middle buttons (2 & 3) programmatically to remain equally spaced between button 1 & 4 if/when the form is expanded? Regards & TIA, Ian