I seem to remember that the Alter Rebbe writes that if a Yid does a Melacha and has a particular purpose in mind and another Yid wants to have Hanoah from the Melacha in a different manner that it is okay? A hypothetical example: If someone comes into my kitchen and puts on the stove to warm up food, can I use the fire on the stove to warm myself up if I am cold?
There is no such Halacha in Alter Rebbe Shulchan Aruch. You might be confusing this with something similar;
There is a Halacha that one may ask a non-Jew to do a Pesik Reisha, i.e. he does an act on Shabbos, even if it results in a Melacha, since the intention here is not the Melacha, rather the act, and the Melacha aspect is an incidental outcome. For example, one may ask him to open the fridge, even though the light will turn on.
There is also a Halacha about a non Jew who has done a Melacha for himself and the benefit the Jew receives is an indirect form of benefit there are many aspects to this Halacha, which are beyond the scope of this response.