Leaderboard
Popular Content
Showing content with the highest reputation on 09/20/2013 in all areas
-
Restore Hidden IE Window created with _IECreate?
GoogleDude reacted to BrewManNH for a topic
Use the object variable returned by the function _IECreate and try using "$o_object.visible = True". see if that works. EDIT: The $o_object would be replaced by whatever variable you used to hold the return value from _IECreate.1 point -
Can you compare the values which is written by AutoIt with VBS? Br, UEZ1 point
-
Here an untested 1:1 conversion: ; 1:1 converted from http://gallery.technet.microsoft.com/scriptcenter/Vbscript-to-set-visual-cd211be9 by UEZ 2013 ; =============== VISUAL EFFECTS =============== $A = "0" ; Animate controls and elements inside windows $B = "0" ; Fade or slide menu;s into view $C = "0" ; Fade or slide ToolTips into view $D = "0" ; Fade out menu items after clicking $E = "0" ; Show shadows under mouse pointer $F = "0" ; Show shadows under windows $G = "0" ; Slide open combo boxes $H = "0" ; Smooth-scroll list boxes $I = "1" ; Use visual styles on windows and buttons $J = "1" ; Show window contents while dragging $K = "1" ; Smooth edges of screen fonts $L = "0" ; Animate windows when minimizing and maximizing $M = "1" ; Show translucent selection rectangle $N = "1" ; Use drop shadows for icon labels on the desktop $O = "0" ; Animations in the taskbar and Start Menu $P = "0" ; Show thumbnails instead of icons $Q = "1" ; Enable desktop composition $R = "0" ; Enable transparent glass $S = "0" ; Enable Aero Peek $T = "0" ; Save taskbar thumbnail previews ; ============================================== Global $UPM_a[8], $UPM_b[8], $i, $bBin Global $UPM_a0[8] = ["1","0","0","1", $H , $G , $B ,"0"] Global $UPM_a1[8] = ["0","0", $E ,"1", $C , $D ,"1","0"] Global $UPM_a2[8] = ["0","0","0","0","0", $F , $I ,"1"] Global $UPM_a3[8] = ["1","0","0","0","0","0","0","0"] Global $UPM_a4[8] = ["0","0","0","1","0","0", $A ,"0"] Global $UPM_a5[8] = ["0","0","0","0","0","0","0","0"] Global $UPM_a6[8] = ["0","0","0","0","0","0","0","0"] Global $UPM_a7[8] = ["0","0","0","0","0","0","0","0"] For $i = 0 To UBound($UPM_a) - 1 $UPM_a[$i] = Execute("$UPM_a" & $i) Next For $i = 0 To UBound($UPM_a) - 1 $UPM_b[$i] = String(BinToDec($UPM_a[$i])) $bBin &= Hex($UPM_b[$i], 2) Next RegWrite("HKCU\Control Panel\Desktop", "UserPreferencesMask", "REG_BINARY", Binary("0x" & $bBin)) RegWrite("HKCU\Control Panel\Desktop", "DragFullWindows", "REG_SZ", IIf($J = "1", "1", "0")) RegWrite("HKCU\Control Panel\Desktop", "FontSmoothing", "REG_SZ", IIf($K = "1", "2", "0")) RegWrite("HKCU\Control Panel\Desktop\WindowMetrics", "MinAnimate", "REG_SZ", IIf($L = "1", "1", "0")) RegWrite("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "ListviewAlphaSelect", "REG_DWORD", IIf($M = "1", 1, 0)) RegWrite("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "ListviewShadow", "REG_DWORD", IIf($N = "1", 1, 0)) RegWrite("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarAnimations", "REG_DWORD", IIf($O = "1", 1, 0)) RegWrite("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "IconsOnly", "REG_DWORD", IIf($P = "1", 0, 1)) RegWrite("HKCU\Software\Microsoft\Windows\DWM", "Composition", "REG_DWORD", IIf($Q = "1", 1, 0)) RegWrite("HKCU\Software\Microsoft\Windows\DWM", "CompositionPolicy", "REG_DWORD", IIf($Q = "1", 2, 0)) RegWrite("HKCU\Software\Microsoft\Windows\DWM", "ColorizationOpaqueBlend", "REG_DWORD", IIf($R = "1", 0, 1)) RegWrite("HKCU\Software\Microsoft\Windows\DWM", "EnableAeroPeek", "REG_DWORD", IIf($S = "1", 1, 0)) RegWrite("HKCU\Software\Microsoft\Windows\DWM", "AlwaysHibernateThumbnails", "REG_DWORD", IIf($T = "1", 1, 0)) RegWrite("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects", "VisualFXSetting", "REG_DWORD", 3) Func BinToDec($arrBin) Local $r = "0", $i, $iUB = UBound($arrBin) - 1 For $i = $iUB To 0 Step - 1 If $arrBin[$i] = "1" Then $r += 2 ^ ($iUB - $i) Next Return $r EndFunc Func IIf($Expression, $TruePart, $FalsePart) If $Expression Then Return $TruePart Return $FalsePart EndFunc There is enough room for code optimization! Br, UEZ Edit: forgot the reg type for the last regwrite line1 point
-
While it could have been written in a nicer tone, I still stand by my assertion that you have cobbled together 2 scripts and just expected them to work together, without really understanding the code you were using or how they work in general. Why do I say this? Mostly because you have a commented out Exit in the first While loop, which looks to me like you copied the basics of the first script and didn't want the script to exit when it previously did. Then found the second script and stuck it onto the end of the first script. How do I know this? Because you have an include statement directly after the Wend statement. This tells me you took an example of how to use the _InetSMTP* functions and added it to the first script. If you want to learn how to code, that's one thing. But, if you want to just have someone fix your mistakes without taking the time to learn what that mistake is in the first place, then you get what is given to you. Your script was easily fixable if you understood how things work in AutoIt, you've been around long enough to get the basics down.1 point
-
Ways to manage big code/functions
kylomas reacted to badapple89 for a topic
Think its a combination of poor explanation, not having clear goals and not knowing what I'm doing. However thanks for all the help. Ill go back to the drawing board on this one.1 point -
MWO shortcuts
JohnQSmith reacted to iamtheky for a topic
You should have told us that first, the forum rules pertaining to game automation clearly state that if your friend has a script that does it then its ok to discuss.1 point -
If NOT
Blue_Drache reacted to trancexx for a topic
Correct answer is because operator NOT has higher precedence than operator =.1 point -
FileSelectFolder - Windows 7 and later new window type
ALIENQuake reacted to Mat for a topic
Well, I gave it a go. You need someone who actually understands interfaces and objects. Global Const $FOS_OVERWRITEPROMPT = 0x00000002 Global Const $FOS_STRICTFILETYPES = 0x00000004 Global Const $FOS_NOCHANGEDIR = 0x00000008 Global Const $FOS_PICKFOLDERS = 0x00000020 Global Const $FOS_FORCEFILESYSTEM = 0x00000040 Global Const $FOS_ALLNONSTORAGEITEMS = 0x00000080 Global Const $FOS_NOVALIDATE = 0x00000100 Global Const $FOS_ALLOWMULTISELECT = 0x00000200 Global Const $FOS_PATHMUSTEXIST = 0x00000800 Global Const $FOS_FILEMUSTEXIST = 0x00001000 Global Const $FOS_CREATEPROMPT = 0x00002000 Global Const $FOS_SHAREAWARE = 0x00004000 Global Const $FOS_NOREADONLYRETURN = 0x00008000 Global Const $FOS_NOTESTFILECREATE = 0x00010000 Global Const $FOS_HIDEMRUPLACES = 0x00020000 Global Const $FOS_HIDEPINNEDPLACES = 0x00040000 Global Const $FOS_NODEREFERENCELINKS = 0x00100000 Global Const $FOS_DONTADDTORECENT = 0x02000000 Global Const $FOS_FORCESHOWHIDDEN = 0x10000000 Global Const $FOS_DEFAULTNOMINIMODE = 0x20000000 Global Const $FOS_FORCEPREVIEWPANEON = 0x40000000 _FileSelectFolderNew() MsgBox(0, @error, @extended) Func _FileSelectFolderNew($sTitle = "Select Folder", $sRootDir = @DesktopDir, $sInitialDir = @WorkingDir, $hParent = 0) Local Const $IID_IModalWindow = "{b4db1657-70d7-485e-8e3e-6fcb5a5c1802}" Local Const $TAG_IModalWindow = "hresult Show(hwnd);" Local Const $CLSID_IFileDialog = "{42F85136-DB7E-439C-85F1-E4075D135FC8}" Local Const $IID_IFileDialog = $CLSID_IFileDialog Local const $TAG_IFileDialog = $TAG_IModalWindow & "AddPlace hresult(ptr;int);Advise hresult(ptr;dword*);ClearClientData hresult();" & _ "Close hresult(hresult);GetCurrentSelection hresult(ptr);GetFileName hresult(ptr);GetFileTypeIndex hresult(uint*);" & _ "GetFolder hresult(ptr);GetOptions hresult(uint*);GetResult hresult(ptr);SetClientGuid hresult(ptr);" & _ "SetDefaultExtension hresult(wstr);SetDefaultFolder hresult(ptr);SetFileName hresult(wstr);SetFileNameLabel hresult(wstr);" & _ "SetFileTypeIndex hresult(uint);SetFileTypes hresult(uint;ptr);SetFilter hresult(ptr);SetFolder hresult(ptr);" & _ "SetOkButtonLabel hresult(wstr);SetOptions hresult(uint);SetTitle hresult(wstr);Unadvise hresult(dword);" Local Const $CLSID_IFileOpenDialog = "{D57C7288-D4AD-4768-BE02-9D969532D960}" Local Const $IID_IFileOpenDialog = $CLSID_IFileOpenDialog Local Const $TAG_IFileOpenDialog = $TAG_IFileDialog & "GetResults hresult(ptr);GetSelectedItems hresult(ptr);" Local $ifd = ObjCreateInterface($CLSID_IFileOpenDialog, $IID_IFileOpenDialog, $TAG_IFileOpenDialog, True) If @error Then Return SetError(@error, @extended, "") Local $options $ifd.GetOptions($options) ConsoleWrite($options & @LF) $ifd.SetOptions(BitOR($FOS_PICKFOLDERS, $options)) $ifd.Show(0) EndFunc I've got no idea how to find out what the v table order is, so I just did it on alphabetical. I have no idea what an IID is, but the helpfile example has it the same as the CLSID so I did the same.1 point -
I thought the point was to be able to use these files WITHOUT having to run the GUI front end? Using FileInstall with compiled scripts you now HAVE to run the GUI before those exes will be extracted, you'd have to run it from the GUI at least once. Sounds like you're changing the goal in the middle of the game to me. Maybe you should slow down and figure out exactly what it is you want to do first, then explain it as well as you can, because right now you're all over the place with what you're final goal is going to be.1 point
-
Count the parameters again, your width is set to -1 your height is set to 800 and your setting the style to 500.1 point
-
Multi-Threading
DatMCEyeBall reacted to c0d3x for a topic
The while loop doesnt restart the script tho? Your just looping threw nothing?1 point -
That's cool. Going to my special folder of special folders of... special things. edit: I did some thinking ( ) and I'm confused by the return values of the duck's code. For me it returns something like this: DiskDrive = \\.\PHYSICALDRIVE0 Caption = WDC WD1200JS-00MVB1 Partition = Disk #0, Partition #0 LogicalDisk = C: Partition = Disk #0, Partition #1 LogicalDisk = F: Partition = Disk #0, Partition #2 LogicalDisk = G: LogicalDisk = H: Partition = Disk #0, Partition #3 LogicalDisk = E:What confuses me is that I never heard of partition #0 and that code returned drive C to be partition #0. I did some searching too and thing is that there shouldn't be partition 0 with windows (better say, partition(0) refers to the entire disk <- link, this too). Further more, my mum (what?) told me that I should try to do something with DeviceIoControl function found in kernel32.dll. I got this: Local $aCall = DllCall("kernel32.dll", "dword", "GetLogicalDrives") Local $iMask = $aCall[0] Local $tIOCTL_STORAGE_GET_DEVICE_NUMBER = DllStructCreate("dword DeviceType;" & _ "dword DeviceNumber;" & _ "int PartitionNumber") Local $hDevice Local $a_hCall, $a_iCall For $i = 0 To 25; alphabet (A = 0) If BitAND(BitShift($iMask, $i), 1) Then; drive exists $a_hCall = DllCall("kernel32.dll", "hwnd", "CreateFile", _ "str", "\\.\" & Chr(65 + $i) & ":", _; want handle to the logical drive "dword", 0, _ "dword", 0, _ "ptr", 0, _ "dword", 3, _; OPEN_EXISTING "dword", 128, _; FILE_ATTRIBUTE_NORMAL "ptr", 0) $hDevice = $a_hCall[0] $a_iCall = DllCall("kernel32.dll", "int", "DeviceIoControl", _ "hwnd", $hDevice, _ "dword", 0x2D1080, _; IOCTL_STORAGE_GET_DEVICE_NUMBER "ptr", 0, _ "dword", 0, _ "ptr", DllStructGetPtr($tIOCTL_STORAGE_GET_DEVICE_NUMBER), _ "dword", DllStructGetSize($tIOCTL_STORAGE_GET_DEVICE_NUMBER), _ "dword*", 0, _ "ptr", 0) DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hDevice) ConsoleWrite("Drive " & Chr(65 + $i) & ": " & @CRLF) ConsoleWrite(@TAB & "DeviceType: " & DllStructGetData($tIOCTL_STORAGE_GET_DEVICE_NUMBER, "DeviceType") & @CRLF) ConsoleWrite(@TAB & "DeviceNumber: " & DllStructGetData($tIOCTL_STORAGE_GET_DEVICE_NUMBER, "DeviceNumber") & @CRLF) ConsoleWrite(@TAB & "PartitionNumber: " & DllStructGetData($tIOCTL_STORAGE_GET_DEVICE_NUMBER, "PartitionNumber") & @CRLF) ConsoleWrite(@CRLF) EndIf NextData returned by that is in some degree different than using PsaltyDS's code. In case that code is correct something like this could be written: $sDDriveLetter = "C" $iDiskNumber = _GetDiskNimberForDrive($sDDriveLetter) If @error Then MsgBox(48, "Error", "Error Number " & @error & @CRLF) Else MsgBox(64, "_GetDiskNimberForDrive", "Drive " & StringUpper($sDDriveLetter) & " is on disk #" & $iDiskNumber) EndIf Func _GetDiskNimberForDrive($sDriveLetter) Local $a_hCall = DllCall("kernel32.dll", "hwnd", "CreateFile", _ "str", "\\.\" & $sDriveLetter & ":", _; logical drive "dword", 0, _ "dword", 0, _ "ptr", 0, _ "dword", 3, _; OPEN_EXISTING "dword", 128, _; FILE_ATTRIBUTE_NORMAL "ptr", 0) If @error Then Return SetError(1, 0, -1); your system is very old. Do something. EndIf If $a_hCall[0] = -1 Then Return SetError(2, 0, -1); non-existing drive EndIf Local $hDevice = $a_hCall[0] Local $tIOCTL_STORAGE_GET_DEVICE_NUMBER = DllStructCreate("dword DeviceType;" & _ "dword DeviceNumber;" & _ "int PartitionNumber") Local $a_iCall = DllCall("kernel32.dll", "int", "DeviceIoControl", _ "hwnd", $hDevice, _ "dword", 0x2D1080, _; IOCTL_STORAGE_GET_DEVICE_NUMBER "ptr", 0, _ "dword", 0, _ "ptr", DllStructGetPtr($tIOCTL_STORAGE_GET_DEVICE_NUMBER), _ "dword", DllStructGetSize($tIOCTL_STORAGE_GET_DEVICE_NUMBER), _ "dword*", 0, _ "ptr", 0) If @error Or Not $a_hCall[0] Then DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hDevice) Return SetError(3, 0, -1); DeviceIoControl failed for some reason EndIf DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hDevice) ; will write some data ConsoleWrite("Drive " & StringUpper($sDriveLetter) & ": " & @CRLF) ConsoleWrite(@TAB & "DeviceType: " & DllStructGetData($tIOCTL_STORAGE_GET_DEVICE_NUMBER, "DeviceType") & @CRLF) ConsoleWrite(@TAB & "DeviceNumber: " & DllStructGetData($tIOCTL_STORAGE_GET_DEVICE_NUMBER, "DeviceNumber") & @CRLF) ConsoleWrite(@TAB & "PartitionNumber: " & DllStructGetData($tIOCTL_STORAGE_GET_DEVICE_NUMBER, "PartitionNumber") & @CRLF) ConsoleWrite(@CRLF) ; end writing If DllStructGetData($tIOCTL_STORAGE_GET_DEVICE_NUMBER, "DeviceType") = 7 Then; FILE_DEVICE_DISK Return SetError(0, 0, DllStructGetData($tIOCTL_STORAGE_GET_DEVICE_NUMBER, "DeviceNumber")) EndIf Return SetError(4, 0, -1); not a disk partition EndFunc ;==>_GetDiskNimberForDrive I only have one disk, so I cannot test it.1 point