MARAN Posted October 4, 2009 Posted October 4, 2009 (edited) Well I developed this script to hide some windows, as you can see in the code. I've created a filter to show only the windows that have "sro_client.exe" as process but it still returning 2 unknown windows: "Default IME" and "M". Why?Yes a function deletes these strings but why it still appearing as "sro_client.exe" windows even with the IsSilkroad() function?expandcollapse popup#NoTrayIcon #include <Process.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListBox.au3> #include <WindowsConstants.au3> $MainGUI = GUICreate("Hai :)", 152, 200, 241, 201) $WindowList = GUICtrlCreateList("", 3, 27, 145, 123, BitOR($LBS_SORT,$LBS_HASSTRINGS,$WS_BORDER)) _GUICtrlListBox_SetColumnWidth($WindowList, 145) GUICtrlSetState($WindowList, $GUI_DISABLE) $HideWindow = GUICtrlCreateButton("&Hide", 3, 177, 42, 19) $WindowTitle = GUICtrlCreateInput("New title goes here!", 3, 153, 145, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL)) GUICtrlSetLimit($WindowTitle, 255) $ShowWindow = GUICtrlCreateButton("&Show", 45, 177, 42, 19) $RenameWindow = GUICtrlCreateButton("Rename", 90, 177, 57, 19) $RefreshList = GUICtrlCreateButton("Refresh Windows List (F5)", 3, 3, 147, 25) Dim $MainGUI_AccelTable[1][2] = [["{F5}", $RefreshList]] GUISetAccelerators($MainGUI_AccelTable) GUISetState(@SW_SHOW) UpdateList() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $RefreshList UpdateList() Case $HideWindow HideSilk() Case $ShowWindow ShowSilk() Case $RenameWindow RenameSilk() EndSwitch WEnd Func HideSilk() Local $SilkTitle = _GUICtrlListBox_GetText($WindowList, _GUICtrlListBox_GetCurSel($WindowList)) WinSetState($SilkTitle, "", @SW_HIDE) EndFunc Func ShowSilk() Local $SilkTitle = _GUICtrlListBox_GetText($WindowList, _GUICtrlListBox_GetCurSel($WindowList)) WinSetState($SilkTitle, "", @SW_SHOWMINNOACTIVE) EndFunc Func RenameSilk() Local $SilkTitle = _GUICtrlListBox_GetText($WindowList, _GUICtrlListBox_GetCurSel($WindowList)) WinSetTitle($SilkTitle, "", GUICtrlRead($WindowTitle)) UpdateList() EndFunc Func UpdateList() Local $List = WinList() _GUICtrlListBox_ResetContent($WindowList) GUICtrlSetState($WindowList, $GUI_DISABLE) _GUICtrlListBox_BeginUpdate($WindowList) For $i = 1 to $List[0][0] If $List[$i][0] <> "" And IsSilkroad($List[$i][1]) = 1 Then _GUICtrlListBox_AddString($WindowList, $List[$i][0]) EndIf Next _GUICtrlListBox_DeleteString($WindowList, _GUICtrlListBox_FindString($WindowList, "Default IME", True)) _GUICtrlListBox_DeleteString($WindowList, _GUICtrlListBox_FindString($WindowList, "M", True)) _GUICtrlListBox_EndUpdate($WindowList) GUICtrlSetState($WindowList, $GUI_ENABLE) EndFunc Func IsSilkroad($WindowHandle) If _ProcessGetName(WinGetProcess($WindowHandle)) = "sro_client.exe" Then Return 1 Else Return 0 EndIf EndFunc Edited October 4, 2009 by MARAN [center][size="4"]MARAN came from a place many miles away from yours...[/size][/center]
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