Leaderboard
Popular Content
Showing content with the highest reputation on 12/02/2012 in all areas
-
Form Builder beta
mLipok and one other 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.zip2 points -
@all If you want to schedule the Pause / Resume then you could use this version. Credits to Melba and others for the basics I found on the forum. I modified this version to fit the needs. #include <GuiToolBar.au3> #Include <GuiMenu.au3> #include <SendMessage.au3> #include <WindowsConstants.au3> ; If you want to click on the bottom item then you just have to send the enter key Send("{ENTER}") ; If you want to 2nd item from the bottom then : Send("{UP 1}{ENTER}") ; Credits tor Rover / Melba / ... ?? Global $hSysTray_Handle, $iSysTray_ButtonNumber Global $sToolTipTitle = "Dropbox" Global $nChars = 7 ; Number of chars to catch $iSysTray_ButtonNumber = Get_SysTray_Index($sToolTipTitle, $nChars) If $iSysTray_ButtonNumber = -1 Then MsgBox(16, "Error", "Icon not found in system tray") Exit Else _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSysTray_ButtonNumber, "right") Sleep(500) Send("{UP 4}") ; Menu index 4 UP Local $ret $ret = GetPopUpSelText() ConsoleWrite($ret & @CRLF) ; This will read the currently selected item If $ret == "Pause syncing" Then Send("{ENTER}") Sleep (1500) EndIf _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSysTray_ButtonNumber, "right") Sleep(500) Send("{UP 4}") $ret = GetPopUpSelText() ConsoleWrite($ret & @CRLF) If $ret == "Resume syncing" Then Send("{ENTER}") Sleep (1500) Else MsgBox(48,"Status","Check the Dropbox Status") EndIf EndIf Exit Func Get_SysTray_Index($sToolTipTitle, $iChar=30) ;ConsoleWrite("Search String = " & StringLeft($sToolTipTitle,$iChar) & @CRLF) ; Systray handle $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') If @error Then MsgBox(16, "Error", "System tray not found") Exit EndIf ; Systray item count Local $iSysTray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) If $iSysTray_ButCount = 0 Then MsgBox(16, "Error", "No items found in system tray") Exit EndIf ; Tooltip catch For $iSysTray_ButtonNumber = 0 To $iSysTray_ButCount - 1 ;ConsoleWrite("Index = " & $iSysTray_ButtonNumber & " Text = " & _GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSysTray_ButtonNumber) & @CRLF) If StringLeft(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSysTray_ButtonNumber),$iChar) = $sToolTipTitle Then ;ConsoleWrite($iSysTray_ButtonNumber & @CRLF) Return $iSysTray_ButtonNumber ; Found EndIf Next Return -1 ; Not found EndFunc ;==>Get_SysTray_Index Func GetPopUpSelText() Local $aPopUp_List = _WinAPI_EnumWindowsPopup() Local $hWnd = $aPopUp_List[1][0] Local $sClass = $aPopUp_List[1][1] If $sClass = "#32768" Then ; This is a "standard" Windows API popup menu $hMenu = _SendMessage($hWnd, $MN_GETHMENU, 0, 0) If _GUICtrlMenu_IsMenu($hMenu) Then $iCount = _GUICtrlMenu_GetItemCount($hMenu) For $j = 0 To $iCount - 1 If _GUICtrlMenu_GetItemHighlighted($hMenu, $j) Then Return _GUICtrlMenu_GetItemText($hMenu, $j) EndIf Next EndIf EndIf Return "" EndFunc Enjoy ! rgds ptrex1 point
-
Custom buttons with GDI+ [solved]
burners reacted to stormbreaker for a topic
Greetings to everyone... while experimenting with GDI+, I ran into a bit of trouble. CODE: #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ; create variables and objects _GDIPlus_Startup() $gpsind0=_GDIPlus_ImageLoadFromFile("search.png") $Form1 = GUICreate("A problem to solve", 150, 150) $btn = GUICtrlCreateButton('Button', 10, 10, 90, 30) GUISetState(@SW_SHOW) $hGraphic=_GDIPlus_GraphicsCreateFromHWND(GUICtrlGetHandle($btn)) ; main program code _GDIPlus_GraphicsDrawImage($hGraphic,$gpsind0,0,0) GUIRegisterMsg($WM_PAINT, "WM_ERASEBKGND") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _GDIPlus_ImageDispose($gpsind0) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_ShutDown() Exit Case $btn msgbox(64, '', 'you clicked a button') EndSwitch WEnd Func WM_ERASEBKGND() _GDIPlus_GraphicsDrawImage($hGraphic,$gpsind0,0,0) EndFunc Well, the image disappears once the mouse hovers over the button (or when the button is clicked etc). Can someone please help me in this issue. Also, could someone please guide me as how to change the image once the button is clicked, mouse hovered, button is pressed and so on... Thank you for your time and invaluable guidance. Regards, MKISH IMAGE ATTACHED BELOW:1 point -
Kroms make a simple script and work on one thing, once you understand how that works move onto something else and/or add to your existing work this is how i start all myscripts and functions: HotKeySet("{F1}", "MyFirstFunc") HotKeySet("{ESC}", "_Exit") ; F1 runs the script Esc closes While 1 Sleep(10) WEnd Func MyFirstFunc() ;your pixel code goes here EndFunc Func _Exit() Exit EndFunc Once you have a working pixel code and you "think" you know how its working try adding to it, i would just give you the code after being called a lier and a thief but i know they will all get arsey on here. Starting to think this community is not very welcoming tbh.1 point
-
Try this. #include <GUIConstants.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> Global $list = ProcessList() ;List all processes Global $proc[5] = ["Explorer.exe", "Chrome.exe", "SVCHOST.exe", "Services.exe", "conhost.exe"] GUICreate("Processes", 510, 700) $run = GUICtrlCreateButton("GET PROCESSES", 10, 660, 100, 30) GUICtrlCreateLabel("Whitelisted Processes", 20, 10) $view = GUICtrlCreateListView("Process | PID", 10, 30, 230, 605, -1, $LVS_EX_CHECKBOXES) GUICtrlCreateLabel("Suspsicious Processes", 270, 10) $view2 = GUICtrlCreateListView("Process | PID", 260, 30, 230, 605, -1, $LVS_EX_CHECKBOXES) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $run Then For $i = 2 To $list[0][0] If _ArraySearch($proc, $list[$i][0]) > 0 Then GUICtrlCreateListViewItem($list[$i][0] & "|" & $list[$i][1], $view) Else GUICtrlCreateListViewItem($list[$i][0] & "|" & $list[$i][1], $view2) EndIf Next EndIf WEnd1 point
-
Here are some good comments for your question: http://stackoverflow.com/questions/8431175/net-system-drawing-namespace-what-are-the-differences-between-bitmap-image-a Or here: Bitmap: Image class (Windows) Image: Bitmap class (Windows) Br, UEZ1 point