Friday, 5 June 2009

Open File Security Warning Removal

Fed up with having to deal with the security warning every time you download a file from the internet? Supress the warning dialog with the instructions found in the first link on this page.

Go to Run -> gpedit.msc
User Configuration -> Administrative Templates -> Windows Components -> Attachment Manager -> Inclusion List for moderate risk file types.
Enable it and in the box specify the extensions such .exe, .jpg, .com

Thursday, 4 June 2009


The .net TreeView doesn't expose a scroll event. Make your own by overriding DefWndProc.

   public class TreeViewScroll : TreeView
private const int WM_VSCROLL = 0x115;
private IntPtr SB_ENDSCROLL = new IntPtr(8);

public event MethodInvoker Scroll;

protected void OnScroll()
if (Scroll != null)

protected override void DefWndProc(ref Message m)
if (m.Msg == WM_VSCROLL)
if (m.WParam != SB_ENDSCROLL)

base.DefWndProc(ref m);

The code above is sufficient for my needs, but if you need more details about the scroll (direction, where you scrolled to, etc) you need to interrogate the message further.

This link should tell you what the message contains:

This link can tell you the scrollbar values: