modded to fix visibility back to 100% upon exit of the app.
#include <GUIConstants.au3>
If (Not IsDeclared('CB_GETCOUNT')) Then Global Const $CB_GETCOUNT = 0x146
If (Not IsDeclared('CB_SETCURSEL')) Then Global Const $CB_SETCURSEL = 0x14E
$perc = "100%"
$winName = ""
GUICreate("iWindow", 220, 135, 0, 0, -1, $WS_EX_TOPMOST)
$repop = GUICtrlCreateButton("Repopulate List", 10, 10, 200, 20)
$winLabel = GUICtrlCreateLabel("Window:", 10, 40)
$win = GUICtrlCreateCombo("Select a Window Title", 10, 55, 200, 100)
$transLabel = GUICtrlCreateLabel("Visibility:", 10, 90)
$trans = GUICtrlCreateCombo("Select Visibility", 10, 105, 200, 100)
GUICtrlSetData(-1, "0%|5%|10%|15%|20%|25%|30%|35%|40%|45%|50%|55%|60%|65%|70%|75%|80%|85%|90%|95%|100%")
repopList()
GUISetState()
Func repopList()
GUICtrlSetData($win, "|")
$winList = WinList()
For $i = 1 To $winList[0][0]
If $winList[$i][0] <> "" And $winList[$i][0] <> "Program Manager" And BitAND(WinGetState($winList[$i][0]), 2) Then
GUICtrlSetData($win, $winList[$i][0])
EndIf
Next
GUICtrlSetData($win, "Select a Window Title", "Select a Window Title")
EndFunc ;==>repopList
Func setTrans()
$perc = StringTrimRight($perc, 1)
$transNum = $perc * 2.55
WinSetTrans($winName, "", $transNum)
EndFunc ;==>setTrans
Do
$msg = GUIGetMsg()
Select
Case $msg = $repop
GUICtrlSetData($trans, "Select Visibility")
repopList()
Case $msg = $trans
$winName = GUICtrlRead($win)
$perc = GUICtrlRead($trans)
If $winName <> "Select a Window Title" Then
setTrans()
EndIf
Case $msg = $GUI_EVENT_CLOSE
GUISetState(@SW_HIDE)
ResetVisibility()
EndSelect
Until $msg = $GUI_EVENT_CLOSE
Func ResetVisibility()
For $i = 0 To _GUICtrlComboBoxGetCount($win) - 1
$perc = "100%"
_GUICtrlComboBoxSetCurSel($win, $i)
$winName = GUICtrlRead($win)
setTrans()
Next
EndFunc ;==>ResetVisibility
;===============================================================================
;
; Description: _GUICtrlComboBoxGetCount
; Parameter(s): $h_combobox - controlID
; Requirement: None
; Return Value(s): The return value is the number of items in the list box.
; If an error occurs, it is CB_ERR
; User CallTip: _GUICtrlComboBoxGetCount($h_combobox) Retrieve the number of items in the list box of a combo box (required: <ComboBox.au3>)
; Author(s): Gary Frost (custompcs@charter.net)
; Note(s): The index is zero-based, so the returned count is one greater
; than the index value of the last item.
;
;===============================================================================
Func _GUICtrlComboBoxGetCount($h_combobox)
Return GUICtrlSendMsg($h_combobox, $CB_GETCOUNT, 0, 0)
EndFunc ;==>_GUICtrlComboBoxGetCount
;===============================================================================
;
; Description: _GUICtrlComboBoxSetCurSel
; Parameter(s): $h_combobox - controlID
; $i_index - Specifies the zero-based index of the string to select
; Requirement: None
; Return Value(s): If the message is successful, the return value is the index of the item selected.
; If $i_index is greater than the number of items in the list or if $i_index is 1,
; the return value is CB_ERR and the selection is cleared
; User CallTip: _GUICtrlComboBoxSetCurSel($h_combobox,$i_index) Select a string in the list of a combo box (required: <ComboBox.au3>)
; Author(s): Gary Frost (custompcs@charter.net)
; Note(s): If this $i_index is 1, any current selection in the list is removed and the edit control is cleared
;
;===============================================================================
Func _GUICtrlComboBoxSetCurSel($h_combobox, $i_index)
Return GUICtrlSendMsg($h_combobox, $CB_SETCURSEL, $i_index, 0)
EndFunc ;==>_GUICtrlComboBoxSetCurSel