Mehmet Posted April 26, 2011 Share Posted April 26, 2011 katılımsız yaptığım bir program var katılımsızda sorun yok gelen bu iletide sorun değil ama bazen bu ileti gelmiyor bazende geliyor yani nedense benim bilgisayarda denediğimde gelmiyor ama başka bir bilgisayarda geliyor demek istediğim Autoıt'te eğer gelirse işlem yap eğer gelmez ise işlem yapma diye kod yazabilirmiyiz sanırım if else kodlarıyla bu halledilir ama nasıl yazılacak onu bilmiyorum gelen iletiyi kapatma kodu bu WinWait("ffdshow compatibility manager") WinActivate("ffdshow compatibility manager") ControlClick("ffdshow compatibility manager","","Button7") WinWait("ffdshow compatibility manager") WinActivate("ffdshow compatibility manager") ControlClick("ffdshow compatibility manager","","Button1") bu kodla rahatlıkla gelen iletiyi kapattırabiliyorum ama gelmediğinde sorun oluyor Quote Link to comment Share on other sites More sharing options...
blue_life Posted April 26, 2011 Share Posted April 26, 2011 (edited) @mehmetben Belli bir süre pencerenin gelmesini bekleyebilirsin. Eğer gelirse ilgili işlemleri yaparsın. Mesela 5 saniye pencerenin gelmesini bekleyelim ve gelmez ise program kapansın. Tabi sen 5 saniyeyi duruma göre artırır/azaltırsın... [codebox]If WinWait("ffdshow compatibility manager","",5) <> 0 Then WinActivate("ffdshow compatibility manager") ControlClick("ffdshow compatibility manager","","Button7") If WinWait("ffdshow compatibility manager","",5) <> 0 Then WinActivate("ffdshow compatibility manager") ControlClick("ffdshow compatibility manager","","Button1") EndIf EndIf[/codebox] Edit: Ufak hata Edited April 26, 2011 by blue_life Quote Link to comment Share on other sites More sharing options...
blackman12 Posted April 26, 2011 Share Posted April 26, 2011 Kodunun başına bunu yaz: [code]AdlibRegister("gelirse")[/code] En sona da bunu ekle: [code]Func gelirse() if WinExists("ffdshow compatibility manager") Then WinActivate("ffdshow compatibility manager") ControlClick("ffdshow compatibility manager","","Button7") WinWait("ffdshow compatibility manager") WinActivate("ffdshow compatibility manager") ControlClick("ffdshow compatibility manager","","Button1") AdlibUnRegister("gelirse") EndIf EndFunc[/code] Quote Link to comment Share on other sites More sharing options...
Mehmet Posted April 26, 2011 Author Share Posted April 26, 2011 (edited) [quote name='blue_life' date='26 April 2011 - 19:38 ' timestamp='1303846733' post='1000162'] @mehmetben Belli bir süre pencerenin gelmesini bekleyebilirsin. Eğer gelirse ilgili işlemleri yaparsın. Mesela 5 saniye pencerenin gelmesini bekleyelim ve gelmez ise program kapansın. Tabi sen 5 saniyeyi duruma göre artırır/azaltırsın... [codebox]If WinWait("ffdshow compatibility manager","",5) <> 0 Then WinActivate("ffdshow compatibility manager") ControlClick("ffdshow compatibility manager","","Button7") If WinWait("ffdshow compatibility manager","",5) <> 0 Then WinActivate("ffdshow compatibility manager") ControlClick("ffdshow compatibility manager","","Button1") EndIf EndIf[/codebox] Edit: Ufak hata [/quote] program değilde ufak bir pencere çünki görev çubuğunda veya görev yöneticisinde çalışan bir uygulama değil programa bağlı yani ControlClick("ffdshow compatibility manager","","Button1") tıklandığında kapanıp diğer işleme geçiyor sırasıyla örnek ControlClick("ffdshow compatibility manager","","Button1") bundan sonra kapanırsa xprograma geçiyor WinWait("xprogram") WinActivate("xporgram") ControlClick("xprogram","","Button1") .........diye gidiyor birde burda verdiğiniz kodlar neyi belirtiyor @blue_life <> 0 Then EndIf EndIf (EndIf son satırda 2 kere yazılmış) @ blackman12 Func if WinExists AdlibRegister("gelirse") AdlibUnRegister("gelirse") Edited April 26, 2011 by mehmetben Quote Link to comment Share on other sites More sharing options...
blue_life Posted April 27, 2011 Share Posted April 27, 2011 @mehmetben If ile başladığımda devam eden Then den sonra bir kaç satır yazacaksak alt satıra geçiyoruz ve kodlarımızı yazıyoruz. İşte direk alt satıra geçtiğimiz için EndIf ile kapatmamız lazım. Birden fazla satır için; [b]If 1 = 1 Then MsgBox(64,"","Test") ;Alt alta yeni satırlar ekleyebilirsin. EndIf[/b] Tek satır için; [b]If 1 = 1 Then MsgBox(64,"","Test")[/b] Çok uzun tek satırı bölmek için; [b]If 1 = 1 Then _ MsgBox(64,"","Test")[/b] [b]If 1 = 1 Then Endif[/b] Yukarıkdai örnekte, kısaca 1 = 1 eşit ise if/endif arasındaki işlemler gerçekleştirilir. Yukarıdaki yazdığım WinWait satırlarında, başlık tespit edilemez ise 0 olarak dönüyor. Yani WinWait("Test","",5) satırında Test başlığı hiç gelmez ise WinWait("Test","",5) = 0 oluyor. Başlık gelirse, heralde handlesi geliyordur! If WinWait("ffdshow compatibility manager","",5) <> 0 Then ;kodlama Endf Eğer WinWait("ffdshow compatibility manager","",5) 0 a eşit değil ise ... gibi bir şey! Neyse fazla uzatıyorum Kolay gelsin... Quote Link to comment Share on other sites More sharing options...
develler Posted April 27, 2011 Share Posted April 27, 2011 bu kodlar ufak htaları bile affetmiyor yanlış kod olmadığına dikkat et Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.