MaXiMiUS Posted July 16, 2009 Share Posted July 16, 2009 (edited) I have an old AutoHotKey script I'm trying to figure out how to convert to AutoIt3. A couple of the functions seem easy enough to copy over, but others, such as the Dll ones, I have no clue how to make work in AutoIt3. expandcollapse popup#SingleInstance force GroupAdd, Excludes, Windows Task-Manager ahk_class #32770 GroupAdd, Excludes, ahk_class _As12__TaskSwitchXP_TaskSwitchWnd_ GroupAdd, Excludes, ahk_class Progman GroupAdd, Excludes, ahk_class Shell_TrayWnd #IfWinNotActive, ahk_group Excludes ^F11:: Critical hWnd := WinActive("A") ToggleFullScreen(hWnd) Return ToggleFullScreen(ByRef hWnd) { ;IniFile := A_ScriptName ".tmp" ;IniRead, Array, %IniFile%, Handles, %hWnd%, Empty If 1 ;(Array="Empty") { hMenu := DllCall("GetMenu", "UInt", hWnd) WinGet, Maximized, MinMax DllCall("SetMenu", "UInt", hWnd, "UInt", 0) WinSet, Style, -0xC00000 WinSet, Style, -0x800000 WinSet, Style, -0x40000 WinMaximize WinMove, , , 0, 0, 1680, 1038 ; (1 680 - 24) / 1 047 = 1.58166189 ;IniWrite, %hMenu%`,%Maximized%, %IniFile%, Handles, %hWnd% } ;Else ;{ ;StringSplit, Array, Array, `, ;hMenu := Array1 ;Maximized := Array2 ;DllCall("SetMenu", "UInt", hWnd, "UInt", hMenu) ;WinSet, Style, +0xC00000 ;WinSet, Style, +0x800000 ;WinSet, Style, +0x40000 ;If !(Maximized) ; { ; WinRestore ; } ;IniDelete, %IniFile%, Handles, %hWnd% ;} } Just in case you're curious why I'm trying to do this, it's because I have some other code in AutoIt3, and I want to merge them. Any help you can provide is greatly appreciated :3 Edited July 16, 2009 by MaXiMiUS Link to comment Share on other sites More sharing options...
KaFu Posted July 16, 2009 Share Posted July 16, 2009 (edited) Seems like the function changes the window style, moves and maximizes it (and vice versa). Use WinMove() and WinSetState() for the last two operations, for the first operation look up _WinAPI_GetWindowLong() _WinAPI_SetWindowLong() in the UDF help-file, no need to make the dll calls yourself. Maybe the style $WS_POPUP will look good for fullscreen, but chose yourself (or look up the win styles used in WindowsConstants.au3). Edited July 16, 2009 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now