Random Musings from the Intellectually Gifted. How's that for no ego? :pfft
Or how to add a tab to Rainlendar
Published on October 4, 2007 By SirSmiley In DesktopX
Or how to add a tab to any window for that matter.

This requires the AutoItX Com object that comes with the full install & takes care of registering it for you. Also, it includes substantial documentation.

Since I use Rainlendar 2 then you might need to change the "Window Titles" use the Au3Info.exe that is in the AutoIt Folder. Double Click it, select freeze from the options menu and drag the finder tool over each Rainlendar window to get the title.

http://www.autoitscript.com/

Code: vbscript
  1. Dim calTitle, eventTitle, todoTitle, speed, x,y
  2. 'Uses the Title of each window/layer
  3. calTitle="Calendar .:. Rainlendar2"            'Calendar Window Title
  4. eventTitle="Event List .:. Rainlendar2"    'Event Window Title
  5. todoTitle="Todo List .:. Rainlendar2"        'To Do List Window Title
  6. speed=50
  7. y=-400    'This has to be set because x & y position isn't determined until com is called
  8. x=1280
  9. '1056
  10. '1258
  11. 'Called when object is being dragged
  12. Function Object_OnDrag(x,y,newX,newY)
  13.             With Object
  14.                 .Left=.Left
  15.             '    If newY > System.WorkareaTop And Object.Bottom < System.WorkareaBottom Then
  16.             '    Else
  17.             '    .Top=.Top
  18.             '    End If
  19.             End With
  20. End Function
  21. 'Checks to see if app is running. If not starts it.
  22. Function appCheck
  23.     Set oAutoIt = CreateObject("AutoItX3.Control")
  24.         If oAutoIt.WinExists(calTitle)=0 Then
  25.             oAutoIt.Run "C:\Program Files\Rainlendar2\Rainlendar2.exe"
  26.             Object.Sleep 1000
  27.             Call posWindow
  28.         Else
  29.             Call posWindow
  30.         End If   
  31.     Set oAutoIt = Nothing
  32. End Function
  33. 'Sets layers/windows to hidden by default
  34. Function posWindow
  35.     Set oAutoIt = CreateObject("AutoItX3.Control")
  36.       Object.Left = 1258
  37.         oAutoIt.WinMove calTitle, "", 1280, -178
  38.         oAutoIt.WinMove eventTitle, "", 1280, 214
  39.         oAutoIt.WinMove todoTitle, "", 1280, 288
  40.     Set oAutoIt=nothing   
  41. End Function
  42. 'Toggle function to hide/show windows
  43. Function toggleWindow
  44.     If x=1280 Then
  45.         Object.KillTimer 200
  46.         Object.SetTimer 100, speed       
  47.     ElseIf x<= 1080 Then
  48.         Object.KillTimer 100
  49.         Object.SetTimer 200, speed
  50.     End If
  51. End Function
  52. 'Called when L-click is released
  53. Function Object_OnLButtonUp(x, y, dragged)
  54.     If Not dragged Then
  55.         Call toggleWindow    'Calls toggle function
  56.     End If
  57. End Function
  58. 'Called when the script is executed
  59. Sub Object_OnScriptEnter
  60. 'Call appCheck
  61. Call posWindow
  62. End Sub
  63. Sub Object_OnTimer100
  64.     Set oAutoIt = CreateObject("AutoItX3.Control")
  65.         'Gets current screen co-ords
  66.         x = oAutoIt.WinGetPosX(calTitle)   
  67.         y = oAutoIt.WinGetPosY(calTitle)
  68.         'width = oAutoIt.WinGetPosWidth(calTitle)    'For reference.
  69.         'height = oAutoIt.WinGetPosHeight(calTitle)
  70.             If x>1080 Then
  71.                 object.Left=object.Left-25
  72.                 oAutoIt.WinMove calTitle, "", x-25, -178    'Calendar
  73.                 oAutoIt.WinMove eventTitle, "", x-25, 214'235    'Event List.
  74.                 oAutoIt.WinMove todoTitle, "", x-25, 288    'To Do List
  75.             ElseIf x<=1080 Then
  76.                 Object.KillTimer 100
  77.                 'oAutoIt.WinActivate calTitle, ""    'Brings window into focues
  78.             End If
  79.     Set oAutoIt=nothing
  80. End Sub
  81. Sub Object_OnTimer200
  82.     Set oAutoIt = CreateObject("AutoItX3.Control")
  83.         x = oAutoIt.WinGetPosX(calTitle)
  84.         y = oAutoIt.WinGetPosY(calTitle)
  85.         'width = oAutoIt.WinGetPosWidth(calTitle)
  86.         'height = oAutoIt.WinGetPosHeight(calTitle)
  87.             If x=1280 Then
  88.                 Object.KillTimer 200
  89.             Else
  90.                 object.Left=object.Left+25
  91.                 oAutoIt.WinMove calTitle, "",x+25, -178
  92.                 oAutoIt.WinMove eventTitle, "", x+25, 214'235
  93.                 oAutoIt.WinMove todoTitle, "", x+25, 288               
  94.             End If
  95.     Set oAutoIt=nothing
  96. End Sub
  97. 'Called when the script is terminated
  98. Sub Object_OnScriptExit
  99. End Sub



Comments
on Oct 05, 2007
Interesting.

Reminds me of Nubs:

While screen space is no longer the problem it used to be, organization has become a messy chore for a lot of users. What if there was an easy way to organize your running applications and windows, and put them out of the way when not in use?

Get organized - use nubs to quickly and easily clean up your workspace and let you get back to focusing on what you want to do!

Nubs is an application for Windows similar to Sticky Windows (Mac OSX) developed by Andrew Powell, of Shellscape Software. Nubs is designed to maximize window management and organization with stylish and themeable tabs. It only takes a few seconds to learn, and is painless to use.

Nubs isn't just for fancy, tabbed Windows. Nubs does what the Windows taskbar can't - Nubs makes use of your entire screen. Multiple monitors? Not a problem for Nubs!


on Oct 05, 2007
That's what I'm using it with and why the tab probably looks familiar.

Sranshaft made one in DesktopX about the same time as Andrew it's called GhostTabs.
I'm thinking of doing a gadget similar to StickyWindows.