Jump to content

Birden Fazla Scripti 1 Scriptte Nasıl Çalıştırılır


bmozdemir
 Share

Recommended Posts

Arkadaşlar elimde 4, 5 adet kod var ve bunları 1 exe içerisinde çalıştırmayı istiyorum fakat ne yaptıysam beceremedim eğer yardım ederseniz sevinirim.

Birde Örnek 1'de [color=#282828][size=2][background=rgb(248, 248, 248)]Case $hButton1 kısmında \index.html [/background][/size][/color]kısmında sayfayı bulamayınca hata veriyor. bunu nasıl önleyebilirim.

1. Örnek Kod

[CODE]
#include <GUIConstantsEx.au3>
#include <IEE.au3>
Global $hGUI2 = 9999, $hGUI3 = 9999, $hGUI4 = 9999, $h1Button1 = 9999, $h2Button1 = 9999, $h3Button1 = 9999 ; Predeclare the variables with dummy values to prevent firing the Case statements
gui1()
Func gui1()

$hGUI1 = GUICreate("Gui 1", 600, 600, 4, 4)
$hButton1 = GUICtrlCreateButton("Web Page 1", 20, 10, 80, 30)
$hButton2 = GUICtrlCreateButton("Web Page 2", 100, 10, 80, 30)
$hButton3 = GUICtrlCreateButton("Web Page 3", 180, 10, 80, 30)
$hButton4 = GUICtrlCreateButton("Web Page 4", 260, 10, 80, 30)
$hButton5 = GUICtrlCreateButton("Web Page 5", 340, 10, 80, 30)
$hButton6 = GUICtrlCreateButton("Web Page 6", 420, 10, 80, 30)
$hButton7 = GUICtrlCreateButton("Web Page 7", 500, 10, 80, 30)
$hButton8 = GUICtrlCreateButton("Show Gui 1", 20, 560, 80, 30)
$hButton9 = GUICtrlCreateButton("Show Gui 2", 100, 560, 80, 30)
$hButton10 = GUICtrlCreateButton("Show Gui 3", 180, 560, 80, 30)
$hButton11 = GUICtrlCreateButton("Show Gui 4", 260, 560, 80, 30)
$hButton12 = GUICtrlCreateButton("Show Gui 5", 340, 560, 80, 30)
$hButton13 = GUICtrlCreateButton("Show Gui 6", 420, 560, 80, 30)
$hButton14 = GUICtrlCreateButton("Show Gui 7", 500, 560, 80, 30)
$MonthCal1 = GUICtrlCreateMonthCal("", 184, 184, 236, 164)
GUISetState()

While 1
$aMsg = GUIGetMsg(1) ; Use advanced parameter to get array
Switch $aMsg[1] ; check which GUI sent the message
Case $hGUI1
Switch $aMsg[0] ; Now check for the messages for $hGUI1
Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we exit <<<<<<<<<<<<<<<
ExitLoop
Case $hButton1
Local $oIE = _IE_Example("basic")
_IEPropertySet($oIE, "addressbar", False)
_IENavigate($oIE, "\index.html")
Case $hButton8
MsgBox("", "MsgBox 1", "Test from Gui 1")
Case $hButton9
GUICtrlSetState($hButton9, $GUI_DISABLE)
gui2()
Case $hButton10
GUICtrlSetState($hButton10, $GUI_DISABLE)
gui3()
Case $hButton11
GUICtrlSetState($hButton11, $GUI_DISABLE)
gui4()
EndSwitch
Case $hGUI2
Switch $aMsg[0] ; Now check for the messages for $hGUI2
Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we just delete the GUI <<<<<<<<<<<<<<<
GUIDelete($hGUI2)
GUICtrlSetState($hButton9, $GUI_ENABLE)
Case $h1Button1
MsgBox("", "MsgBox", "Test from Gui 2")
EndSwitch
Case $hGUI3
Switch $aMsg[0] ; Now check for the messages for $hGUI2
Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we just delete the GUI <<<<<<<<<<<<<<<
GUIDelete($hGUI3)
GUICtrlSetState($hButton10, $GUI_ENABLE)
Case $h2Button1
MsgBox("", "MsgBox", "Test from Gui 3")
EndSwitch
Case $hGUI4
Switch $aMsg[0] ; Now check for the messages for $hGUI2
Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we just delete the GUI <<<<<<<<<<<<<<<
GUIDelete($hGUI4)
GUICtrlSetState($hButton11, $GUI_ENABLE)
Case $h3Button1
MsgBox("", "MsgBox", "Test from Gui 3")
EndSwitch
EndSwitch
WEnd

EndFunc ;==>gui1
Func gui2()
$hGUI2 = GUICreate("Gui 2", 600, 600, 50, 50)
$h1Button1 = GUICtrlCreateButton("MsgBox 2", 10, 10, 80, 30)
$h1Button2 = GUICtrlCreateButton("MsgBox 3", 10, 40, 80, 30)
GUISetState()

EndFunc ;==>gui2

Func gui3()

$hGUI3 = GUICreate("Gui 3", 600, 600, 100, 100)
$h2Button1 = GUICtrlCreateButton("MsgBox 2", 10, 10, 80, 30)
$h2Button2 = GUICtrlCreateButton("MsgBox 3", 10, 40, 80, 30)
GUISetState()

EndFunc ;==>gui3
Func gui4()

$hGUI4 = GUICreate("Gui 4", 600, 600, 150, 150)
$h3Button1 = GUICtrlCreateButton("MsgBox 2", 10, 10, 80, 30)
$h3Button2 = GUICtrlCreateButton("MsgBox 3", 10, 40, 80, 30)
GUISetState()

EndFunc ;==>gui4
[/CODE]

2. Örnek Kod

[CODE]
#include "MouseOnEvent.au3"
HotKeySet("{ESC}", "_Quit")
Global $iLimit_Coord_Left = 0
Global $iLimit_Coord_Top = 20
Global $iLimit_Coord_Width = 1500
Global $iLimit_Coord_Height = 25
;This will disable primary down event, double clicks included (see next)
_MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "_MousePrimaryDown_Event", 0, -1)
;Enable Double click, comment next line if double clicks should be disabled
_MouseSetOnEvent($MOUSE_PRIMARYDBLCLK_EVENT, "_MousePrimaryDown_Event", 0, -1)
While 1
Sleep(100)
WEnd
Func _MousePrimaryDown_Event()
Local $aMPos = MouseGetPos()
If ($aMPos[0] >= $iLimit_Coord_Left And $aMPos[0] <= $iLimit_Coord_Left + $iLimit_Coord_Width) And _
($aMPos[1] >= $iLimit_Coord_Top And $aMPos[1] <= $iLimit_Coord_Top + $iLimit_Coord_Height) Then Return 1 ;Block mouse click
Return 0
EndFunc
Func _Quit()
Exit
EndFunc
[/CODE]

Bu @blue_life Arkadaşın verdiği bir örnek
3.Örnek Kod

[CODE]
Local $var = IniRead("C:\1.ini", "SectionName", "key", "Hata")
Global $BlueLife_Info[5]
_BlueLife_Info($var, 1336, 30)
While 1
For $i = 1390 To -1400 Step -1
GUICtrlSetPos($BlueLife_Info[1], $i)
Sleep(5)
Next
WEnd
GUICtrlSetData($BlueLife_Info[1], "Kurulum tamamlandı.")
_BlueLife_Info(1, 0, 0)
Exit ;çıkış
Func _BlueLife_Info($BL_MSG, $BL_X = 200, $BL_Y = 50)
Local $Tray_Heihgt = WinGetHandle("[CLASS:Shell_TrayWnd]")
If $Tray_Heihgt = "" Then
$Tray_Heihgt = 0
Else
$Tray_Heihgt = WinGetPos($Tray_Heihgt)
$Tray_Heihgt = $Tray_Heihgt[3]
EndIf

If IsHWnd($BlueLife_Info[0]) = 0 Then
$BlueLife_Info[0] = GUICreate("", $BL_X, $BL_Y, @DesktopWidth - ($BL_X + 2), (@DesktopHeight - $Tray_Heihgt) - $BL_Y, 0x80000000)
$BlueLife_Info[1] = 0
$BlueLife_Info[2] = $BL_X
$BlueLife_Info[3] = $BL_Y
$BlueLife_Info[4] = 100
GUISetBkColor(0x3300CC)
Local $BK_GUI_GDI = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", 1, "long", 1, "long", $BlueLife_Info[2], "long", $BlueLife_Info[3], "long", 5, "long", 5)
If $BK_GUI_GDI[0] Then
DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $BlueLife_Info[0], "long", $BK_GUI_GDI[0], "int", 1)
EndIf
$BlueLife_Info[1] = GUICtrlCreateLabel($BL_MSG, 6, 6, $BlueLife_Info[2] - 10, $BlueLife_Info[3] - 10) ;, 1
GUICtrlSetFont(-1, 11, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetResizing(-1, 64 + 32)
GUISetState(@SW_SHOWNOACTIVATE)
WinSetTrans($BlueLife_Info[0], "", $BlueLife_Info[4])
Else
If StringIsDigit($BL_MSG) = 1 And $BL_X + $BL_Y = 0 Then
Sleep($BL_MSG)
Do
$BlueLife_Info[4] -= 5
WinSetTrans($BlueLife_Info[0], "", $BlueLife_Info[4])
Sleep(25)
Until $BlueLife_Info[4] < 1
GUIDelete($BlueLife_Info[0])
$BlueLife_Info = ""
Return
EndIf
GUICtrlSetData($BlueLife_Info[1], $BL_MSG)
If $BL_X <> $BlueLife_Info[2] Or $BL_Y <> $BlueLife_Info[3] Then
$BlueLife_Info[2] = $BL_X
$BlueLife_Info[3] = $BL_Y
WinMove($BlueLife_Info[0], "", @DesktopWidth - ($BlueLife_Info[2] + 2), (@DesktopHeight - $Tray_Heihgt) - $BlueLife_Info[3], $BlueLife_Info[2], $BlueLife_Info[3], 1)
Local $BK_GUI_GDI = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", 1, "long", 1, "long", $BlueLife_Info[2], "long", $BlueLife_Info[3], "long", 5, "long", 5)
If $BK_GUI_GDI[0] Then
DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $BlueLife_Info[0], "long", $BK_GUI_GDI[0], "int", 1)
EndIf
EndIf
EndIf
EndFunc
[/CODE]

İşin aslı örnek olarak bunlar ama atıyorum ben bişi daha eklemek istesem programa nasıl ekleyeceğim gerçek derdim bu bunlar birbirleri ile çakışıyorlar.
Eğer yardım ederseniz çok sevinirim.
İyi günler.
Link to comment
Share on other sites

arkadaşım ne yapmak istediğini tam anlamadım
burda iki döngü var basit bir şekilde bağladım
lakin bu gibi programlarda bu şekilde değilde
ne yapmak istediğini bilerek çalışmanı tavsiye ederim
ama sen nasıl çalıştıklarını merak ettiğin için küçük bir örnek yaptım
daha eklenecek kodları var ama amaçsız kod yazmak istemedim.

[CODE]
#include <GUIConstantsEx.au3>
#include <IE.au3>
#include "MouseOnEvent.au3"
HotKeySet("{ESC}", "_Quit")
Global $iLimit_Coord_Left = 0
Global $iLimit_Coord_Top = 20
Global $iLimit_Coord_Width = 1500
Global $iLimit_Coord_Height = 25
Local $var = IniRead("C:\1.ini", "SectionName", "key", "Esc ile çıkınız")
Global $BlueLife_Info[5]
Global $hGUI2 = 9999, $hGUI3 = 9999, $hGUI4 = 9999, $h1Button1 = 9999, $h2Button1 = 9999, $h3Button1 = 9999 ; Predeclare the variables with dummy values to prevent firing the Case statements
gui1()
Func gui1()

$hGUI1 = GUICreate("Gui 1", 600, 600, 4, 4)
$hButton1 = GUICtrlCreateButton("Web Page 1", 20, 10, 80, 30)
$hButton2 = GUICtrlCreateButton("Web Page 2", 100, 10, 80, 30)
$hButton3 = GUICtrlCreateButton("Web Page 3", 180, 10, 80, 30)
$hButton4 = GUICtrlCreateButton("Web Page 4", 260, 10, 80, 30)
$hButton5 = GUICtrlCreateButton("Web Page 5", 340, 10, 80, 30)
$hButton6 = GUICtrlCreateButton("Web Page 6", 420, 10, 80, 30)
$hButton7 = GUICtrlCreateButton("Web Page 7", 500, 10, 80, 30)
$hButton8 = GUICtrlCreateButton("Show Gui 1", 20, 560, 80, 30)
$hButton9 = GUICtrlCreateButton("Show Gui 2", 100, 560, 80, 30)
$hButton10 = GUICtrlCreateButton("Show Gui 3", 180, 560, 80, 30)
$hButton11 = GUICtrlCreateButton("Show Gui 4", 260, 560, 80, 30)
$hButton12 = GUICtrlCreateButton("Show Gui 5", 340, 560, 80, 30)
$hButton13 = GUICtrlCreateButton("Show Gui 6", 420, 560, 80, 30)
$hButton14 = GUICtrlCreateButton("Show Gui 7", 500, 560, 80, 30)
$MonthCal1 = GUICtrlCreateMonthCal("", 184, 184, 236, 164)
GUISetState()
While 1
$aMsg = GUIGetMsg(1) ; Use advanced parameter to get array
Switch $aMsg[1] ; check which GUI sent the message
Case $hGUI1
Switch $aMsg[0] ; Now check for the messages for $hGUI1
Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we exit <<<<<<<<<<<<<<<
MsgBox("", "MsgBox", $aMsg[0])
ExitLoop
Case $hButton1
Local $oIE = _IE_Example("basic")
_IEPropertySet($oIE, "addressbar", False)
;_IENavigate($oIE, "\index.html")
Case $hButton8
MsgBox("", "MsgBox 1", "Test from Gui 1")

while 1
_MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "_MousePrimaryDown_Event", 0, -1)
;Enable Double click, comment next line if double clicks should be disabled
_MouseSetOnEvent($MOUSE_PRIMARYDBLCLK_EVENT, "_MousePrimaryDown_Event", 0, -1)
_BlueLife_Info($var, 1336, 30)
For $i = 1390 To -1400 Step -1
GUICtrlSetPos($BlueLife_Info[1], $i)
Sleep(5)
Next
GUICtrlSetData($BlueLife_Info[1], "Kurulum tamamlandı.")
_BlueLife_Info(1, 0, 0)
Exit ;çıkış
wend




Case $hButton9
GUICtrlSetState($hButton9, $GUI_DISABLE)
gui2()
Case $hButton10
GUICtrlSetState($hButton10, $GUI_DISABLE)
gui3()
Case $hButton11
GUICtrlSetState($hButton11, $GUI_DISABLE)
gui4()
EndSwitch
Case $hGUI2
Switch $aMsg[0] ; Now check for the messages for $hGUI2
Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we just delete the GUI <<<<<<<<<<<<<<<
GUIDelete($hGUI2)
GUICtrlSetState($hButton9, $GUI_ENABLE)
Case $h1Button1
MsgBox("", "MsgBox", "Test from Gui 2")
EndSwitch
Case $hGUI3
Switch $aMsg[0] ; Now check for the messages for $hGUI2
Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we just delete the GUI <<<<<<<<<<<<<<<
GUIDelete($hGUI3)
GUICtrlSetState($hButton10, $GUI_ENABLE)
Case $h2Button1
MsgBox("", "MsgBox", "Test from Gui 3")
EndSwitch
Case $hGUI4
Switch $aMsg[0] ; Now check for the messages for $hGUI2
Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we just delete the GUI <<<<<<<<<<<<<<<
GUIDelete($hGUI4)
GUICtrlSetState($hButton11, $GUI_ENABLE)
Case $h3Button1
MsgBox("", "MsgBox", "Test from Gui 3")
EndSwitch
EndSwitch
WEnd

EndFunc ;==>gui1
Func gui2()
$hGUI2 = GUICreate("Gui 2", 600, 600, 50, 50)
$h1Button1 = GUICtrlCreateButton("MsgBox 2", 10, 10, 80, 30)
$h1Button2 = GUICtrlCreateButton("MsgBox 3", 10, 40, 80, 30)
GUISetState()

EndFunc ;==>gui2

Func gui3()

$hGUI3 = GUICreate("Gui 3", 600, 600, 100, 100)
$h2Button1 = GUICtrlCreateButton("MsgBox 2", 10, 10, 80, 30)
$h2Button2 = GUICtrlCreateButton("MsgBox 3", 10, 40, 80, 30)
GUISetState()

EndFunc ;==>gui3
Func gui4()

$hGUI4 = GUICreate("Gui 4", 600, 600, 150, 150)
$h3Button1 = GUICtrlCreateButton("MsgBox 2", 10, 10, 80, 30)
$h3Button2 = GUICtrlCreateButton("MsgBox 3", 10, 40, 80, 30)
GUISetState()

EndFunc ;==>gui4

Func _MousePrimaryDown_Event()
Local $aMPos = MouseGetPos()
If ($aMPos[0] >= $iLimit_Coord_Left And $aMPos[0] <= $iLimit_Coord_Left + $iLimit_Coord_Width) And _
($aMPos[1] >= $iLimit_Coord_Top And $aMPos[1] <= $iLimit_Coord_Top + $iLimit_Coord_Height) Then Return 1 ;Block mouse click
Return 0
EndFunc
Func _Quit()
Exit
EndFunc
Func _BlueLife_Info($BL_MSG, $BL_X = 200, $BL_Y = 50)
Local $Tray_Heihgt = WinGetHandle("[CLASS:Shell_TrayWnd]")
If $Tray_Heihgt = "" Then
$Tray_Heihgt = 0
Else
$Tray_Heihgt = WinGetPos($Tray_Heihgt)
$Tray_Heihgt = $Tray_Heihgt[3]
EndIf

If IsHWnd($BlueLife_Info[0]) = 0 Then
$BlueLife_Info[0] = GUICreate("", $BL_X, $BL_Y, @DesktopWidth - ($BL_X + 2), (@DesktopHeight - $Tray_Heihgt) - $BL_Y, 0x80000000)
$BlueLife_Info[1] = 0
$BlueLife_Info[2] = $BL_X
$BlueLife_Info[3] = $BL_Y
$BlueLife_Info[4] = 100
GUISetBkColor(0x3300CC)
Local $BK_GUI_GDI = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", 1, "long", 1, "long", $BlueLife_Info[2], "long", $BlueLife_Info[3], "long", 5, "long", 5)
If $BK_GUI_GDI[0] Then
DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $BlueLife_Info[0], "long", $BK_GUI_GDI[0], "int", 1)
EndIf
$BlueLife_Info[1] = GUICtrlCreateLabel($BL_MSG, 6, 6, $BlueLife_Info[2] - 10, $BlueLife_Info[3] - 10) ;, 1
GUICtrlSetFont(-1, 11, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetResizing(-1, 64 + 32)
GUISetState(@SW_SHOWNOACTIVATE)
WinSetTrans($BlueLife_Info[0], "", $BlueLife_Info[4])
Else
If StringIsDigit($BL_MSG) = 1 And $BL_X + $BL_Y = 0 Then
Sleep($BL_MSG)
Do
$BlueLife_Info[4] -= 5
WinSetTrans($BlueLife_Info[0], "", $BlueLife_Info[4])
Sleep(25)
Until $BlueLife_Info[4] < 1
GUIDelete($BlueLife_Info[0])
$BlueLife_Info = ""
Return
EndIf
GUICtrlSetData($BlueLife_Info[1], $BL_MSG)
If $BL_X <> $BlueLife_Info[2] Or $BL_Y <> $BlueLife_Info[3] Then
$BlueLife_Info[2] = $BL_X
$BlueLife_Info[3] = $BL_Y
WinMove($BlueLife_Info[0], "", @DesktopWidth - ($BlueLife_Info[2] + 2), (@DesktopHeight - $Tray_Heihgt) - $BlueLife_Info[3], $BlueLife_Info[2], $BlueLife_Info[3], 1)
Local $BK_GUI_GDI = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", 1, "long", 1, "long", $BlueLife_Info[2], "long", $BlueLife_Info[3], "long", 5, "long", 5)
If $BK_GUI_GDI[0] Then
DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $BlueLife_Info[0], "long", $BK_GUI_GDI[0], "int", 1)
EndIf
EndIf
EndIf
EndFunc

[/CODE]

Link to comment
Share on other sites

ilginize teşekkür ederim gerçekten güzel ve anlaşılır olmuş benim için lakin amacım bu tarz ayrı ayrı kod gruplarının nasıl bağlanabildiği idi bana bu tarz bilgilerini edinebileceğim bir döküman veya bir kaynak bulamadığımdan bu tarz bir soru sorma gereğinde bulundum ilginize teşekkür ederim.

Birde show gui 1 butonuna tıklayınca diğer butonlara tıklayamıyorum pasif hale geliyorlar.

ilginize tekrar teşekkür ederim.

Link to comment
Share on other sites

autoit dosyasının içinde help dosyası var
örnek kodlar var
ve autoittin kendi sitesi var
birazda ingilizce varsa
bu kodlama işini yapamama durumun yoktur bence
birazda azim :)
bu arada ben size belirtmiştim ek kodlama gereken yerler var demiştim ama buna dikkat etmemişsiniz

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