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
- Dim calTitle, eventTitle, todoTitle, speed, x,y
- 'Uses the Title of each window/layer
- calTitle="Calendar .:. Rainlendar2" 'Calendar Window Title
- eventTitle="Event List .:. Rainlendar2" 'Event Window Title
- todoTitle="Todo List .:. Rainlendar2" 'To Do List Window Title
- speed=50
- y=-400 'This has to be set because x & y position isn't determined until com is called
- x=1280
- '1056
- '1258
- 'Called when object is being dragged
- Function Object_OnDrag(x,y,newX,newY)
- With Object
- .Left=.Left
- ' If newY > System.WorkareaTop And Object.Bottom < System.WorkareaBottom Then
- ' Else
- ' .Top=.Top
- ' End If
- End With
- End Function
- 'Checks to see if app is running. If not starts it.
- Function appCheck
- Set oAutoIt = CreateObject("AutoItX3.Control")
- If oAutoIt.WinExists(calTitle)=0 Then
- oAutoIt.Run "C:\Program Files\Rainlendar2\Rainlendar2.exe"
- Object.Sleep 1000
- Call posWindow
- Else
- Call posWindow
- End If
- Set oAutoIt = Nothing
- End Function
- 'Sets layers/windows to hidden by default
- Function posWindow
- Set oAutoIt = CreateObject("AutoItX3.Control")
- Object.Left = 1258
- oAutoIt.WinMove calTitle, "", 1280, -178
- oAutoIt.WinMove eventTitle, "", 1280, 214
- oAutoIt.WinMove todoTitle, "", 1280, 288
- Set oAutoIt=nothing
- End Function
- 'Toggle function to hide/show windows
- Function toggleWindow
- If x=1280 Then
- Object.KillTimer 200
- Object.SetTimer 100, speed
- ElseIf x<= 1080 Then
- Object.KillTimer 100
- Object.SetTimer 200, speed
- End If
- End Function
- 'Called when L-click is released
- Function Object_OnLButtonUp(x, y, dragged)
- If Not dragged Then
- Call toggleWindow 'Calls toggle function
- End If
- End Function
- 'Called when the script is executed
- Sub Object_OnScriptEnter
- 'Call appCheck
- Call posWindow
- End Sub
- Sub Object_OnTimer100
- Set oAutoIt = CreateObject("AutoItX3.Control")
- 'Gets current screen co-ords
- x = oAutoIt.WinGetPosX(calTitle)
- y = oAutoIt.WinGetPosY(calTitle)
- 'width = oAutoIt.WinGetPosWidth(calTitle) 'For reference.
- 'height = oAutoIt.WinGetPosHeight(calTitle)
- If x>1080 Then
- object.Left=object.Left-25
- oAutoIt.WinMove calTitle, "", x-25, -178 'Calendar
- oAutoIt.WinMove eventTitle, "", x-25, 214'235 'Event List.
- oAutoIt.WinMove todoTitle, "", x-25, 288 'To Do List
- ElseIf x<=1080 Then
- Object.KillTimer 100
- 'oAutoIt.WinActivate calTitle, "" 'Brings window into focues
- End If
- Set oAutoIt=nothing
- End Sub
- Sub Object_OnTimer200
- Set oAutoIt = CreateObject("AutoItX3.Control")
- x = oAutoIt.WinGetPosX(calTitle)
- y = oAutoIt.WinGetPosY(calTitle)
- 'width = oAutoIt.WinGetPosWidth(calTitle)
- 'height = oAutoIt.WinGetPosHeight(calTitle)
- If x=1280 Then
- Object.KillTimer 200
- Else
- object.Left=object.Left+25
- oAutoIt.WinMove calTitle, "",x+25, -178
- oAutoIt.WinMove eventTitle, "", x+25, 214'235
- oAutoIt.WinMove todoTitle, "", x+25, 288
- End If
- Set oAutoIt=nothing
- End Sub
- 'Called when the script is terminated
- Sub Object_OnScriptExit
- End Sub