Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all 12506 articles
Browse latest View live

Dllcall from 32 bit compile not working on 64 bit

$
0
0

Hi all,

 

Hope someone out there can help...

I'm having a problem trying to get the following test script to work under windows 8.1 64bit when compiled as 32 bit.

 

The 64bit compile works fine!?? Also, the 32 bit compile works fine on 32 bit...

 

I've found some information on the issue here

 

http://www.pinvoke.net/default.aspx/winspool/DocumentProperties.html

 

They refer to using 'IntPtr.Zero' which seems to be for C#.

 

More info here

 

https://msdn.microsoft.com/en-us/library/system.intptr.zero(v=vs.110).aspx

 

I'm sure the issue is with the data type set for the pointer to the devmode struct but I've tried everything I can think of.

 

Please see follow test script to show the issue.

 

Many thanks in advance

 

**Edit**  Cleaned up first line of _DocumentProperties() function, as per JohnOne's comment below.

AutoIt         
  1. #include <Array.au3>
  2. #include <WinAPIEx.au3>
  3.  
  4.  
  5. Global Const $DM_OUT_DEFAULT = 1
  6.  
  7. Local $sPrinterName = _GetDefaultPrinter()
  8. ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sPrinterName = ' & $sPrinterName & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
  9. Local $iDevModeSize = _DocumentProperties(0, $sPrinterName)
  10. ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iDevModeSize = ' & $iDevModeSize & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
  11. Local $ptrDevMode= _WinAPI_CreateBuffer($iDevModeSize);adding 100 due to
  12. Local $tDevMode = DllStructCreate($tagDEVMODE, $ptrDevMode)
  13. DllStructSetData($tDevMode, "Size", DllStructGetSize($tDevMode))
  14.  
  15. ;Local $iTestBufferSize = _WinAPI_GetMemorySize($ptrDevMode)
  16. ;MsgBox(4096, "Memory Size", $iTestBufferSize)
  17. ;_WinAPI_DisplayStruct($tDevMode, $tagDEVMODE)
  18.  
  19. _DocumentProperties(0, $sPrinterName, $tDevMode, $DM_OUT_DEFAULT)
  20.  
  21. _WinAPI_DisplayStruct($tDevMode, $tagDEVMODE)
  22.  
  23.  
  24. $tDevMode = 0
  25. _WinAPI_FreeMemory($ptrDevMode)
  26.  
  27.  
  28.  
  29. Func _DocumentProperties($hPrinter, $sPrinter, $tDevModeOutput = 0, $iFunc = 0)
  30.     Local $ptrDevModeInput = DllStructGetPtr($tDevModeOutput)
  31.     If $iFunc <> 0 Then MsgBox(0, "Pointer", $ptrDevModeInput)
  32.     Local $ptrDevModeOut = $ptrDevModeInput
  33.     Local $aResult = DllCall("Winspool.drv", "long", "DocumentPropertiesW", "hwnd", 0, "ptr", 0, "wstr", $sPrinter, "ptr", $ptrDevModeOut, "ptr", 0, "dword", $iFunc)
  34.     ;_ArrayDisplay($aResult)
  35.     Return $aResult[0]
  36.  
  37.  
  38.  
  39. Func _GetDefaultPrinter()
  40.     Local $tBufferSize = DllStructCreate("dword")
  41.     DllCall("Winspool.drv", "long", "GetDefaultPrinterW", "wstr", 0, "ptr", DllStructGetPtr($tBufferSize))
  42.     Local $tPrinterName = DllStructCreate("wchar[" & DllStructGetData($tBufferSize, 1) & "]")
  43.     DllCall("Winspool.drv", "long", "GetDefaultPrinterW", "ptr", DllStructGetPtr($tPrinterName), "ptr", DllStructGetPtr($tBufferSize))
  44.     Local $sPrinter = DllStructGetData($tPrinterName, 1)
  45.     $tPrinterName = 0
  46.     $tBufferSize = 0
  47.     Return $sPrinter

Interlink two processes; if 1st is closed also kill the 2nd

$
0
0

Hey there,

 

I'm curious if there's a possibility to interlink two processes. Is someone kind enough to help me writing this one?

 

run iexplore.exe

run program2.exe (program2 is already designed to stay hidden in the taskbar just waiting for some keystrokes from iexplore)

 

if iexplore.exe gets closed also terminate program2.

 

I'd love to get some help from a pro :)

Not able to click on button in a setup

$
0
0

Hi i am trying to click on the next button in a setup that i need to use, only problem is it is not responding. Below the code and the info:

        $TITLE = "Setup - Lenovo Slim USB Keyboard Driver for Windows 7/XP/Vista"         $SUB = "Welcome to the Lenovo Slim USB Keyboard Driver for Windows 7/XP/Vista Setup Wizard"             WinWait($TITLE, $SUB)             If Not WinActive($TITLE, $SUB) Then WinActivate($TITLE, $SUB)             WinActive($TITLE, $SUB)             Sleep(100)             ControlClick($TITLE, $SUB, "[ID:264262]")             Sleep(100)             ControlClick($TITLE, $SUB, "button1")             Sleep(100)             ControlClick($TITLE, $SUB, "TNewButton:1")             Sleep(100)             ControlClick($TITLE, $SUB, "TNewButton1")             Sleep(100)             ControlClick($TITLE, $SUB, "[CLASS:TNewButton; INSTANCE:1]")             Sleep(100)             ControlClick($TITLE, $SUB, "[CLASSNN:TNewButton1]")             Sleep(100)             Send("{enter}")             Sleep(100)             ControlSend($TITLE, $SUB, "", "{enter}")

I tried every way i could think of to click on the next button.

Probably a couple of stupid attemds but you cant blame me for trying.

Plain Text         
>>>> Window <<<< Title:  Setup - Lenovo Slim USB Keyboard Driver for Windows 7/XP/Vista Class:  TWizardForm Position:   2219, 415 Size:   503, 389 Style:  0x16CA0000 ExStyle:    0x00010100 Handle: 0x00000000001F066E >>>> Control <<<< Class:  TNewButton Instance:   1 ClassnameNN:    TNewButton1 Name:   Advanced (Class):   [CLASS:TNewButton; INSTANCE:1] ID: 461326 Text:   &Next > Position:   327, 327 Size:   75, 23 ControlClick Coords:    29, 14 Style:  0x54010001 ExStyle:    0x00000000 Handle: 0x0000000000070A0E >>>> Mouse <<<< Position:   2578, 782 Cursor ID:  0 Color:  0xE8E8E8 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< Welcome to the Lenovo Slim USB Keyboard Driver for Windows 7/XP/Vista Setup Wizard This will install Lenovo Slim USB Keyboard Driver for Windows 7/XP/Vista version 1.10.0.0 on your computer. It is recommended that you close all other applications before continuing. Click Next to continue, or Cancel to exit Setup. &Next > Cancel

Hope you guys can point me in the right direction...

 

*EDIT*: After posting i see that the ID of the button changed, that is strainge and don't blame my wrong number in the script please :P

Custom MsgBox Button Expansion

$
0
0

Hello, Please look the image below:

 

Capture2.PNG

 

Code:

_MsgBoxEx(48, "Test", "Please look at the buttons", -1, -1, "Mr. Button, can you expand a bit?")

I am using MsgBox UDF by Smoke_n

 

Thanks in Advance, TD :)

How to set a cookie

$
0
0

I am trying to set a local cookie preferably without opening the browser window.  I can see how to read a cookie but setting a cookie is not clear.

#include <msgboxConstants.au3> #include <Array.au3> #include <IE.au3> Global $oIE = _IECreate("google.com") Global $oCookie = $oIE.document.cookie msgbox($MB_SYSTEMMODAL, "", $oCookie) ; check for string Global $oCookieValues = StringSplit($oCookie, ";") _ArrayDisplay($oCookieValues) ; check for Array ;$oIE.document.cookie = name1=value1;name2=value2 $oIE.document.cookie = myCookie=test;name2=value2

I think this will set my cookie?

$oIE = _IECreate("www.google.com") $oIE.document.cookie = "test_cookie=one; path=/;" ConsoleWrite($oIE.document.cookie & @CRLF) $oIE.document.cookie = "test_cookie=two; path=/;" ConsoleWrite($oIE.document.cookie & @CRLF) _IEQuit($oIE)

Error : Variable used without being declared

$
0
0
Hello im new here and i dont have experience on autoit can somebody help me? So the problem is :
Line 18 $sGuid = $sGuid[0] $sGuid = ERROR
The Script
AutoIt         
#include "WinHttp.au3" #include <String.au3> Opt("MustDeclareVars", 1) Local $hOpen = _WinHttpOpen() Local $hConnect = _WinHttpConnect($hOpen, "[url=http://www.guidgenerator.com/]http://www.guidgenerator.com/[/url]") Local $hRequest = _WinHttpOpenRequest($hConnect, "POST", "online-guid-generator.aspx") Local $data = "txtCount=1&chkHypens=On&Button1=Generate" Local $data1 = "__VIEWSTATE=%2FwEPDwUJMTk1MDgwNTkxZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAwUMY2hrVXBwZXJjYXNlBQtjaGtCcmFja2V0cwUJY2hrSHlwZW5zEP0U%2BOIYUuW3bpG4bQtW980Sr%2Fg%3D&__VIEWSTATEGENERATOR=247C709F&__EVENTVALIDATION=%2FwEWBwKJo9mYBgLJkuW4AwKyzJeLDALcw7KJAgKm%2FOiABwKM54rGBgL6g7v1A9pSCUBhX%2BccVPc3JQBvo3RVU1Zu&txtCount=1&chkHypens=on&Button1=Generate+some+GUIDs%21&txtResults=" Local $sHeader = "Content-Type: application/x-www-form-urlencoded" & @CRLF _WinHttpSendRequest($hRequest, $sHeader, $WINHTTP_NO_REQUEST_DATA, StringLen($data1), 0) _WinHttpWriteData($hRequest, $data1) _WinHttpReceiveResponse($hRequest) Local $response = _WinHttpReadData($hRequest) Local $sGuide = _StringBetween($response, 'id="txtResults">', "") $sGuid = $sGuid[0] ;convert from array to string RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography", "MachineGuid", "REG_SZ", $sGuid) TrayTip("MachineGUID:", "Changed to: " & $sGuid, 1000) Sleep(2000) _WinHttpCloseHandle($hOpen) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hRequest)

Help! Gui choose 2 skin

$
0
0

hi friends, I am trying to add on my form 2 skins for the User choice, by clicking on the first skin works as usual but when I choose the second skin does not work. Please help me !

 

 

Plain Text         
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 521, 269, 192, 124) $Radio1 = GUICtrlCreateRadio("Skin1", 64, 88, 129, 49) $Radio2 = GUICtrlCreateRadio("Skin2", 64, 168, 161, 49) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $Radio1 $skin1 = @ScriptDir & "\Cosmo.msstyles" DllCall("kernel32.dll", "handle", "LoadLibraryW", "wstr", "Skin.dll") DllCall("Skin.dll", "int", "USkinInit", "ptr", "", "ptr", "", "str", $skin1) Case $Radio2 $skin = @ScriptDir & "\GoldCoast.msstyles" DllCall("kernel32.dll", "handle", "LoadLibraryW", "wstr", "Skin.dll") DllCall("Skin.dll", "int", "USkinInit", "ptr", "", "ptr", "", "str", $skin) EndSwitch WEnd

 

need help about auto chat

$
0
0

guys, i need help about creating auto chat looping.. please help :(

i try using notepad as a test, but i dont know how to loop after sending chat2 going to chat 1 again :(

AutoIt         
#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("WinTitleMatchMode", 2) #Region ### START GUI section ### Form= $Form1 = GUICreate("Form1", 218, 300, 192, 124) GUICtrlCreateLabel("chat1:",16,6,130,121) $chat1 = GUICtrlCreateInput("", 16, 24, 185, 21) GUICtrlCreateLabel("Sleep 1000 millisecond = 1 second",16,57,200,22) $Sleep1 = GUICtrlCreateInput("",16, 75, 185, 21) GUICtrlCreateLabel("chat2:",16, 106, 140, 22) $Pass = GUICtrlCreateInput("", 16, 125, 185, 21,) GUICtrlCreateLabel("Sleep 1000 millisecond = 1 second",16,155,200,22) $Sleep2 = GUICtrlCreateInput("",16, 175, 185, 21) $Button1 = GUICtrlCreateButton("Button1", 56, 230, 107, 25) GUISetState(@SW_SHOW) #EndRegion ### END GUI section ### While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit         Case $Button1             Run ("Notepad.exe")             WinWait("Notepad")             For             Send("User: " & GUICtrlRead($chat1))             Send("{enter}")             Sleep ( GUICtrlRead($Sleep1) )             Send("Password: " & GUICtrlRead($chat2))             Send("{enter}")             Sleep ( GUICtrlRead($Sleep2) )             Send ("End")             ExitLoop 2       EndSwitch  WEnd

using AD UDF - is it possible to move a machine to a machine group

$
0
0

I see the ability to move a machine to an OU, but I am looking to add a machine to a machine-group.

 

Thanks

Handling dynamic amount of controls

$
0
0

I get a list externally and create a load of labels and input fields to match it.

 

If that list is larger than the gui can handle, the controls are outside the bounds of the gui height.

 

Wondering what sort of control I can put them in, so user can scroll to see all the fields.

 

Some sort of scrollable panel would be ace, but open to any suggestions.

 

Here is reproducer.

AutoIt         
#include <Array.au3> Global $AppName = "The App" Global $aProducts = FileReadToArray(@ScriptDir & "\Products.txt") ;_ArrayDisplay($aProducts) _AbsentCategory($aProducts) Func _AbsentCategory(ByRef $array)     If UBound($array) < 1 Then         Return     EndIf     $Top = 40     Local $aControls[UBound($array)][4]     Local $hNotFoundGUI = GUICreate($AppName & ": Products need adding", 575, 700)     ; Labels     GUICtrlCreateLabel("Product name", 15, 10, 100)     GUICtrlCreateLabel("Category 1", 240, 10, 100)     GUICtrlCreateLabel("Category 2", 410, 10, 100)     Local $hNotFounButtonOK = GUICtrlCreateButton("Done", 15, 670, 60)     ; Create an array of contrils with the backup array as text     For $y = 0 To UBound($array) - 1         GUICtrlCreateLabel($array[$y], 15, $Top, 210, 20)         $aControls[$y][0] = GUICtrlCreateInput("", 240, $Top, 150) ; cat 1         $aControls[$y][1] = GUICtrlCreateInput("", 410, $Top, 150) ; cat 2         $Top += 30     Next     GUISetState()     Sleep(5000)     While GUIGetMsg() <> $hNotFounButtonOK     WEnd     ; Not finished yet     ; Check all fields are filled before proceding     Do     Until _Checkfields($aControls)     ; Update array     For $i = 0 To UBound($array) - 1         $array[$i][1] = GUICtrlRead($aControls[$i][0])         $array[$i][2] = GUICtrlRead($aControls[$i][1])     Next EndFunc   ;==>_AbsentCategory Func _Checkfields(ByRef $array)     For $i = 0 To UBound($array) - 1         If GUICtrlRead($array[$i][0]) = "" Or GUICtrlRead($array[$i][1]) = "" Then             MsgBox(4096 + 48, $AppName & ": - Warning", "Fill all fields" & @CRLF & "and press OK")             Return 0         EndIf     Next     Return 1 EndFunc   ;==>_Checkfields

Here is Products.txt

Plain Text         
Product1 Product2 Product3 Product4 Product5 Product6 Product7 Product8 Product9 Product10 Product11 Product12 Product13 Product14 Product15 Product16 Product17 Product18 Product19 Product20 Product21 Product22 Product23 Product24 Product25 Product26 Product27 Product28 Product29

[..] Icon in the Windows taskbar (for non-AutoIt windows)

$
0
0

Bonjour, Hello, My name is Glass Joe !
 
[FYI, I'm under Windows 7 Pro & Windows 8.1 Family Edition] I based my code on the WinSetIcon function brought to me by Mikell on the french AutoIt forum ( here is the [link] ). This is the example code I used (with the _WinAPI_LoadImage function in order to force the icon size) :

#include <WinAPI.au3> ShellExecute(StringRegExpReplace(@AutoItExe, '(.+)\\[^\\]+', "$1") & "\AutoIt.chm") Do   Sleep(10) Until WinExists("AutoIt Help") $handle = WinGetHandle("AutoIt Help") WinSetIcon($handle, @ScriptDir&"\Icone.ico")   Func WinSetIcon($hwnd, $file)     Local $icon = _WinAPI_LoadImage(0, $file, $IMAGE_ICON, 32, 32, BitOR($LR_LOADFROMFILE, $LR_CREATEDIBSECTION))     If Not $icon Then Return False    _SendMessage($handle, 0x0080, 1, $icon) ; $WM_SETICON = 0x0080    _WinAPI_DestroyIcon($icon) EndFunc

And this is the screenshot concerning my problem :
http://www.autoitscript.fr/forum/download/file.php?id=3612&mode=view

As you can see, the icon I created has several sizes : 48x48, 32x32 and 16x16. All my taskbar icons are 32x32, but when the code above is executed, the icon is pixellated. The one in the upperleft corner of the window is correct, but it's the one is the taskbar that matters to me. Could you help me please !?

Thanks in advance for your help, and see you soon !
 
PS: When using a single-sized icon 48/32/16, I've got the same result : pixellated.
PS2: The green arrow icon in Mikell's example is also pixellated on each computer I used.

Attachment: The icon used with this sample code

Attached Files

Append to line in file

$
0
0

Hello!

 

at once - sorry for my bad engilshi.. is my hmm.. second language.

 

Ok, i have a problem: 

 

I must append to line in txt

 

i.e (google translator :P

 

i have in file: 

 

word

word

word

 

and now i wants append:   (word1 form input)

 

word1 word

word1 word

word1 word 

 

I hope it is well described (google translator) 

 

Im try add to array but still do not know how to do it

 

 

at once
at once
at once
at once 
 
at once
 
at once
 

 

Finding ComPorts by VID and PID

$
0
0

I have been using this function for years. I want to loop through all the ComPorts on a computer and return the ComPort of any port having VID 401 and PID 6003. This has worked forever but today I found a serious problem. I guess there is a "PortName" and a "FriendlyName" for each port. I have been incorrectly using the "FriendlyName" and need to start using the "PortName" because I guess there are certain instances where the "FriendlyName" doesn't really reflect the ""PortName". Here is the code. Can anyone tell me what I have to change to get the "PortName" and not the "FriendlyName"?

AutoIt         
; Will scan all FTDI COMPorts in the WMI and return either the comport FTDI on or "" Func FindOBD()     Local $NumericPort, $Leftprens, $Rightprens, $TestDevice     Local $oWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2")     If @error Then Return SetError(@error, 0, "")     Local $oItems = $oWMIService.ExecQuery("SELECT * FROM Win32_PnPEntity WHERE Name LIKE '%(COM%)'", "WQL", 48)     $CommPort = ""     For $oItem In $oItems         $TestDevice = StringInStr($oItem.DeviceID, "FTDIBUS\VID_0403+PID_6001")         If $TestDevice = 0 Then             ContinueLoop         EndIf         $Leftprens = StringInStr($oItem.Name, "(")         $Rightprens = StringInStr($oItem.Name, ")")         $CommPort = StringMid($oItem.Name, $Leftprens + 1, $Rightprens - $Leftprens - 1)         $NumericPort = Int(StringRight($CommPort, StringLen($CommPort) - 3))         If ($NumericPort > 9) Then             $CommPort = "\\.\" & $CommPort         EndIf     Next     Return $CommPort EndFunc

SSDP to my Roku

$
0
0

i am trying to ping my roku to see if its online so i can send some remote commands to it via telnet...

 

what i have so far is this BUT its not coming back anything:

Plain Text         
#include <AutoItConstants.au3> #include <Constants.au3> $getInfo = _GetDOSOutput("M-SEARCH * HTTP/1.1" & @CRLF & "HOST: 239.255.255.250:1900" & @CRLF & "ST:roku:ecp" & @CRLF & "MAN:""ssdp:discover""" & @CRLF & "MX:10" & @CRLF & @CRLF) ConsoleWrite($getInfo  & @CRLF) Func _GetDOSOutput($sCommand)     Local $iPID, $sOutput = ""     $iPID = Run('"' & @ComSpec & '" /c ' & $sCommand, "", @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD) ConsoleWrite($iPID  & @CRLF)     While 1         $sOutput &= StdoutRead($iPID, False, False) ConsoleWrite($sOutput  & @CRLF)         If @error Then    ConsoleWrite("you have a error"  & @CRLF)             ExitLoop         EndIf         Sleep(10)     WEnd     Return $sOutput  EndFunc   ;==>_GetDOSOutput

Also all the info i want is returned the IP address that should come something back like this:
 

Location: http://192.168.1.134:8060/

any idea(s) what i am doing wrong here? 

 

VLC media player recording automation

$
0
0

Hi. I'm new here! I have created a simple script to automate the process of recording an IP stream in VLC media player and it works! Now I have to find out how to stop the recording after the specified ending time. I am using 'Windows task scheduler' to run the script on a schedule. The script opens VLC and executes the default recording hotkey (+r). I want to find a way to re-execute (send ("+r")), about a second before the task ends in Windows task scheduler. So essentially I will be automating the process of recording in VLC media player on a schedule in Windows 7.

 

Like I said I'm new here! I’m open to suggestions instead of using Windows task scheduler, or maybe there is a simple few lines of code I can add?

 

My code.

http://imgur.com/gallery/7VumOaw/new

 

 


Reading line from file then matching it to a variable.

$
0
0
Hello folks,
I have stopped writing anything in Autoit for more than 4 years now and am getting back into it to do some stuff for my son's lacrosse team. Any help for this forgetful old fart would be very helpful.
 
How do you read a line of text from a file and if it matches a set variable, copy it to a new file and repeat till end of file?
 
For instance lets say there is a lacrosse team and each boy has a list of equipment.
 
John Doe
Helmet - CascadeR
Stick - Dpole
Chest - Warrior
 
Bob Pham
Helmet - STX
Stick - Attack
Chest - Brine
 
etc.....
 
I want to make a new file that shows just the sticks
 
Stick - Dpole
Stick - Attack
etc...

need help with a FOR LOOP

$
0
0

i know this is simple but i cant seem to figure it out...

here is my code :
 

 
Plain Text         
   For $s_idx = 1 To $search_things[0]       If StringInStr(FileGetAttrib($search_root & $search_things[$s_idx]), 'D', 0, 1) Then          $href = StringEncrypt(1, 'SandelPerieanu|' & StringLeft($search_root, StringInStr($search_root, '\', 0, -1) - 1) & '|' & $search_root & $search_things[$s_idx], $pass_encrypt)          $s_dirs &= '<a class="padding1" href="folder-' & $href & '"><img align="middle" hspace="10" border=0 height="28px" width="28px" src="filefolder.png"><b>' & $search_things[$s_idx] & '</b></a><br>' & @CRLF       Else $files = $search_things[$s_idx] Local $folder2check = $search_root Local $vidType = "*.flv" Local $FileList = _FileListToArray($folder2check , $vidType, $FLTA_FILES, True) If @error Then ; display nothing Else For $i = 1 To $FileList[0]   $okFiles = GetFileName($FileList[$i])   ConsoleWrite("this is the files allowed : " & $okFiles  & @CRLF)   $href = StringEncrypt(1, 'SandelPerieanu|' & $search_root & $okFiles, $pass_encrypt)   $s_files &= '<a class="padding1" href="file-' & $href & '"><img align="middle" hspace="10" border=0 height="28px" width="28px" src="file.png"><b>' & $okFiles & '</b></a><br>' & @CRLF Next WEnd EndIf  EndIf    Next

 Just trying to only show certain files NOT all file extension, no need to show  windows files etc...

 well it works BUT because of the for loop it is showing the files more than once,  i have been stuck on this for a few hours and not sure how else to get the correct files with out a for loop inside the other loop.  any ideas?

Obvisously only want to display the files once  this code starts about line 360 
 

Excel rangeread

$
0
0
  1. $ar_array=_ExcelReadSheetToArray($arexcel,2) ;----from 2nd row
  2. $weekly_array=_ExcelReadSheetToArray($weeklyexcel,2,5) ;----from 2nd row and 5th col
  3.  

how to get the same  effect by use _Excel_RangeRead? thanks!

Need Function Drag and Drop for AutoItx64

$
0
0
Func wm_dropfiles_func($hwnd, $msgid, $wparam, $lparam)     Local $nsize, $pfilename     Local $namt = DllCall("shell32.dll", "int", "DragQueryFileW", "hwnd", $wparam, "int", -1, "ptr", 0, "int", 255)     For $i = 0 To $namt[0] - 1         $nsize = DllCall("shell32.dll", "int", "DragQueryFileW", "hwnd", $wparam, "int", $i, "ptr", 0, "int", 0)         $nsize = $nsize[0] + 1         $pfilename = DllStructCreate("wchar[" & $nsize & "]")         DllCall("shell32.dll", "int", "DragQueryFileW", "hwnd", $wparam, "int", $i, "int", DllStructGetPtr($pfilename), "int", $nsize)         ReDim $gaDropFiles[$i + 1]         $gaDropFiles[$i] = DllStructGetData($pfilename, 1)         $pfilename = 0     Next EndFunc   ;==>wm_dropfiles_func

wm_dropfiles_func Errror:
eror_dnd.png
 
+>AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0   Keyboard:00000409  OS:WIN_81/  CPU:X64 OS:X64    Environment(Language:0409) AutoIt v3.3.12.0 

Code Example:

AutoIt         
Opt("MustDeclareVars", 1) Opt("TrayAutoPause", 0) Global Const $WS_EX_ACCEPTFILES = 0x00000010 Global Const $WS_EX_TOPMOST = 0x00000008 Global Const $WS_EX_WINDOWEDGE = 0x00000100 Global Const $GUI_EVENT_CLOSE = -3 Global Const $GUI_EVENT_MINIMIZE = -4 Global Const $GUI_EVENT_RESTORE = -5 Global Const $GUI_EVENT_MAXIMIZE = -6 Global Const $GUI_EVENT_PRIMARYDOWN = -7 Global Const $GUI_EVENT_PRIMARYUP = -8 Global Const $GUI_EVENT_SECONDARYDOWN = -9 Global Const $GUI_EVENT_SECONDARYUP = -10 Global Const $GUI_EVENT_MOUSEMOVE = -11 Global Const $GUI_EVENT_RESIZED = -12 Global Const $GUI_EVENT_DROPPED = -13 Global Const $gui_dropaccepted = 8 Global Const $wm_dropfiles = 563 Global Const $CodeBy="Dao Van Trong - Trong.TK" Global $gaDropFiles[1],$sListFileDrop,$sDropsAccept=True ;~ Global Const $GUI_SS_DEFAULT_GUI = BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU) Global $Form1 = GUICreate("Form1", 448, 116, -1, -1, -1, BitOR($WS_EX_ACCEPTFILES, $WS_EX_TOPMOST, $WS_EX_WINDOWEDGE)) Global $Pic1 = GUICtrlCreatePic("C:\Users\TrOnG\Desktop\Image.jpg", 0, 0, 112, 112) GUICtrlSetState(-1, $gui_dropaccepted) Global $sListProcessFile = GUICtrlCreateList("", 112, 1, 333, 112) GUICtrlSetState(-1, $gui_dropaccepted) GUISetState(@SW_SHOW) GUIRegisterMsg($wm_dropfiles, "wm_dropfiles_func") While 1     Local $nMsg = GUIGetMsg()     Switch $nMsg         Case $gui_event_dropped             $sDropsAccept = False             Local $i, $ntotal = UBound($gaDropFiles) - 1             For $i = 0 To $ntotal                 $sListFileDrop &= "|" & $gaDropFiles[$i]             Next             GUICtrlSetData($sListProcessFile, $sListFileDrop)             $sListFileDrop = ""             $sDropsAccept = True         Case $GUI_EVENT_CLOSE             Exit     EndSwitch WEnd Func wm_dropfiles_func($hwnd, $msgid, $wparam, $lparam)     If $sDropsAccept Then     Local $nsize, $pfilename     Local $namt = DllCall("shell32.dll", "int", "DragQueryFileW", "hwnd", $wparam, "int", -1, "ptr", 0, "int", 255)     For $i = 0 To $namt[0] - 1         $nsize = DllCall("shell32.dll", "int", "DragQueryFileW", "hwnd", $wparam, "int", $i, "ptr", 0, "int", 0)         $nsize = $nsize[0] + 1         $pfilename = DllStructCreate("wchar[" & $nsize & "]")         DllCall("shell32.dll", "int", "DragQueryFileW", "hwnd", $wparam, "int", $i, "int", DllStructGetPtr($pfilename), "int", $nsize)         ReDim $gaDropFiles[$i + 1]         $gaDropFiles[$i] = DllStructGetData($pfilename, 1)         $pfilename = 0     Next     EndIf EndFunc   ;==>wm_dropfiles_func

Sending three keys at once with Send()

$
0
0

I'm trying to have a script hit: alt + shift + k

 

This is what I have and it isn't working

 

HotKeySet("!q", toTableOfContents) HotKeySet("!w", toSelectedTab)   func toTableOfContents()    Send("!+k") EndFunc   func toSelectedTab()    MouseMove(2690, 300, 0) EndFunc   while 1    sleep(100) wend

 

I literally had to delete the code block and retype it in autoit tags before I was able to type after it. And this time it did not delete the content. So not only is the forum buggy, it's inconsistently buggy which is far far worse.

Viewing all 12506 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>