title: Windows: How to create custom appcompat shims (Application Fixes)?
body: <p>Windows has the capability to apply <a href="http://thelazyadmin.com/blogs/thelazyadmin/archive/2008/10/15/creating-custom-application-compatibility-shims.aspx" rel="nofollow noreferrer"><strong>shims</strong> to mis-behaving applications</a>. Shims are used to intercept API calls and change it. For example, shims can be used to:</p>
  
  <ul>
  <li>change the incoming paramters</li>
  <li>lie about the return values</li>
  <li>change it to call something else</li>
  </ul>
  
  <p>The <a href="http://technet.microsoft.com/en-us/library/cc507852.aspx" rel="nofollow noreferrer">Application Compatibility Tookit</a> has quite a few existing shims you can apply to your own mis-behaving application. Here's an example of one that ignores your API call and instead calls a completely different API instead:</p>
  
  <p><a href="https://i.stack.imgur.com/4QexP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4QexP.png" alt="alt text"></a>
  </p>
  
  <p>i need a shim that isn't one of the hundreds of shims Microsoft already wrote. <a href="https://serverfault.com/questions/46980/is-there-is-running-in-terminal-session-lie-shim">i need a custom shim</a>.</p>
  
  <p>In my case i want to intercept calls to:</p>
  
  <pre><code>GetSystemMetrics(0x1000)
  </code></pre>
  
  <p>so that it returns <code>0</code>. i can't find any information on how to give Windows my own DLL that will have the fix i need. i don't even know if you <strong>can</strong> create custom shims.</p>
  
  <p>Does Windows support custom shims?</p>