Page 1 of 1

How to transfer 2 files to Meld program via registry?

Posted: Wed Mar 23, 2022 5:06 pm
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.

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

Posted: Thu Sep 08, 2022 9:27 pm
by AZJIO