Leaderboard
Popular Content
Showing content with the highest reputation on 04/17/2013 in all areas
-
Form Builder beta
mLipok reacted to BuckMaster for a topic
Update v1.0.6 Major script overhaul, I literally started over from scratch only adding parts of code from the old script that were solid. I don’t have a help file made as of now so I am going to explain all of the functionality in this post - Form Builder is no longer bi-directional, you now toggle between script mode and GUI mode using a button in the top right or F4 - The script no longer recompiles on every change but instead inserts changes into the script - Form Builder no longer cares about Event mode or GuiGetMsg mode - No more .gui files, you now edit .au3 scripts directly - Script edit is now a SciLexer control, includes syntax highlighting, folding, call tips, keywords, and inline error annotations. - Script output console is now at the bottom in script mode - Main GUI menu redone, most functions from SciTe have been added along with their hotkeys - All restrictions to editing the script have been removed - GDI+ and Graphic editors removed - Cleanup of script, stability greatly increased - Hotkeys no longer use _IsPressed they now use GUIAccelerator keys (with exception to a few) - Multiple scripts can be open - Form Builder buffers the open scripts and adds an asterisk * to scripts that have been modified - Rich Edit, GUIScrollbars, Dummy, and Updown are disabled for now until I can add them - GUI Menu controls cannot be created as of now but will be rendered in the editor - Undo and Redo actions in script mode and GUI mode added, the GUI undo and redo buffer is cleared switching between modes - The Undo and Redo buffers do not have a limit but are cleared when switching between modes or scripts - Undo and Redo actions do not work for controls that have no control handle - The Treeview now works as a Go to function for controls and functions in script mode - Form Builder now tries to preserve as much of the original content as possible, it will save whitespace in-between parameters and comments on controls - Treeview context menu reworked, much more responsive - Unicode support added File -> Encoding -> UTF-8 - Language support added, I added a couple of language files and used Google translate just so I could size my GUI's for different languages, I do not support what those language files say - Selecting a GUI in the Treeview in GUI mode will allow you to change the GUI's Handle, Position, Background Color, State, Cursor, Font, Font Size and Font Attributes - Auto Declare is no longer hiding in the settings, it is now on the top right and is a toggle between Off, Global and Local - Help File Lookup added (Ctrl + H), allows you to search selected text in the help file, Any variable will be searched and the first result will be displayed, any string will be searched as a keyword in the index - Added current script line, column, and selection length in the bottom left - Standard undeclared style constants are checked before script execution and the script will prompt if an undefined style constant is found - You can now toggle script whitespace, EOL characters, line numbers, margins and output in the View menu - View -> Toggle All Folds works as it does in SciTe, only base level folds are changed and the first fold found determines whether to expand or contract - Form Builder Settings redone - Bugs with submitting data and control selection have been fixed - Fixed problems with frequently called repetitive functions causing issues with large scripts - Fixed bugs with B, I, U and S font attribute buttons getting stuck and called when enter was pressed Update v1.0.7 - Help File Look-up hotkey changed to Ctrl+B - Replace hotkey changed to Ctrl+H - Changes to $SCN_MODIFIED so only text events are notified - Bookmarks added, Ctrl+M to add or delete a Bookmark from the current line - Edit -> Bookmarks -> Set Bookmark changes the currently selected Bookmark - Edit -> Clear Current Bookmarks deletes only the currently selected Bookmark - Allows you to change foreground and background colors of Bookmarks - Added F2 hotkey for Next Bookmark - Added Shift+F2 hotkey for Previous Bookmark - Fixed a bug that made it so script annotation did not show up for some people - Script errors and warnings now add a Bookmark on each line - Ctrl+E hotkey added to clear all Bookmarks and Annotations - Minor GUI tweaks - Fixed a bug with the GUI Style undo action - Undo and Redo actions for GUI windows will now update the window properties if the GUI is selected - F4 Hotkey no longer switches modes, switching modes is now F10 - F4 is to toggle next error or warning message, works like it does in SciTe, bookmarks the line and highlights the error in the console - Shift+F4 Hotkey added to toggle previous error or warning message - Shift+F5 Hotkey added to clear script output - Ctrl+F5 Hotkey added as SyntaxCheck Prod - Form Builder now performs a SyntaxCheck before entering GUI Mode and prompts on Error or Warning - Language Select Menu Added Settings -> Lanugage - Icons added to main menu - Languages added to all new menu items and msgbox's - Language Files updated for new data - Language Support added for Arabic, Chinese, Dutch, French, German, Hebrew, Japanese, Swedish, Thai, and Vietnamese [ Google Translate ] - Fixed bug with updating a language that made it look like ANSI and UTF-8 were both selected - Added redo button next to undo button - Font attribute buttons Bold, Italic, Underline and Strike-Out changed to labels Update v1.0.8 - Somehow a main function got deleted causing the script to crash on some changes - Fixed some issues with updating Languages Hotkeys Ctrl + N - New Blank Script Ctrl + G - New GUI Script Ctrl + O - Open Script Ctrl + Shift + S - Save As Ctrl + S - Save Esc - Close Open Script Alt + F4 - Exit Ctrl + Z - Undo Ctrl + Y - Redo Ctrl + X - Cut Ctrl + C - Copy Ctrl + V - Paste Ctrl + A - Select All Ctrl + W - Clear inline script annotation Ctrl + E - Clear inline script annotation and bookmarks Ctrl + F - Find Ctrl + F3 - Find Next Shift + F3 - Find Previous (doesn’t work yet) Ctrl + B - Help File Lookup F5 - Go Alt + F5 - Beta Run F7 - Build Ctrl + F7 - Compile F11 - Full screen F8 - Toggle Show/Hide Script Output Ctrl + I - Open Include Ctrl + H - Replace F1 - AutoIt Help File Ctrl + D - Duplicate Control Delete - Delete Control Ctrl + Shift + 8 - Toggle Show/Hide Script Whitespace Ctrl + Shift + 9 - Toggle Show/Hide Script EOL characters Ctrl - GUI Mode multicontrol selection F10 - Switch Modes F4 - Next Message Shift+F4 - Previous Message Shift+F5 - Clear Output Ctrl+M - Add Bookmark F2 - Next Bookmark Shift+F2 - Previous Bookmark Basic GUI Mode How To Create a Control - click a control on the left - click in the GUI you wish to add the control Left Click: Click and drag to auto resize the control Right Click: Creates the control at a standard size Select a Control - click inside the control or select it in the treeview Change a controls Data - First select the control - modify the controls data on the right, press enter to submit changes state, cursor, font and resizing update when you change the data - when modifying the data parameter the script recognizes if there is a variable in the data and will add quotes accordingly ex. data parameter = $data, End result in script: GUICtrlCreateButton($data, 50, 50, 100, 20) ex. data parameter = data, End result in script: GUICtrlCreateButton("data", 50, 50, 100, 20) ex. data parameter = "data"&$data, End result in script: GUICtrlCreateButton("data"&$data, 50, 50, 100, 20) Applying an Image to a control - select a control - control styles must be applied to some controls before adding an image - click the ... button next to the Image input in the Control Properties area in the bottom right - select the image you want to display, allows jpg, bmp, gif, ico and dll files - selecting a dll will open another prompt to choose which resource to display Control Grouping - multiple controls must be selected - press the group controls button - control grouping allows you to resize and move multiple controls at the same time, as of now groups are deleted when leaving GUI mode I only have a couple odds and ends to finish up before everything should be complete, I need to add Undo and Redo actions for copying and duplicating controls and a couple other minor things, eventually I want to try to add all of the UDF controls as well. If people are willing to translate the language file I would be very grateful, the ones I have right now are from Google translate, I only used them for testing and have no idea what they say. I want to thank Kip, Prog@ndy, Isi360 and all of the other contributors on this forum, without you guys i don't think i could have written this script. Please post any comments, problems or suggestions, BuckMaster * I only used one "magic number" on my main close case statement, only for faster locating, and i don't care. Form Builder Source.zip Form Builder.zip1 point -
I think that if you dont have closed the $oExcel object you dont need to re-use: $oExcel = ObjCreate("Excel.Application") So $oExcel = _ExcelBookOpen($sFilePath1) should be fine. Hi!1 point
-
Very rude way: If ProcessExists("excel.exe") Then ProcessClose("excel.exe") EndIf Hi!1 point
-
1 point
-
Taskbar for no GUI script
PoojaKrishna reacted to Decipher for a topic
PoojaKrishna, Is this what you wanted? Global $hGUI = GUICreate("My Window's Title", @DesktopWidth, @DesktopHeight, -1, -1, $WS_POPUP) WinSetTrans($hGUI, "", 0) GUISetState(@SW_SHOW, $hGUI) ; - When you compile your script with a custom icon it will replace the default AutoIt Icon that is shown in the taskbar. ; - This GUI shouldn't be visible or interfere with any other applications Sleep(5000) *Edit - for better example. Anonymous1 point -
Limit an area to be between 2 points?
olo reacted to stormbreaker for a topic
You are welcome indeed. However, I suggest you to use the example in Post-7 of this thread. It's much better than the first one (which you have quoted).1 point -
afzalw, I would recommend using this UDF the functions probably don't return until they've completed but if you have further problems please let us know. Also remember to search before posting. Anonymous1 point
-
#include <Constants.au3> Local $sSearch = "+5v" ;search words ;retrieves the browser window handle Local $hWnd = WinGetHandle("Title") ;window title WinActivate($hWnd) WinWaitActive($hWnd) Send("^f") ;opens the search input Send($sSearch, 1) ;writes the search Send("{ENTER}") ;starts the search, will point to the first text found Local $aPos = WinGetPos($hWnd) ;get the browser wnd pos MouseClick("right", $aPos[0] + 15, $aPos[1] + 120, 1, 0) ;right click on the pdf ClipPut("") ;if nothing is found the clipboard content is not changed (so we clear it) Send("{DOWN 3}{ENTER}") ;select the "Copy" menu item Local $sContent1 = ClipGet() ;content copied If $sContent1 <> $sSearch Then ;if the content copied is different from the search MsgBox($MB_APPLMODAL, "", "Nothing found.") Else MsgBox($MB_APPLMODAL, "", "Found.") EndIf Better ?1 point
-
hi all this is my first example in autoit forum so please comment after seeing andybiochem's topic about the elastic radio buttons following the mouse pointer i decided to create something for my GF using this func for valentine's day HAPPY VALENTINE DAY ok now to test this u will have to save the script then save the PNGs to a folder named "Set" in the script directory and it should look like this : ;====== Elastic Trail script ====== ; Original Javascript by Philip Winston - pwinston@yahoo.com ; Adapted for AutoIT by AndyBiochem ; Used with GDI+ for PNG's by yehia #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <GDIPlus.au3> ;----- Variables ----- Global $iDots = 7 ;..... Number of PNGs Global $aDots[$iDots][5] ;..... PNGs array Global $iXpos = 0 Global $iYpos = 0 Global $iDeltaT = 0.01 Global $iSegLen = 10 Global $iSpringK = 10 Global $iMass = 1 Global $iXGravity = 0 Global $iYGravity = 50 Global $iRes = 10 Global $iStopVel = 0.1 Global $iStopAcc = 0.1 Global $iDotSize = 25 Global $iBounce = 0.75 Global Const $AC_SRC_ALPHA = 1 Global $iHeight = @DesktopHeight Global $iWidth = @DesktopWidth ;----- 'PNGs' ----- Myname() ; just my name on the back :P For $i = 1 To ($iDots - 1) $iDotSize-=2 $aDots[$i][0] = GUICreate("", $iDotSize, $iDotSize, 144, 160, $WS_POPUP , $WS_EX_LAYERED + $WS_EX_TOOLWINDOW+$WS_EX_TOPMOST) _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir &"\Set\" &$i& ".png") SetBitMap($aDots[$i][0] , $hImage, 255) GUISetState(@SW_SHOW) Next ;############### LOOP ############### While 1 Sleep(10) $m = MouseGetPos() $iXpos = $m[0] $iYpos = $m[1] _Animate() WEnd ;#################################### Func _Animate() $aDots[0][1] = $iXpos $aDots[0][2] = $iYpos For $i = 1 To ($iDots - 1) Local $spring[3] $spring[1] = 0 $spring[2] = 0 _Spring_Force($i - 1, $i, $spring) If $i < ($iDots - 1) Then _Spring_Force($i + 1, $i, $spring) Local $resist[3] $resist[1] = -$aDots[$i][3] * $iRes $resist[2] = -$aDots[$i][4] * $iRes Local $accel[3] $accel[1] = ($spring[1] + $resist[1]) / $iMass + $iXGravity $accel[2] = ($spring[2] + $resist[2]) / $iMass + $iYGravity $aDots[$i][3] += ($iDeltaT * $accel[1]) $aDots[$i][4] += ($iDeltaT * $accel[2]) If Abs($aDots[$i][3]) < $iStopVel And Abs($aDots[$i][4]) < $iStopVel And Abs($accel[1]) < $iStopAcc And Abs($accel[2]) < $iStopAcc Then $aDots[$i][3] = 0 $aDots[$i][4] = 0 EndIf $aDots[$i][1] += $aDots[$i][3] $aDots[$i][2] += $aDots[$i][4] If ($aDots[$i][2] < 0) Then If ($aDots[$i][4] < 0) Then $aDots[$i][4] = $iBounce * - $aDots[$i][4] $aDots[$i][2] = 0 EndIf If ($aDots[$i][2] >= $iHeight - $iDotSize - 1) Then If ($aDots[$i][4] > 0) Then $aDots[$i][4] = $iBounce * - $aDots[$i][4] $aDots[$i][2] = $iHeight - $iDotSize - 1 EndIf If ($aDots[$i][1] >= $iWidth - $iDotSize) Then If ($aDots[$i][3] > 0) Then $aDots[$i][3] = $iBounce * - $aDots[$i][3] $aDots[$i][1] = $iWidth - $iDotSize - 1 EndIf If ($aDots[$i][1] < 0) Then If ($aDots[$i][3] < 0) Then $aDots[$i][3] = $iBounce * - $aDots[$i][3] $aDots[$i][1] = 0 EndIf WinMove($aDots[$i][0], "", $aDots[$i][1], $aDots[$i][2]) Next EndFunc ;==>_Animate Func _Spring_Force($i, $j, ByRef $spring) Local $springF $dx = $aDots[$i][1] - $aDots[$j][1] $dy = $aDots[$i][2] - $aDots[$j][2] $len = Sqrt($dx ^ 2 + $dy ^ 2) If Not ($len > $iSegLen) Then Return $springF = $iSpringK * ($len - $iSegLen) $spring[1] += ($dx / $len) * $springF $spring[2] += ($dy / $len) * $springF EndFunc ;==>_Spring_Force Func SetBitmap($hGUI, $hImage, $iOpacity) Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize ) DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth ($hImage)) DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage)) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha" , $iOpacity ) DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA) _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) _WinAPI_ReleaseDC (0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteDC ($hMemDC) EndFunc ;==>SetBitmap Func Myname() $yGUI = GUICreate("", 200, 120, (@DesktopWidth/2)-100, (@DesktopHeight/2)-60, $WS_POPUP , $WS_EX_LAYERED + $WS_EX_TOOLWINDOW+$WS_EX_TOPMOST) _GDIPlus_Startup() $yImage = _GDIPlus_ImageLoadFromFile(@ScriptDir &"\Set\y.png") SetBitMap($yGUI , $yImage, 255) GUISetState(@SW_SHOW) EndFunc ;==>Myname NOW the PNGs, download this rar file attached put it in the script directory and bam u got it HAPPY VALENTINE again credit goes to andybiochem first then me, i just created the GDI part Edit : spelling Set.rar1 point