Download:
Self-extracting file...
http://www.box.net/shared/djdv19zm00
Zip...
http://www.box.net/shared/lg2jlcydsr
I often want a window topmost -- this is example of a 'how-to' using AutoIt:
SCREENSHOT:
SCRIPT SOURCE:
#region ;**** Directives created by AutoIt3Wrapper_GUI ****#AutoIt3Wrapper_icon=_ICO\preferences-system.ico#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****#include#include #include Opt('MustDeclareVars', 1);-Func IsVisible($handle) If BitAND(WinGetState($handle), 2) Then Return 1 Else Return 0 EndIfEndFunc;-Func _Main() Local _ $btnBottom, _ $btnHelp, _ $btnLoc, _ $btnTop, _ $hCombo, _ $i, _ $msg, _ $sTitle, _ $var ;- $var = WinList() GUICreate('myWinSetTopMost', 450, 25) $hCombo = _ GUICtrlCreateCombo('', 2, 2, 366, 296) $btnLoc = @ScriptDir & '\_ICO\go-top.ico' $btnTop = _ GUICtrlCreateIcon($btnLoc, -1, 375, 4, 16, 16) $btnLoc = _ @ScriptDir & '\_ICO\go-bottom.ico' $btnBottom = _ GUICtrlCreateIcon($btnLoc, -1, 400, 4, 16, 16) $btnLoc = @ScriptDir & '\_ICO\help-browser.ico' $btnHelp = _ GUICtrlCreateIcon($btnLoc, -1, 425, 4, 16, 16) GUISetState() WinSetOnTop('myWinSetTopMost', '', 1) For $i = 1 To $var[0][0] If IsVisible($var[$i][1]) And _ not ($var[$i][0] = '') And _ not ($var[$i][0] = 'Start') And _ not ($var[$i][0] = _ 'Program Manager') _ Then _GUICtrlComboBox_AddString($hCombo, $var[$i][0]) EndIf Next Send('{down}') Do $msg = GUIGetMsg() $sTitle = _ _GUICtrlComboBox_GetEditText($hCombo) $sTitle = _ StringLeft($sTitle, StringLen($sTitle) - 1) Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $btnTop If not ($sTitle = '') Then TrayTip(@ScriptName, $sTitle & ' on top...', 3, 1) WinActivate($sTitle, '') Sleep(550) ;$sTitle=InputBox(@scriptname,'$sTitle',$sTitle) WinSetOnTop($sTitle, '', 1) EndIf Case $msg = $btnBottom If not ($sTitle = '') Then TrayTip(@ScriptName, $sTitle & ' NOT on top...', 3, 1) WinActivate($sTitle, '') Sleep(550) WinSetOnTop($sTitle, '', 0) EndIf Case $msg = $btnHelp ShellExecute( _ 'http://michaeltbeeitprof.blogspot.com/' & _ 'search?q=myWinSetTopMost') EndSelect Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete()EndFunc;-$Debug_CB = False_Main();-Exit
No comments:
Post a Comment