am name="hWnd"&gt;Window handle&lt;/param&gt;
''' &lt;param name="bState"&gt;&lt;c&gt;True&lt;/c&gt; to set thin borders, &lt;c&gt;False&lt;/c&gt; to
 remove them.&lt;/param&gt;
Private Sub ThinBorder(ByVal hWnd As Long, ByVal bState As Boolean)
Dim lStyle As Long
   ' Thin border:
   lStyle = GetWindowLong(hWnd, GWL_EXSTYLE)
   If bState Then
      lStyle = lStyle And Not WS_EX_CLIENTEDGE Or WS_EX_STATICEDGE
   Else
      lStyle = lStyle Or WS_EX_CLIENTEDGE And Not WS_EX_STATICEDGE
   End If
   SetWindowLo