How to transfer 2 files to Meld program via registry?

Just starting out? Need help? Post your questions and find answers here.
AZJIO
Addict
Addict
Posts: 1372
Joined: Sun May 14, 2017 1:48 am

How to transfer 2 files to Meld program via registry?

Post by AZJIO »

I create data in the registry:

Code: Select all

HKEY_CLASSES_ROOT\*\shell\Meld\command
"C:\Program Files (x86)\Meld\Meld.exe" "%L" %*
Or

Code: Select all

HKEY_CLASSES_ROOT\*\shell\WinMerge\command
"C:\Program Files (x86)\WinMerge\WinMergeU.exe" "%L" %*
This command forces the program to open each file instead of passing two files on the same command line.
I found information that you can pass a handle.
%i – IDList stored in a shared memory handle is passed here.
https://web.archive.org/web/20111002101 ... s.85).aspx
https://superuser.com/questions/136838/ ... -a-context


I decided to test if I would get the files so that I can then transfer them to another program.
I compiled the program and added the command to the registry.
"C:\PureBasic\Source\2022.03\launcher.exe" %i

Code: Select all

EnableExplicit

Define SpecialFolderLocation.s, IDList, tmp$
If CountProgramParameters()
	tmp$ = ProgramParameter(0)
	tmp$ = Mid(tmp$, 2)
	MessageRequester("", tmp$)
	IDList = Val(tmp$)
	SpecialFolderLocation = Space(#MAX_PATH)
	SHGetPathFromIDList_(IDList, @SpecialFolderLocation)
	CoTaskMemFree_(IDList)
	If Asc(SpecialFolderLocation)
		MessageRequester("", SpecialFolderLocation)
	EndIf
EndIf
I am getting the following line:
:666412128:4276
This line does not look like a handle. I used dangerous experiments, i.e. substituting parameters in the hope of getting lucky.
Does anyone know how to solve this problem?

I know it works via SendTo.
AZJIO
Addict
Addict
Posts: 1372
Joined: Sun May 14, 2017 1:48 am

Re: How to transfer 2 files to Meld program via registry?

Post by AZJIO »

Post Reply