Mehmet Posted August 30, 2011 Share Posted August 30, 2011 Arkadaşlar yaptığımız gui nekadar pencere açılırsa açılsın en üstte veya en altta kalması için hangi kodu yazmalıyız birde şu While döngüsünde örneğin bir buton var butona tıklandığında not defterine ahmet yazdı tekrar tıkladığımda mehmet yani bir butonla iki farklı isim veya yazı yazdırma ve bunu sürekli tekrarlatma. Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted August 30, 2011 Share Posted August 30, 2011 (edited) [font="Tahoma"][b]GUI nin en üstte kalması için gereken kod [color="#ff0000"]WinSetOnTop ( "title", "text", flag )[/color] bunu kullanabilirsin.Veyahut [color="#ff0000"]GUICreate("FORM1", 100, 500,-1,-1,-1,$WS_EX_TOPMOST[/color][color="#ff0000"])[/color] bunu da kullanabilirsin fakat bunu kullanacağın zaman #include <WindowsConstants.au3> kütüphanesini kullanman gerekir seçim senin tabi ama böyle ufak codlar için library kullanma bence.Ufak bir örnek verecek olursak[/b][/font]; [codebox]Local $Form1 = GUICreate("Form1", 273, 155, 192, 124) Local $Checkbox1 = GUICtrlCreateCheckbox("Her zaman üstte", 144, 120, 113, 17) GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case -3 Exit Case $nMsg = $Checkbox1 If GUICtrlRead($Checkbox1) = 1 Then WinSetOnTop("Form1", "", 1) Else WinSetOnTop("Form1", "", 0) EndIf EndSwitch WEnd[/codebox] [font="Tahoma"][b]Diğer sorun bana biraz saçma geldi doğrusu. Onu while döngüsüyle yapamazsın! Hem kaç kere yazdırmak istiyorsun bu da önemli tek butonla olacağına pek sanmıyorum.Daha mantıklı bir şey yapacaksan 2 butonla yapabilir belki..[/b][/font] Edited August 30, 2011 by SimpsoN_Bart Quote Link to comment Share on other sites More sharing options...
Mehmet Posted September 1, 2011 Author Share Posted September 1, 2011 (edited) @SimpsoN_Bart Demek istediğim böyle birşey sitemizdeki şeçtiğim üyeye farklı mesajlar göndermek. [img]http://www.tnctr.com/uploads/imgs/pre_1314854191__mesaj.jpg[/img] ad,soyad,gün sabit buradaki mesajınız bölümüne herzaman aynı mesaj değilde farklı farklı yazdırmak şöyle bir şayde olabilir ben daha önceden hazırladığım bir txt dosyasına alt alta lütfen ara toplantıdayım geç dönerim dışardayım gibi hazır mesaj şablonu oluştursam bunları yazdırsamda olur kodlarım bu [codebox] #include<IE.au3> #include <File.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #NoTrayIcon _ProcessCheck() Global $ISLEM = False Opt("GUIOnEventMode", 1) Global $Form1 = GUICreate("Form1", 300, 200, -1, -1, BitOR($WS_SYSMENU, $WS_POPUP)) GUISetOnEvent(-3, "_cik") Global $Baslat_Durdur = GUICtrlCreateButton("Baslat", 18, 130, 120, 25) GUICtrlSetOnEvent(-1, "_Baslat_Durdur") Global $Button2 = GUICtrlCreateButton("Hakkında", 160, 130, 120, 25) GUICtrlSetOnEvent(-1, "_About") Global $Button2 = GUICtrlCreateButton("Çık", 100, 165, 120, 25) GUICtrlSetOnEvent(-1, "_cik") WinSetTrans($Form1, "", 170) GUIRegisterMsg(0x0201, "_blue_life_WinMove") GUISetState(@SW_SHOW) WinSetOnTop("Form1", "", 1) While 1 If $ISLEM = True Then Local $mailtxt = "mehmetben" Local $passtxt = "tnctr" Local $guntxt = "pazartesi" Local $yazitxt = "Salı günü toplantı var" $Mail = $mailtxt $Pass = $passtxt $yazi = $yazitxt $gun = $guntxt $oIE = _IECreate("http://www.sitem.com/user/hasanyilmaz/", 0, 1, 1) WinSetState ( "sitem-uye-hasanyilmaz - Windows Internet Explorer", "", @SW_HIDE ) $oForm = _IEFormGetObjByName($oIE, "uyem1form") $oQuery = _IEFormElementGetObjByName($oForm, "ad") $o_Query = _IEFormElementGetObjByName($oForm, "soy") $ogun = _IEFormElementGetObjByName($oForm, "gun") $oyazi = _IEFormElementGetObjByName($oForm, "yazi") $oSubmit = _IEFormElementGetObjByName($oForm, "submit") _IEFormElementSetValue($oQuery, $Mail) _IEFormElementSetValue($o_Query, $Pass) _IEFormElementSetValue($oyazi, $yazi) _IEFormElementSetValue($ogun, $gun) _IEAction($oSubmit, "click") Else Sleep(100) EndIf WEnd Func _Baslat_Durdur() If $ISLEM = True Then GUICtrlSetData($Baslat_Durdur, "Başlat") Else GUICtrlSetData($Baslat_Durdur, "Durdur") EndIf $ISLEM = Not $ISLEM EndFunc Func _Durdur() $ISLEM = False EndFunc Func _About() MsgBox(0, "Kodlayan", "Bu program benim tarafından kodlanmıştır", 0, $Form1) EndFunc Func _cik() Exit EndFunc Func _ProcessGetLocation($iPID); Programın çalıştığı dizin Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID) If $aProc[0] = 0 Then Return SetError(1, 0, '') Local $vStruct = DllStructCreate('int[1024]') DllCall('psapi.dll', 'int', 'EnumProcessModules', 'hwnd', $aProc[0], 'ptr', DllStructGetPtr($vStruct), 'int', DllStructGetSize($vStruct), 'int_ptr', 0) Local $aReturn = DllCall('psapi.dll', 'int', 'GetModuleFileNameEx', 'hwnd', $aProc[0], 'int', DllStructGetData($vStruct, 1), 'str', '', 'int', 2048) If StringLen($aReturn[3]) = 0 Then Return SetError(2, 0, '') Return $aReturn[3] EndFunc ;==>_ProcessGetLocation Func _ProcessCheck() Local $Plist If @Compiled Then $Plist = ProcessList(@ScriptName) For $i = 1 To $Plist[0][0] If $Plist[$i][1] = @AutoItPID Then ContinueLoop ;Çalıştırdığımız programın pid bilgisi listen alınana uyuyorsa atlıyoruz. If FileGetLongName(_ProcessGetLocation($Plist[$i][1])) = FileGetLongName(@AutoItExe) Then ;Dosya konumları bir birine uyuyorsa, uygulamayı kapatıyoruz ProcessClose($Plist[$i][1]) EndIf Next EndIf EndFunc ;==>_ProcessCheck Func _blue_life_WinMove($hwnd) If BitAND(WinGetState($hwnd), 32) Then Return "GUI_RUNDEFMSG" DllCall("user32.dll", "long", "SendMessage", "hwnd", $hwnd, "int", 0x0112, "int", 0xF009, "int", 0) EndFunc ;==>_WinMove [/codebox] Edited September 1, 2011 by mehmetben Quote Link to comment Share on other sites More sharing options...
Mehmet Posted September 1, 2011 Author Share Posted September 1, 2011 [quote name='SimpsoN_Bart' date='30 August 2011 - 21:45 ' timestamp='1314740758' post='1072123'] [font="Tahoma"][b]GUI nin en üstte kalması için gereken kod [color="#ff0000"]WinSetOnTop ( "title", "text", flag )[/color] bunu kullanabilirsin.Veyahut [color="#ff0000"]GUICreate("FORM1", 100, 500,-1,-1,-1,$WS_EX_TOPMOST[/color][color="#ff0000"])[/color] bunu da kullanabilirsin fakat bunu kullanacağın zaman #include <WindowsConstants.au3> kütüphanesini kullanman gerekir seçim senin tabi ama böyle ufak codlar için library kullanma bence.Ufak bir örnek verecek olursak[/b][/font]; [codebox]Local $Form1 = GUICreate("Form1", 273, 155, 192, 124) Local $Checkbox1 = GUICtrlCreateCheckbox("Her zaman üstte", 144, 120, 113, 17) GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case -3 Exit Case $nMsg = $Checkbox1 If GUICtrlRead($Checkbox1) = 1 Then WinSetOnTop("Form1", "", 1) Else WinSetOnTop("Form1", "", 0) EndIf EndSwitch WEnd[/codebox] [font="Tahoma"][b]Diğer sorun bana biraz saçma geldi doğrusu. Onu while döngüsüyle yapamazsın! Hem kaç kere yazdırmak istiyorsun bu da önemli tek butonla olacağına pek sanmıyorum.Daha mantıklı bir şey yapacaksan 2 butonla yapabilir belki..[/b][/font] [/quote] Bu şekilde yapmayı düşünüyorum ama böyle kodlarsak çok uzun yazmamız gerekecek TestFunc1() TestFunc2() MsgBox(0, "çıkış", "Mesaj sonaerdi") Exit Func TestFunc1() MsgBox(0, "1.mesaj", "mesaj1") EndFunc Func TestFunc2() MsgBox(0, "2.mesaj", "mesaj2") EndFunc az kodla bu işlemi yapamazmıyız Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted September 1, 2011 Share Posted September 1, 2011 [font="Georgia"]Anladığım kadarıyla kodları istediğin şekilde çok da kısaltmak pek mümkün değil ama emin değilim! (Belki Blue_Life akılıcı bir yöntemle sana yardım edebilir.) Göndermek istediğin sabit bilgileri mesaj isim vs. bir database nin içine önceden girmen daha iyi olur bence. bu .ini veya .txt dosyası olabilir.veya script içinde değişken tanımlayıp da yapabilirsin.veya şöyle yap mesajlarını random komutuyla karıştır her mesaj yazdığında farklı şekilde yazsın.Combobox da bunları tanımlayıp da yapabilirsin.Yani sana kalmış pek yardımcı olamadım sanıırm evde değilim bilgisayar da bana ait değil maalesef yapabileceğim bu kadar kolay gelsin.[/font] Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted September 1, 2011 Share Posted September 1, 2011 (edited) [font="Georgia"]Edit : Tarayıcı hatasında dolayı mesaj 2 defa gitti[/font] Edited September 1, 2011 by SimpsoN_Bart Quote Link to comment Share on other sites More sharing options...
blue_life Posted September 2, 2011 Share Posted September 2, 2011 @mehmetben Forumlarda genelde ad, soyad olmaz diyebilirim. Yani nickimiz (kullanıcı adımız) olur ve bunun üzerinden mesaj göndeririz. Peki mesaj genderilecek kullanıcı bilgisini nerden alacaksın! Gönderilecek sabit mesajlar için bir ini dosyası iş görür... Kısaca guini tasarlayıp, yapmak istediğini biraz daha netleştirdikten sonra bizimle paylaşırsan, seni yönlendirmeye çalışırız... Quote Link to comment Share on other sites More sharing options...
Mehmet Posted September 2, 2011 Author Share Posted September 2, 2011 (edited) @blue_life bu forum değil abi normal bir site admin olarak giriş yaptığımda bir üye seçtiğimde arama çubuğunda http://www.sitem.com/user/hasanyilmaz/diye bir link oluşuyor. sayfadaki form verdiğim resimdeki örnek gibi o üyeye mesaj gönderiyorum form ve elemanlarının ismide aşağıdaki gibi ama ben bunu hotmaildeki formun örneğiyle yaptım soy ad kısmınada kendi soy ismimi yazıyorum $oForm = _IEFormGetObjByName($oIE, "uyem1form") $oQuery = _IEFormElementGetObjByName($oForm, "ad") $o_Query = _IEFormElementGetObjByName($oForm, "soy") $ogun = _IEFormElementGetObjByName($oForm, "gun") $oyazi = _IEFormElementGetObjByName($oForm, "yazi") ----burası değişken olucak yani mesaj kısmı. $oSubmit = _IEFormElementGetObjByName($oForm, "submit") Edited September 2, 2011 by mehmetben Quote Link to comment Share on other sites More sharing options...
blue_life Posted September 2, 2011 Share Posted September 2, 2011 @mehmetben Melesef tam olarak nasıl bir şey yapmak istediğini, kafamda canlandıramadım Yarın gün içinde şu yazdıklarını tekrar okuyacağım... Quote Link to comment Share on other sites More sharing options...
Mehmet Posted September 3, 2011 Author Share Posted September 3, 2011 @blue_life Bu linkteki http://www.sitem.com/user/hasanyilmaz/ bu form'a [img]http://www.tnctr.com/uploads/imgs/pre_1314854191__mesaj.jpg[/img] arka planda mesaj göndermek istiyorum. Quote Link to comment Share on other sites More sharing options...
blue_life Posted September 3, 2011 Share Posted September 3, 2011 (edited) @mehmetben Ilgili linkte herangi bir form vs. yok! Ayrıntılı bilgi vs. de malesef vermedin. Neyse senin için bir gui tasarlayalım. Belki işini görür... Kolay gelsin... [codebox]#include<IE.au3> #NoTrayIcon _ProcessCheck() Global $MAIL = "mehmetben" Global $SIFRE = "tnctr" Global $GUN = _Blue_WDAY() Global $DEF_SABLON = "Tamam bekliyorum" Global $SABLON = "Selam Millet|Bu bün hava güzel|Alo oradamısın?|Salı günü toplantı var|" & $DEF_SABLON Global $BlueForum = GUICreate("Form1", 360, 350, -1, -1, -2146959360) GUISetFont(10, 800, 0, "Tahoma") GUISetBkColor(0xFFFFFF) GUICtrlCreateLabel("Seçilen Üye:", 5, 5, 90, 17,-1,0x00100000) GUICtrlCreateLabel($MAIL, 100, 5, 90, 17,-1,0x00100000) GUICtrlCreateLabel("Ad:", 5, 35, 90, 17,-1,0x00100000) GUICtrlCreateLabel("Şifre:", 5, 55, 90, 17,-1,0x00100000) GUICtrlCreateLabel("Gün:", 5, 75, 90, 17,-1,0x00100000) GUICtrlCreateLabel("Şablon:", 5, 110, 90, 17,-1,0x00100000) Global $Input_Mail = GUICtrlCreateInput($MAIL, 100, 35, 250, 20) Global $Input_sifre = GUICtrlCreateInput($SIFRE, 100, 55, 250, 20) Global $Input_gun = GUICtrlCreateInput($GUN, 100, 75, 250, 20) Global $Combo_sablon = GUICtrlCreateCombo("", 100, 105, 250, 20) GUICtrlSetData($Combo_sablon, $SABLON, $DEF_SABLON) GUICtrlCreateLabel("Mesajınız", 5, 140, 90, 17,-1,0x00100000) Global $Edit_Mesaj = GUICtrlCreateEdit("", 5, 160, 350, 150) GUICtrlSetData(-1, $DEF_SABLON) Global $Gonder = GUICtrlCreateButton("Mesajı Gönder", 5, 320, 140, 24) GUICtrlSetState(-1,256) Global $About = GUICtrlCreateButton("Hakkında", 150, 320, 100, 24) Global $KAPAT = GUICtrlCreateButton("Kapat", 255, 320, 100, 24) GUIRegisterMsg(0x0201, "_blue_life_WinMove") WinSetTrans($BlueForum, "", 170) WinSetOnTop($BlueForum, "", 1) GUISetState(@SW_SHOW) Local $Read_Value1, $Read_Value2 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $KAPAT, -3 Exit Case $Combo_sablon $Read_Value1 = GUICtrlRead($Combo_sablon) GUICtrlSetData($Edit_Mesaj, $Read_Value1) Case $About MsgBox(64, "Kodlayan", "Bu program xxx tarafından kodlanmıştır", 0, $BlueForum) Case $Gonder $MAIL = GUICtrlRead($Input_Mail) $SIFRE = GUICtrlRead($Input_sifre) $GUN = GUICtrlRead($Input_gun) $MAIL = GUICtrlRead($Input_Mail) $Read_Value1 = GUICtrlRead($Edit_Mesaj) ;Bu kısım hakkında ne desem boş! ;Şimdilik bu kısma dokunmuyorum. ;Bu kısma müdehale etmem için ilgili site için login bilgilerine ihtiyacım var! ; =================================================================== $oIE = _IECreate("", 0, 1, 1) WinSetState("sitem-uye-hasanyilmaz - Windows Internet Explorer", "", @SW_HIDE) $oForm = _IEFormGetObjByName($oIE, "uyem1form") $oQuery = _IEFormElementGetObjByName($oForm, "ad") $o_Query = _IEFormElementGetObjByName($oForm, "soy") $ogun = _IEFormElementGetObjByName($oForm, "gun") $oyazi = _IEFormElementGetObjByName($oForm, "yazi") $oSubmit = _IEFormElementGetObjByName($oForm, "submit") _IEFormElementSetValue($oQuery, $MAIL) _IEFormElementSetValue($o_Query, $SIFRE) _IEFormElementSetValue($oyazi, $Read_Value1) _IEFormElementSetValue($ogun, $GUN) _IEAction($oSubmit, "click") ; =================================================================== EndSwitch WEnd Func _ProcessGetLocation($iPID); Programın çalıştığı dizin Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID) If $aProc[0] = 0 Then Return SetError(1, 0, '') Local $vStruct = DllStructCreate('int[1024]') DllCall('psapi.dll', 'int', 'EnumProcessModules', 'hwnd', $aProc[0], 'ptr', DllStructGetPtr($vStruct), 'int', DllStructGetSize($vStruct), 'int_ptr', 0) Local $aReturn = DllCall('psapi.dll', 'int', 'GetModuleFileNameEx', 'hwnd', $aProc[0], 'int', DllStructGetData($vStruct, 1), 'str', '', 'int', 2048) If StringLen($aReturn[3]) = 0 Then Return SetError(2, 0, '') Return $aReturn[3] EndFunc ;==>_ProcessGetLocation Func _ProcessCheck() Local $Plist If @Compiled Then $Plist = ProcessList(@ScriptName) For $i = 1 To $Plist[0][0] If $Plist[$i][1] = @AutoItPID Then ContinueLoop ;Çalıştırdığımız programın pid bilgisi listen alınana uyuyorsa atlıyoruz. If FileGetLongName(_ProcessGetLocation($Plist[$i][1])) = FileGetLongName(@AutoItExe) Then ;Dosya konumları bir birine uyuyorsa, uygulamayı kapatıyoruz ProcessClose($Plist[$i][1]) EndIf Next EndIf EndFunc ;==>_ProcessCheck Func _blue_life_WinMove($hwnd) If BitAND(WinGetState($hwnd), 32) Then Return "GUI_RUNDEFMSG" DllCall("user32.dll", "long", "SendMessage", "hwnd", $hwnd, "int", 0x0112, "int", 0xF009, "int", 0) EndFunc ;==>_blue_life_WinMove Func _Blue_WDAY() Local $ReturnWday Switch @WDAY Case 1 $ReturnWday = "Pazar" Case 2 $ReturnWday = "Pazartesi" Case 3 $ReturnWday = "Salı" Case 4 $ReturnWday = "Çarşamba" Case 5 $ReturnWday = "Perşembe" Case 6 $ReturnWday = "Cuma" Case 7 $ReturnWday = "Cumartesi" EndSwitch Return $ReturnWday EndFunc ;==>_Blue_WDAY[/codebox] Edited September 3, 2011 by blue_life Quote Link to comment Share on other sites More sharing options...
Mehmet Posted September 3, 2011 Author Share Posted September 3, 2011 (edited) link örnek verdim sadece reklam olmasın diye mesajlarımın hiç birine gerçek link vermem reklamı hiç sevmiyorum eline sağlık blue_life hemen bakıyorum Tam benim istediğim gibi olmuş bir tek sorun kaldı abi ard arda mesaj gönderdiğimde görev yöneticisinde 4 5 tane IEXPLORE.EXE [img]http://www.tnctr.com/uploads/imgs/pre_1315024984__explorer.jpg[/img] Edited September 3, 2011 by mehmetben Quote Link to comment Share on other sites More sharing options...
blue_life Posted September 3, 2011 Share Posted September 3, 2011 @mehmetben Örnek itemeizin ismi www.sitem.com olsun. Kodlarda yazdığım üzere, www.sitem.com daki ilgili formun nasıl işlediğini bilmediğim için yardımcı olamam. Yardımcı olabilmem için, www.sitem.com daki ilgili formun tam linkini ve kullanıcı bilgilerini vermen gerekecek. Yani kodlar www.sitem.com için yazılacaksa, test için bu sitedeki formun tam linktini ve test için bir kullanıcı bilgisi vermen gerekiyor. Bu arada www.sitem.com daki forma göre iexplore.exe ye gerek olmayabilir... Ie komutları biraz sıkıntılı... Quote Link to comment Share on other sites More sharing options...
MostWanted Posted September 3, 2011 Share Posted September 3, 2011 _IEQuit kullanmadığın için oluyor o. Quote Link to comment Share on other sites More sharing options...
Mehmet Posted September 3, 2011 Author Share Posted September 3, 2011 @blue_life iexplore.exe ye gerek olmayabilir... demişssin bir sitede mesaj yorum gibi şeyler için başka arka planda iexplore.exe gerek kalmadan yapılabilirmi bi örnek verebilirmisiniz ben kendime göre düzenlerim. Quote Link to comment Share on other sites More sharing options...
blue_life Posted September 4, 2011 Share Posted September 4, 2011 @mehmetben ObjCreate ile autoit içinde, internet explorer alt yapısını kullan nesneler oluşturabiliyoruz. Yani autoit ekranında ilgili sitelerdeki forumlara giriş yapmak mümkün. Tabi sistenin verdiği desteğe göre herangi bir arayüz olmadan da bu işler yapılabiliyor. Kısacası bu sitenin verdiği desteğe bağlı. Ben sana sadece objcreate ile bir örnek vereyim. Ben bu tip işler ile fazla ilgili deyilim... [codebox]Opt("GUIResizeMode", 768) Global $BLUE_OIE = ObjCreate("Shell.Explorer.2") Global $BLUE_GUI = GUICreate("BluLife Test", 640, 480, -1, -1, 0x00040000 + 0x00020000 + 0x00010000) $IE_OBJECT = GUICtrlCreateObj($BLUE_OIE, 0, 0, 640, 456) GUICtrlSetResizing(-1, 102) GUISetState(@SW_SHOW) $BLUE_OIE.navigate("http://www.google.com.tr") DllCall("psapi.dll", "int", "EmptyWorkingSet", "long", -1) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case -3 Exit EndSwitch WEnd[/codebox] 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.