Leaderboard
Popular Content
Showing content with the highest reputation on 08/03/2013 in all areas
-
Last Update 10/1/11 This is a rewrite of my previous thumbnail toolbar UDF that includes all the other methods for ITaskBarList4. Some of the function new functions I really liked were the icon overlays like the IE icon in the snapshot, and SetThumbNailClip that allows you to crop the Thumbnail preview to any portion of the gui you want it to be. I tested this in 64bit and didnt have any problems so hopefully all the structure alignment problems have been fixed in autoit. As with anything I post, please let me know if you have any problems or suggestions (and I love comments). Requirements are Windows 7 and the new beta (3.3.7.18). All examples are included in the attatchment. Special thanks to the AutoitObject Team, wraithdu for his original ITaskBarList Example, and extra thanks to trancexx for the new ObjCreateInterface() thats actually included in autoit now!! Your the F****ing Sh**t! UDF Functions ; #INDEX# ======================================================================================================================= ; Title .........: ITaskBarList ; AutoIt Version : 3.3.7.18 (Beta) ; Language ......: English ; Description ...: Functions to assist in using the ITaskBarList Interface. ; Author(s) .....: Brian J Christy (Beege) ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ; _ITaskBar_CreateTaskBarObj - Creates a ITaskBarList object. ; _ITaskBar_SetOverlayIcon - Applies an overlay to a taskbar button to indicate application status or a notification to the user. ; _ITaskBar_SetThumbNailClip - Selects a portion of a window's client area to display as that window's thumbnail in the taskbar. ; _ITaskBar_AddTBButtons - Applies buttons that have been previously created using _ITaskBar_CreateTBButton() ; _ITaskBar_CreateTBButton - Creates a ThumbBar button ; _ITaskBar_UpdateTBButton - Shows, enables, disables, or hides buttons in a thumbnail toolbar as required by the window's current state. ; _ITaskBar_SetTBImageList - Specifies an image list that contains button images for a toolbar embedded in a thumbnail image of a window in a taskbar button flyout. ; _ITaskBar_ActivateTab - Activates an item on the taskbar. The window is not actually activated; the window's item on the taskbar is merely displayed as active. ; _ITaskBar_AddTab - Adds an item to the taskbar. ; _ITaskBar_DeleteTab - Deletes an item from the taskbar. ; _ITaskBar_SetActiveAlt - Marks a taskbar item as active but does not visually activate it. ; _ITaskBar_MarkFullscreenWindow - Marks a window as full-screen. ; _ITaskBar_RegisterTab - Informs the taskbar that a new tab or document thumbnail has been provided for display in an application's taskbar group flyout. ; _ITaskBar_UnregisterTab - Removes a thumbnail from an application's preview group when that tab or document is closed in the application. ; _ITaskBar_SetTabProperties - Allows a tab to specify whether the main application frame window or the tab window should be used as a thumbnail or in the peek feature under certain circumstances. ; _ITaskBar_SetProgressState - Sets the type and state of the progress indicator displayed on a taskbar button. ; _ITaskBar_SetProgressValue - Displays or updates a progress bar hosted in a taskbar button to show the specific percentage completed of the full operation. ; _ITaskBar_SetTabActive - Informs the taskbar that a tab or document window has been made the active window. ; _ITaskBar_SetTabOrder - Inserts a new thumbnail into a tabbed-document interface (TDI) or multiple-document interface (MDI) application's group flyout or moves an existing thumbnail to a new position in the application's group. ; _ITaskBar_SetThumbNailToolTip - Specifies or updates the text of the tooltip that is displayed when the mouse pointer rests on an individual preview thumbnail in a taskbar button flyout. ; _ITaskBar_DestroyObject - Destroys ITaskBarObject and icons freeing any memory the icons occupied ; =============================================================================================================================== Example 1 Example 2 ITaskBarList.zip1 point
-
makes me smile. it was me who initiated GUISetStyle() to be added to autoit functions many many years ago. the mods told me they doubt that anyone will ever need it. edit: pre gdi+ times times of course1 point
-
Coded after a long. Check the example #include <GDIPlus.au3> #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <StaticConstants.au3> #include <Constants.au3> #include <Array.au3> Global Const $AC_SRC_ALPHA = 1 Global $iWidth, $iHeight, $hRegion Global $___hNew_WndProc, $___pNew_WndProc, $___pOld_WndProc _GDIPlus_Startup() $s_Bitmap = @ScriptDir & "\ciik.png" ;http://img823.imageshack.us/img823/8938/ciik.png - link given by the OP at http://www.autoitscript.com/forum/topic/153261-who-wants-to-help-me-learn-enhanced-gui-building/#entry1102795 $hLayeredGUI = _GUICreate_Alpha("LayeredWin | Phoenix XL", $s_Bitmap, $iWidth, $iHeight) GUISetState() ;show the main gui ;when the background color and the transcolor are the same of a layered GUI we recieve transparent background ;this would create an invisible window $hControls_GUI = GUICreate("ControlGUI", $iWidth, $iHeight, 0, 0, $WS_POPUP, BitOR($WS_EX_MDICHILD, $WS_EX_LAYERED), $hLayeredGUI) GUISetBkColor(0xABCDEF) _WinAPI_SetLayeredWindowAttributes($hControls_GUI, 0xABCDEF, 230) ;set transparency to 230 ;the close button you can use icon also $iCloseButton = GUICtrlCreateLabel("X", 26, 30, 10, 10) GUICtrlSetCursor(-1, 0) GUICtrlSetColor(-1, 0xFFFFFF) ;now lets create the so required controls to sync the user interaction $iProgressBar = GUICtrlCreateProgress(80, 50, 360, 30) GUICtrlSetData(-1, 20) ;set the initial position of the progress to 20 $iText = GUICtrlCreateLabel("You will get all the status updates and the information here...." & @CRLF & "Stay Tuned..", 80, 90, 279, 205) GUISetState() ;show the controls window Local $iMsg, $aInfo, $f_ClkThrough = False Do $iMsg = GUIGetMsg(1) ;use advanced method for there are multiple GUIs Switch $iMsg[1] Case $hControls_GUI ;msg is received from controls gui Switch $iMsg[0] Case $iCloseButton ;close btn is clicked ExitLoop EndSwitch EndSwitch $aInfo = GUIGetCursorInfo($hControls_GUI) If @error Then ContinueLoop ;enable clickthrough for the invisible control gui If $aInfo[4] = 0 And $f_ClkThrough = False Then _WinSetClickThrough($hControls_GUI) $f_ClkThrough = True ElseIf $aInfo[4] And $f_ClkThrough Then _WinSetClickThrough($hControls_GUI, False) $f_ClkThrough = False EndIf Until $iMsg[0] = $GUI_EVENT_CLOSE _GDIPlus_Shutdown() Exit Func _WinSetClickThrough($hWin, $iCLickThrough = True) Local $iExStyle = GUIGetStyle($hWin) $iExStyle = $iExStyle[1] If $iCLickThrough Then $iExStyle = BitOR($iExStyle, $WS_EX_TRANSPARENT) Else $iExStyle = BitXOR($iExStyle, $WS_EX_TRANSPARENT) EndIf Return GUISetStyle(Default, $iExStyle) EndFunc ;==>_WinSetClickThrough ;I have not created the following functions.. Func _GUICreate_Alpha($sTitle, $sPath, ByRef $iWidth, ByRef $iHeight, $iX = -1, $iY = -1, $iOpacity = 255) Local $hGUI, $hImage $hImage = _GDIPlus_ImageLoadFromFile($sPath) $iWidth = _GDIPlus_ImageGetWidth($hImage) $iHeight = _GDIPlus_ImageGetHeight($hImage) $hGUI = GUICreate($sTitle, $iWidth, $iHeight, $iX, $iY, $WS_POPUP, $WS_EX_LAYERED) SetBitmap($hGUI, $hImage, $iOpacity) _GDIPlus_ImageDispose($hImage) Return $hGUI EndFunc ;==>_GUICreate_Alpha 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 I hope now you can modify by yourself. Regards1 point
-
@ScriptDir returns trailing slash
trancexx reacted to Richard Robertson for a topic
However, this is unrelated to the current discussion as you would never use the working directory or script directory with the assumption that it is a drive root.1 point -
I understand, but I'm looking at it from a users point of view, same as will thousands of others. AutoIt has had great admiration across the internet for it's documentation Awsomeness, scaling it back is silly. It's like putting less lettuce on burgers because the burger guy is overworked. I know you do tons of work on the help file, and don't take it personally but thousands of people outside of us who do not post here, don't care. They just want the Awsomness to continue.1 point
-
For me, removing function headers because of the size of a download for the sake of a few lousy megabytes or a few extra minutes compile time is silly. Or anything else regarding size which trades detail and/or completeness.1 point
-
Thanks. Now I'm thinking of making a small game with S3d. Edit: This topic became "Hot"!1 point
-
GUI beginner attempt, cash register
WhiteSpace reacted to Edano for a topic
okay, now that WhiteSpace has begun, i dare to alter the script as well. . ;http://www.autoitscript.com/forum/topic/153239-gui-beginner-attempt-cash-register/#entry1102600 ;Post #6 ;D:\DOKUME~1\ADMINI~1\LOKALE~1\Temp\SLICER\Avatar\default_large.png ;by WhiteSpace ;Script grabbed by SLICER by Edano here: http://www.autoitscript.com/forum/topic/152402-slicer-autoit-forum-script-grabber/?p=1093575 GUICreate ("Articles", 975, 635, 500, 100) ;==> crta GUI GUISetFont (20, 400, "", "Comic Sans MS") Global $ware[18] For $j=0 To 2 For $i=0 To 5 $ware[$j*6+$i]=GUICtrlCreateButton ("Product "&$i+1+$j*6,5+255*$j,5+105*$i,250,100) Next Next $Kraj = GUICtrlCreateButton ("Finish", 770, 5, 200, 625) GUISetState() ;==> shows GUI While 1 $msg = GUIGetMsg() ;==> proves GUI For $i=0 To 17 If $msg=$ware[$i] Then _EvaluateQuantity($i) Next If $msg = $Kraj Or $msg=-3 Then Exit WEnd ;\\\\\\\\\\\\\\\\\\\\\\\\\\\\ FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Func _EvaluateQuantity($button) Local $product=GUICtrlRead($ware[$button]) Local $quantity = InputBox ("", "Quantity of "&$product&":", "", "", 500, 250, 500, 200, "", "") Local $ans = MsgBox (4,"","You chose an article: " & $product & ", and quantity: " & $quantity) EndFunc . please ask if you don't understand, but study the help file first E.1 point -
In both instances, your script will work if you add a delay before gathering the IE objects. Place the command "Sleep(3000)" after the final IENavigate command and then run the script again. I suspect that the issue is due to the fact that the websites haven't loaded or the objects haven't fully instantiated. Therefore, you aren't getting accurate results when scanning through the IE instances. You could also use the Ubound() function to check the size of the array, which would have helped in diagnosing this issue.1 point
-
Ever had the need to pick a hex value for a color for a GUI or a control? Ever tried to figure out how to get those numbers into your script once you've picked the perfect color? I have come up with an extremely small script, that when compiled and placed in a folder inside the SciTE folder will allow you to quickly select the color you want using the _ChooseColor dialog. It will then paste this color code into your script where you cursor is currently placed. It works with Scite only for now, mainly because it uses ControlSend to paste the value into SciTE's editor window, but can easily be modified to work with any editor by changing the window title and control ID it's sending to. This code will work when compiled and placed into the "Autoit3\Scite\ColorChooser" folder, or wherever you have your installation of SciTE, but has to be in the folder named ColorChooser for the tool code to work, or you'll have to change that yourself. Here's the code for the colorchooser: #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Run_Tidy=y #Tidy_Parameters=/rel #AutoIt3Wrapper_Run_Obfuscator=y #Obfuscator_Parameters=/so #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Misc.au3> #include <SendMessage.au3> Opt("WinTitleMatchMode", 2) Global $sDefaultColor = 0 Global $iMode = 1 Global Const $WM_COPYDATA = 0x004A If $cmdline[0] > 0 Then $sDefaultColor = $cmdline[1] EndIf If StringLeft($sDefaultColor, 2) <> "0x" Then $iMode = 0 $sDefaultColor = "0x" & $sDefaultColor EndIf $sReturn = _ChooseColor(2, $sDefaultColor, 2) If $sReturn = -1 Then Exit (1) If Not $iMode Then $sReturn = StringMid($sReturn, 3) EndIf _SciTE_InsertText($sReturn) Func _SciTE_InsertText($sString) Return _SciTE_Send_Command(0, WinGetHandle("DirectorExtension"), "insert:" & $sString) EndFunc ;==>_SciTE_InsertText Func _SciTE_Send_Command($hHandle, $hSciTE, $sString) Local $ilParam, $tData If StringStripWS($sString, 8) = "" Then Return SetError(2, 0, 0) ; String is blank. EndIf $sString = ":" & Dec(StringTrimLeft($hHandle, 2)) & ":" & $sString $tData = DllStructCreate("char[" & StringLen($sString) + 1 & "]") ; wchar DllStructSetData($tData, 1, $sString) $ilParam = DllStructCreate("ptr;dword;ptr") ; ulong_ptr;dword;ptr DllStructSetData($ilParam, 1, 1) ; $ilParam, 1, 1 DllStructSetData($ilParam, 2, DllStructGetSize($tData)) DllStructSetData($ilParam, 3, DllStructGetPtr($tData)) _SendMessage($hSciTE, $WM_COPYDATA, $hHandle, DllStructGetPtr($ilParam)) Return Number(Not @error) EndFunc ;==>_SciTE_Send_Command As you can see, there's not a whole lot to it. It just pops open the color chooser dialog, copies the results to the clipboard and then pastes it into SciTE using the ControlSend command. You will also notice, that if you don't choose a color, by hitting cancel in the Color Chooser dialog, it will also exit without pasting anything, so you shouldn't need to worry about pasting something you don't want in your scripts. This code should be added to your SciTEUser.properties file so that you can call it from within SciTE by hitting Ctrl-Alt-C, this can be changed if you already have a hot key set to that combination. # 43 Color Chooser command.name.43.*=Color Chooser command.43.*="$(SciteDefaultHome)\ColorChooser\ColorChooser.exe" $(CurrentSelection) command.shortcut.43.*=Ctrl+Alt+C That's all there is to it, enjoy. EDIT: I have updated the script and the SciTEUser.properties code so that if you have a color code that's currently selected when this is called, it will send that to the _ChooseColor dialog now as the starting color. UPDATED: 31-May-12 I've updated the script so that it now uses the "DirectorExtension" as suggested by guinness instead of copying the data to the clipboard and pasting it into SciTE, which might cause problems with what you have on the clipboard currently. I have also updated it so that if you send the script a color in the format "FFFFFF" without the preceeding "0x", it will return the color code in the same format. This is useful if, for example, you're changing a color in one of SciTE's properties files, which don't start with "0x". I've also changed the command.43.* line, I've moved the quote from the end of the line to the end of the command because I've noticed that a lot of times it causes issues if the color code is inside the quotes.1 point
-
dasiuss, Accelerators do work with OnEvent mode - as you can see here: #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) $hGUI = GUICreate("Test", 500, 500) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") $hButton = GUICtrlCreateButton("Press", 10, 10, 80, 30) GUICtrlSetOnEvent(-1, "PressClicked") GUISetState() ; Set accelerator key for button press Dim $AccelKeys[1][2]=[["b", $hButton]] GUISetAccelerators($AccelKeys) While 1 Sleep(10) WEnd Func PressClicked() MsgBox(0, "Button", "Pressed") EndFunc Func CLOSEClicked() Exit EndFuncIf you press "b", you fire the button code. Or do you have another problem? M231 point
-
Hi 1- the flag 0x100000 is not listed on the help file, i discovered it by trial and error. Msgbox (0x100000,"Test Mirror", "This is a Mirrored Msgbox") 2- Mirror tech. is so important for people like me who writes Arabic scripts “Right to left”1 point