tommeke228 Posted April 22, 2008 Share Posted April 22, 2008 (edited) if sro_client.exe selected in a listbox then must a button be enabled else disabled Edited April 22, 2008 by tommeke228 Link to comment Share on other sites More sharing options...
spudw2k Posted April 22, 2008 Share Posted April 22, 2008 #Include <GuiListBox.au3> If _GUICtrlListBox_GetSel($hWnd,$iIndex) = True Then GUICtrlSetState($btn,$GUI_DISABLE) Else GUICtrlSetState($btn,$GUI_ENABLE) EndIf Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
tommeke228 Posted April 22, 2008 Author Share Posted April 22, 2008 (edited) can you explain the things thx If _GUICtrlListBox_GetSel($hWnd,$iIndex) = True Then i want that if sro_client is selected in listbox then button is enable Edited April 22, 2008 by tommeke228 Link to comment Share on other sites More sharing options...
spudw2k Posted April 22, 2008 Share Posted April 22, 2008 (edited) The helpfile explains what functions do. _GUICtrlListBox_GetSel($hWnd,$iIndex) $hWnd = the Handle of the listbox, $iIndex is the index of a row in the listbox. If sro_client.exe is always on the same row then use that static index (zero-based), otherwise you can loop through the rows of the list box. Use_GUICtrlListBox_GetCount($hWnd) Edited April 22, 2008 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
tommeke228 Posted April 22, 2008 Author Share Posted April 22, 2008 but theres a whole list of processes if they click another process then nothing happens if they select process sro_client then button enabled xD Link to comment Share on other sites More sharing options...
spudw2k Posted April 22, 2008 Share Posted April 22, 2008 Is this listbox something you put together or is it external to the script? Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
tommeke228 Posted April 22, 2008 Author Share Posted April 22, 2008 uuhm this is my code at the end it says $ProcID i want that id first in the listbox and if that id selected then button enabled expandcollapse popup$GUI = GUICreate("", 200, 200) $Form1 = GUICreate("No Dc Patcher", 272, 215, 193, 125) $List1 = GUICtrlCreateList( "", 16, 24, 161, 136) $Button1 = GUICtrlCreateButton("Refresh", 184, 24, 73, 137, 0) $Button2 = GUICtrlCreateButton("Patch", 16, 168, 161, 33, 0) GUICtrlSetState(-1, $GUI_DISABLE) $Group1 = GUICtrlCreateGroup(" No Dc ", 8, 8, 257, 201) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $Button2 Then PatchSro() EndIf If $msg = $Button1 Then Refresh() EndIf If $msg = $GUI_EVENT_CLOSE Then Exit EndIf Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button2 $PL = ProcessList() GUICtrlSetData($list1, "lol") WinSetTitle($GUI, "", "Processes " & $PL[0][0]) For $i = 1 To $PL[0][0] GUICtrlSetData($list1, $PL[$i][1] & " " & $PL[$i][0]) Next EndSelect WEnd Func Refresh() GUICtrlSetState($button2,$GUI_ENABLE) EndFunc Func PatchSro() If ProcessExists("sro_client.exe") Then $ProcID = ProcessExists("sro_client.exe") $OpenProc = _MemoryOpen($ProcID) ;JMP 00bc9e20 _MemoryWrite(0x0073f52e, $OpenProc, 0xe9, "byte[1]") _MemoryWrite(0x0073f52f, $OpenProc, 0xe0, "byte[1]") _MemoryWrite(0x0073f530, $OpenProc, 0xa8, "byte[1]") _MemoryWrite(0x0073f531, $OpenProc, 0x48, "byte[1]") _MemoryWrite(0x0073f533, $OpenProc, 0x90, "byte[1]") ;NOP ;MOV EAX, 492E20 _MemoryWrite(0x00bc9e13, $OpenProc, 0xb8, "byte[1]") _MemoryWrite(0x00bc9e14, $OpenProc, 0x20, "byte[1]") _MemoryWrite(0x00bc9e15, $OpenProc, 0x2e, "byte[1]") _MemoryWrite(0x00bc9e16, $OpenProc, 0x49, "byte[1]") ;CALL EAX _MemoryWrite(0x00bc9e18, $OpenProc, 0xff, "byte[1]") _MemoryWrite(0x00bc9e19, $OpenProc, 0xd0, "byte[1]") ;POP EDI _MemoryWrite(0x00bc9e1a, $OpenProc, 0x5f, "byte[1]") ;ADD ESP, 10 _MemoryWrite(0x00bc9e1b, $OpenProc, 0x83, "byte[1]") _MemoryWrite(0x00bc9e1c, $OpenProc, 0xc4, "byte[1]") _MemoryWrite(0x00bc9e1d, $OpenProc, 0x10, "byte[1]") ;RETN _MemoryWrite(0x00bc9e1e, $OpenProc, 0xc3, "byte[1]") MsgBox(0, "Patch Successful", "No disconnect has been applied to process " & $ProcID) Else MsgBox(0, "Message", "No process or wrong process selected") EndIf EndFunc Link to comment Share on other sites More sharing options...
zackrspv Posted April 23, 2008 Share Posted April 23, 2008 (edited) if sro_client.exe selected in a listbox then must a button be enabled else disabled So, something like this? expandcollapse popup#include <guiconstants.au3> $form = GUICreate("Test", 600, 600) $list = GUICtrlCreateList("", 0, 0, 599, 570, BitOR($LBS_NOTIFY, $WS_VSCROLL, $LBS_SORT, $WS_BORDER)) $refresh = GUICtrlCreateButton("Refresh", 0, 570, 90, 25) $Patch = GUICtrlCreateButton("Patch", 150, 570, 90, 25) GUICtrlSetState(-1, $GUI_HIDE) GUISetState() Refresh() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $refresh Call("Refresh") Case $list $item = GUICtrlRead($list, 1) If $item <> "sro_client.exe" Then Else GUICtrlSetState($Patch, $GUI_SHOW) EndIf Case $Patch Call("Patch") EndSwitch WEnd Func Refresh() $list2 = ProcessList() For $i = 1 To $list2[0][0] GUICtrlSetData($list, $list2[$i][0], "sro_client.exe") Next EndFunc Func Patch() ConsoleWrite("At patch" & @CRLF) EndFunc Builds a GUI window, builds a list, populates the list with processes, allows the user to select a process, which automatically checks if the selected process is the 'sro_client.exe' file. If not, does nothing, if so, enables a patch button; if clicked calls a patch function. Refresh, refreshes the list. NOTE: I didn't really read the rest of the post, just the first part; so if already accomplished, just disregard my code there. Edited April 23, 2008 by zackrspv -_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë. Link to comment Share on other sites More sharing options...
tommeke228 Posted April 23, 2008 Author Share Posted April 23, 2008 So, something like this? expandcollapse popup#include <guiconstants.au3> $form = GUICreate("Test", 600, 600) $list = GUICtrlCreateList("", 0, 0, 599, 570, BitOR($LBS_NOTIFY, $WS_VSCROLL, $LBS_SORT, $WS_BORDER)) $refresh = GUICtrlCreateButton("Refresh", 0, 570, 90, 25) $Patch = GUICtrlCreateButton("Patch", 150, 570, 90, 25) GUICtrlSetState(-1, $GUI_HIDE) GUISetState() Refresh() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $refresh Call("Refresh") Case $list $item = GUICtrlRead($list, 1) If $item <> "sro_client.exe" Then Else GUICtrlSetState($Patch, $GUI_SHOW) EndIf Case $Patch Call("Patch") EndSwitch WEnd Func Refresh() $list2 = ProcessList() For $i = 1 To $list2[0][0] GUICtrlSetData($list, $list2[$i][0], "sro_client.exe") Next EndFunc Func Patch() ConsoleWrite("At patch" & @CRLF) EndFunc Builds a GUI window, builds a list, populates the list with processes, allows the user to select a process, which automatically checks if the selected process is the 'sro_client.exe' file. If not, does nothing, if so, enables a patch button; if clicked calls a patch function. Refresh, refreshes the list. NOTE: I didn't really read the rest of the post, just the first part; so if already accomplished, just disregard my code there. thx and no i was not ready thx thx thx xD 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