i have a script that let you type text then give a random result on an output box, writes the result on a text file and tries to add the result text to an edit box but doesn't support multiple lines. I want the script to add lines of results on the edit box (as a log of results)
#include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <File.au3> #include <Date.au3> Global $result1s=["one", "two", "three"] _Main() Func _Main() Local $button1 Local $output, $die, $msg, $results1 Local $file = FileOpen("test.txt", 1) Local $g_idEdit GUICreate("test", 600, 400, -1, -1) $button1 = GUICtrlCreateButton("Result", 432, 350, 80, 40) $sText = $results1 $edit = GUICtrlCreateEdit($sText & @CRLF & $sText & @CRLF & $sText, 60, 50, 450, 300, BitOr($GUI_SS_DEFAULT_EDIT, $ES_READONLY)) $output1 = GUICtrlCreateInput("", 60, 30, 450, 20, BitOR($ES_CENTER, $ES_READONLY)) $g_idEdit = GUICtrlCreateEdit("", 60, 10, 450, 20, $SS_LEFT) $die = GUICtrlCreateLabel("", 700, 500, 700, 20, $SS_SUNKEN) GUICtrlSetFont($output, 8, 800, "", "Verdana") GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $button1 $results1 = Random(1, 2, 1) GUICtrlSetData($output1, $result1s[$results1]) GUICtrlSetData($edit, $result1s[$results1]) $read1 = GUICtrlRead($output1) FileWriteLine($file, _NowDate()& " " & _nowTime() & " " &GUICtrlRead($g_idEdit)) FileWriteLine($file, _NowDate()& " " & _nowTime() & " " &$read1) EndSelect If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>_Main
I'm looking for a way to do a Video Overlay GUI or something like that. The idea is to create a GUI which plays a video loop (with transparency/alpha channel) in front of an other GUI. Before you asking why - because I don't believe that GDIPlus can do it out of the box. My skillset for that kind of graphical things isn't good enough to do that, but here are some specialist like @UEZ maybe who can help.
Example alpha channel video (visualized as animated *.gif):
I tried to do the light rays effect directly with GDIPlus, but honestly that's a bit too difficult for me. I would be very glad and grateful if there are some suggestions, ideas or recommendations.
Code for the Video play:
Example video "End.mpeg":
The next challenge is that the overlay GUI should be not clickable. If I hover over the overlay area, I want to have the possibility to control the GUI or what ever, in the background. But if there is any chance to make it with GDIPlus as a Video Overlay for light rays, I would prefer that approach instead of my crazy work-around idea.
Thanks for any suggestion - I'm grateful!
I am searching for a way to display a transparent image (or Icon) over an Button. And the image should always stay on top.
Here is what i have so far:
At script start the picture is over the button..but if you move the mouse over the button it overlaps the image.
And if i add $GUI_ONTOP to the picture, the transparency is gone
Maybe someone has an idea..
Thanks in advance!
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WinAPIIcons.au3> #include <WinAPIShellEx.au3> GUICreate("GUI", 300, 300) $hbutton = GUICtrlCreateButton("This is a button", 20, 40, 150, 30,$WS_CLIPSIBLINGS) $hpic = GUICtrlCreatePic("", 10, 10, 128, 128) _SetIconAlpha($hpic,"shell32.dll", 12,128,128) GUICtrlSetState(-1, $GUI_DISABLE) ;~ GUICtrlSetState(-1,$GUI_ONTOP) ;If you uncomment this..the picture is on top...but the transparency is gone :( GUISetState() While 1 $Msg = GUIGetMsg() If $Msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Func _SetIconAlpha($hWnd, $sIcon, $iIndex, $iWidth, $iHeight) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) If $hWnd = 0 Then Return SetError(1, 0, 0) EndIf EndIf If $iIndex <> 0 Then $iIndex = $iIndex - 1 Local $hIcon = _WinAPI_ShellExtractIcon($sIcon, $iIndex, $iWidth, $iHeight) If $hIcon = 0 Then Return SetError(1, 0, 0) EndIf Local $hBitmap, $hObj, $hDC, $hMem, $hSv $hDC = _WinAPI_GetDC($hWnd) $hMem = _WinAPI_CreateCompatibleDC($hDC) $hBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $iWidth, $iHeight) $hSv = _WinAPI_SelectObject($hMem, $hBitmap) _WinAPI_DrawIconEx($hMem, 0, 0, $hIcon, $iWidth, $iHeight, 0, 0, 2) _WinAPI_ReleaseDC($hWnd, $hDC) _WinAPI_SelectObject($hMem, $hSv) _WinAPI_DeleteDC($hMem) _WinAPI_DestroyIcon($hIcon) _WinAPI_DeleteObject(_SendMessage($hWnd, 0x0172, 0, 0)) _SendMessage($hWnd, 0x0172, 0, $hBitmap) $hObj = _SendMessage($hWnd, 0x0173) If $hObj <> $hBitmap Then _WinAPI_DeleteObject($hBitmap) EndIf Return 1 EndFunc ;==>_SetIconAlpha
I know many newbies search for this feature.
I decided to share this piece of code with everyone.
Basically its a "splash screen" that has a transparent image.
In a nutshell - Gui with a transparent gif.
Splash Screen GUI.zip
Hello everyone !
I'm making a little password generator with save function.
And i would like to set a line limit at 25.
For my script, the user have to enter a name in "$input1" and click on the button "$btn_save" to display it in the editbox "$edit1".
The user can't edit himself because the edit box have $ES_READONLY
If someone know how, Thanks you !
PS: I've already looked in the help and didn't find anything..