Aqil990 Posted November 9, 2010 Share Posted November 9, 2010 Bir zamanlar yazmisdim ama oylece kalmish, arhivde. Kimlerinse ishine yarar diye dushundum ve foruma qoyuyorum. Buyurun: #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #Include <GuiListView.au3> $Form1 = GUICreate("Process Reporter ! | by: Aqil", 496, 444, 192, 124) $ListView1 = GUICtrlCreateListView("Process listesi: | Hacm:", 8, 40, 481, 369) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 380) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 75) GUISetState(@SW_SHOW) $cmenu=GUICtrlCreateContextMenu($ListView1) $cmenuitem2=GUICtrlCreateMenuItem("Listeni Yenile",$cmenu) $cmenuitem5=GUICtrlCreateMenuItem("",$cmenu) $cmenuitem1=GUICtrlCreateMenuItem("Processi Durdur",$cmenu) $cmenuitem3=GUICtrlCreateMenuItem("Restart Ver",$cmenu) $cmenuitem6=GUICtrlCreateMenuItem("",$cmenu) $cmenuitem4=GUICtrlCreateMenuItem("Ozelliklerine Bak",$cmenu) _proses() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $cmenuitem2 _proses() Case $cmenuitem1 $secilmis=_GUICtrlListView_GetItemText(GUICtrlGetHandle($ListView1),_GUICtrlListView_GetSelectedIndices($ListView1),0) ProcessClose($secilmis) _proses() Case $cmenuitem3 $secilmis=_GUICtrlListView_GetItemText(GUICtrlGetHandle($ListView1),_GUICtrlListView_GetSelectedIndices($ListView1),0) ProcessClose($secilmis) _proses() Run($secilmis) If ProcessExists($secilmis) Then MsgBox(48,"Dikkat","Restart verildi!",10) Else MsgBox(64,"Dikkat","Restart verilemedi, Sehv yarandi!",10) EndIf Case $cmenuitem4 $secilmis=_GUICtrlListView_GetItemText(GUICtrlGetHandle($ListView1),_GUICtrlListView_GetSelectedIndices($ListView1),0) _ShowFileProperties($secilmis) EndSwitch WEnd Func _proses() _GUICtrlListView_DeleteAllItems($ListView1) $list = ProcessList() for $i = 1 to $list[0][0] GUICtrlCreateListViewItem($list[$i][0] & "|" & $list[$i][1],$ListView1) next EndFunc ;==> _proses() Func _ShowFileProperties($sFile, $sVerb = "properties", $hWnd = 0) ; function by Rasim ; http://www.autoitscript.com/forum/index.php?showtopic=78236&view=findpost&p=565547 Local Const $SEE_MASK_INVOKEIDLIST = 0xC Local Const $SEE_MASK_NOCLOSEPROCESS = 0x40 Local Const $SEE_MASK_FLAG_NO_UI = 0x400 Local $PropBuff, $FileBuff, $SHELLEXECUTEINFO $PropBuff = DllStructCreate("char[256]") DllStructSetData($PropBuff, 1, $sVerb) $FileBuff = DllStructCreate("char[256]") DllStructSetData($FileBuff, 1, $sFile) $SHELLEXECUTEINFO = DllStructCreate("int cbSize;long fMask;hwnd hWnd;ptr lpVerb;ptr lpFile;ptr lpParameters;ptr lpDirectory;" & _ "int nShow;int hInstApp;ptr lpIDList;ptr lpClass;hwnd hkeyClass;int dwHotKey;hwnd hIcon;" & _ "hwnd hProcess") DllStructSetData($SHELLEXECUTEINFO, "cbSize", DllStructGetSize($SHELLEXECUTEINFO)) DllStructSetData($SHELLEXECUTEINFO, "fMask", $SEE_MASK_INVOKEIDLIST) DllStructSetData($SHELLEXECUTEINFO, "hwnd", $hWnd) DllStructSetData($SHELLEXECUTEINFO, "lpVerb", DllStructGetPtr($PropBuff, 1)) DllStructSetData($SHELLEXECUTEINFO, "lpFile", DllStructGetPtr($FileBuff, 1)) $aRet = DllCall("shell32.dll", "int", "ShellExecuteEx", "ptr", DllStructGetPtr($SHELLEXECUTEINFO)) If $aRet[0] = 0 Then Return SetError(2, 0, 0) Return $aRet[0] EndFunc ;==>_ShowFileProperties Kodlari oylesine yazmishim. Mesela Ozelliklerine Bak komutu hepsine bakamaz yalniz system fayllarina baka bilir. Kim isterse gelishtirib kendisine gore editleye bilir. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.