
reb
Active Members-
Posts
218 -
Joined
-
Last visited
-
Days Won
1
Everything posted by reb
-
How to delete the variables after used?
reb replied to hiepkhachsg's topic in AutoIt General Help and Support
Why would this not work? It seems like your "security info" would not exist but only the new values placed there. -
Your script is untitled. Save it and every thing should work.
-
How to Have Two Keys in a HotKeySet
reb replied to mike0264's topic in AutoIt General Help and Support
@ Melba23 Thanks for the correction. I was fooled by numpad2 being first. pressing 1 did not work and then I only pressed 1 & 2 together, never 2 alone. I Learned somethings new Today. 1. Test all possibilities & 2. Your method of handling it. Happy New Year REB -
How to Have Two Keys in a HotKeySet
reb replied to mike0264's topic in AutoIt General Help and Support
This should do it. HotKeySet("{Numpad2}{Numpad1}","_Start") while 11 Sleep(100) WEnd Func _Start () MsgBox(0,"","Got it") EndFunc Happy new year. -
Try this link https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCEQFjAAahUKEwiK9MLh3ojJAhWETCYKHXKKBWw&url=https%3A%2F%2Fwww.autoitscript.com%2Fforum%2Fapplications%2Fcore%2Finterface%2Ffile%2Fattachment.php%3Fid%3D25713&usg=AFQjCNGA4R2RA95c2T1n89qSdpdyNNcfHA&cad=rja
- 13 replies
-
- dllcall
- codewizard
-
(and 2 more)
Tagged with:
-
If the lessons are all as clear as section 1 I might learn something after all. Thanks for the link
-
GUI Button Text Alignment & Text Color question
reb replied to tbwalker's topic in AutoIt GUI Help and Support
Labels will do the job. #include <GUIConstantsEx.au3> #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> Local $Form1 = GUICreate("button text color test", 250, 250) ;BUTTON 1 WITH NO TEXT COLOR CHANGE Local $button1 = GUICtrlCreateLabel("Line 1 of text" & @CRLF & "Line 2 of text" _ & @CRLF & "Line 3 of text", 50, 10, 150, 70) ; , BitOR($BS_MULTILINE,$BS_LEFT)) ;BUTTON 2 WITH TEXT COLOR CHANGE Local $button2 = GUICtrlCreateLabel("Line 1 of text" & @CRLF & "Line 2 of text" _ & @CRLF & "Line 3 of text", 50, 100, 150, 70) ; , BitOR($BS_MULTILINE,$BS_LEFT)) GUICtrlSetColor ( $button2, 0xCC0066 ) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button1 MsgBox(0, "ControlID = " & $Button1, "Button 1 was Pressed!") Case $Button2 MsgBox(0, "ControlID = " & $Button1, "Button 2 was Pressed!") EndSwitch WEnd -
Limiting moves of a borderless window ...
reb replied to snaileater's topic in AutoIt GUI Help and Support
This Limits the x,y co-ordinates ; Original code - martin #include <GuiconstantsEx.au3> #include <WindowsConstants.au3> #include <SendMessage.au3> #include <MsgBoxConstants.au3> #include <Array.au3> Global Const $SC_DRAGMOVE = 0xF012 Local $xlimit = 300, $xlimit2 = 900, $Ylimit = 300, $Ylimit2 = 500 Local $Pos, $mP[1] HotKeySet("{ESC}", "On_Exit") local $hGUI = GUICreate("X", 100, 100, -1, -1, $WS_POPUP) GUISetBkColor(0x00FF00, $hGUI) $hButton = GUICtrlCreateButton("Test", 10, 35, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_PRIMARYDOWN _SendMessage($hGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0) Case $hButton On_Button() EndSwitch Checkx() WEnd Func On_Button() MsgBox(0, "Hi", "Button Pressed") EndFunc ;==>On_Button Func On_Exit() Exit EndFunc ;==>On_Exit Func Checkx() $Info = GUIGetCursorInfo($hGUI) if $Info[2] = 1 then return $Pos = WinGetPos($hGUI,"") ; x, y, width, height if $Pos > $xlimit or $Pos < $xlimit2 then MsgBox(0,"","Returned") return EndIf Select Case $Pos[0] < $xlimit and $Info[2] = 0 WinMove($hGUI,"",$xlimit,$Pos[1]) if $Pos[1] < $ylimit Then WinMove($hGUI,"",$Pos[0], $ylimit) if $Pos[1] > $ylimit2 Then WinMove($hGUI,"",$Pos[0], $ylimit2) Case $Pos[0] > $xlimit2 and $Info[2] = 0 WinMove($hGUI,"",$xlimit2,$Pos[1]) if $Pos[1] < $ylimit Then WinMove($hGUI,"",$Pos[0], $ylimit) if $Pos[1] > $ylimit2 Then WinMove($hGUI,"",$Pos[0], $ylimit2) Case $Pos[0] > $xlimit and $Info[2] = 0 if $Pos[1] < $ylimit Then WinMove($hGUI,"",$Pos[0], $ylimit) if $Pos[1] > $ylimit2 Then WinMove($hGUI,"",$Pos[0], $ylimit2) EndSelect EndFunc- 4 replies
-
- borderless
- move
-
(and 1 more)
Tagged with:
-
Limiting moves of a borderless window ...
reb replied to snaileater's topic in AutoIt GUI Help and Support
WinGetPos returns an arry $aArray[0] = X position $aArray[1] = Y position $aArray[2] = Width $aArray[3] = Height if x y exceeds your desired position then reset window to what you want.- 4 replies
-
- borderless
- move
-
(and 1 more)
Tagged with:
-
@ BrewManNH I revised my post just above yours using label constants. I see your point. Thank you. #include <Constants.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ColorConstantS.au3> #include <FontConstants.au3> #include "ColorConstants.au3" Opt("GUIOnEventMode", 1) $GUI = GUICreate("GUI", 250, 300) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $bBm = "Button" & @CRLF & "One" $Button = GUICtrlCreateLabel(@CRLF & $bBm, 160, 185, 85, 110, $SS_CENTER,$WS_EX_CLIENTEDGE) ;, $SS_CENTERIMAGE)) ; $BS_MULTILINE, $BS_CENTER, $BS_VCENTER, $WS_EX_WINDOWEDGE)) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetFont($Button, 14, 800, 0, "MV Boli", 5) GUICtrlSetColor($Button, 0xFF0000) GUICtrlSetOnEvent($Button, "_Exit") GUISetState() While 1 Sleep(100) WEnd Func _Exit() Exit EndFunc ;==>_Exit .
- 6 replies
-
- button
- guictrlsetbkcolor
-
(and 1 more)
Tagged with:
-
I guess you could always fake a button with a label. include <Constants.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ColorConstantS.au3> #include <FontConstants.au3> #include "ColorConstants.au3" Opt("GUIOnEventMode", 1) $GUI = GUICreate("GUI", 250, 300) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $bBm = "Button" & @CRLF & "One" $Button = GUICtrlCreateLabel(@CRLF & $bBm, 160, 185, 85, 110, BitOR($SS_CENTER, $BS_VCENTER),$WS_EX_CLIENTEDGE) ;, $SS_CENTERIMAGE)) ; $BS_MULTILINE, $BS_CENTER, $BS_VCENTER, $WS_EX_WINDOWEDGE)) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetFont($Button, 14, 800, 0, "MV Boli", 5) GUICtrlSetColor($Button, 0xFF0000) GUICtrlSetOnEvent($Button, "_Exit") GUISetState() While 1 Sleep(100) WEnd Func _Exit() Exit EndFunc ;==>_Exit _WinAPI_DrawText
- 6 replies
-
- button
- guictrlsetbkcolor
-
(and 1 more)
Tagged with:
-
This works for me. #include <Constants.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ColorConstantS.au3> #include <FontConstants.au3> #include "ColorConstants.au3" Opt("GUIOnEventMode", 1) $GUI = GUICreate("GUI", 250, 300) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $Button = GUICtrlCreateButton("Button" & @CRLF & "One", 160, 185, 85, 110, BitOR($SS_CENTER, $SS_CENTERIMAGE)) ; $BS_MULTILINE, $BS_CENTER, $BS_VCENTER, $WS_EX_WINDOWEDGE)) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetFont($Button, 14, 800, 0, "MV Boli", 5) GUICtrlSetColor($Button, 0xFF0000) GUICtrlSetOnEvent($Button, "_Exit") GUISetState() While 1 Sleep(100) WEnd Func _Exit() Exit EndFunc ;==>_Exit
- 6 replies
-
- button
- guictrlsetbkcolor
-
(and 1 more)
Tagged with:
-
I did also. McAffe quarantined it. I just turned off the live scan and turned off the internet then re installed. then reactivated McAffe and excluded the file in real time scan. I just trust Autoit to not do anything like that.
-
Change The Size Of The Gui Title Bar?
reb replied to ManneMoses's topic in AutoIt GUI Help and Support
@JohnOne I like that. Centered text in label ;~ Name: JohnOne ;~ URL: https://www.autoitscript.com/forum/topic/173672-change-the-size-of-the-gui-title-bar/#comment-1257450 #include <WindowsConstants.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> ;~ Local $GUI_WS_EX_PARENTDRAG GUICreate("GUI", 200, 200, 100, 100, 0x80880000) ; 0x80880000 = $WS_POPUPWINDOW $TitleBar = GUICtrlCreateLabel("Title Bar", 0, 0, 160, 40,BitOR($SS_CENTER,$SS_CENTERIMAGE),0x00100000) ;$GUI_WS_EX_PARENTDRAG) ; 0x00100000 = $GUI_WS_EX_PARENTDRAG , -1 GUICtrlSetBkColor(-1, 0x0000FF) GUICtrlSetColor(-1, 0xFFFFFF) $Close = GUICtrlCreateButton("X", 160, 0, 40, 40,$WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, 0xFF0000) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetFont($TitleBar,10,600) GUISetState(@SW_SHOW) While 3 Switch GUIGetMsg() Case -3 Exit Case $Close Exit EndSwitch WEnd -
If the items exist then why not use _GUICtrlListView_SetItem ?
-
I found this This. It certainly puts win 8.1 in hibernate but does not restore it after the time set with this. SetWakeUpTime(@HOUR,@min+1); wakeup the system in 2 minutes from now Start button wakes up just fine.
-
Get arrow keys by Windows Message Code
reb replied to Luigi's topic in AutoIt General Help and Support
Try This Sory this does not work correctly. I will check later to find out what is wrong with it. Local $Out = 0 HotKeySet("{UP}{DOWN}","UPDOWN") do Sleep(10) Until $Out = 1 Func UPDOWN() MsgBox(0,"","UP Down Presses") $Out = 1 EndFunc -
This might be of some use to you. local $MainWindow = GUICreate("Sample window") GUISetState(@SW_SHOW, $MainWindow)
-
Whats going wrong with my rotation script?
reb replied to Wendallwoof's topic in AutoIt General Help and Support
From the help file (I need it all the time) WinGetStateRetrieves the state of a given window. WinGetState ( "title" [, "text"] ) ParameterstitleThe title/hWnd/class of the window to get the state. See Title special definition.text[optional] The text of the window to get the state. Default is an empty string. See Text special definition.Return ValueSuccess:a value indicating the state of the window. Multiple values are added together so use BitAND() to examine the part you are interested in: 1 = Window exists 2 = Window is visible 4 = Window is enabled 8 = Window is active 16 = Window is minimized 32 = Window is maximized -
Declared undeclared var at start of script . Look for the <------------------------------------------ on lien 5 Did not test. #include <WinAPI.au3> #include <File.au3> #include <GDIPlus.au3> Local $WALLPAPER_STRETCH ;<---------------------- Declared variable here #Region WallpaperSet() ; =================================================================== ; WallpaperSet($sPath, $nStyle = $WALLPAPER_STRETCH, $sConversionPath = "") ; ; Sets the desktop wallpaper to the specified file. ; Parameters: ; $sPath - IN - The path to the wallpaper file. If this file is not a BMP then it will be converted ; to a BMP at either $sConversionPath (if present) or an auto-generated location. ; $nStyle - IN/OPTIONAL - Controls the display of the wallpaper using the $WALLPAPER_* flags. ; $sConversionPath - IN/OPTIONAL - The path to save a BMP wallpaper when one is generated from ; a non-BMP wallpaper. ; Returns: ; Success - Returns True. ; Failure - Returns False and sets @error to non-zero. ; =================================================================== Func WallpaperSet($sPath, $nStyle = $WALLPAPER_STRETCH, $sConversionPath = "") ; Ensure the file exists. Allows an empty path which clears the wallpaper. If $sPath And Not FileExists($sPath) Then Return SetError(1, 0, False) ; Split the path. Local $sDrive, $sDir, $sFile, $sExt _PathSplit($sPath, $sDrive, $sDir, $sFile, $sExt) ; Convert the image to a bitmap. If $sPath And $sExt <> ".bmp" Then ; Startup GDI Plus. If Not _GDIPlus_Startup () Then Return SetError(2, 0, False) ; Declare variables that are used inside and outside the loop. Local $hImage, $nError, $nExtended ; Pseudo-loop so that cleanup will always happen. Do ; Load the image in it's original format. $hImage = _GDIPlus_ImageLoadFromFile($sPath) If $hImage = -1 Then $nError = 3 ExitLoop EndIf ; Get the Bitmap converter CLSID. Local $sCLSID = _GDIPlus_EncodersGetCLSID ("BMP") If Not $sCLSID Then $nError = 4 ExitLoop EndIf ; If the conversion path isn't specified generate one from the input file. If Not $sConversionPath Then $sConversionPath = _PathMake($sDrive, $sDir, $sFile, ".bmp") ; Change the input path to the converted path. $sPath = $sConversionPath ; Save the output file to the new path. If Not _GDIPlus_ImageSaveToFileEx($hImage, $sPath, $sCLSID) Then $nError = 5 ExitLoop EndIf Until True ; Release the image. _GDIPlus_ImageDispose($hImage) ; Shutdown GDI Plus. _GDIPlus_ShutDown() ; Abort if an error occurred in the loop. If $nError Then Return SetError($nError, $nExtended, False) EndIf ; Constant for the registry key where the wallpaper information is stored. Local Const $sRegKey = "HKEY_CURRENT_USER\Control Panel\Desktop" ; Tiling and centering/stretching are handled by two separate keys. If ; tiling then the style needs set to 0 and tile needs set to 1. Otherwise ; tile needs set to 0 and the style needs set to either 0 or 2. If $nStyle = $WALLPAPER_TILE Then RegWrite($sRegKey, "TileWallPaper", "REG_SZ", 1) RegWrite($sRegKey, "WallpaperStyle", "REG_SZ", 0) Else RegWrite($sRegKey, "TileWallPaper", "REG_SZ", 0) RegWrite($sRegKey, "WallpaperStyle", "REG_SZ", $nStyle) EndIf ; Constants for SystemParametersInfo(). Local $SPI_SETDESKWALLPAPER = 20 Local $SPIF_UPDATEINIFILE = 1 Local $SPIF_SENDCHANGE = 2 ; Create a structure to hold the path string. Local $vPath = DllStructCreate("wchar[" & StringLen($sPath) + 1 & "]") DllStructSetData($vPath, 1, $sPath) ; Update the wallpaper. Local $bResult = _WinAPI_SystemParametersInfo($SPI_SETDESKWALLPAPER, 0, DllStructGetPtr($vPath), BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDCHANGE)) ; Ensure the update was successful. If not set @error to a unique value. If Not $bResult Then Return SetError(6, 0, $bResult) Return $bResult EndFunc ; WallpaperSet() #EndRegion WallpaperSet() InetGet("http://mattys-stuff.uboxi.com/s.bmp", @TempDir & "\s.bmp") WallpaperSet(@TempDir&"\s.bmp",$WALLPAPER_STRETCH) ChangeDesktopWallPaper(@TempDir & '\' & 's.bmp',1)
-
Try This Google search site:autoitscript.com set image as wallpaper
-
Internet Speed check and check provider
reb replied to Wingens's topic in AutoIt General Help and Support
a couple of on line tests http://testinternetspeed.org/ http://www.att.com/speedtest/ -
put your room name into $YourArray[x][0] put your ip address into $YourArray[x][1] then do an _ArraySearch from the help file: Return ValueSuccess:the index that $vValue was found at.