diff --git a/.gitignore b/.gitignore
index 9491a2f..ed1be58 100644
--- a/.gitignore
+++ b/.gitignore
@@ -360,4 +360,6 @@ MigrationBackup/
.ionide/
# Fody - auto-generated XML schema
-FodyWeavers.xsd
\ No newline at end of file
+FodyWeavers.xsd
+
+*.MD
\ No newline at end of file
diff --git a/Splitter/DropShadow.cs b/Splitter/DropShadow.cs
index e019e82..fdc9059 100644
--- a/Splitter/DropShadow.cs
+++ b/Splitter/DropShadow.cs
@@ -15,8 +15,6 @@ public class DropShadow
#region Fields
- private bool _isAeroEnabled = false;
- private bool _isDraggingEnabled = false;
private const int WM_NCHITTEST = 0x84;
private const int WS_MINIMIZEBOX = 0x20000;
private const int HTCLIENT = 0x1;
diff --git a/Splitter/FormSplitter.cs b/Splitter/FormSplitter.cs
index 4aa9416..99efdb6 100644
--- a/Splitter/FormSplitter.cs
+++ b/Splitter/FormSplitter.cs
@@ -1,13 +1,128 @@
-namespace Splitter
+namespace Splitter
{
public partial class FormSplitter : Form
{
+ private TaskbarPosition _taskbarPosition;
+
public FormSplitter()
{
InitializeComponent();
+
+ // Detect taskbar position
+ _taskbarPosition = TaskbarHelper.GetTaskbarPosition();
+ System.Diagnostics.Debug.WriteLine($">>> Detected Taskbar Position: {_taskbarPosition}");
+ System.Diagnostics.Debug.WriteLine($">>> Is Vertical Taskbar: {TaskbarHelper.IsVerticalTaskbar()}");
+
+ // Apply appropriate icon and dimensions based on taskbar position
+ ConfigureForTaskbarPosition();
+
+ // Apply drop shadow
(new Core.DropShadow()).ApplyShadows(this);
}
+ ///
+ /// Configures form icon, size and position based on taskbar location
+ ///
+ private void ConfigureForTaskbarPosition()
+ {
+ System.Diagnostics.Debug.WriteLine(">>> ConfigureForTaskbarPosition called");
+
+ if (TaskbarHelper.IsVerticalTaskbar())
+ {
+ System.Diagnostics.Debug.WriteLine(">>> Configuring for VERTICAL taskbar (Left/Right)");
+
+ // Use horizontal icon for vertical taskbar
+ LoadHorizontalIcon();
+
+ // Adjust form dimensions for vertical taskbar
+ // Width should be smaller, height should be larger
+
+ //this.Width = 8; // Thin horizontal separator
+ //this.Height = 100; // Longer bar
+
+ System.Diagnostics.Debug.WriteLine($">>> Form dimensions set to: Width={this.Width}, Height={this.Height}");
+ }
+ else
+ {
+ System.Diagnostics.Debug.WriteLine(">>> Configuring for HORIZONTAL taskbar (Top/Bottom)");
+
+ // Use vertical icon for horizontal taskbar (default)
+ LoadVerticalIcon();
+
+ // Keep existing dimensions for horizontal taskbar
+ this.Width = 100;
+ this.Height = 8;
+
+ System.Diagnostics.Debug.WriteLine($">>> Form dimensions set to: Width={this.Width}, Height={this.Height}");
+ }
+ }
+
+ ///
+ /// Loads the horizontal separator icon (for vertical taskbar)
+ ///
+ private void LoadHorizontalIcon()
+ {
+ try
+ {
+ string iconPath = System.IO.Path.Combine(
+ Application.StartupPath,
+ "icons",
+ "separator_horizontal.ico"
+ );
+
+ System.Diagnostics.Debug.WriteLine($">>> Loading horizontal icon from: {iconPath}");
+ System.Diagnostics.Debug.WriteLine($">>> File exists: {System.IO.File.Exists(iconPath)}");
+
+ if (System.IO.File.Exists(iconPath))
+ {
+ this.Icon = new Icon(iconPath);
+ System.Diagnostics.Debug.WriteLine(">>> Horizontal icon loaded successfully ✓");
+ }
+ else
+ {
+ System.Diagnostics.Debug.WriteLine(">>> ERROR: Horizontal icon file not found!");
+ }
+ }
+ catch (Exception ex)
+ {
+ // Log error but don't crash the application
+ System.Diagnostics.Debug.WriteLine($">>> ERROR loading horizontal icon: {ex.Message}");
+ }
+ }
+
+ ///
+ /// Loads the vertical separator icon (for horizontal taskbar)
+ ///
+ private void LoadVerticalIcon()
+ {
+ try
+ {
+ string iconPath = System.IO.Path.Combine(
+ Application.StartupPath,
+ "icons",
+ "separator.ico"
+ );
+
+ System.Diagnostics.Debug.WriteLine($">>> Loading vertical icon from: {iconPath}");
+ System.Diagnostics.Debug.WriteLine($">>> File exists: {System.IO.File.Exists(iconPath)}");
+
+ if (System.IO.File.Exists(iconPath))
+ {
+ this.Icon = new Icon(iconPath);
+ System.Diagnostics.Debug.WriteLine(">>> Vertical icon loaded successfully ✓");
+ }
+ else
+ {
+ System.Diagnostics.Debug.WriteLine(">>> ERROR: Vertical icon file not found!");
+ }
+ }
+ catch (Exception ex)
+ {
+ // Log error but don't crash the application
+ System.Diagnostics.Debug.WriteLine($">>> ERROR loading vertical icon: {ex.Message}");
+ }
+ }
+
private void btnClose_Click(object sender, EventArgs e)
{
Application.Exit();
diff --git a/Splitter/Splitter.csproj b/Splitter/Splitter.csproj
index fa9bb80..4c032d9 100644
--- a/Splitter/Splitter.csproj
+++ b/Splitter/Splitter.csproj
@@ -10,7 +10,12 @@
-
+
+ Always
+
+
+ Always
+
\ No newline at end of file
diff --git a/Splitter/TaskbarHelper.cs b/Splitter/TaskbarHelper.cs
new file mode 100644
index 0000000..2ec6e51
--- /dev/null
+++ b/Splitter/TaskbarHelper.cs
@@ -0,0 +1,117 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace Splitter
+{
+ ///
+ /// Represents the position of the Windows taskbar on the screen
+ ///
+ public enum TaskbarPosition
+ {
+ ///
+ /// Taskbar is positioned on the left side of the screen
+ ///
+ Left = 0,
+
+ ///
+ /// Taskbar is positioned at the top of the screen
+ ///
+ Top = 1,
+
+ ///
+ /// Taskbar is positioned on the right side of the screen
+ ///
+ Right = 2,
+
+ ///
+ /// Taskbar is positioned at the bottom of the screen (default)
+ ///
+ Bottom = 3,
+
+ ///
+ /// Taskbar position could not be determined
+ ///
+ Unknown = -1
+ }
+
+ ///
+ /// Helper class to detect Windows taskbar position and properties
+ ///
+ public static class TaskbarHelper
+ {
+ [StructLayout(LayoutKind.Sequential)]
+ private struct APPBARDATA
+ {
+ public uint cbSize;
+ public IntPtr hWnd;
+ public uint uCallbackMessage;
+ public uint uEdge;
+ public RECT rc;
+ public int lParam;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ private struct RECT
+ {
+ public int left;
+ public int top;
+ public int right;
+ public int bottom;
+ }
+
+ [DllImport("shell32.dll", SetLastError = true)]
+ private static extern IntPtr SHAppBarMessage(uint dwMessage, ref APPBARDATA pData);
+
+ private const uint ABM_GETTASKBARPOS = 5;
+
+ ///
+ /// Gets the current position of the Windows taskbar
+ ///
+ /// TaskbarPosition enum indicating where the taskbar is located
+ public static TaskbarPosition GetTaskbarPosition()
+ {
+ try
+ {
+ APPBARDATA data = new APPBARDATA
+ {
+ cbSize = (uint)Marshal.SizeOf(typeof(APPBARDATA))
+ };
+
+ IntPtr result = SHAppBarMessage(ABM_GETTASKBARPOS, ref data);
+
+ if (result == IntPtr.Zero)
+ {
+ // If API fails, return Bottom as default
+ return TaskbarPosition.Bottom;
+ }
+
+ return (TaskbarPosition)data.uEdge;
+ }
+ catch
+ {
+ // In case of error, return Bottom as default
+ return TaskbarPosition.Bottom;
+ }
+ }
+
+ ///
+ /// Checks if the taskbar is in vertical position (Left or Right)
+ ///
+ /// True if taskbar is on left or right side
+ public static bool IsVerticalTaskbar()
+ {
+ var position = GetTaskbarPosition();
+ return position == TaskbarPosition.Left || position == TaskbarPosition.Right;
+ }
+
+ ///
+ /// Checks if the taskbar is in horizontal position (Top or Bottom)
+ ///
+ /// True if taskbar is on top or bottom
+ public static bool IsHorizontalTaskbar()
+ {
+ var position = GetTaskbarPosition();
+ return position == TaskbarPosition.Top || position == TaskbarPosition.Bottom;
+ }
+ }
+}
diff --git a/Splitter/icons/separator_horizontal.ico b/Splitter/icons/separator_horizontal.ico
new file mode 100644
index 0000000..9a20ec2
Binary files /dev/null and b/Splitter/icons/separator_horizontal.ico differ
diff --git a/TaskSplitter11/MainForm.cs b/TaskSplitter11/MainForm.cs
index f065c1f..c15ada9 100644
--- a/TaskSplitter11/MainForm.cs
+++ b/TaskSplitter11/MainForm.cs
@@ -1,6 +1,7 @@
+using IWshRuntimeLibrary;
+using Splitter;
using System.Diagnostics;
using System.Runtime.InteropServices;
-using IWshRuntimeLibrary;
using WindowsShortcutFactory;
using File = System.IO.File;
@@ -10,7 +11,6 @@ public partial class MainForm : Form
{
public enum ShowWindowCommands : int
{
-
SW_HIDE = 0,
SW_SHOWNORMAL = 1,
SW_NORMAL = 1,
@@ -32,12 +32,10 @@ public static extern IntPtr ShellExecute(
string lpszOp,
string lpszFile,
string lpszParams,
- string lpszDir,
+ string? lpszDir,
ShowWindowCommands FsShowCmd
);
-
-
public MainForm()
{
InitializeComponent();
@@ -45,39 +43,42 @@ public MainForm()
private void btnCreate_Click(object sender, EventArgs e)
{
-
//Setup & config
var docsPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
- string appPath = Path.GetDirectoryName(Application.ExecutablePath);
+ string appPath = Path.GetDirectoryName(Application.ExecutablePath) ?? string.Empty;
string shortcutsPath = Path.Join(docsPath, "TaskSeparator11", "Shortcuts");
Directory.CreateDirectory(shortcutsPath);
- //Ensure files are in thwe right place
+ //Ensure files are in the right place
EnsureSplitterFilesAreAvailable(appPath, shortcutsPath);
-
-
//Make a copy of the Splitter exe
string splitterExe = Path.Join(appPath, "Splitter.exe");
string splitterExeLocation = GetNewLinkName(shortcutsPath, "exe");
File.Copy(splitterExe, splitterExeLocation);
-
//Create a shortcut to the Splitter exe
string linkLocation = GetNewLinkName(shortcutsPath, "lnk");
- //Create shortcut
+ // Detect taskbar position and choose appropriate icon
+ var taskbarPosition = TaskbarHelper.GetTaskbarPosition();
+ bool isVerticalTaskbar = TaskbarHelper.IsVerticalTaskbar();
+
+ // Determine which icon to use based on taskbar position
+ string iconFileName = isVerticalTaskbar ? "separator_horizontal.ico" : "separator.ico";
+ string iconPath = Path.Join(shortcutsPath, "icons", iconFileName);
+
+ //Create shortcut with appropriate icon
using var shortcut = new WindowsShortcut
{
Path = splitterExeLocation,
+ IconLocation = new IconLocation(iconPath, 0),
};
shortcut.Save(linkLocation);
-
- ShellExecute(IntPtr.Zero, "open", linkLocation, "--gui", null, ShowWindowCommands.SW_NORMAL);
+ ShellExecute(IntPtr.Zero, "open", linkLocation, "--gui", lpszDir: null, ShowWindowCommands.SW_NORMAL);
Application.Exit();
-
}
private void EnsureSplitterFilesAreAvailable(string appPath, string shortcutsPath)
@@ -87,7 +88,7 @@ private void EnsureSplitterFilesAreAvailable(string appPath, string shortcutsPat
var dir = new DirectoryInfo(appPath);
var files = dir.GetFiles("Splitter*");
- foreach(var f in files)
+ foreach (var f in files)
{
var source = Path.Join(appPath, f.Name);
var dest = Path.Join(shortcutsPath, f.Name);
@@ -95,14 +96,28 @@ private void EnsureSplitterFilesAreAvailable(string appPath, string shortcutsPat
File.Copy(source, dest, true);
}
+ // Also copy icons folder
+ string iconsSourcePath = Path.Join(appPath, "icons");
+ string iconsDestPath = Path.Join(shortcutsPath, "icons");
-
+ if (Directory.Exists(iconsSourcePath))
+ {
+ Directory.CreateDirectory(iconsDestPath);
+
+ var iconFiles = new DirectoryInfo(iconsSourcePath).GetFiles("*.ico");
+ foreach (var iconFile in iconFiles)
+ {
+ var source = Path.Join(iconsSourcePath, iconFile.Name);
+ var dest = Path.Join(iconsDestPath, iconFile.Name);
+ File.Copy(source, dest, true);
+ }
+ }
}
private string GetNewLinkName(string path, string ext)
{
int count = 1;
- char c = ext == "exe" ? '_' : ' ';
+ char c = ext == "exe" ? '_' : ' ';
string shortcutLink = Path.Join(path, $"{c}.{ext}");
do
@@ -113,10 +128,5 @@ private string GetNewLinkName(string path, string ext)
return shortcutLink;
}
-
- private void label3_Click(object sender, EventArgs e)
- {
-
- }
}
}
\ No newline at end of file
diff --git a/TaskSplitter11/TaskSplitter11.csproj b/TaskSplitter11/TaskSplitter11.csproj
index 1d67c54..32cbe05 100644
--- a/TaskSplitter11/TaskSplitter11.csproj
+++ b/TaskSplitter11/TaskSplitter11.csproj
@@ -2,7 +2,7 @@
WinExe
- net6.0-windows
+ net9.0-windows7.0
enable
true
enable
@@ -10,6 +10,7 @@
TaskSeparator11
icons8-taskbar-96.png
1.0.2
+ TaskSplitter11.Program
@@ -29,7 +30,7 @@
-
+
diff --git a/TaskSplitter11/images/vertical.png b/TaskSplitter11/images/vertical.png
new file mode 100644
index 0000000..9e18e2c
Binary files /dev/null and b/TaskSplitter11/images/vertical.png differ
diff --git a/TaskbarHelper.cs b/TaskbarHelper.cs
new file mode 100644
index 0000000..7d56917
--- /dev/null
+++ b/TaskbarHelper.cs
@@ -0,0 +1,15 @@
+public static class TaskbarHelper
+{
+ public static TaskbarPosition GetTaskbarPosition()
+ {
+ // Windows API ile taskbar pozisyonunu tespit et
+ // Örnek implementasyon...
+ return TaskbarPosition.Bottom; // veya tespit edilen pozisyon
+ }
+
+ public static bool IsVerticalTaskbar()
+ {
+ var position = GetTaskbarPosition();
+ return position == TaskbarPosition.Left || position == TaskbarPosition.Right;
+ }
+}
\ No newline at end of file
diff --git a/readme.md b/readme.md
index 9097cf7..87cde01 100644
--- a/readme.md
+++ b/readme.md
@@ -1,8 +1,6 @@
-
-
## About
-Task Separator 11 allows you to add one or more splitters to the Windows 11 Taskbar. This gives you greater freedom to arrange your often used programs into groups
+Task Separator 11 allows you to add one or more splitters (based on your taskbar location supports both vertical and horizontal orientations) to the Windows 11 Taskbar. This gives you greater freedom to arrange your often used programs into groups!

@@ -15,6 +13,4 @@ Install the latest release directly from the releases tab:
## Copyright
-Task Separator 11 is licenced under the MIT licence.
-
-
+Task Separator 11 is licensed under the MIT license.
\ No newline at end of file