Leaderboard
Popular Content
Showing content with the highest reputation on 03/13/2016 in all areas
-
I think a) plus c) should yield the desired result.1 point
-
I had to read your thread triple times and finally understood what you want. a. hide the gridlines b. make range ws.cells white borderlines c. then import your data and color only the data you add with a range("b2:n2400") (you have to do the number last line)1 point
-
Gridlines are a global setting for a worksheet. Set the grid lines, then add your data and then set the borders for the usedrange object.1 point
-
When I found the support article and knew they were talking about gridlines and how to set/unset them it was easy to run the macro recorder and see what happens when unselecting gridlines. Then a few modifications to translate it from VBA to AutoIt. Voilá!1 point
-
It's easy #include <Excel.au3> Global $oExcel = _Excel_Open() Global $oBook = _Excel_BookOpen($OExcel, "C:\temp\test.xlsx") $oExcel.ActiveWindow.DisplayGridlines = False1 point
-
Maybe this helps: https://support.office.com/en-us/article/Show-or-hide-gridlines-on-a-worksheet-512bb922-3942-46d0-8eb6-070fd3165e1d1 point
-
Pixel Check Sum: can I use it for math calculations?
tarretarretarre reacted to JohnOne for a topic
In order to do that, I believe you would need to reverse the algorithm used (adler) to create the checksum, unfortunately I do not believe it can be reversed because it is essentially a hash (one way encryption). I am not 100% on that, but fairly confident of it.1 point -
Seems you are out of luck then You and I do not know how to remove the lines. The guy who knows does not tell you. As it is a co-worker you could ask your boss to force the guy to pass the password for the macro.1 point
-
If the Excel file you got from your friend already contains the invisible lines, could you please post a stripped down version of this file?1 point
-
hold a button down for a certain part of my script
loganvh22 reacted to tarretarretarre for a topic
Just use MouseDown before your Send code and then end with MouseUp, add the difference in your sleep at the end Example MouseDown("right") Send()... sleep().. sleep(20msec - sleep time passed ) MouseUp("right")1 point -
@junkew, as I understand it he doesn't want to hide rows but just remove the borders from all rows/columns without any data.1 point
-
rows(n).hidden=true ; where n is an valid row number to hide multiple rows range(rows(n1),rows(n2)).hidden=true ; will hide rows n1 though n21 point
-
This "dock" technique is already included n the _DragMe or the _Resize_Control_Oben_Links function. At first it calls _Positionsarray_aller_Controls_aufbauen() to create an array wit positions of all the controls in the form. Then "while you drag, or resize the control" it checkes with _Pruefe_Ob_Control_an_anderes_andockt if a position "docks" to an other control and displays the line(s). The Line what you see is an simple Lable control with 1px height. (Yeah i know GDI+ would be better :P)1 point
-
You need to select the entire row/column as described here and set the borders for this range.1 point
-
The "drag" magic happens in the _DragMe() function (orginal from ChaosKeks) in the Addons.au3 (line 1070). It uses the Variable $Markiertes_Control_ID to get the handle of the selected control. Triggered is this function from the main "while" loop directly from the formstudio2.au3. The resizing thing is splitted into several functions. When you select a control the formstudio create dots around the control. Each dot is a simple Picture witch an Guictrlsetonevent on it. For Example the upper left dot uses the func _Resize_Control_Oben_Links() to resize the control. (Addons.au3, line 326) So for every dot ther is a own func. So if you click on the dot, the func is triggered and you can resize the control. (The funcs use again $Markiertes_Control_ID to get the handle of the current selected control)1 point
-
You can test with code like this: The size of the structure in post 1 seems to be 172 bytes. You can create an array with room for 50 structures in this way: ; Structure definition $MAX_ARRAY_SIZE = 50 ;$tag_LanSearchInfo2 = "char UID[21];char IP[16];ushort port;char DeviceName[132];char Reserved" ; Structure, 174 bytes $tag_LanSearchInfo2 = "align 1;char UID[21];char IP[16];ushort port;char DeviceName[132];char Reserved" ; Structure, 172 bytes $st_LanSearchInfo2 = DllStructCreate( $tag_LanSearchInfo2 ) ; Create structure $size_LanSearchInfo2 = DllStructGetSize( $st_LanSearchInfo2 ) ; Size of structure ConsoleWrite( "$size_LanSearchInfo2 = " & $size_LanSearchInfo2 & @CRLF ) $array_LanSearchInfo2 = DllStructCreate( "byte[" & $size_LanSearchInfo2 * $MAX_ARRAY_SIZE & "]" ) ; Array of structures You have to test the code to see if you need alignment or not. Now you can call the function like this: ; Function call $nWaitTimeMs = 5000 $nSendIntervalMs = 0 ; ???? DllCall( "IOTCAPIs.dll", "int", "IOTC_Lan_Search2_Ex", "struct*", $array_LanSearchInfo2, "int", $MAX_ARRAY_SIZE, "int", $nWaitTimeMs, "int", $nSendIntervalMs ) ;DllCall( "IOTCAPIs.dll", "int:cdecl", "IOTC_Lan_Search2_Ex", "struct*", $array_LanSearchInfo2, "int", $MAX_ARRAY_SIZE, "int", $nWaitTimeMs, "int", $nSendIntervalMs ) You have to test the code to see if you need the "cdecl" calling convention. ; Get count $count = 0 $pointer = DllStructGetPtr( $array_LanSearchInfo2 ) For $i = 0 To $MAX_ARRAY_SIZE - 1 $st_LanSearchInfo2 = DllStructCreate( $tag_LanSearchInfo2, $pointer ) If DllStructGetData( $st_LanSearchInfo2, "UID" ) Then $count += 1 $pointer += $size_LanSearchInfo2 Next ConsoleWrite( "$count = " & $count & @CRLF )1 point
-
Hi everyone and thanks for the comments. I edit my post and I add the code fixed with JohnOne's fix and also with English Comments, I don't need to use Google Translator to do that so you maybe will find some Grammar mistakes or something like that. Here in Cuba Google Translator among other things are a Luxury Option for an insanely expensive and slow Dial-Up internet connection. So here we code without searching in Google(and there I think a lot of self named "coders" copy and paste from Internet) I don't mean to offend or harm to anyone is that clear? Kind Regards Alien.1 point
-
How to license / sell autoit programs?
tarretarretarre reacted to TheSaint for a topic
There are a few UDF's or scripts out there I believe. I seem to recall that JohnOne did one. It is 'obfuscation' not 'observation', and if I recall rightly (unsure though), it is no longer being used ... there was a topic about that recently. While I'm not a fan of such things, except for security reasons, it should be simple enough to devise your own method. [1] Get details like Username, Computer name, HDD serial, email address, etc. [2] Have your program export a 'Details key', which is sent to you. Encrypted of course. [3] Have a program that grants a 'License key' for those details, which you then send back to user. [4] The program you provided the User with, then checks that 'License key', having the same code as your checking program, to do it. If a match occurs, the program is activated. Your checking code should allow for some changes, so perhaps a few matches are possible. If the HDD serial changed for instance, you would want most of the other details to still match. If the HDD serial stayed the same, you could be more flexible with the other details.1 point -
double click in autoit3 how ?
Gianni reacted to InunoTaishou for a topic
Are you wanting to detect when the label is double clicked? Here's one way #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <WinApi.au3> Global $hGUI = GUICreate("Double Click", 144, 144) Global $lblLabel = GUICtrlCreateLabel("Double click this!" & @CRLF & "For something cool", 10, 10) Global $hWnd_wndproc = DllCallbackRegister("NewWndProc", "ptr", "hwnd;uint;wparam;lparam") Global $ptr_new_wndproc = DllCallbackGetPtr($hWnd_wndproc) Global $ptr_old_wndproc = _WinAPI_SetWindowLong(GUICtrlGetHandle($lblLabel), $GWL_WNDPROC, $ptr_new_wndproc) GUISetState(@SW_SHOW, $hGUI) While (True) Switch (GUIGetMsg()) Case $GUI_EVENT_CLOSE GUIDelete($hGUI) DllCallbackFree($hWnd_wndproc) Exit 0 Case $lblLabel ConsoleWrite("Label clicked" & @LF) EndSwitch WEnd Func NewWndProc($hWndFrom, $iMsg, $wParam, $lParam) Switch $hWndFrom Case GUICtrlGetHandle($lblLabel) Switch $iMsg Case $WM_LBUTTONDBLCLK ConsoleWrite("Label Double clicked!" & @LF) MsgBox("", "Double Click!", "You double clicked my label!") EndSwitch EndSwitch Return _WinAPI_CallWindowProc($ptr_old_wndproc, $hWndFrom, $iMsg, $wParam, $lParam) EndFunc ;==>NewWndProc Here's another one using WM_COMMAND #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <WinApi.au3> Global $hGUI = GUICreate("Double Click", 144, 144) Global $lblLabel = GUICtrlCreateLabel("Double click this!" & @CRLF & "For something cool", 10, 10) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUISetState(@SW_SHOW, $hGUI) While (True) Switch (GUIGetMsg()) Case $GUI_EVENT_CLOSE GUIDelete($hGUI) Exit 0 Case $lblLabel ConsoleWrite("Label clicked" & @LF) EndSwitch WEnd Func WM_COMMAND($hWndFrom, $iMsg, $wParam, $lParam) Local $iIDFrom = BitAND($wParam, 0xFFFF) ; Low Word Local $iCode = BitShift($wParam, 16) ; Hi Word Switch ($hWndFrom) Case $hGUI Switch ($iIDFrom) Case $lblLabel If ($iCode) Then ConsoleWrite("Label Double clicked!" & @LF) MsgBox("", "Double Click!", "You double clicked my label!") EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND1 point -
Scite API/CallTips Questions with objects
tarretarretarre reacted to Jos for a topic
1. The dot character isn't a word character in my setup and since your words contains dot is only considers the last word. changing this will make that work but I am not sure how much else will be screwed up: calltip.au3.word.characters=$(chars.alpha)$(chars.numeric)_. 2. This id described in the helpfile. just add them to file $(SciteUserHome)\au3.user.calltips.api Jos1 point -
Problem with 2 different gui objects erasing keybinds and such
tarretarretarre reacted to Kovacic for a topic
Can you give a little more detail on 'the input for my embedded internet explorer object gets destroyed'?1 point -
Function Name Lister 06/27/2014
obiwanceleri reacted to jaberwacky for a topic
Hi. Have you ever tried to manually maintain a list of function names for your various projects? What I mean is when you start an AutoIt project you might have tried to maintain a running list of all of the functions that are in your project. This is fine when your project is small. When the project grows out of control then you may be like me and you simply stop maintaining that list. So I am hacking together a simple script to automate that process. Instructions: 1) Paste this into your user options file (Scite -> Options -> Open User Options File): # 37 FunctionNameLister command.37.$(au3)="$(SciteDefaultHome)\FunctionNameLister\FunctionNameLister.exe" "$(FilePath)" command.name.37.$(au3)=FunctionNameLister command.shortcut.37.$(au3)=Ctrl+Shift+Alt+f command.save.before.37.$(au3)=1 command.is.filter.37.$(au3)=1 Note: the number 37 may be changed to a number which suits you. 2) Create a folder named FunctionNameLister in the "...AutoIt3SciTE" directory. 3) Place the FunctionNameLister.exe into the folder that was created in step 2. FunctionNameLister.zip downloads:26 4) Browse to an AutoIt source. Paste the following two lines wherever you would like for your list of function names to appear in your source: #region ; Functions #endregion ; Functions Press Ctrl + Shift + Alt + f. Updates: Here is just the main code for those interested. The zip file contains the required exe. #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_AU3Check_Parameters=-w 1 -w 2 -w 3 -w 4 -w 6 -w 7 -d -q #Region ; Functions ; alert ; backup_original_copy ; create_function_list_string ; erase_function_list ; file_stream_read_line ; get_source_path ; main ; write_function_list_to_string #EndRegion ; Functions #include-once #include "SciTE Director.au3" #include <Array.au3> #include <File.au3> #include <String.au3> ; These tags are required to be in the au3 source in order for FunctionNameLister to work properly. ; They may be changed by editing the settings.ini file. Const $tag_begin = IniRead(@ScriptDir & "\settings.ini", "Tags", "TagBegin", "#Region ; Functions") Const $tag_end = IniRead(@ScriptDir & "\settings.ini", "Tags", "TagEnd", "#EndRegion ; Functions") ; Constants for FileStream functionality. Const $file_stream_eof = -1 Const $file_stream_other_error = 1 main() Switch @error Case 0 alert("FunctionNameLister was successful.") Case 1 alert("You must provide a path to an au3 source.", True) Case 2 alert("Could not make a back up of the original file.", True) Case 3 alert("Could not find the required tags.", True) EndSwitch Func main() Local Const $source_path = get_source_path() If @error Then Return SetError(1, 0, False) EndIf Switch backup_original_copy($source_path) Case True Local Const $autoit_source = erase_function_list($source_path) ; find the function names and write them to an array -- thanks Yashied Local Const $func_list = StringRegExp(StringRegExpReplace($autoit_source, "(?ims)#c[^#]+#c", ''), "(?ims)^\s*func\s*([^(]*)", 3) Local Const $func_string = create_function_list_string($func_list, True) Local Const $file_overwrite = FileOpen($source_path, $FO_OVERWRITE) Switch $file_overwrite <> -1 Case True Local Const $new_au3 = write_function_list_to_string($func_string, $autoit_source) If @error Then Return SetError(3, 0, False) EndIf FileWrite($file_overwrite, $new_au3) FileClose($file_overwrite) scite_close($source_path) scite_open($source_path) EndSwitch Case False Return SetError(2, 0, False) EndSwitch Return True EndFunc Func get_source_path() Local $source_path Select Case UBound($cmdline) <= 1 $source_path = FileOpenDialog("Browse to an au3 source.", '', "AU3 (*.au3)" ) If @error Then Return SetError(1, 0, False) EndIf Case Else $source_path = $cmdline[1] EndSelect Return $source_path EndFunc Func backup_original_copy(Const $source_path) Local $drive, $dir, $name, $ext _PathSplit($source_path, $drive, $dir, $name, $ext) Local Const $backup_path = _PathMake($drive, $dir, $name, ".BAK") Return FileCopy($source_path, $backup_path, 1) ? True : SetError(1, 0, False) EndFunc Func write_function_list_to_string(Const $func_string, Const $autoit_source) Local Const $tag_position = StringInStr($autoit_source, $tag_begin) If Not $tag_position Then Return SetError(1, 0, False) EndIf Local Const $tag_length = StringLen($tag_begin) Local Const $insert_string = ((StringInStr($func_string, $tag_end) > 0) ? $func_string : ($func_string & $tag_end)) Return _StringInsert($autoit_source, $insert_string & @CRLF, ($tag_position + $tag_length + 1)) EndFunc Func create_function_list_string($func_array, Const $sort) If Not IsArray($func_array) Then Return SetError(1, 0, False) If $sort Then _ArraySort($func_array, 0) Local $func_string = '' For $function In $func_array $func_string &= "; " & $function & @CRLF Next Return $func_string EndFunc Func erase_function_list(Const $source_path) Local $line = '' Local $autoit_source = '' Local $within_func_list = False Do $line = file_stream_read_line($source_path) Switch @error Case 0 Switch $line Case $tag_begin $within_func_list = True $autoit_source &= $tag_begin & @CRLF ContinueLoop Case $tag_end Switch $within_func_list Case True $within_func_list = False ContinueLoop EndSwitch EndSwitch Case $file_stream_eof, $file_stream_other_error ExitLoop EndSwitch Switch $within_func_list Case False $autoit_source &= $line & @CRLF Case True Select Case StringLeft($line, 1) <> ';' $within_func_list = False EndSelect EndSwitch Until False Return $autoit_source EndFunc Func file_stream_read_line(Const $path) Local Const $file_stream_close = -2 Local Const $file_stream_ready = -3 Local Const $file_stream_open_error = -1 Local Static $file_open = FileOpen($path, $FO_READ) Switch $path Case $file_stream_close FileClose($file_open) $file_open = $file_stream_ready Return True EndSwitch Select Case $file_open = $file_stream_open_error $file_open = $file_stream_ready Return SetError(2, 1, False) Case $file_open = $file_stream_ready $file_open = FileOpen($path, $FO_READ) Switch $file_open Case $file_stream_open_error $file_open = $file_stream_ready Return SetError(2, 2, False) EndSwitch ContinueCase Case $file_open >= 0 Local Const $file_line = FileReadLine($file_open) Switch @error Case 0 Return $file_line Case $file_stream_eof FileClose($file_open) $file_open = $file_stream_ready Return SetError($file_stream_eof, 0, False) Case $file_stream_other_error FileClose($file_open) $file_open = $file_stream_ready Return SetError($file_stream_other_error, 0, False) EndSwitch EndSelect EndFunc Func alert(Const $message, Const $error = False) Switch @Compiled Case True Switch $error Case False MsgBox($MB_OK, "FunctionNameLister", $message) Case True MsgBox($MB_OK + $MB_ICONERROR, "FunctionNameLister", $message) EndSwitch Case False Switch $error Case False ConsoleWrite(@CRLF & "> " & $message & @CRLF & @CRLF) Case True ConsoleWrite(@CRLF & "! " & $message & @CRLF & @CRLF) EndSwitch EndSwitch EndFunc1 point