Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/10/2018 in all areas

  1. I do not read my english is very bad
    1 point
  2. moimon

    WinHTTP functions

    This should be: #include "WinHttp.au3" $sDomain = "api-metrika.yandex.com" $sPage = "/stat/v1/data?preset=tech_platforms&dimensions=ym:s:browser&id=2138128&oauth_token=05dd3dd84ff948fdae2bc4fb91f13e22bb1f289ceef0037" ; Initialize and get session handle $hOpen = _WinHttpOpen() ; Get connection handle $hConnect = _WinHttpConnect($hOpen, $sDomain) ; Make a request $hRequest = _WinHttpOpenRequest($hConnect, "GET", $sPage) _WinHttpSendRequest($hRequest) ; Wait for the response _WinHttpReceiveResponse($hRequest) ; See what's returned Dim $sReturned If _WinHttpQueryDataAvailable($hRequest) Then ; if there is data Do $sReturned &= _WinHttpReadData($hRequest) Until @error EndIf ; Close handles _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) ; See what's returned MsgBox(4096, "Returned", $sReturned) ConsoleWrite($sReturned & @CRLF)
    1 point
  3. Asking this question means you are not understanding your own script so start with studying it and learn by trying. Jos
    1 point
  4. Your code is really pretty messed up as far as logic is concerned. Have a look at this version and see if that is what you like to do: #include <Misc.au3>; include statements To handdel basic input functions #include <MsgBoxConstants.au3>; include statement To use message box object #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 254, 233, 516, 270) $List1 = GUICtrlCreateList("", 16, 8, 217, 149, BitOR($LBS_STANDARD, $LBS_EXTENDEDSEL)) ; BitOR style taken from help file $sItems = "+|-|*|/" GUICtrlSetData($List1, $sItems) _GUICtrlListBox_SetSel($List1, 1) ; Set position 1 (which is the 2nd in list) as default $Button1 = GUICtrlCreateButton("Select", 80, 176, 75, 25) GUISetState(@SW_SHOW) $selItems = _GUICtrlListBox_GetSelItemsText($sItems) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Button1 Switch GUICtrlRead($List1) Case "+" MsgBox(0, "You choose:", "+") Case "-" MsgBox(0, "You choose:", "-") Case "*" MsgBox(0, "You choose", "*") Case "/" MsgBox(0, "You choose", "/") EndSwitch EndSwitch WEnd Jos
    1 point
  5. you can do it like : HotKeySet("{ENTER}", "ENTER_KEY") You GUI code here Func Enter_Key () if not WinActive($GUI_ttl) then HotKeySet("{ENTER}") Send ("{ENTER}") HotKeySet("{ENTER}", "ENTER_KEY") endif EndFunc
    1 point
  6. I told you it was untested, how are you going to fix it? Think of it as a learning experience. I have included the corrected version that works right, but you should try to fix it for yourself first, minor problem in the code.
    1 point
  7. @Nadsky although I didn't understand the IT joke above, the basic principle is sound; we cannot do much to help based off a screenshot. This is a coding forum; in order to best help you we need to see your code. That said, if you are taking in input from the user (be it sensitive or not) there are only so many things you can do with it: you can declare the variable and hold it in memory (good only for as long as the parent process is running) you can store it in a file on the hard drive or local network (be it database, text, ini, etc. etc), encrypted, hashed, permission-locked, etc. you can store it in the registry write out to an online repository In all cases, you have to understand that AutoIt is not going to be 100% secure, anyone will be able to read your source code with very little effort. The question of "how do I 100% protect sensitive data in my script?" has been asked and answered so many times that we simply don't discuss any longer. If you determine how you would like to store the data specifically, please let us know and we will do our best to assist
    1 point
  8. Ascer

    WinHTTP functions

    Trancexx is ded bro. WinHttp default convert Binary to String from ResponseText so in my opinion better use InetRead function. Local $sBinaryImage = InetRead("http://maps.googleapis.com/maps/api/staticmap?center=10.82,14.34&zoom=12&size=465x365&markers=size:mid%7Ccolor:red%7C40.82,14.34")
    1 point
  9. jguinch

    start IE In Private mode

    Try this one : #Include <IE.au3> Local Const $navOpenInNewTab = 0x0800 Local $sURL = "http://www.forsythpl.org" Local $oIE = _IECreatePrivate($sURL) $oIE.Navigate2('http://www.autoitscript.com/forum', $navOpenInNewTab) Func _IECreatePrivate($sURL = "", $iWait = 1) Local $iPid = ShellExecute ("iexplore.exe", "-private about:blank") If Not $iPid Then Return SetError(1, 0, 0) Local $hIEPrivate = WinWait("[REGEXPTITLE:\[InPrivate\]$]") Local $oIEPrivate = _IEAttach($hIEPrivate, "hwnd") If @error Then Return SetError(2, 0, 0) _IENavigate($oIEPrivate, $sURL, $iWait) Return $oIEPrivate EndFunc
    1 point
  10. If you want to minimize a window, check WinSetState ( "title", "text", flag )
    1 point
  11. It's late and Screen brightness hurts your eyes and you do not remember how you can regulate it ? I get a solution ! TinyBrightnessControler Left click on Tray Icon for show Controler and Right click for Tray Menu, that's all ! #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=Electric bulb1.ico #AutoIt3Wrapper_outfile=TinyBrightnessControler.exe #AutoIt3Wrapper_Res_Description=Adjust Screen Brightness #AutoIt3Wrapper_Res_Fileversion=1.0.0.2 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p #AutoIt3Wrapper_Res_LegalCopyright=Copyright 2011 wakillon #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Res_Field=AutoIt Version|%AutoItVer% #AutoIt3Wrapper_Res_Field=Compile date|%longdate% %time% #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ----------------------------------------------------------------------------------------------------------- AutoIt Version : 3.3.6.1 Author : wakillon Based on the noctis Post : http://autoit.de/index.php?page=Thread&postID=83474#post83474 Title : TinyBrightnessControler Script Fonction : Adjust Screen Brightness. Left click on Tray Icon for show Controler and Right click for Tray Menu. #ce ----------------------------------------------------------------------------------------------------------- #include <WindowsConstants.au3> #include <GuiSlider.au3> Opt ( "TrayOnEventMode", 1 ) Opt ( "TrayMenuMode", 1 ) OnAutoItExitRegister ( "_Exit" ) Global Const $TRAY_UNCHECKED = 4 Global Const $TRAY_EVENT_PRIMARYDOWN = -7 Global $_Rgb, $_DefaultItem, $_GetPosOld, $_AboutItem, $_TitleItem, $_UpdateItem, $_SaveItem Global $_Gui, $_Slider, $_Label1, $_Label2, $_Dll Global $_Version = _GetScriptVersion ( ) _TrayMenu ( ) $_Rgb = RegRead ( "HKEY_LOCAL_MACHINESoftwareTBC", "Gamma" ) If $_Rgb = '' Then $_Rgb =128 $_GetPosOld=$_Rgb _SetGamma ( $_Rgb, $_Rgb, $_Rgb ) While 1 Sleep ( 10 ) WEnd Func _DisplaySlider ( ) Local $_MousePos = MouseGetPos ( ) Local $_GuiWight= 50, $_GuiHeight=230 Local $_Gui = GUICreate ( "", $_GuiWight, $_GuiHeight, $_MousePos[0]-$_GuiWight/2, @DesktopHeight - $_GuiHeight - _GetTaskbarHeight ( ) -2, _ BitOR ( $WS_POPUP, $WS_BORDER ), $WS_EX_TOPMOST, WinGetHandle ( AutoItWinGetTitle ( ) ) ) $_Label1 = GUICtrlCreateLabel ( "Min", 15, 10 ) $_Slider = GUICtrlCreateSlider ( 15, 30, 20, 180, BitOR ( $TBS_VERT, $TBS_TOOLTIPS, $TBS_AUTOTICKS ) ) GUICtrlSetLimit ( -1, 256, 0 ) $_Label2 = GUICtrlCreateLabel ( "Max", 15, 210 ) GUISetState ( ) _GUICtrlSlider_SetPos ( $_Slider, $_GetPosOld ) $_TimerInit = TimerInit ( ) While 1 $_GetPos = _GUICtrlSlider_GetPos ( $_Slider ) If $_GetPos <> $_GetPosOld Then $_Rgb = $_GetPos _SetGamma ( $_Rgb, $_Rgb, $_Rgb ) $_GetPosOld = $_GetPos $_TimerInit = TimerInit ( ) EndIf If _IsMouseOverCtrls ( $_Gui ) Then $_TimerInit = TimerInit ( ) $_TimerDiff = Round ( TimerDiff ( $_TimerInit )/ 1000 ) If $_TimerDiff > 2 Then ExitLoop WEnd GUIDelete ( ) EndFunc ;==> _DisplaySlider ( ) Func _IsMouseOverCtrls ( $_GuiHwnd, $_Active=0 ) $_CursorInfo = GUIGetCursorInfo ( $_GuiHwnd ) If Not @error Then Switch $_CursorInfo[4] Case $_Slider, $_Label1, $_Label2 Return 1 EndSwitch EndIf EndFunc ;==> _IsMouseOverCtrls ( ) Func _Normal ( ) TrayItemSetState ( $_DefaultItem, $TRAY_UNCHECKED ) $_Rgb = 128 $_GetPosOld = 128 _SetGamma ( $_Rgb, $_Rgb, $_Rgb ) EndFunc ;==> _Normal ( ) Func _Exit ( ) DllClose ( $_Dll ) Exit EndFunc ;==> _Exit ( ) Func _SetGamma ( $vRed=128, $vGreen=128, $vBlue=128 ) Local $n_ramp, $rVar, $gVar, $bVar, $Ret, $i, $dc If $vRed < 0 Or $vRed > 386 Then Return -1 If $vGreen < 0 Or $vGreen > 386 Then Return -1 If $vBlue < 0 Or $vBlue > 386 Then Return -1 $dc = DLLCall ( "user32.dll", "int", "GetDC","hwnd", 0 ) $n_ramp = DllStructCreate ( "short[" & ( 256*3 ) & "]" ) For $i = 0 to 256 $rVar = $i * ( $vRed + 128 ) If $rVar > 65535 Then $rVar = 65535 $gVar = $i * ( $vGreen + 128 ) If $gVar > 65535 Then $gVar = 65535 $bVar = $i * ( $vBlue + 128 ) If $bVar > 65535 Then $bVar = 65535 DllStructSetData ( $n_ramp, 1, Int ( $rVar ), $i ) ; red DllStructSetData ( $n_ramp, 1, Int ( $gVar ), $i+256 ) ; green DllStructSetData ( $n_ramp, 1, Int ( $bVar ), $i+512 ) ; blue Next $ret = DLLCall ( "gdi32.dll", "int", "SetDeviceGammaRamp", "int", $dc[0], "ptr", DllStructGetPtr ( $n_Ramp ) ) $dc = 0 $n_Ramp = 0 EndFunc ;==> _SetGamma ( ) Func _TrayMenu ( ) $_TempDir = @TempDir & 'TBCskin' If Not FileExists ( $_TempDir ) Then DirCreate ( $_TempDir ) If Not FileExists ( $_TempDir & 'Electric bulb1.ico' ) Then _ InetGet ( 'http://tinyurl.com/d3srkot', $_TempDir & 'Electric bulb1.ico', 9, 0 ) TraySetToolTip ( $_Version & @CRLF & @CRLF & '* Left click for show Controler' & @CRLF & '* Right click for Tray Menu' & @CRLF ) TraySetIcon ( $_TempDir & 'Electric bulb1.ico' ) TraySetClick ( 16 ) TraySetOnEvent ( $TRAY_EVENT_PRIMARYDOWN, '_DisplaySlider' ) $_TitleItem = TrayCreateItem ( $_Version ) TrayItemSetOnEvent ( -1, '_UnCheck' ) TrayCreateItem ( '' ) $_DefaultItem = TrayCreateItem ( 'Set Brightness To Normal' ) TrayItemSetOnEvent ( -1, '_Normal' ) TrayCreateItem ( '' ) $_UpdateItem = TrayCreateItem ( "See For Update" ) TrayItemSetOnEvent ( -1, '_SeeForUpdate' ) TrayCreateItem ( "" ) $_AboutItem = TrayCreateItem ( "About" ) TrayItemSetOnEvent ( -1, '_About' ) TrayCreateItem ( "" ) $_SaveItem = TrayCreateItem ( "Save Settings" ) TrayItemSetOnEvent ( -1, '_Save' ) TrayCreateItem ( "" ) $_ExitItem = TrayCreateItem ( 'Exit' ) TrayItemSetOnEvent ( -1, '_Exit' ) TraySetState ( 4 ) EndFunc ;==> _TrayMenu ( ) Func _Save ( ) TrayItemSetState ( $_SaveItem , $TRAY_UNCHECKED ) RegWrite ( "HKEY_LOCAL_MACHINESoftwareTBC", "Gamma", "REG_SZ", $_Rgb ) Msgbox ( 262144+4160, "Saved", "Gamma Settings have been saved", 3 ) EndFunc Func _SeeForUpdate ( ) TrayItemSetState ( $_UpdateItem , $TRAY_UNCHECKED ) ShellExecute ( 'http://www.autoitscript.com/forum/topic/127668-tinybrightnesscontroler/' ) EndFunc ;==> _SeeForUpdate ( ) Func _UnCheck ( ) TrayItemSetState ( $_TitleItem , $TRAY_UNCHECKED ) EndFunc ;==> _UnCheck ( ) Func _GetScriptVersion ( ) If Not @Compiled Then Return StringTrimRight ( @ScriptName, 4 ) & ' © wakillon 2010 - 2011' Else Return StringTrimRight ( @ScriptName, 4 ) & ' v' & FileGetVersion ( @ScriptFullPath ) & ' © wakillon 2010 - 2011' EndIf EndFunc ;==> _GetScriptVersion ( ) Func _About ( ) TrayItemSetState ( $_AboutItem , $TRAY_UNCHECKED ) Msgbox ( 262144+4160, "About : ", $_Version & @CRLF & @CRLF & "April 2011" & @CRLF & @CRLF & "Based on the noctis's Gamma Topic on AutoIt.de" & @CRLF & @CRLF & "wakillon." & @CRLF & " " ) EndFunc ;==> _About ( ) Func _GetTaskbarHeight ( ) $_OptOld = Opt ( "WinTitleMatchMode", 4 ) $_WinPos = WinGetPos ( "classname=Shell_TrayWnd" ) If @error Then Return -1 Opt ( "WinTitleMatchMode", $_OptOld ) Return $_WinPos[3] EndFunc ;==> _GetTaskbarHeight ( ) Scripts and executables with full embeded files are available on GoogleCode, see link in my sig. Comments are welcome ! All this time spent in front of the screen, remember to protect your eyes !
    1 point
  12. Zedna

    Error adding file

    Try to use full path FileInstall("c:\yourpath\Yahoomessenger.msi",$Program)
    1 point
×
×
  • Create New...