Jump to content

programmerdelphi2k

Members
  • Content Count

    1406
  • Joined

  • Last visited

  • Days Won

    22

Everything posted by programmerdelphi2k

  1. programmerdelphi2k

    TProcessList issue.

    UNnecessary usage: just use this: function GetApplicationInstances(const FileName: string): TArray<string>; var ProcessEntry: TProcessEntry32; Snapshot: THandle; begin Snapshot := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); if Snapshot <> INVALID_HANDLE_VALUE then begin ProcessEntry.dwSize := SizeOf(ProcessEntry); if Process32First(Snapshot, ProcessEntry) then begin repeat if (ProcessEntry.szExeFile = FileName) then // Replace with appropriate condition begin result := result + [ProcessEntry.szExeFile]; end; until not Process32Next(Snapshot, ProcessEntry); end; CloseHandle(Snapshot); end; end; // on client-code = your form/app/etc... MyArrayFromMyFunc := GetApplicationInstances; ShowMessage( Length(MyArrayFormMyFunc ).ToString ); for var A in MyArrayFromMyFunc do Memo1.Lines.Add( A )
  2. programmerdelphi2k

    TProcessList issue.

    // function GetApplicationInstances(const FileName: string; out Count: Integer): TArray<string>; // for var Item in GetApplicationInstances do Memo1.Lines.Add( Item ); // Item = string // or Memo1.Lines.AddStrings( GetApplicationInstances ) // anyway, if result = [] then nothing will be add on Memo!
  3. programmerdelphi2k

    TProcessList issue.

    @Ian Branch in my RAD11.3 UP1 and I dont have this Class/record named TProcessList in all sources!!! verify your project sources or anyother used in your project!
  4. programmerdelphi2k

    TZipFile.ExtractZipFile overwrite files?

    @bnobre try this... var MyZIP: TZipFile; begin MyZIP := TZipFile.Create; try MyZIP.ExtractZipFile('D:\MyZip\MyNewZip.zip', 'D:\MyZip'); finally MyZIP.Free; end;
  5. programmerdelphi2k

    TZipFile.ExtractZipFile overwrite files?

    @bnobre YES, it will be replaced! But you can choice "what" file need extract be do it, then, you can put in another folder, for example!
  6. programmerdelphi2k

    11.3 and Android tools

    @limelect really, my opinion is: you can use what is better for you! Using Android Studio is very pratice, no command is necessary, all in UI! 🙂 Using command-line, is better for old-school pratices, I like this, more control! the big trap is a incompatible way to store the info about setup file, nothing more! as you know, JAVA is basically command-line, just look at "window message" when compiling any project in RAD Studio to Android, Linux, macOS, or same Windows... a lot of "dcc32, javaxxxx, etc..."
  7. programmerdelphi2k

    11.3 and Android tools

    @limelect I have test here create a new AVD (but as I dont have used anymore, it's necessary define a custom manually answer the questions) avdmanager create avd -n test -k "system-images;android-30;default;arm64-v8a" <-- your image to use a little here form SoF https://stackoverflow.com/questions/42792947/how-to-create-android-virtual-device-with-command-line-and-avdmanager
  8. programmerdelphi2k

    11.3 and Android tools

    @limelect my experience with "manuall" updates RAD installed - no SDK/NDK - OK ---> cmd-tools is a zip file, then unzip to see the "sdkmanager.bat" - if necessary, just download last cmd-tools from Android Studio official site! using old SDK/NDK from RAD 10.4 - update using sdkmanager.bat in RAD11 - ok with CMD-TOOLS you can use sdkmanager.bat to update your enviroment as said above if using Android Studio, you can to do the same downloads, BUT it change some setup files that is different from "manual" updates by SDKManager.bat... but if your warning dont worry, go ahead. you dont need REALLY use any virtual devices, alias, using real device is better and more performatic to install apps etc..
  9. programmerdelphi2k

    11.3 and Android tools

    dont forget set the enviroment var "REPO_OS_OVERRIDE" is set to "windows", before run the command to download set REPO_OS_OVERRIDE=windows
  10. programmerdelphi2k

    11.3 and Android tools

    @limelect I think that you need download "an image platform" at first, to create your AVD... use SkdManager.bat to download your image desirable! I dont use virtual devices here!
  11. programmerdelphi2k

    11.3 and Android tools

    I think that this EXE is from old editions from Android in RAD, now is AVD*.BAT @rem Execute avdmanager "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %AVDMANAGER_OPTS% -classpath "%CLASSPATH%" com.android.sdklib.tool.AvdManagerCli %CMD_LINE_ARGS%
  12. programmerdelphi2k

    11.3 and Android tools

    if fact, you dont need "install it", but just "COPY it" from any PC with SDK/NDK Android. Of course, need the same version used in RAD 11.x!!! Using Android Studio, you can download it, not problem, but need pay attetion that the Android Studio is a little different about setup file (please read about this) Summary: you can copy SDK/NDK Android (to RAD 11.x) folders from any other PC (Android SDK/NDK is free for install/copy) you can copy this folders to any disk/folder that you want (dont need be Public\...\Embarcadero\...etc) -> just use Tools->Options->Deployment->SDK-Android... and use it!!! in default RAD 11.x install, you dont have all files in SDK/NDK android... you need install (copy it) later install RAD!!! -- you'll have just the "commandlinetools-win-XXXXXXX.zip" - unzip to see the tools or download it from Android Studio site!!! in x:\xxxxx\AndroidSDK\cmdline-tools\bin you'll have the "sdkmanager.bat" that can aux in update your sdk/ndk basically, you can: sdkmanager.bat --help to see all params to update your Android SDK/NDK for example: skdmanager.bat --sdk_root=<<Path root of your Android SDK>> --list <-- to know what packages is on Google skdmanager.bat --sdk_root=<<Path root of your Android SDK>> --list_Installed <-- to know what packages is installed in your PC sdkmanager.bat --sdk_root=<<Path root of your Android SDK>> --update "build-tools;31.0.0" "cmdline-tools;v5" <--- to install this packages sdkmanager.bat --sdk_root=<<Path root of your Android SDK>> --uninstall "build-tools;31.0.0" "cmdline-tools;v5" <--- to uninstall it etc... you can try download the files using Android Studio (just for first download files).. then in Settings, see where was dowloaded later, copy the folders for your disk/folder to better access (if you want) later, in RAD Studio, just use it! later, you can use "SDKManager.bat" for update it (if dont need Android Studio anymore)! I have used SDK/NDK from RAD 10.4 and updated using SKDManager.bat to download news version to 11.x and works so good! Any thing, do the tests because RAD11 use another SDK/NDK versions!!!
  13. programmerdelphi2k

    Save edgebrowser new window as file

    maybe you need "intercept" the download procedure and then re-direct it for you folder (for your type-file)
  14. programmerdelphi2k

    Save edgebrowser new window as file

    by default, all files is downloaded on "Download" dir defined in browser setup (I think that It's not possible your requirement, for each file type, in case PDF) , you can try set the key on Registry. Then, it would can be used by Edge. HCU.... "Software\Microsoft\Edge\Main" if does not exists, create it! later, Reg.OpenKey('Software\Microsoft\Edge\Main', False); Reg.WriteString('Default Download Directory', 'D:\Your_New_Download_Dir_For_All_Files_Not_Only_PDF');
  15. programmerdelphi2k

    Convert line endings on paste?

    You're right! I beg your perdon about anything and let's go ahead...
  16. programmerdelphi2k

    Convert line endings on paste?

    look your avatar... is nervous or calm down?
  17. programmerdelphi2k

    Convert line endings on paste?

    😁 mmm, sometimes the "words" say more than itself! ok, YOU'RE not nervous now!
  18. programmerdelphi2k

    Convert line endings on paste?

    ok, you're very nervous! sorry!
  19. programmerdelphi2k

    Convert line endings on paste?

    You mean open PDF files in the IDE? well, then, I think this is beyond the scope of the IDE, after all third-party applications have adopted their own rules for creating and opening files. However, in RAD you have the option of "UserInterface->Editor->LineEndings-> ASK" to convert the CRLF when the file is opened, have you tried this route? you may need to add the file extension in "Known extentions"...
  20. programmerdelphi2k

    Convert line endings on paste?

    if does not exists, then just "Copy" to any text-editor like MS Notepad, and later. "Copy/Paste" in your unit Pas!
  21. programmerdelphi2k

    RTL.PhotoWall Sample using BlueTooth freeze at start on Android

    some Firewall/Antivirus rules active ?
  22. programmerdelphi2k

    Intercept "WM_COPY" on Windows

    @gioma you could just check the data that "HDROP(LGlobalLock)" is pointed to, to get the objects this way ---> in message WM_CLIPBOARDUPDATE procedure LGLobalLock := GlobalLock(LClipboardData); try if (LGLobalLock <> nil) then begin LDQFindexFile := 0; // $FFFFFFFF = all; LDQFbufferSizeInChars := MAX_PATH; // LDQFresult := DragQueryFile(HDROP(LGLobalLock), LDQFindexFile, LFilenameBuffer, LDQFbufferSizeInChars); // if LDQFresult > 0 then begin // if is Directory, then use a "FOR" to process each object LItemIndex :=0; // "i" in "FOR" looping LDQFresultProcessEachItem := DragQueryFile(HDROP(LGLobalLock), LItemIndex, LFilenameBuffer, 255); // reviewing objets... // {$WARN SYMBOL_PLATFORM OFF} // remove this warning about platform specific! LIsDirectory := ((FileGetAttr(LFilenameBuffer) and faDirectory) = faDirectory); {$WARN SYMBOL_PLATFORM ON} // if LIsDirectory then Memo1.Lines.Add(string(LFilenameBuffer) + ' is a directory') else Memo1.Lines.Add(string(LFilenameBuffer) + ' is a file'); end else Memo1.Lines.Add('DragQueryFile = 0 = failed!'); end else Memo1.Lines.Add('LGLobalLock = nil'); finally GlobalUnlock(LClipboardData); end;
  23. programmerdelphi2k

    RTL.PhotoWall Sample using BlueTooth freeze at start on Android

    @FabDev then, try comment this line now, put a new button on "MobilePhotoApp" to call "FindWalls" manually... that way, you can use Debug to trace it... understood?
  24. programmerdelphi2k

    Intercept "WM_COPY" on Windows

    @gioma As I said just above, I would rule out using the Clipboard, and instead adopt a safer route like: PC1_aplicativoA sends the files to PC2 in a specific folder to receive the files (PC2_folderDownloadedFromPC1); PC2_aplicativoB monitors this folder from time to time, to check if a new file has been posted there (you could use a list to control the files already worked on, or even the date/time of the last jobs done, that is, if there are a new file, its creation date and time will be the latest in the folder); if there are new files in the folder (PC2_folderDownloadedFromPC1), then PC2_aplicativoB will be able to carry out the desired actions, and, clean the list or control date/time; as already mentioned, you can test whether the file has already completed its transfer from A to B, just by trying to open the file exclusively. This way, you will always have greater control over what has been processed or not, and you will no longer depend on the data in the Clipboard's memory (which can be easily changed by other applications on the PC2);
  25. programmerdelphi2k

    Intercept "WM_COPY" on Windows

    @gioma dont forget: you need verify if the file really exists and then some way block another app to change/delete...
×