Jump to content

tobi95

Members
  • Posts

    16
  • Joined

  • Last visited

tobi95's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. yes, this is true. it's not so complicated to create a selfmade segmented one. good idea.
  2. hmm thanx but no doesn't change anything. the uxthemes have to be turned off in winxp to enable a smooth ($PBS_SMOOTH) progress bar. but i want a segmented progress bar (default style) in win7. i do not use $PBS_SMOOTH style. it seems win7 always draws smooth bars.
  3. when i create a progress control in default style, i get a segmented bar in win xp. in win7 it is always smooth. $PBS_VERTICAL style works with win7, and i get a marquee effect with style=8. but is it possible to get the original progress bar with segments in win7 ? thx in advance t. (example script is the SampleControls.au3 in autoit examples directory)
  4. ooops i think i found the answer. i did not save the html properly to my harddrive. wrong fileopen mode. which mode is recommended to save unicode html pages ? 32 = Use Unicode UTF16 Little Endian reading and writing mode. Reading does not override existing BOM. 64 = Use Unicode UTF16 Big Endian reading and writing mode. Reading does not override existing BOM. 128 = Use Unicode UTF8 (with BOM) reading and writing mode. Reading does not override existing BOM. 256 = Use Unicode UTF8 (without BOM) reading and writing mode. 16384 = When opening for reading and no BOM is present, use full file UTF8 detection. If this is not used then only the initial part of the file is checked for UTF8. no. i tried every mode, the unicode characters are not displayed in the embed control. i have no idea
  5. when i use ObjCreate("Shell.Explorer.2") for an embedded interrnet explorer control it won't display unicode characters properly altho my IE is set to unicode and displays the same page properly. anyone an idea ? thx in advance. i hope someone has the trick.
  6. the adapted script from the above link does not work either. same problem as before. #include <Math.au3> $jDll = DllOpen("Wininet.dll") $Buffer = Inet_Read('http://www.autoitscript.com/site/wp-content/themes/TheCorporation/images/logo.png',100) MsgBox(0,"",@error) $Of = FileOpen("test.png",2) FileWrite($Of,Binary(DllStructGetData($Buffer,1))) FileClose($Of) Func Inet_Read($lpszUrl,$ByteAtaTime) if ($ByteAtaTime <= 0) Then Return SetError(1,0,0) $HIntOpen = InternetOpen("OPEN") if Not ($HIntOpen) Then Return SetError(2,0,0) $HIntOpenUrl = InternetOpenUrl($HIntOpen,$lpszUrl,"",0,0,0) if Not ($HIntOpenUrl) Then Return SetError(3,0,0) $FileSize = HttpQueryInfo($HIntOpenUrl,5) if @error Then Return SetError(4,0,0) $Buffer = DllStructCreate("BYTE[" & $FileSize & "]") $lpBuffer = DllStructGetPtr($Buffer) Local $MovePos = 0 $FileSize = Number($FileSize) While 1 $OutPtr = $lpBuffer + $MovePos $dwNumberOfBytesToRead = _Min($ByteAtaTime,$FileSize - $MovePos); $lpdwNumberOfBytesRead = InternetReadFile($HIntOpenUrl,$OutPtr,$dwNumberOfBytesToRead) $error = @error if $error Or $lpdwNumberOfBytesRead <= 0 Then ExitLoop $MovePos += $lpdwNumberOfBytesRead WEnd if ($error) Then $error = 5 InternetCloseHandle($HIntOpen) InternetCloseHandle($HIntOpenUrl) Return SetError($error,0,$Buffer) EndFunc Func InternetReadFile($hFile,$lpBuffer,$dwNumberOfBytesToRead) $DLLSDWORD = DllStructCreate("DWORD") $lpdwNumberOfBytesRead = DllStructGetPtr($DLLSDWORD) $BOOL = DllCall($jDll,"BOOL","InternetReadFile","HANDLE",$hFile,"ptr",$lpBuffer, _ "DWORD",$dwNumberOfBytesToRead,"ptr",$lpdwNumberOfBytesRead) if @error Or $BOOL[0] = 0 Then Return SetError(1,0,0) Return SetError(0,0,DllStructGetData($DLLSDWORD,1)) EndFunc Func HttpQueryInfo($hRequest,$dwInfoLevel,$lpdwIndex = 0) Local $lpdwBufferLength = 1000 $DLLSDWORD = DllStructCreate("DWORD") DllStructSetData($DLLSDWORD,1,$lpdwBufferLength) $LPDWORDLENGTH = DllStructGetPtr($DLLSDWORD) $DLLSlpvBuffer = DllStructCreate("WCHAR[" & $lpdwBufferLength & "]") $lpvBuffer = DllStructGetPtr($DLLSlpvBuffer) $BOOL = DllCall($jDll,"BOOL","HttpQueryInfoW","HANDLE",$hRequest,"DWORD",$dwInfoLevel, _ "ptr",$lpvBuffer,"ptr",$LPDWORDLENGTH,"DWORD",$lpdwIndex) if @error Or $BOOL[0] = 0 Then Return SetError(1,0,0) Return SetError(0,0,DllStructGetData($DLLSlpvBuffer,1)) EndFunc Func InternetOpenUrl($hInternet,$lpszUrl,$lpszHeaders,$dwHeadersLength,$dwFlags,$dwContext) $HINTERNET = DllCall($jDll,"HANDLE","InternetOpenUrlW","HANDLE",$hInternet,"wstr",$lpszUrl, _ "wstr",$lpszHeaders,"DWORD",$dwHeadersLength,"DWORD",$dwFlags,"ptr",$dwContext) if @error Then Return SetError(1,0,0) if Not ($HINTERNET[0]) Then Return SetError(2,0,0) Return SetError(0,0,$HINTERNET[0]) EndFunc Func InternetOpen($lpszAgent,$dwAccessType = 0,$lpszProxyName = "",$lpszProxyBypass = "",$dwFlags = 0) $HINTERNET = DllCall($jDll,"HANDLE","InternetOpenW","wstr",$lpszAgent,"DWORD",$dwAccessType, _ "wstr",$lpszProxyName,"wstr",$lpszProxyBypass,"DWORD",$dwFlags) if @error Then Return SetError(1,0,0) if Not ($HINTERNET[0]) Then Return SetError(2,0,0) Return SetError(0,0,$HINTERNET[0]) EndFunc Func InternetCloseHandle($hInternet) $BOOL = DllCall($jDll,"BOOL","InternetCloseHandle","HANDLE",$hInternet) if @error Or $BOOL[0] = 0 Then Return SetError(1,0,0) Return SetError(0,0,$BOOL[0]) EndFunc now i am really puzzled why wininet functions fail with the test.png
  7. yes, but i have to test if it behaves better with thousands of files. i really hope so. thank you ok, tested it and i have to say, InetRead is as slow as Inetget when it comes to lots of files,and it creates temp files as well. i hoped it worked better very disappointed. now i will try the WinINet Functions but that is the same as my old and faulty _InetGetSource method i fear. *sigh*
  8. ty all, i tried it all day long and couldn't explain myself what was wrong.
  9. @progandy: downloading 4000 files, inetget gets incredibly slow and temp internetfiles is full. i wanted to try the other method without temp file. ok so my include may be outdated. is InetRead() better ?
  10. no @errors. the file is created. but empty.
  11. strange. so strange. this is my _inetgetsource: Func _INetGetSource($s_URL, $s_Header = '') If StringLeft($s_URL, 7) <> 'http://' And StringLeft($s_URL, 8) <> 'https://' Then $s_URL = 'http://' & $s_URL Local $h_DLL = DllOpen("wininet.dll") Local $ai_IRF, $s_Buf = '' Local $ai_IO = DllCall($h_DLL, 'int', 'InternetOpen', 'str', "AutoIt v3", 'int', 0, 'int', 0, 'int', 0, 'int', 0) If @error Or $ai_IO[0] = 0 Then DllClose($h_DLL) SetError(1) Return "" EndIf Local $ai_IOU = DllCall($h_DLL, 'int', 'InternetOpenUrl', 'int', $ai_IO[0], 'str', $s_URL, 'str', $s_Header, 'int', StringLen($s_Header), 'int', 0x80000000, 'int', 0) If @error Or $ai_IOU[0] = 0 Then DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IO[0]) DllClose($h_DLL) SetError(1) Return "" EndIf Local $v_Struct = DllStructCreate('udword') DllStructSetData($v_Struct, 1, 1) While DllStructGetData($v_Struct, 1) <> 0 $ai_IRF = DllCall($h_DLL, 'int', 'InternetReadFile', 'int', $ai_IOU[0], 'str', '', 'int', 256, 'ptr', DllStructGetPtr($v_Struct)) $s_Buf &= StringLeft($ai_IRF[2], DllStructGetData($v_Struct, 1)) WEnd DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IOU[0]) DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IO[0]) DllClose($h_DLL) Return $s_Buf EndFunc ;==>_INetGetSource it must work. but it does not.
  12. _inetgetsource does not fail. i can see the data with msgbox. but the file created stays empty. this is crazy. does it really work for you ?
  13. no, it does not work for me. test.png is an empty file. 0 bytes. somehow the binary data has to be converted.
  14. ooops no i have win xp. this works ?
  15. something like: $pic=_INetGetSource("http://www.autoitscript.com/site/wp-content/themes/TheCorporation/images/logo.png",False) $open=FileOpen("c:logo.png",18) FileWrite($open,$pic) FileClose($open) but no matter how i put it, it does not show.
×
×
  • Create New...