-
Content Count
1936 -
Joined
-
Last visited
-
Days Won
25
Everything posted by Attila Kovacs
-
How to open a file in the already running IDE?
Attila Kovacs replied to aehimself's topic in Delphi IDE and APIs
caption is a good alternative yes, as long as it won't change in the future -
How to open a file in the already running IDE?
Attila Kovacs replied to aehimself's topic in Delphi IDE and APIs
as you can only have one instance of one major version installed, it should not be a problem -
How to open a file in the already running IDE?
Attila Kovacs replied to aehimself's topic in Delphi IDE and APIs
with http://melander.dk/articles/versioninfo/ the versions are Berlin 24.0.25048.9432 D2007 11.0.2902.10471 we have everything we need -
How to open a file in the already running IDE?
Attila Kovacs replied to aehimself's topic in Delphi IDE and APIs
here is the executable name Buffer: array [0 .. 4095] of Char; Modules: array [0 .. 255] of THandle; PID: DWORD; exePathLen: integer; hProcess: THandle; nResult: boolean; nTemp: Cardinal; aService, aTopic: WORD; .... if GetWindowThreadProcessId(ci.hwndPartner, PID) <> 0 then begin hProcess := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ, False, PID); if hProcess <> 0 then begin nResult := EnumProcessModules(hProcess, @Modules[0], Length(Modules), nTemp); if nResult then begin nTemp := GetModuleFileNameEx(hProcess, 0, Buffer, SizeOf(Buffer)); Memo1.Lines.Add(Buffer); end; end; end; ... -
How to open a file in the already running IDE?
Attila Kovacs replied to aehimself's topic in Delphi IDE and APIs
make exhaustive testing, it stopped working on my system again. no clue why -
How to open a file in the already running IDE?
Attila Kovacs replied to aehimself's topic in Delphi IDE and APIs
Yeah, but now, I want my bdsLaucher2, where one can define, from which folder which IDE should spawn or open the file! -
How to open a file in the already running IDE?
Attila Kovacs replied to aehimself's topic in Delphi IDE and APIs
ooooooooo **** me running. This helped to fix my problem opening files by doublekingkong on them in the explorer. At some point, I set bds.exe itself to run as administrator, not just a shortcut, the exe! No clue why, but from that point I could only open files from the IDE, of course. I noticed that the program above works only from the IDE, which made me think. -
How to open a file in the already running IDE?
Attila Kovacs replied to aehimself's topic in Delphi IDE and APIs
Here. This queries all the running bde's and opens a file in every one. This is a good start, you have to find out which is which version somehow, I have no more time for that. DDE-test.7z -
How to open a file in the already running IDE?
Attila Kovacs replied to aehimself's topic in Delphi IDE and APIs
this opens me the file in the running IDE DdeClientConv1.ServiceApplication := '"C:\Program Files (x86)\Embarcadero\Studio\18.0\bin\bds.exe"'; Memo1.Lines.Add('Setting DDE link...'); If Not DdeClientConv1.SetLink('bds', 'system') then begin Memo1.Lines.Add('Setting link failed!'); Exit; end; // Memo1.Lines.Add('Opening DDE link...'); // If Not DdeClientConv1.OpenLink then // begin // Memo1.Lines.Add('Opening link failed!'); // Exit; // end; try Memo1.Lines.Add('Invoking DDE command...'); if Not DdeClientConv1.ExecuteMacro(PAnsiChar('[open("C:\Temp\tmp\a.pas")]'), False) then begin Memo1.Lines.Add('Invoking command failed!'); Exit; end; finally Memo1.Lines.Add('Closing DDE link...'); DdeClientConv1.CloseLink; end; -
How to open a file in the already running IDE?
Attila Kovacs replied to aehimself's topic in Delphi IDE and APIs
@aehimself How is the bdslauncher answering your query anyway? It's not a resident application, do you have some ghost processes of it? It's bdsLauncher which should detect if bds is running and if yes, send a dde to bds, otherwise start it. AFAIK. Am I Wrong? -
How to open a file in the already running IDE?
Attila Kovacs replied to aehimself's topic in Delphi IDE and APIs
are you sure it's PAnsiChar? -
How to open a file in the already running IDE?
Attila Kovacs replied to aehimself's topic in Delphi IDE and APIs
perhaps he has a Cherry keyboard... -
How to open a file in the already running IDE?
Attila Kovacs replied to aehimself's topic in Delphi IDE and APIs
with full path of bds.exe? -
How to open a file in the already running IDE?
Attila Kovacs replied to aehimself's topic in Delphi IDE and APIs
what about bdslauncher.exe bds.exe /np d:\myfile.pas ? with full paths ofc -
How to open a file in the already running IDE?
Attila Kovacs replied to aehimself's topic in Delphi IDE and APIs
you have to start the bdslauncher not the bds, theoretically, on my install it stopped working completely couple of months ago. -
How do I delete a row in a database with FireDAC?
Attila Kovacs replied to JohnLM's topic in Databases
not buying every hdd's on the earth? 😉 -
It's for text only. I'd put binary in resources. Or you can extend the component to apply to your needs.. but in this case you have to replace tstringlists with streams and implement a Writer and a Reader for the dfm.
-
Just download the 3 units above and add it to a newly created package and save it and install it
-
https://chat.openai.com/chat "To download a file from HTTP in Delphi, you can use the TIdHTTP component from the Indy library. This component provides methods for sending HTTP requests and receiving HTTP responses, including the ability to download files from a URL. Here is an example of how you could use TIdHTTP to download a file in Delphi:" uses IdHTTP; var http: TIdHTTP; url: string; filename: string; stream: TMemoryStream; begin // Create the HTTP client object http := TIdHTTP.Create; // Specify the URL of the file you want to download url := 'http://www.example.com/myfile.txt'; // Specify the name of the file where you want to save the downloaded data filename := 'C:\myfile.txt'; // Create a memory stream to hold the downloaded data stream := TMemoryStream.Create; try // Use the HTTP client to download the file from the specified URL http.Get(url, stream); // Save the downloaded data to the specified file stream.SaveToFile(filename); finally // Clean up stream.Free; http.Free; end; end. "In this example, the TIdHTTP.Get method is used to download the file from the specified URL and save the data to the TMemoryStream object. Once the download is complete, the data is saved to the specified file using the TMemoryStream.SaveToFile method." 2nd run: uses IdHTTP; procedure DownloadFile(const URL, FileName: string); var HTTP: TIdHTTP; Stream: TFileStream; begin HTTP := TIdHTTP.Create(nil); try Stream := TFileStream.Create(FileName, fmCreate); try HTTP.Get(URL, Stream); finally Stream.Free; end; finally HTTP.Free; end; end; "download a file from http in delphi in the background": uses IdHTTP, Classes; type TDownloadThread = class(TThread) private FURL: string; FFileName: string; FHTTP: TIdHTTP; FStream: TFileStream; protected procedure Execute; override; public constructor Create(const URL, FileName: string); destructor Destroy; override; end; constructor TDownloadThread.Create(const URL, FileName: string); begin inherited Create(False); FURL := URL; FFileName := FileName; FHTTP := TIdHTTP.Create(nil); FStream := TFileStream.Create(FileName, fmCreate); end; destructor TDownloadThread.Destroy; begin FStream.Free; FHTTP.Free; inherited Destroy; end; procedure TDownloadThread.Execute; begin FHTTP.Get(FURL, FStream); end; procedure DownloadFile(const URL, FileName: string); var Thread: TDownloadThread; begin Thread := TDownloadThread.Create(URL, FileName); Thread.Start; end;
-
I made this component back in the days, drop it on a form/datamodule, you can add files by doubleclicking the component on the form or manually enter text by adding items. Use it like: "Storage['Title']" I have commented out some encryption stuff but you can implement it yourself if you need it. It can zip its content. (Install it by creating a new package and add the units to it) Public domain, no restrictions, have fun. forsix.StringListHelper.pas forsix.VCL.Storage.pas forsix.VCL.Storage.Design.pas
-
I know, but in this particular case I can't think of any situation where I would test any function for supporting a tree when there is no tree. Or building a console application and having stuff for a tree, which I do not need. In my view, in this case, you are mixing the GUI and the business logic.
-
As the component itself stores only a reference in both cases, I can't see any benefit.
-
You both never worked with treeviews, do you?
-
How to connect to wss:// server ?
Attila Kovacs replied to wright's topic in ICS - Internet Component Suite
"Host not found" to "ws.xn--twelvedata-lb99c.com" You will not have the drink, Kimi. -
Overlap JPG photo to oa background transparently
Attila Kovacs replied to Clément's topic in RTL and Delphi Object Pascal
okay everybody, we make the photoshooting today.. remember, don't smile, and close your eyes! by the way, if the background isn't just white and you don't have to automatize https://www.photoroom.com/white-background/