4 posts in this topic
first of all i searched in the forum but i didn't found any solution to my problem.
I am using windows 10.
I made a script that is supposed to change the title to the active window, resize it to the smallest size possible (should be around 800 x 600) and move to (0, 0).
I can change the title but i fail to do the other 2 tasks.
i use wingettitle [active] copied from the F1 help tool (and this works), i i put the title in a variable and than i use
winsettitle ($variable, "one") (this works too)
winmove ("one", 0, 0, 800, 600) (doesn't do anything)
i also tried
local $x = winget ( "one")
msgbox (0, "", $x) (i get a completely white box so i suppose winget can't have any data about my window ??)
any suggestion ?
Create modern looking borderless and resizable GUIs with control buttons (Close,Maximize/Restore,Minimize, Fullscreen, Menu) True borderless, resizeable GUI with full support for aerosnap etc. Many color schemes/themes included. See MetroThemes.au3 for more details. 3 type of Windows 8/10 style buttons. Modern checkboxes, radios, toggles and progressbar. All buttons, checkboxes etc. have hover effects! Windows 10 style modern MsgBox. Windows 10/Android style menu that slides in from left. Windows 10 style right click menu
Credits: @UEZ, for the function to create buttons with text using GDIPlus. @binhnx for his SSCtrlHover UDF
Version 220.127.116.11 - Changelog - 07.10.2017
Fixed a bug where certain controls in the GUI (Tabs/Listviews) were not handled properly because of a bug in _WinAPI_DefSubclassProc. Thanks @LarsJ. Removed the automated handling of the control buttons (except for fullscreen), as they were triggering the close/min/max/restore message multiple times when the user clicked them on the child window multiple times during a sleep, which caused the parent window to also receive the message. Fixed a bug where in certain situations the active child window prevented the fullscreen activation from working properly on the parent window. Fixed a bug where the resize cursor was not displayed properly when hovering over the corners. -> Currently it is required to reset the cursor to default if you use any controls very close to the window border and move your mouse from the corner to the control. I will try to think of something later. Fixed a bug where the lines of the _Metro_AddControlButton_Back were misplaced on certain DPI settings. Also fixed the hover not working with this button. Other small changes New features:
Added _Metro_AddHSeperator/_Metro_AddVSeperator to create simple vertical/horizontal seperator lines in the GUI.
Version 5.0 - Changelog - 03.09.2017
Hover effects, minimize,maximize,restore and other GUI effects are now working natively, there is no need to call any function in a loop. This also allows the hover effects to work if the main script is paused due to "Sleep, Msgbox etc." The hover effects now work slightly faster and create less CPU usage, however the startup time of the main script is slightly increased. Thanks to @binhnx for his SSCtrlHover UDF. Maximize, Minimize, Fullscreen and Restore buttons now work natively, meaning you don't need to set actions for them manually. If you prefer handling the buttons manually, then you can disable this by setting "$ControlBtnsAutoMode = False" Added _Metro_CreateButtonEx2 -> Creates a slightly rounded button without a frame around. Hovering changes the button color to a lighter color. Added _Metro_CreateCheckboxEx2 -> Creates a modern round checkbox. Added _Metro_CreateRadioEx -> Creates a metro style radio with colored checkmark. Added "_Metro_RightClickMenu" an easy to use rightclick menu. You can use this with listviews or anything else. Check out the example for a demo of the rightclick menu and how to implement it. -> Rightclick on Button3 to show the menu. Added multiple new themes with flat colors and updated the old themes. Check out the example for a demo with all themes by pressing the menu button -> Themes Demo Improvements:
You can now delete all controls that have hover effects(buttons, checkboxes etc.) using GUICtrlDelete($ControlHandle). This will also automatically release all resources and remove the control from the global array. Many other optimizations,changes and bugfixes.
Download UDF with example:
I use a monospace font for editing AutoIt scripts in SciTE (currently, CourierNew 9pt). Regardless of what font size I set in the configuration, when I start SciTE to resume editing the script text is one size smaller than I specified. When I type Ctrl+<numpad-slash> the text changes to the desired size. The same is true of the output pane, and I have to reset the size for both areas every time I start SciTE.
IIRC, I've made few other changes to the configuration (e.g., changed the search highlight color and disabled Tidy), so this behavior seems odd. About SciTE says it's version 3.6.0 (Aug. 4, 2015).
Any idea how to fix this?
As they're opinion-based to some degree; how are AutoIt's best practices decided and do suggestions get considered?
Some suggestions :
For...To...Step...Next -loop variable-naming like $iN ($i1, $i2, etc.) : conforms to recommended naming convention, identifies level (albeit inverted to ExitLoop and ContinueLoop's convention) and enables SciTE selection-highlighting (requires minimum of 3 characters). Minimize logic in global scope, separate data & settings from logic, use of vertical space, project organization (folder structure, resource- and include file management). Example (loop variable-naming, minimizing logic in global scope and separation of settings from logic) :
#include <Array.au3> Global Enum $RANDOM_RETURNFLOAT, _ $RANDOM_RETURNINTEGER Global Enum $EXITCODE_NONE Global Const $g_sChar0 = '-' Global Const $g_sChar1 = '+' Global Const $g_iAmountX = 10 Global Const $g_iAmountY = $g_iAmountX Main() Func Main() Local $aArray[$g_iAmountY][$g_iAmountX] For $i1 = 0 To $g_iAmountY - 1 For $i2 = 0 To $g_iAmountX - 1 $aArray[$i1][$i2] = Random(0, 1, $RANDOM_RETURNINTEGER) ? $g_sChar1 : $g_sChar0 Next Next _ArrayDisplay($aArray) Exit $EXITCODE_NONE EndFunc Example (project organization) :
+ project_folder + bak [backup files] + bin [distributed binaries and dependencies] + inc [non-standard include files] + res [resource files (icons, file+install files, etc.)] + usr [configuration files, databases, etc.] - script.au3 - script.exe Example (use of vertical space) :
Func _DigitalRoot($iNum) Local $sNum = '' Local $aNum While $iNum > 9 $sNum = String($iNum) $aNum = StringSplit($sNum, '') $iNum = 0 For $i1 = 1 To $aNum $iNum += Int($aNum[$i1]) Next WEnd Return $iNum EndFunc
Is it possible to open file(s) in scite in read only mode ?
If so, How ?