Fast View braucht einen Neuanfang
admin | 30. September 2009Nachdem ich in den letzten Tagen endlich mal wieder ein paar Stunden für Fast View gefunden habe, hat sich herausgestellt, dass der Code viel zu unübersichtlich und verschachtelt ist. Kleine Kostprobe gefällig?
private static IntPtr _hookID = IntPtr.Zero;
private static LowLevelKeyboardProc _proc = new LowLevelKeyboardProc(InterceptKeys.HookCallback);
private static Form1 form;
private const int WH_KEYBOARD_LL = 13;
private const int WM_KEYDOWN = 0×100;
[DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]
private static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
private static string GetExplorerPath()
{
try
{
ShellWindows shellWindows = new ShellWindowsClass();
int foregroundHandle = GetForegroundWindow().ToInt32();
foreach (InternetExplorer ie in shellWindows)
{
if (ie.HWND == foregroundHandle)
{
return ((IShellFolderViewDual2) ie.Document).FocusedItem.Path;
}
}
}
catch (Exception)
{
return null;
}
return null;
}








