anixon Posted March 25, 2010 Share Posted March 25, 2010 Skype is running with an online icon [white tick in a green oval] displayed on the Windows Notification Taskbar. When maximized the Skype Window Title consists of a Skype Graphic then the text 'Skype' then a trademark 'TM' then '- Username'This code will not set the focus and maximize the Skype.WinSetState("[CLASS:Skype]", "", @SW_MAXIMIZE)and neither willWinActivate(.....can anyone help me with the magic.. Ant.. Link to comment Share on other sites More sharing options...
GodlessSinner Posted March 25, 2010 Share Posted March 25, 2010 (edited) To start maximized: Right click on Skype's link, -->Properties--> Window: Maximized Edited March 25, 2010 by wwwvgtulzcomua _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
anixon Posted March 25, 2010 Author Share Posted March 25, 2010 (edited) To start maximized: Right click on Skype's link, -->Properties--> Window: MaximizedThanks for that but Skype is already running with its Icon displayed on the Notification Area of the Taskbar what I need is the script to focus on Skype and maximise the window for the running application.. Ant Edited March 25, 2010 by anixon Link to comment Share on other sites More sharing options...
GodlessSinner Posted March 25, 2010 Share Posted March 25, 2010 If Maximize button have a CTRL ID, try ControlClick _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
anixon Posted March 25, 2010 Author Share Posted March 25, 2010 Thanks for that this does not work ControlClick("Skype", "", "ToolbarWindow32:INSTANCE:1") To perform the task manually to maximise the window you right click the Icon in the Windows Notification area of the Taskbar and then you have to select one of three menu items 'Open Skype' to open the window. Perhaps it is simply easier to prompt the user to open the window manually Ant.. Link to comment Share on other sites More sharing options...
GodlessSinner Posted March 27, 2010 Share Posted March 27, 2010 (edited) Skype-->Tools-->Options-->Advanced-->Hotkeys : Focus Skype (assign hotkey) WinSetState("[CLASS:Skype]", "", @SW_SHOW) > Possible, if you switch Skype to Classic Window(in Skype's options), but: - Window will be shown Without any controls! - Skype don't know that window is shown, therefore window can't be closed(need to click in tray menu "Open Skype" before) Edited March 27, 2010 by GodlessSinner _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
anixon Posted March 27, 2010 Author Share Posted March 27, 2010 Skype-->Tools-->Options-->Advanced-->Hotkeys : Focus Skype (assign hotkey) WinSetState("[CLASS:Skype]", "", @SW_SHOW) > Possible, if you switch Skype to Classic Window(in Skype's options), but: - Window will be shown Without any controls! - Skype don't know that window is shown, therefore window can't be closed(need to click in tray menu "Open Skype" before) Thanks for the reply cannot get your code to work even in either Skype or Classic mode even with the Skype window minimized onto the Taskbar. It should be noted that you still have the Skype Icon appearing on the Notification Area of the Taskbar [Right click gives you the Menu 'Change Online Status', 'Open Skype' and 'Quit' whereas if you click on the minimized Skype Window Button on the Taskbar it opens to the last size and xy position. WinSetState("[CLASS:Skype]", "", @SW_SHOW) has no effect of maximising the minimised Skype Window Assigning a hotkey to 'Focus Skype' works a treat but this would involve advising the end user what key combination had to be configured in tools my preference would be for WinSetState to open and close the Skype window that way you can check that Skype is running and maximize the screen. Ant.. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 27, 2010 Moderators Share Posted March 27, 2010 anixon, Here you go - this works for my Skype: expandcollapse popup#Include <GuiToolBar.au3> Global $hSysTray_Handle, $iSystray_ButtonNumber Global $sToolTipTitle = "Skype" Open_Skype() Exit Func Open_Skype() $iSystray_ButtonNumber = Get_Systray_Index($sToolTipTitle) If $iSystray_ButtonNumber = 0 Then MsgBox(16, "Error", "Icon not found in system tray") Exit Else Sleep(500) _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "right") Sleep(500) Send("{DOWN}{DOWN}{ENTER}") EndIf EndFunc Func Get_Systray_Index($sToolTipTitle) ; Find systray handle $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') If @error Then MsgBox(16, "Error", "System tray not found") Exit EndIf ; Get systray item count Local $iSystray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) If $iSystray_ButCount = 0 Then MsgBox(16, "Error", "No items found in system tray") Exit EndIf ; Look for wanted tooltip For $iSystray_ButtonNumber = 0 To $iSystray_ButCount - 1 If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSystray_ButtonNumber), $sToolTipTitle) > 0 Then ExitLoop Next If $iSystray_ButtonNumber = $iSystray_ButCount Then Return 0 ; Not found Else Return $iSystray_ButtonNumber ; Found EndIf EndFunc Enjoy the F1 Grand Prix tomorrow - I will be up early to watch it. Good luck to Mark Webber (although I will not cry too much if he comes 2nd to Jenson Button, who lives just down the road!). M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
anixon Posted March 27, 2010 Author Share Posted March 27, 2010 anixon, Here you go - this works for my Skype: expandcollapse popup#Include <GuiToolBar.au3> Global $hSysTray_Handle, $iSystray_ButtonNumber Global $sToolTipTitle = "Skype" Open_Skype() Exit Func Open_Skype() $iSystray_ButtonNumber = Get_Systray_Index($sToolTipTitle) If $iSystray_ButtonNumber = 0 Then MsgBox(16, "Error", "Icon not found in system tray") Exit Else Sleep(500) _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "right") Sleep(500) Send("{DOWN}{DOWN}{ENTER}") EndIf EndFunc Func Get_Systray_Index($sToolTipTitle) ; Find systray handle $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') If @error Then MsgBox(16, "Error", "System tray not found") Exit EndIf ; Get systray item count Local $iSystray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) If $iSystray_ButCount = 0 Then MsgBox(16, "Error", "No items found in system tray") Exit EndIf ; Look for wanted tooltip For $iSystray_ButtonNumber = 0 To $iSystray_ButCount - 1 If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSystray_ButtonNumber), $sToolTipTitle) > 0 Then ExitLoop Next If $iSystray_ButtonNumber = $iSystray_ButCount Then Return 0 ; Not found Else Return $iSystray_ButtonNumber ; Found EndIf EndFunc Enjoy the F1 Grand Prix tomorrow - I will be up early to watch it. Good luck to Mark Webber (although I will not cry too much if he comes 2nd to Jenson Button, who lives just down the road!). M23 How clever are we then, I guess with all your help I will have to talk about you in the most favourable terms... he he.... Yep we are looking forward to the F1 always good to see someone we know win on their own turf. In his presence I can remember the Doohan winning at Philip Island on from memory a 'Honda' that was exciting. I also had the privilege of being invited by Qantas to the first F1 their corporate box was above the 'Ferrari' pits the noise was horrific but the tea and sticky buns was well worth it... but all of that was in a previous life.. Thanks again Ant.. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now