Click here to Skip to main content
Click here to Skip to main content

Window Tabifier

By , 29 Mar 2008
 
Sample Image

Contents

Introduction

This program allows to host several open Windows in one parent window so that you can easily access and navigate between them, as well as clean up space in the taskbar. The idea of creating this program came to me when I was reading an article by Jay Nelson: Hosting EXE Applications in a WinForm project. Instead of hosting just a single executable inside a WinForm project, I decided to have a tabcontrol and host different Windows on different tabs. This will allow to group similar Windows together, easily navigate between them and clean up space in the taskbar. Interested? In that case, let's start exploring the application.

Background

All the functionality of this application is achieved using Windows API functions, so you should be familiar with basic winapi programming. Consequently you should know what P/Invoke is and how it works. If you are familiar with the article: Window Tray Minimizer, then it will help you a lot.

How the Program Works

When you run the application, it hides the main form and an icon is shown in the system tray. If you right-click the icon, a context menu will be shown which has two main buttons: 'Tab Windows' and 'Tab all Windows'. When you click 'Tab Windows', a new window will pop up with a list of open Windows. The list can be filtered by the title of the Windows. When you select the Windows you wish to tabify and click 'OK', a new window will be created and all the checked Windows will be hosted in a tabcontrol. There will be one more tabpage called Menu which has two buttons: one for adding open Windows to the tabcontrol and another for choosing files that will be automatically opened in new tabs. You can also drag & drop files or folders from Windows Explorer on this tabpage for having them opened in new tabs automatically. You can navigate between tabs by clicking Ctrl+1, Ctrl+2 and so on or you can just simply hover mouse over the tab and it will be selected automatically. When selected tab changes, icon of the host window is changed either with the icon of the executable file that created current window or with the icon of the window itself. Minimizing the host window minimizes it to tray, but if it is not what you want, you can turn off the feature from the options dialog.

Code Behind the Application

Before we begin exploring the application itself, I'd like to introduce a class for storing simple properties of a window and methods for manipulation on it. The main properties are: Handle, Location, Parent, Size and Title. The main methods include closing the window, getting the path of the executable file that created the window, moving it, setting/restoring parent and setting style. There is also one static method that enumerates all open Windows. The class has one constructor that takes the window's handle as a parameter and sets its simple properties. Here is a class diagram:

WindowTabifier3.jpg

Enumerating Windows and Filtering Them

When you click the 'Tab Windows' button, a window is shown which lists all open Windows. In order to enumerate all Windows, you should call the winapi function called EnumWindows. The function takes two parameters. The first one is a pointer to a callback function. The code snippet below shows how this function works:

public static List<window> GetOpenWindows()
{
openwnd = new List<window>();

winapi.EnumWindowsProc callback = new winapi.EnumWindowsProc(EnumWindows);
winapi.EnumWindows(callback, 0);

List<window> result = new List<window>(openwnd);
openwnd.Clear();

result.RemoveAt(result.Count - 1);

return result;
}

private static bool EnumWindows(IntPtr hWnd, int lParam)
{
if (!winapi.IsWindowVisible(hWnd) || hWnd == winapi.statusbar)

return true;

openwnd.Add(new window(hWnd));

return true;
}

After this, we need to filter this list. Firstly, we need to get rid of the Windows that were opened by our application so that we don't get host Windows hosting other host Windows. This can be done for each returned window by finding the path of the executable that created the window and comparing it to our application's location. Secondly, if the user has selected to ignore Windows without a title, we have to remove them.

Finding Windows Executable

These are the steps required to find the path of the executable that created a given window:

  1. Get the process id that created the specified window using the GetWindowThreadProcessId() function
  2. Get a handle of the process by OpenProcess() function
  3. Get the executable path by calling GetModuleFileNameEx() function

All these functions are winapi functions imported by dllimport attribute. Here is the actual implementation ported to C#:

public string GetExecutablePath()
{

uint dwProcessId;

//Get the process id
winapi.GetWindowThreadProcessId(handle, out dwProcessId);

//Get the handle of the process
IntPtr hProcess = winapi.OpenProcess(winapi.ProcessAccessFlags.VMRead |
 winapi.ProcessAccessFlags.QueryInformation, false, dwProcessId);

//Get the executable path
StringBuilder path = new StringBuilder(1024);
winapi.GetModuleFileNameEx(hProcess, IntPtr.Zero, path, 1024);

winapi.CloseHandle(hProcess);

return path.ToString();
}

Filtering Windows

At this point we have a variable of List<window> class. In C# 2.0, we can use FindAll method of List<T> class to filter it.

private void GetWindows()
{
 if (Properties.Settings.Default.Ignore)
 {
 windows = window.GetOpenWindows().FindAll(delegate(window wnd) {

return wnd.Title.Length > 0 && wnd.GetExecutablePath() != Application.ExecutablePath; });
 }
 else
{
windows = window.GetOpenWindows().FindAll(delegate(window wnd) {
 return wnd.GetExecutablePath() != Application.ExecutablePath; });
 }
}

In C# 3.0, you can make use of a new feature called Lambda expressions and rewrite it like this:

private void GetWindows()
{
 if (Properties.Settings.Default.Ignore)
 {
 windows = window.GetOpenWindows().FindAll((window wnd)=>wnd.Title.Length>0 &&
 wnd.GetExecutablePath()!=Application.ExecutablePath);
 }
 else
{
windows = window.GetOpenWindows().FindAll((window wnd) => wnd.GetExecutablePath()
!= Application.ExecutablePath);
}
}

Hosting Windows

When a user selects those Windows that are to be tabbed and clicks OK, a new 'host' window is created and selected Windows are passed to it. When the host is displayed, it adds a new tabpage for each window and displays the window.

private void ProcessWindows(List<window> windows)
{
lock (tabs)
 {
 int startindex = tabs.Items.Count - 1;
 for (int i = startindex; i < windows.Count; i++)
 {
 int count = tabs.Items.Add(new FATabStripItem(windows[i].Title, null));

 windows[i].SetParent(tabs.Items[count].Handle);
 windows[i].SetStyle(winapi.GWL_STYLE, (IntPtr)winapi.WS_VISIBLE);
 windows[i].Move(tabs.Location, tabs.Size, true);
 }
 }
}

Whenever a tabpage is closed, the window that was displayed on it is released.

private void Release(window wnd)
{
wnd.RestoreParent();
wnd.SetStyle(winapi.GWL_STYLE, (IntPtr)wnd.PreviousStyle);
wnd.Move(wnd.Location, wnd.Size, true);
}

Managing Drag & Drop

Detecting drag 'n' drop of files from Windows Explorer on the menu tab is detected by the component that comes with the source code of this book: Windows Forms 2.0 Programming. When files or folders are dropped on the form or user selects them by clicking 'Open files in new tab', they are filtered and a new process is started using the filename.

private void ProcessFiles(string[] files)
{
 foreach (string filename in files)
 {
 //If it isn't a shortcut then process it.
 if (!filename.EndsWith(".lnk"))
 {
    ParameterizedThreadStart thrparam = new ParameterizedThreadStart(ProcessFile);
    Thread thr = new Thread(thrparam);
    thr.Start(filename);
 }
 }
}

The ProcessFile method starts a new process based on a parameter, waits 5 seconds for an application to become idle and then checks its MainWindowHandle property. If a folder was dropped, then it tries to get the handle to the window which was created by using winapi FindWindow function.

private void ProcessFile(object filename)
{
 string path = filename as string;
 if (File.Exists(path))
 {
 Process proc = Process.Start(path);

 if (proc != null)
 {
    proc.WaitForInputIdle(5000);
    if (proc.MainWindowHandle != IntPtr.Zero)
    {
    lock (hostedwindows)
    {
    hostedwindows.Add(new window(proc.MainWindowHandle));
    }
    }
    proc.Dispose();
 }
 }
 else
 if (Directory.Exists(path))
 {
    int i = 0;
    Process.Start(path);

    //Tries five times to find new window
    IntPtr handle = IntPtr.Zero;
    while (handle==IntPtr.Zero && i<5)
    {
    i++;
    Thread.Sleep(1000);
    // 'CabinetWClass' is the class name of explorer windows.
    handle = window.FindWindow("CabinetWClass", Path.GetFileName(path));
    }

    if (handle != IntPtr.Zero)
    {
    lock (hostedwindows)
    {
    hostedwindows.Add(new window(handle));
    }
    }
 }
}

Navigation Between Tabs

Except just clicking the tab with mouse which you wish to select there are two ways to navigate between them: You can either click Ctrl+1, Ctrl+2, etc. at the same time to switch to the corresponding tab or you can simply hover mouse over the tab and it will be selected automatically. The code snippets below show how these are accomplished.

Code Snippet for Ctrl+1, Ctrl+2, etc.


private void tabs_KeyDown(object sender, KeyEventArgs e)
{
 //Check if Ctrl key is pressed and that there is
 //corresponding tab item to the number which was pressed.
 if (e.Control && e.KeyValue>48 && e.KeyValue<58 && tabs.Items.Count>=(e.KeyValue-48))
 {
 tabs.SelectedItem = tabs.Items[e.KeyValue - 49];
 }br>}

Code Snippet for Automatically Selecting Tab when Mouse is Moved Over It


private void tabs_MouseMove(object sender, MouseEventArgs e)
{
 //Make sure that there is tab under mouse and that automatic selection is enabled.
 FATabStripItem c = tabs.GetTabItemByPoint(e.Location);
 if (c != null && Properties.Settings.Default.SelectonHover)
 {
 tabs.SelectedItem = tabs.Items[tabs.Items.IndexOf(c)];
 }
}

Host Window Icon

When you change active tab in host window, the host window icon changes either with the icon of the executable file that created the currently displayed window or with the icon of the window itself that is displayed. So we need to retrieve either the executable icon or the window's icon.

Retrieving Executable Icon

In order to retrieve the executable icon we need to call SHGetFileInfo() and pass the path of the executable file and an instance of SHFILEINFO structure. After you have retrieved a handle to the icon, you must call DestoyIcon() API to prevent a memory leak.

private Icon GetIcon()
{
 System.Drawing.Icon icon = null;
 string path = GetExecutablePath();

 if (System.IO.File.Exists(path))
 {
    //Retrieve SHFILEINFO type variable
    winapi.SHFILEINFO info = new winapi.SHFILEINFO();
    winapi.SHGetFileInfo(path, 0, ref info, (uint)Marshal.SizeOf(info),
            winapi.SHGFI_ICON | winapi.SHGFI_SMALLICON);

    //Create icon and destroy the handle
    System.Drawing.Icon temp = System.Drawing.Icon.FromHandle(info.hIcon);
    icon = (System.Drawing.Icon)temp.Clone();
    winapi.DestroyIcon(temp.Handle);
 }

 return icon;
}

Retrieving Window Icon

In order to retrieve window icon, I used the code snippet from this article: Screen Captures, Window Captures and Window Icon Captures with Spy++ Style Window Finder! with small modifications. Here it is:

private Icon GetWindowIcon()
{
 int result;

 winapi.SendMessageTimeout(handle, winapi.WM_GETICON, winapi.ICON_SMALL, 0,
 winapi.SMTO_ABORTIFHUNG, 1000, out result);

 IntPtr IconHandle = new IntPtr(result);

 if (IconHandle == IntPtr.Zero)
 {
 result = winapi.GetClassLong(handle, winapi.GCL_HICONSM);
 IconHandle = new IntPtr(result);
 }

 if (IconHandle == IntPtr.Zero)
 {
 winapi.SendMessageTimeout(handle, winapi.WM_QUERYDRAGICON, 0, 0,
 winapi.SMTO_ABORTIFHUNG, 1000, out result);
 IconHandle = new IntPtr(result);
 }

 if (IconHandle == IntPtr.Zero)
 {
 return null;
 }

 System.Drawing.Icon temp = System.Drawing.Icon.FromHandle(IconHandle);
 System.Drawing.Icon icon = (System.Drawing.Icon)temp.Clone();

 winapi.DestroyIcon(IconHandle);

 return icon;
}

Managing Start-up

You can add the program to start-up from the options Window. To add program to start-up, you need to navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run key, create a new string and set its value equal to the application's path. Removing the program from start-up is easier: you just remove the value. The code snippet below shows how to do it:

[RegistryPermissionAttribute(SecurityAction.LinkDemand,
 Write = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run")]
private void startup(bool add)
{
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\
 CurrentVersion\Run", true);

if (add)
{
key.SetValue("Window Tabifier", "\"" + Application.ExecutablePath + "\"");
}
else
key.DeleteValue("Window Tabifier");

key.Close();
}

Making the Application Single-instance

If you try to launch the second instance of the application, you will get a message box saying that it is already running. This is achieved using the mutex class. Mutex allows to share resources between threads. When the first instance of the program is launched, it creates a new mutex. When a second instance is launched, it checks the existence of the mutex. If it exists, then it exits. When the first instance quits, it releases the existing mutex.

static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Mutex mt = null;

try
{
//Try to open existing mutex
mt = Mutex.OpenExisting("Window Tabifier");
 }
 catch (WaitHandleCannotBeOpenedException)
 {

 }

 if (mt == null)
 {
 //If the mutex doesn't exist create it and launch the application.
mt = new Mutex(true, "Window Tabifier");
 Application.Run(new Main());

 //Tell GC not to destroy mutex until the application is running and
//release the mutex when application exits.
GC.KeepAlive(mt);
mt.ReleaseMutex();
}
else
{
//The mutex exists so exit
mt.Close();
MessageBox.Show("Application already running");
 Application.Exit();
 }
}

Possible Enhancements

These are possible features that would make the application more useful:

  • Detecting window opening automatically and adding it to the host window
  • Detecting WM_SETTEXT message for tabbed Windows in order to update tab title.

Both features require setting Windows hooks.

Points of Interest

While experimenting with this application, I found that if you start a new process through file shortcut, then the return value is always null.

References

I would like to thank Giorgi Moniava for the advice he gave me.

History

  • 20th January, 2008 - Initial release

  • 11th February, 2008 - version 1.5

    Bugs Fixed

    • Bug #1: When a tabbed window is released, it has the same state as before it was tabbed. (If the window was maximized before tabbing, it will be maximized after it is released.)
    • Bug #2: When a minimized window is released, you no more need to right-click it with the mouse and click restore in order to open it, you can just click it with the mouse as you usually would.

    Features Added

    • Feature #1: You can now drag and drop a folder on the host window and it will be automatically opened in a new tab.
  • 6th March, 2008 - version 1.6

    Features Added

    • Feature #1: A tab is selected automatically when the mouse is moved over it.
  • 20th March, 2008 - version 1.8

    Features Added

    • Feature #1: When you change the active tab in the host window, the host window icon is set to the icon of the executable file that created the currently displayed window.
    • Feature #2: Host window minimizes to system tray. This feature can be turned off from the options dialog.
  • 29th March, 2008 - version 1.9

    Features Added

    • Feature #1: When you change the active tab in the host window, the host window icon changes either with the icon of the executable file that created the currently displayed window or with the icon of the window itself. This behaviour can be configured from the options dialog.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Giorgi Dalakishvili
Software Developer
Georgia Georgia
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionPls help for FarsiLibrarymembermightygirls16 Apr '09 - 23:06 
This Article is very nice and helpfull. Can you pls. tell me from where i'll get
that Tabstrip.dll's code and DragAndDropFileComponent.dll's source code... I would
like to see the full code... because am not much expert in .NET.
Thanks in Advance.
 
Jiby

AnswerRe: Pls help for FarsiLibrarymvpGiorgi Dalakishvili18 Apr '09 - 5:28 
Here you are:
TabStrips: A TabControl in the Visual Studio 2005 way![^]
 
2nd edition book sample code for Visual Studio 2005 and the .NET Framework 2.0 in C#[^]
 

Generaldamn awesomemember Xmen 20 Mar '09 - 4:20 
thanks man for sharing your hardwork...
 


TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can

GeneralRe: damn awesomemvpGiorgi Dalakishvili20 Mar '09 - 6:25 
Xmen wrote:
thanks man for sharing your hardwork...

 
You are welcome. I have some more plans about it to make it more robust. I hope I'll find time for it Smile | :)
 

GeneralRe: damn awesomemember Xmen 20 Mar '09 - 6:28 
cool Big Grin | :-D
 


TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can

GeneralThis app rulesmemberVodstok24 Dec '08 - 4:24 
I just felt the need to publicly aknowledge how much help this app has been for me. I am currently working in an environment that uses windows XP and office 2003. I am used to office 2007 in vista, so "minimize outlook to tray" is a standby to me. Thanks to this, i get the same functionality.
 
Additionally, I am able to run multiple IE windows without cluttering up my workspace, and was just able to integrate the "window grab" into a testing app for Watir.
 

Thanks to Giorgi for introducing me to this.
 
______________________
Oh Hamburgers!

GeneralRe: This app rulesmvpGiorgi Dalakishvili24 Dec '08 - 7:44 
Thank you very much for your comment Smile | :)
 
Any ideas for improving it?
 

GeneralRe: This app rulesmemberVodstok24 Dec '08 - 8:58 
A small one. Adding an event for the tab control to handle resize event, and reusing .Move(new Point(0, 0), tabber.Items[0].Size, true);
 
resizes the tabbed windows nicely. you have to loop through the windows and assign it to each one.
this is what i am using
tabs.Resize += new System.EventHandler(tabs_Resize);
 
the above goes in the Host.Designer.cs
 
and this goes in Host.cs
 
private void tabs_Resize(object sender, System.EventArgs e)
{
foreach (window w in hostedwindows)
{
w.Move(new Point(0, 0), tabs.Items[0].Size, true);
}
}
 
______________________
Oh Hamburgers!

GeneralRe: This app rulesmvpGiorgi Dalakishvili23 Nov '09 - 1:57 
Hi,
 
Have you added the code you suggested? Is it working well?
 
Thank you.
 

GeneralMy vote of 1memberProJester12 Dec '08 - 10:43 
dangerous
GeneralRe: My vote of 1mvpGiorgi Dalakishvili8 Dec '08 - 2:39 
That's all you have to say? No reason no explanation?
 

GeneralRe: My vote of 1memberDan Letecky15 Dec '08 - 23:36 
Don't worry, Georgi. It's a nice article. You got 5 from me.
 
--
My open-source ASP.NET 2.0 controls:
DayPilot - Outlook-like calendar/scheduling control
DayPilot MonthPicker - Light-weight month picker
MenuPilot - Hover context menu

GeneralRe: My vote of 1mvpGiorgi Dalakishvili16 Dec '08 - 1:11 
Thank you Dan Smile | :)
 

GeneralSuggestions & ideasmemberMarcus Deecke7 Nov '08 - 23:12 
Hi
 
Nice project, first of all.
 
When I was searching for projects like yours my intention was to organize my Windows Explorer windows.
Therefore your Possible Enhancement of detecting the WM_SETTEXT message is vital.
When the the selected directory in a Explorer window changes and the caption will not be updated, how to navigate?
 
Your first enhancement of detetcting opening windows would be nice, as well. The idea could be to centralize all windows of certain applications in a Tabifier host window.
E.g. all Explorer windows are combined in one Tabifier instance and all console windows are combined in another. This should be customizable.
 
Some goodies would be bookmarks and something like projects, which make it possible to group windows to reopenable projects.
 
I think your project has the potential for a real good and useful app. If continued.
 
Regards
Marcus
GeneralRe: Suggestions & ideasmvpGiorgi Dalakishvili8 Nov '08 - 3:48 
Hi,
 

Marcus Deecke wrote:
Nice project, first of all.

 
Thanks. It really makes me feel better when I know that someone liked what I did Smile | :) Thanks for the interesting comments too.
 
Marcus Deecke wrote:
Therefore your Possible Enhancement of detecting the WM_SETTEXT message is vital.
When the the selected directory in a Explorer window changes and the caption will not be updated, how to navigate?
 
Your first enhancement of detecting opening windows would be nice, as well.

 
Unfortunately it's quite difficult if not impossible to use global hooks from c#
 
Marcus Deecke wrote:
The idea could be to centralize all windows of certain applications in a Tabifier host window.

It's an interesting idea. However, people usually don't have many instances of same application open so the application might lost its idea if the taskbar is still full of windows. But having an option is possible.
 
I think it would be better to organize windows from same application in tabs next to each other. E.g. first all tabs from windows of explorer, than all tabs from firefox and so on. This should be customizable as well.
 
The best option would be to have the ability to reorder tabs at runtime. Ideally, I am looking for a tabcontrol that supports runtime reordering of tabs, icons for each tab (both exist in firefox) and close button (like in this application). One possible way of tab reordering is to show a window that lists all open tabs and allows user to reorder them there and will automatically apply it to existing tabs.
 

GeneralRe: Suggestions & ideasmemberbmac20 Jan '12 - 8:45 
Actually (IIRC - it's been a while) using global hooks from C# is a matter of creating a small, simple C dll that does the hooking and then loading that via Win32/PInvoke as an initialization step of the C# exe. My C# WinForms exe was able to successfully utilize realtime hook event data for some of the WH_SHELL hooks as well as WH_KEYBOARD and WH_MOUSE.
 
It's been maybe 3-4-5-6 years since I worked on the project, but the solution ended up being rather elegant in that the C files (one .C and one .H) are very small and the communication between the C dll and the C# exe is dead-simple.
 
Of course, this is all from memory, and memory is not always a 1:1 mapping to the reality of the past Smile | :) In any event, my interest is piqued now, so I'll likely dig up the old project when I get home. Let me know if you're interested and I'll make the effort for you, because the work you've done on this project is superb and I'd love to get you over a technical hump, if possible.
 
One thing that I didn't have to contend with back then was 64-bit Windows, which leads to modifying the code to handle compiling to either target (which I have but a bare understanding of), and then the ramifications that brings to the .NET side of the equation. Sounds like some gritty, hardcore programming fun Smile | :)
Robert McCall
Lasting peace and happiness for *ALL* human beings!

GeneralRe: Suggestions & ideasmemberprognovice20 Jun '11 - 21:01 
Hello,
 
When window resize app is not resizing: this would be great if it did.
 
Thanks.
GeneralHi, i saw the original article of hosting exe in an appllicationmemberMember 237557731 Oct '08 - 11:40 
based on what you have, how would I call a method in one window/exe from a host window?
GeneralRe: Hi, i saw the original article of hosting exe in an appllicationmvpGiorgi Dalakishvili31 Oct '08 - 11:47 
Generally, you can't call method of another executable. However, try using SendKeys class or sending messages by SendMessage WinApi function.
 
Giorgi Dalakishvili
 
#region signature
My Articles / My Latest Article[^] / My blog[^]
#endregion

GeneralVista - not tried on XPmemberDaveyM6923 Oct '08 - 9:51 
Cool App - one that deserves a 6 at least!
 
I don't know if this only happens on Vista, but if I select Tab All Windows, it tabs the Start Button, the SideBar and all the gadgets in the sidebar too!
 
Not a problem, just thought I'd let you know. I'll have a look at the source and see if I can work a solution to exclude them.
 
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

GeneralRe: Vista - not tried on XPmvpGiorgi Dalakishvili23 Oct '08 - 10:03 
Thanks for the comment and vote.
 
As for the behavior on vista, yes I am aware about it. The application was initially developed for xp so in xp there was only one window to exclude Smile | :) I am thinking about adding some sort of rules to the application. The rules will allow users to exclude certain windows based on title of the window or path of the executable path. I just need some time to think about it and decide how to design it.
 
Giorgi Dalakishvili
 
#region signature
My Articles / My Latest Article[^] / My blog[^]
#endregion

GeneralRe: Vista - not tried on XPmemberDaveyM6923 Oct '08 - 10:50 
How about something simple but functional like...?
private List<ExclusionListItem> exclusionList;
public class ExclusionListItem
{
    public ExclusionListItem(string friendlyName, string data, ExclusionTypes exclusionType)
    {
        // ...
    }
}
public enum ExclusionTypes
{
    Title,
    Path,
    // ...
}

 
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

QuestionFocus from host lost?memberc3csystems20 Oct '08 - 2:07 
Hi!
 
Thank you for such a nice article and such a wonderful application.
 
Few bug-reports: When you host an application and start working on it, the focus from the host application, i.e. Main form is lost. Thus, you cannot use Ctrl-Tab and other shortcuts for the host. Any ideas, how to take care of this? Also, if you have focus on a hosted application, say IE, and you open a new window (untabbed), say Notepad, the Notepad is on top (which is expected). But if you click on the IE window (tabbed inside our application), Notepad does not go to background and remains on top, though the focus from the Notepad is gone.
 
If my problems are not clear, do let me know and I will try to explain them further.
 
I code at Will!

GeneralExcellent workmemberMohammad Dayyan11 Sep '08 - 4:34 
Hi there Giorgi
Excellent work
5 from me
GeneralRe: Excellent workmvpGiorgi Dalakishvili11 Sep '08 - 5:45 
Thanks Smile | :)
 
Giorgi Dalakishvili
 
#region signature
my articles
#endregion

GeneralRe: Excellent workmemberMartin Howe6 Dec '08 - 13:50 
Yes this is a good piece of work.
 
It looks as if it could potentially be very helpful to anybody making a "commander" style application or tabbed explorer window style program; instead of attempting to slavishly replicate all the bells and whistles of Explorer using tons of COM interop, PIDLs, treeviews, listviews, etc (like some projects hosted on CP), just start a real window of whatever version of Explorer is present on the system. Instead of trying to create a file viewer, just start whatever is available or allow the end-user to specify their own (e.g., Irfanview for pictures, EditPlus for textfiles, etc).
 
Of course, as defaults, built-in ones doing it the hard way could be used, I suppose.
GeneralRe: Excellent workmvpGiorgi Dalakishvili7 Dec '08 - 7:02 
Thank you for your opinion Smile | :)
 

GeneralGreat piece of software!memberxzz01957 Jul '08 - 11:59 
Giorgi,
Your work here is very nice indeed keep up the fantastic work!
GeneralRe: Great piece of software!mvpGiorgi Dalakishvili8 Jul '08 - 9:21 
Thanks very much Smile | :)
 
Giorgi Dalakishvili
 
#region signature
my articles
#endregion

GeneralSuggestion : Resize tabbed windows when Tabifier window is resized.memberBill West21 Jun '08 - 14:11 
Suggestion:
 
Add an option (or make default behavior) to have the tabbed windows resize when the Window Tabifier window is resized.
 
As it is now, when the Tabifier window is maximized, all the tabbed windows look fine, but if I reduce the size of Tabifier, the tabbed windows get cut off.
GeneralRe: Suggestion : Resize tabbed windows when Tabifier window is resized.memberMarcus Deecke7 Nov '08 - 22:08 
And vice versa.
If Tabifier is not maximized, a window is added, then Tabifier is maximized, the added window is not maximized.
That looks a bit strange. Never mind, if you know about this behaviour, just keep Tabifier maximized.
Generalthanks i'm from china i like heremembermirhan20 Jun '08 - 3:54 
is good
GeneralA question on using the codememberThallikar26 Mar '08 - 2:38 
Is it possible to use your source code and make it work with the windows tab control? I am assuming that it will work. Thanks.
GeneralRe: A question on using the codemvpGiorgi Dalakishvili26 Mar '08 - 2:41 
Why don't you give it a try?
 
Giorgi Dalakishvili
 
#region signature
my articles
#endregion

GeneralRe: A question on using the codememberThallikar26 Mar '08 - 3:19 
Actually, that is what I am doing today. I will let you know how it goes. Currently, I am converting the code to VB.NET also.
 
Thanks.
GeneralRe: A question on using the codememberThallikar26 Mar '08 - 5:43 
Ok. I need your expert help. I am trying this in VB. Just trying to attach a window to a panel. I have been trying this for sometime with no luck. I am getting the window handle for the client. Setting the parent to be the panel's window handle. Then, I set the style and move the window to the panel's location and size. But i have been unable to get the window attached to the panel. Everything works fine but I just cannot get the window attached to the panel. What makes the window attach to another window? How do you do it? Just can't seem to figure that out.
 
Thanks.
GeneralRe: A question on using the codemvpGiorgi Dalakishvili26 Mar '08 - 6:41 
I can't tell you what's the problem. You seem to be doing everything what is needed to attach window to another one. If you can't get it work in VB why don't you just build a library from c# code and use it from your VB application?
 
Giorgi Dalakishvili
 
#region signature
my articles
#endregion

GeneralRe: A question on using the codememberThallikar26 Mar '08 - 6:56 
Thanks. I will try that out. I am planning to incorporate your code and use that to attach the windows that I want. The client application that I am working with has a CSharp version. So, I might just end up using that version and then I can use your code directly. Thanks, Giorgi.
Generalgreate job, but has some conflict with Office 2007membergianhut6 Mar '08 - 19:00 
This is absolutely a great idea. However, i find some bugs as using this it to tabify Microsoft Word 2007, Microsoft Excel 2007... The maximize and Close button also affect the host application (your application). I noticed that you tried to hide the title bar of the windows, but the application failed to to that to office 2007.
 
Keep up the good work!
 
Gia Nhut

GeneralGreat ....but noticed some issuesmemberaschip6 Mar '08 - 18:03 
I observed issues working with some of the tabified windows.
To start with, I tabified all the windows I am working on. It worked perfectly.
I had a yahoo messenger chat window as one of the windows, it failes to tabify it correctly.
Then I had Microsoft Outlook ,the currently selected message alone is displayed correctly, if I select any other mail message , it doesnt display it.
 
I then exited the tabifier, it rearranged my windows on task bar, that is, the sequence in which the windows were before tabifying and after tabifying was different.
 
I am using Windows XP version 2002 Service pack 2
GeneralNice app but...memberJoseph Mccornell22 Feb '08 - 7:01 
But I think there are some issues:
- The Menu tab is useless, add that two options to the menu that appears when you press the arrow on the top right. Also drag and drop can be used in other location.
- Changing the icon of the app with the icon of the app in the selected tab would be great.
- Add the icon of the app to the app selection list.
- Adding tray possibilities to your application would be another good feature.
 
Well, you see. I like very much your application. I just think it could be improved.
GeneralRe: Nice app but... [modified]mvpGiorgi Dalakishvili22 Feb '08 - 9:33 
Thanks for your comments and ideas.
 

Joseph Mccornell wrote:
The Menu tab is useless, add that two options to the menu that appears when you press the arrow on the top right. Also drag and drop can be used in other location.

 
The menu that appears when you press the arrow on the top right is owned by the tabstrip control so in order to add more items to it I'll have to look into source code of tabstrip control and modify it. Even if I do that, there won't be any space for drag and drop.
 
Joseph Mccornell wrote:
- Changing the icon of the app with the icon of the app in the selected tab would be great.

 
Great idea! I'll definitely add it
 

Joseph Mccornell wrote:
- Add the icon of the app to the app selection list.

 
In order to do that I'll need a custom checkedlistbox control which will allow to add items with images so I guess it will need quite some work.
 
Joseph Mccornell wrote:
- Adding tray possibilities to your application would be another good feature.

 
This is also good idea but should I have one option to minimize host window to tray implemented globally for the whole application or should I have this option for each host window separately?
 

BTW, I'll post a new version in nearest future which will have one new feature so don't forget to come back and check it Smile | :)
 
#region signature
my articles
#endregion
modified on Friday, February 22, 2008 4:19 PM

GeneralRe: Nice app but...memberJoseph Mccornell23 Feb '08 - 5:42 
About the custom checkedlistbox, probably there are some in codeproject, take a look.
 
To start i would add the feature minimize host window to tray.
 
Nice to see you are still working in this app. Thanks for your work. I think it can be very useful to many people including me Smile | :)
GeneralRe: Nice app but...mvpGiorgi Dalakishvili23 Feb '08 - 23:20 
One more question Joseph.
If I add the feature 'minimize host window to tray' what icon should be displayed in system tray? If I display program's main icon then it will be confusing. Do you think it is good idea to display the icon of the window which is currently selected?
 
#region signature
my articles
#endregion

GeneralRe: Nice app but... [modified]memberJoseph Mccornell27 Feb '08 - 10:31 
Well, in my opinion, using the icon of the selected window is the best option.
 
modified on Wednesday, February 27, 2008 4:38 PM

GeneralRe: Nice app but...mvpGiorgi Dalakishvili28 Feb '08 - 6:45 
I will implement it too.
 
#region signature
my articles
#endregion

GeneralRe: Nice app but...mvpGiorgi Dalakishvili20 Mar '08 - 2:25 
Hello
 
I have updated my application and now it includes some of the features you suggested. What do you think about it?
 
Giorgi Dalakishvili
 
#region signature
my articles
#endregion

GeneralRe: Nice app but...memberJoseph Mccornell25 Mar '08 - 8:47 
great, thanks
QuestionTaskbar?protectorMarc Clifton11 Feb '08 - 6:01 
I may be missing something here, but why is this better than what the taskbar already does?
 
Marc
 

AnswerRe: Taskbar?mvpGiorgi Dalakishvili11 Feb '08 - 6:46 
Hello Mark,
 
Why is tabbed browser better than an ordinary one?
 
Using my program you can host several related windows in one so you easily find and navigate between them. If you have many windows open then it will clean space in taskbar and allow to group related window together. I've sent an updated version to codeproject which allows you to drop folders on the host window and has several annoying bugs fixed so I suggest you have a look at it again when it's updated.
 
By the way, did you vote 1 for it? Rating has recently fallen from 4.84 to 4.56 with one vote.
 
#region signature
my articles
#endregion

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 29 Mar 2008
Article Copyright 2008 by Giorgi Dalakishvili
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid