title: How to link a compiled resource (.res) file into an executable
body: <p>What I want to do is to programmatically update resources of an executable file.  </p>
  
  <p>I have a binary resource (.res) file containg bitmaps, icons, version info and a manifest, created with a <a href="http://melander.dk/reseditor/" rel="nofollow">resource editor</a>, and a PE file compiled with AutoHotkey to which I want to copy the resources from the .res file.</p>
  
  <p>Until now I used to do this with ResourceHacker in command prompt, but ResourceHacker can't be redistributed and besides I want to do this more elegantly.  </p>
  
  <p>So I was looking in the WinAPI functions and there seems to be a way to do this: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms648008%28v=vs.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/desktop/ms648008%28v=vs.85%29.aspx</a><br>
  But the problem is that the article describes how to copy resources from an executable file to another, and you can't import non-executable files (the .res file) with <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms684175%28v=vs.85%29.aspx" rel="nofollow">LoadLibrary</a>/<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms684179%28v=vs.85%29.aspx" rel="nofollow">LoadLibraryEx</a>.</p>
  
  <p>There also seems to be a way to do this with tools from Visual Studio, particularly <a href="http://msdn.microsoft.com/en-us/library/kcz8ck35.aspx" rel="nofollow">LINK.exe</a>. But I'm not sure if it can be used outside of the VS enviroment. I have no idea how it works.</p>