Hi,
ic hab mal wieder ein Problem.
Und zwar wollte ich ein kleines Menü machen mit transparenten Textfeldern und Buttons. klappt ja auch so weit, jetzt wollte ich aber prüfen ob eine der textboxen den Focus hat und dann den Text löschen der drinsteht.
aber ich bekomm einfach nicht den Focus abgefragt.
hab es versucht mit
[autoit]If _IsFocused ($frmFinder, $txtUser) And $Clear = 0 Then
GUICtrlSetData ($txtUser, "")
$Clear = 1
ElseIf $Clear = 1 And Not _IsFocused ($frmFinder, $txtUser) Then
GUICtrlSetData($txtUser,"search User...")
$Clear = 0
EndIf
Func _IsFocused($hWnd, $nCID)
Return ControlGetHandle($hWnd, '', $nCID) = ControlGetHandle($hWnd, '', ControlGetFocus($hWnd))
EndFunc ;==>_IsFocused
und nur mit
[autoit]ControlGetFocus($hWnd))
[/autoit]
aber leider bekomm ich nix hin.
vielleicht hat einer eine Idee?
Zur Info so stell ich die transparens ein:
[autoit]$txtLeo = GUICtrlCreateInput("search dictLeo...", 5, 154, 191, 21)
_GuiCtrlMakeTrans(-1,175)
Func _GuiCtrlMakeTrans($iCtrlID,$iTrans=255)
Local $pHwnd, $nHwnd, $aPos, $a
$hWnd = GUICtrlGetHandle($iCtrlID);Get the control handle
If $hWnd = 0 then Return SetError(1,1,0)
$pHwnd = DllCall("User32.dll", "hwnd", "GetParent", "hwnd", $hWnd);Get the parent Gui Handle
If $pHwnd[0] = 0 then Return SetError(1,2,0)
$aPos = ControlGetPos($pHwnd[0],"",$hWnd);Get the current pos of the control
If @error then Return SetError(1,3,0)
$nHwnd = GUICreate("", $aPos[2], $aPos[3], $aPos[0], $aPos[1], 0x80000000, 0x00080000 + 0x00000040, $pHwnd[0]);greate a gui in the position of the control
If $nHwnd = 0 then Return SetError(1,4,0)
$a = DllCall("User32.dll", "hwnd", "SetParent", "hwnd", $hWnd, "hwnd", $nHwnd);change the parent of the control to the new gui
If $a[0] = 0 then Return SetError(1,5,0)
If NOT ControlMove($nHwnd,'',$hWnd,0,0) then Return SetError(1,6,-1);Move the control to 0,0 of the newly created child gui
GUISetState(@SW_Show,$nHwnd);show the new child gui
WinSetTrans($nHwnd,"",$iTrans);set the transparency
If @error then Return SetError(1,7,0)
GUISwitch($pHwnd[0]);switch back to the parent Gui
Return $nHwnd;Return the handle for the new Child gui
EndFunc
mfg
nefas