| freehuntx |
11/11/2011 07:24 |
Autoit Unchecken Fails
Hey.
Ich will in einem Script, mehere checkboxen haben.
Und es soll immer nur eine checkbox auswählbar sein.
Dazu verwende ich folgendes:
Quote:
Case $Radio1
GuiCtrlSetState($Radio2, 4)
|
Aber es will einfach nicht funktionieren.
Hier mein Momentaner Source:
Quote:
#include <GDIPlus.au3>
#include <GuiListBox.au3>
#include <String.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <StructureConstants.au3>
#include <WinAPI.au3>
#include <IE.au3>
Opt("GUIOnEventMode", 1)
Global Const $AC_SRC_ALPHA = 1
#Region
$GUI = GUICreate("Anrufliste", 799, 510, -1, -1, $WS_POPUP, BitOR($WS_EX_CONTROLPARENT, $WS_EX_LAYERED))
_GDIPlus_Startup()
$pngSrcGUIBK = "gui_bg.png"
Global $hImageGUIBK = _GDIPlus_ImageLoadFromFile($pngSrcGUIBK)
SetBitmap($GUI, $hImageGUIBK, 255)
#EndRegion
; de en fr it es ru
#Region
$GUI_Main = GUICreate("sss", 799, 510, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $GUI)
GUISetBkColor(0x585858)
_WinAPI_SetLayeredWindowAttributes($GUI_Main, 0x585858)
$Radio1 = GUICtrlCreateRadio(" German", 290, 470, 17, 17, $WS_GROUP)
$Radio2 = GUICtrlCreateRadio(" English", 373, 470, 17, 17, $WS_GROUP)
$Radio3 = GUICtrlCreateRadio(" France", 456, 470, 17, 17, $WS_GROUP)
$Radio4 = GUICtrlCreateRadio(" Italian", 539, 470, 17, 17, $WS_GROUP)
$Radio5 = GUICtrlCreateRadio(" Spanish", 622, 470, 17, 17, $WS_GROUP)
$Radio6 = GUICtrlCreateRadio(" Russian", 705, 470, 17, 17, $WS_GROUP)
Global $Button1 = GUICtrlCreateButton("Start", 17, 342, 246, 34, $BS_BITMAP)
Global $Button2 = GUICtrlCreateButton("Register", 35, 380, 212, 29, $BS_BITMAP)
GUICtrlSetOnEvent(-1, "_Register")
Global $Button3 = GUICtrlCreateButton("Cancel", 53, 418, 176, 25, $BS_BITMAP)
GUICtrlSetOnEvent(-1, "_Schliessen")
$object = ObjCreate("Shell.Explorer.2")
$object_ctrl = GUICtrlCreateObj($object, 300, 185, 461, 260)
_IENavigate($object, "http://s4.de.alaplaya.net/pages/patcher")
GUICtrlSetImage($Button1, @ScriptDir&"\Start.bmp", 0)
GUICtrlSetImage($Button2, @ScriptDir&"\Register.bmp", 0)
GUICtrlSetImage($Button3, @ScriptDir&"\Cancel.bmp", 0)
#EndRegion
GUISetState(@SW_SHOW, $GUI)
GUISetState(@SW_SHOW, $GUI_Main)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Radio1
guictrlsetstate($Radio2, 0)
EndSwitch
WEnd
Func _Register()
If GUICtrlRead($Radio1) = $GUI_CHECKED Then
ShellExecute("http://s4.de.alaplaya.net/landingpage/patcher")
Endif
If GUICtrlRead($Radio2) = $GUI_CHECKED Then
ShellExecute("http://s4.en.alaplaya.net/landingpage/patcher")
Endif
If GUICtrlRead($Radio3) = $GUI_CHECKED Then
ShellExecute("http://s4.fr.alaplaya.net/landingpage/patcher")
Endif
If GUICtrlRead($Radio4) = $GUI_CHECKED Then
ShellExecute("http://s4.it.alaplaya.net/landingpage/patcher")
Endif
If GUICtrlRead($Radio5) = $GUI_CHECKED Then
ShellExecute("http://s4.es.alaplaya.net/landingpage/patcher")
Endif
If GUICtrlRead($Radio6) = $GUI_CHECKED Then
ShellExecute("http://s4.ru.alaplaya.net/landingpage/patcher")
Endif
EndFunc
Func _Schliessen()
_GDIPlus_ImageDispose($hImageGUIBK)
_WinAPI_DeleteObject($hImageGUIBK)
_GDIPlus_Shutdown()
Exit
EndFunc
Func SetBitmap($hGUI, $hImage, $iOpacity)
Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend
$hScrDC = _WinAPI_GetDC(0)
$hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
$hOld = _WinAPI_SelectObject($hMemDC, $hBitmap)
$tSize = DllStructCreate($tagSIZE)
$pSize = DllStructGetPtr($tSize)
DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage))
DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage))
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", $iOpacity)
DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA)
_WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
_WinAPI_ReleaseDC(0, $hScrDC)
_WinAPI_SelectObject($hMemDC, $hOld)
_WinAPI_DeleteObject($hBitmap)
_WinAPI_DeleteDC($hMemDC)
EndFunc
|
Bevor ihr aber antworten wollt, würde ich euch bitten den source selbst testen, und erst wenn es auch funktioniert mir tipps geben, weil ich mehrere wege probiert habe, und bei manchen konnte man boxen garnicht mehr auswählen.
|