Jump to content

If / Else / Elseif Winexists


byMaPa
 Share

Recommended Posts

Run("x86.exe")
If WinExists("Pencere","") Then
	WinWaitActive("Pencere","")
	BlockInput(1)
	ControlCommand("Pencere","", "Button1", "Check")
	WinWaitActive("Pencere","You need to reboot for changes to take effect.")
	ControlCommand("Pencere","", "Button1", "Check")
	BlockInput(0)
ElseIf WinExists("Pencere","") Then
	If @OSArch = "X86" Then
	ProcessClose("x86.exe")
	Else
    ProcessClose("x64.exe")
    EndIf
	MsgBox(0x00000010, "Hata", " Zaten Kurul.", 5)
EndIf

Nerde hata yaptım ?

Link to comment
Share on other sites

Arkadaşım ben autoit bilmiyorum ama if/elseif döngü yapısı tüm programlama dillerinde aynıdır. O şemaya göre söyledim. WinExists(); komutu sanırım pencere başlığına bakarak o pencerenin olup olmadığına göre true/false döndürüyor, eğer doğruysam sen pencere title'inda "" yani boş olan ya da "1" yani 1 yazan bir pencere arıyorsun? yok mu ya bir autoitci yardım edin :)

Link to comment
Share on other sites

Arkadaşım ben autoit bilmiyorum ama if/elseif döngü yapısı tüm programlama dillerinde aynıdır. O şemaya göre söyledim. WinExists(); komutu sanırım pencere başlığına bakarak o pencerenin olup olmadığına göre true/false döndürüyor, eğer doğruysam sen pencere title'inda "" yani boş olan ya da "1" yani 1 yazan bir pencere arıyorsun? yok mu ya bir autoitci yardım edin :)

pencere ve "1" sembolik yazdım. 1. döngüde  

("Pencere","1")

gelmediği için direk ikinci döngüye geçmesi gerekiyor ama geçmiyor.

Link to comment
Share on other sites

  • Editor
    Run("x86.exe")
    If WinExists("Pencere") Then
			WinWaitActive("Pencere","")
			BlockInput(1)
			ControlCommand("Pencere","", "Button1", "Check")
			WinWaitActive("Pencere","You need to reboot for changes to take effect.")
			ControlCommand("Pencere","", "Button1", "Check")
			BlockInput(0)
    Else
			If @OSArch = "X86" Then
			ProcessClose("x86.exe")
			Else
			ProcessClose("x64.exe")
			EndIf
			MsgBox(0x00000010, "Hata", " Zaten Kurul.", 5)
    EndIf

bu şekilde denermisin kardeşim.

Link to comment
Share on other sites

    Run("x86.exe")
    If WinExists("Pencere") Then
			WinWaitActive("Pencere","")
			BlockInput(1)
			ControlCommand("Pencere","", "Button1", "Check")
			WinWaitActive("Pencere","You need to reboot for changes to take effect.")
			ControlCommand("Pencere","", "Button1", "Check")
			BlockInput(0)
    Else
			If @OSArch = "X86" Then
			ProcessClose("x86.exe")
			Else
			ProcessClose("x64.exe")
			EndIf
			MsgBox(0x00000010, "Hata", " Zaten Kurul.", 5)
    EndIf

bu şekilde denermisin kardeşim.

 

aynısı değil mi?

Link to comment
Share on other sites

  • Editor

WinExists("Pencere") ile Pencere adında bir pencere varmı kontrol ediyoruz eger varsa

 

winwaitactive ile kontrol edip komutlar gönderiyoruz. Eğer pencere isminde bir pencere yoksa x86 vey x64 duruma göre process ten kapatıyoruz.Kod bu işte.

Link to comment
Share on other sites

WinExists("Pencere") ile Pencere adında bir pencere varmı kontrol ediyoruz eger varsa

 

winwaitactive ile kontrol edip komutlar gönderiyoruz. Eğer pencere isminde bir pencere yoksa x86 vey x64 duruma göre process ten kapatıyoruz.Kod bu işte.

controlcommanda sıkıntı var heralde. onu yapamıyorum

Link to comment
Share on other sites

pairsin verdiği çalışıyo arkadaşım dalga mı geçiyorsun? ama istediğinin tam örneği şöyle:

Run("x86.exe")
If WinExists("Pencere","") Then
	WinWaitActive("Pencere","")
	BlockInput(1)
	ControlCommand("Pencere","", "Button1", "Check")
	WinWaitActive("Pencere","You need to reboot for changes to take effect.")
	ControlCommand("Pencere","", "Button1", "Check")
	BlockInput(0)
ElseIf WinExists("Pencere2","") Then
	If @OSArch = "X86" Then
	ProcessClose("x86.exe")
	Else
	ProcessClose("x64.exe")
	EndIf
	MsgBox(16, "Hata", " Zaten Kurul.", 5)
ElseIf WinExists("[CLASS:Shell_TrayWnd]", "") Then
	If @OSArch = "X86" Then
	ProcessClose("x86.exe")
	Else
	ProcessClose("x64.exe")
	EndIf
	MsgBox(64, "Yeay!", "Görev çubuğun varmış senin", 5)
Else
	MsgBox(16, "Hata", "Aranan hiçbir pencere bulunamadı.", 5)
EndIf
Link to comment
Share on other sites

öyle bi ihtimal var mı yahu mesajlarına bakıyorum da olmayacak şeyler diyosun. Sen sadece karşılaştığın sorunu söyle, sebebini tanımlayamıyorsun belliki

abi dediğim gibi run script deyince winwaitactive de yani pencere gelince control command yapıp tıklıyor. ama scripti exe yapınca tıklamıyor. daha nasıl anlatayım? istersen gösterebilirim canlı olarak

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...