Jump to content

Kapat Butonu Çalışmıyor.


justpl4y
 Share

Recommended Posts

  1. Butonlara tıkladığımda fonksiyonlar çalışmıyordu. "Opt("GUIOnEventMode", 1)" ile o sorunu hallettim fakat bu sefer de kapat butonu çalışmıyor. 
    Ek olarak butonlardan biri cmd komutu çalıştıracak ve komutun bir kısmını da değişkenle vermem gerek.
    Seç butonu ile seçilen klasörde boşluk varsa cmd'de hata veriyor ve kod çalışmıyor.  Normal şartlarda komut isteminde tırnak içine alırsam boşluğu da görecek fakat autoit te değişkeni tırnak içine alırsam değişken de çalışmıyor.

    Bu sorunları nasıl çözebilirim acaba?



    [spoiler]
    #RequireAdmin
    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Icon=refresh.ico
    #AutoIt3Wrapper_Compile_Both=y
    #AutoIt3Wrapper_UseX64=y
    #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
     
    Opt("GUIOnEventMode", 1)  ; Change to OnEvent mode
    Opt("TrayIconHide", 1)
    #Region ### START Koda GUI section ### Form=C:\Users\T-Servis\Desktop\recovery.kxf
    $Form1 = GUICreate("Windows 8 Recovery Image Creator", 401, 301, 192, 124)
    GUISetIcon("C:\Users\T-Servis\Desktop\logo.png")
     
    $Pic1 = GUICtrlCreatePic("C:\Users\T-Servis\Desktop\recimg.jpg", 0, 0, 400, 300, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    GUICtrlSetState(-1, $GUI_DISABLE)
     
    $Input = GUICtrlCreateInput("İmajın kaydedileceği yeri seçin.", 56, 97, 185, 20)
     
    $sec = GUICtrlCreateButton("Seç", 240, 96, 27, 21, $WS_GROUP)
    GUICtrlSetOnEvent($sec, "Sec")
     
    $Baslat = GUICtrlCreateButton("Başlat", 120, 136, 81, 25, $WS_GROUP)
    GUICtrlSetOnEvent($Baslat, "Baslat")
     
    $Button1 = GUICtrlCreateButton("About", 365, 274, 33, 25, $WS_GROUP)
    GUICtrlSetOnEvent($Button1, "About")
     
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
     
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
     
    EndSwitch
    WEnd
     
     
    Func sec()
            Global $Dest = FileSelectFolder ("Yedeklerinizi nereye atmak istiyorsunuz?", "" , 1)
    if @error = 1 Then
            Exit
    EndIf
    GUICtrlSetData ($Input, $Dest)
    EndFunc
    
    [/spoiler]
Link to comment
Share on other sites

[spoiler]

#RequireAdmin
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=refresh.ico
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Users\T-Servis\Desktop\recovery.kxf
$Form1 = GUICreate("Windows 8 Recovery Image Creator", 401, 301, -1, -1)
GUISetIcon("C:\Users\T-Servis\Desktop\logo.png")
$Pic1 = GUICtrlCreatePic("C:\Users\T-Servis\Desktop\recimg.jpg", 0, 0, 400, 300, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
GUICtrlSetState(-1, $GUI_DISABLE)
$Input = GUICtrlCreateInput("İmajın kaydedileceği yeri seçin.", 56, 97, 185, 20)
$sec = GUICtrlCreateButton("Seç", 240, 96, 27, 21, $WS_GROUP)
$Baslat = GUICtrlCreateButton("Başlat", 120, 136, 81, 25, $WS_GROUP)
$Button1 = GUICtrlCreateButton("About", 365, 274, 33, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

$islem = "explorer.exe"

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Baslat
			Baslat()
		Case $Button1
			About()
		Case $sec
			sec()
	EndSwitch
WEnd

Func sec()
	Global $Dest = FileSelectFolder("Yedeklerinizi nereye atmak istiyorsunuz?", "", 1)
	If @error = 1 Then
		Exit
	EndIf
	GUICtrlSetData($Input, $Dest)
EndFunc   ;==>sec

Func Baslat()
ShellExecuteWait("cmd.exe", "/C taskkill /f /im " & $islem)
EndFunc   ;==>Baslat

Func About()
EndFunc   ;==>About

[/spoiler]

Link to comment
Share on other sites

Düzeltmeler için teşekkürler yalnız değişkeni alıyorum fakat bazı durumlarda değişkende boşluk olabilir. komut boşlukla beraber cmd ye aktarıldığında boşluktan sonrasını çalıştırmıyor.
Örn.  $islem = "internet explorer.exe"

Şöyle anlatayım.
Seç butonundan FileSelectFolder komutu ile işlemin yapılacağı klasör seçiliyor. Seçilen klasör adında boşluk varsa cmd hata veriyor. Boşluk yoksa işlemi gerçekleştiriyor.

Edited by justpl4y
Link to comment
Share on other sites

Düzeltmeler için teşekkürler yalnız değişkeni alıyorum fakat bazı durumlarda değişkende boşluk olabilir. komut boşlukla beraber cmd ye aktarıldığında boşluktan sonrasını çalıştırmıyor.
Örn.  $islem = "internet explorer.exe"

Şöyle anlatayım.
Seç butonundan FileSelectFolder komutu ile işlemin yapılacağı klasör seçiliyor. Seçilen klasör adında boşluk varsa cmd hata veriyor. Boşluk yoksa işlemi gerçekleştiriyor.

 

$islem = '"internet explorer.exe"'

 

kullanım bu şekilde. Seçilen dizine tırnakları eklemek için de bu şekilde yapacaksınız;

Global $Dest = FileSelectFolder("Yedeklerinizi nereye atmak istiyorsunuz?", "", 1)
$Path = '"' & $Dest & '"'
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...