Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


aehimself last won the day on April 6

aehimself had the most liked content!

Community Reputation

47 Excellent

Technical Information

  • Delphi-Version
    Delphi 10.3 Rio

Recent Profile Visitors

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

  1. Now this applies only to Windows as I'm not working with Linux machines, but the Windows Computer Browser service is basically collecting a bunch of broadcasted information and then others connect to it via TCP (source). If the activity-based startup is locked to an IP it will not be triggered by broadcast messages; the rest of the communication will be between other PCs and the current directory master. Alas, this only applies for standard services. My program attempting to ping this IP to see if it's alive or not will trigger the power on for sure.
  2. If File Explorer is the standard Windows file management application which pops up when you click on My Computer / This PC; and you just type ftp://host_or_ip_of_device it's hardwired in the shell for sure. I am also certain that Microsoft did not maintain this Client as they saw the future in WebDav; not FTP; but to be honest it's irrelevant in your case. You said your only issue is that your device is inserting a null character at the end of each file upon listing, which you save to a file. I'm not sure if Delphi is handling #0 characters in strings since Unicode; but you can try: Var sl: TStringList; a: Integer; Begin sl := TStringList.Create; Try sl.Delimiter := #0; sl.LoadFromFile('MyList.lst'); For a := 0 To sl.Count - 1 Do // Do something with the file at sl[a] Finally sl.Free; End; End; Or... Uses System.IOUtils; Var sa: TArray<String>; fname: String; Begin sa := TFile.ReadAllText('MyList.lst').Split([#0]); For fname In sa Do // Do something with the file in fname End; and then using any FTP client component you issue a download request. Edit: It does. Var sa: TArray<String>; fname: String; Begin sa := String('Hello' + #0 + 'World' + #0 + 'Zero char' + #0 + 'separation').Split([#0]); For fname In sa Do ShowMessage(fname); End; works, popping up one segment at a time; so it should do the trick.
  3. aehimself

    3 explorer running

    By the definition from MSDN (https://docs.microsoft.com/en-us/windows/win32/api/exdisp/nn-exdisp-ishellwindows) "IShellWindows interface Provides access to the collection of open Shell windows." [...] "A Shell window is a window that has been registered by calling IShellWindows::Register or IShellWindows::RegisterPending." Which means that if I want to, I can register any application as a shell window and you will see it in your collection. Maybe this is what you mean "hidden" as it is an instance of a shell window, which is NOT an Explorer process...? Edit: I suppose you already read this: "If the type is VT_UI4, the value of index is interpreted as a member of ShellWindowTypeConstants" ...which leads you here: "SWC_EXPLORER An Windows Explorer (Explorer.exe) window. SWC_BROWSER An Internet Explorer (Iexplore.exe) browser window. SWC_3RDPARTY A non-Microsoft browser window. SWC_CALLBACK A creation callback window. SWC_DESKTOP Windows Vista and later. The Windows desktop." So I suppose you are handling these cases in your code...?
  4. What periodic activity you mean? In normal circumstances a regular server (DHCP, DNS, File server) is not looking for offline clients. Regular protocols are not even looking for Clients at all as most of the actions are initiated by the Client.
  5. To be honest I never heard of this until now, but I'm sure our PCs do not support this (or - it's not enabled). I'll do my research on it; it would be an easier solutionfor sure.
  6. aehimself

    Drone control from mobile

    Sending commands only. I don't have any specific projects in mind; I just see the opportunities of a connection between a Delphi app and an Arduino. For the time being I'd just be interested in a hello-world type setup. Make an Arduino light an LED when you check a checbox on a Delphi form. I'll make my way from there, when I have anything specific in mind ๐Ÿ™‚
  7. aehimself

    Drone control from mobile

    Nice! I also played around with Arduino boards (this is how I fixed my smoking Christmas tree lights on Christmas eve) and I love them a lot. I even minified a project to a single ATMega chip for extra efficiency. But there was one thing I was always wondered but never took the time to dig myself into... can I talk to this board with Delphi...? I don't want you to share mission critical parts, but can you give some hints on how you did it? Are you using standard Serial to USB and text commands? Or a custom interface?
  8. While we were working from home the office building decided that it's a good time to test the electric breakers. This resulted someone having to travel on-site and turning all PCs on one-by-one on the whole floor. I started to experiment; my plan is to write a simple service application which is discovering PCs in a pre-defined range and provides a web interface where you can log on with your domain credentials and choose which PC you would like to wake up with WOL. If I get the green light from management I think this is going to be our solution. I'll have to test though, if a WOL broadcast packet actually works out-of-subnet or not; or what configuration is required on the network devices as I have no personal experience with this.
  9. aehimself

    Minifing HTML

    Thank god we use XMLs in this case ๐Ÿ™‚
  10. aehimself

    3 explorer running

    And that is an issue, if you ask me. To be honest I lost track a long time ago, but for a while the Windows Taskbar and the Desktop was hosted by an instance of the same explorer.exe process what you launched when you clicked on "My computer"; maybe Windows is using it for even more undocumented things (like specific background processes; which would answer why they just come and go). If your application requires to interact with an Explorer window, you should let your users to choose which one. But then again - this is how I think. Wrong. A process has multiple granted properties; like an executable NAME and a PID for example. All processes have that, having visible windows or not, being service applications or not, being launched under a svchost process or not. Depending on how you enumerate those, you get different properties available. I personally never used ShellWindows as I always went for EnumWindows or FindWindow what @Fr0sT.Brutal advised to you already. It's a bit more low level, but opens up tons of opportunities. And this part; I must totally have to agree with @David Heffernan. If someone anonymous on the Internet would tell you "Download my app, it's useful, you always can delete"... would you trust him/her? At this point noone really understands why you are doing what you are doing so they are unable to give you alternatives. Without an understandable code snipplet (e.g. I have no damn clue what "Do not forget Dispatch := ShellWindows.Item(i); is nil" means and I think I'm not alone) or a clear goal set... it just sounds like an other million dollar idea what SW developers are usually getting.
  11. aehimself

    Minifing HTML

    I quickly realized. It threw a nullpointer exception anyway because of embedded JavaScript. And XML does not have that ๐Ÿ™‚ Our overgrown legacy system is talking to an other, overgrown legacy system through a custom protocol, transporting the XMLs in a beautified form. Now the issue is, that sometimes these two systems start to get misaligned because either of a 3rd overgrown legacy system, a bug in their software or a bug in ours. So after fixing a bug these information packets should be re-processed or re-sent. And as the protocol was designed you always need a reference to an earlier packet as well... quite complicated, resulting us having to save all communication between our software instances and their system. Originally, someone decided to keep the XMLs in a BLOB field in a table. Unfortunately the code is so big and disorganized (20+ years old) that changing the saving scheme would need a re-writing half our application plus the web interface. We know it should be done but we also know that it never will be done as the clients do not pay for refactoring. The good thing in legacy systems are the gems what you can find. My favorite goes like this: Function GetUserID: Integer; Begin Case MenuID Of 0: Result := -1; 1: Result := -1; 2: Result := -1; [...] 100: Result := -1; Else Result := -1; End; End; ... and oooooh, those sweet comments ๐Ÿ™‚ Too bad that most of them are in Hungarian, otherwise I'd have posted them on DevHumor.
  12. aehimself

    Minifing HTML

    I know, just wanted bring a really negative example. Most of the CMS WYSIWYG editors are no exception though and since they love to use shared libraries I suppose webmail interfaces are guilty as well. As I mentioned I mainly work with XML, which is similar (but not the same) as HTML; and in XML the results are surprising already. Iโ€™ll go ahead and call minifying a compression method (a fairly inefficient one, though) from now on. As with most compressions the output heavily depends on the input; but usually the larger the input, the better the ratio becomes. The purpose of a compression is not to make it readable, and if it causes errors itโ€™s a bug in the code. All Iโ€™m saying is whether if itโ€™s efficient or not - minifying is still viable as this is the only way the output is still accepted by the target software. Just out of curiosity Iโ€™ll run my XML minifyer on a HTML page and will post the results.
  13. aehimself

    Minifing HTML

    Oh, you would be surprised. The last WYSIWYG program that wrote clean HTML code was Front Page Express around 2000. My favorite was creating a simple page, saving it in Word 2003 as HTML and then manually trimming the waste out. I usually could save aywhere between 5 or 20 kilobytes, keeping the original design. Now imagine trimming the "useless" characters too, used only to make the code readable. We deal with XMLs mostly at work. As an example, a beautified XML is 687722 characters, the same minimized is 455528; that's about 33% "compression".
  14. aehimself

    Generics and Classes on Windows 2000 = OOM

    So after weeks of attempting to find the guilty code piece I found nothing. Every allocation had a release pair, memory usage was perfectly consistent for close to a month. This combined with the fact that only one machine was affected means that whatever happened, it was not caused by my code (and therefore generics and classes) and was only a coincidence. And I think I already know what happened. So thanks all for the tips; at least we know that (even if it's unsupported) D10.3 applications are running happily (and correctly) on Windows 2000 too ๐Ÿ™‚
  15. Sorry, true that; it's physical cores not logical ones. Please disregard my previous comment.