FireFox Posted February 2, 2009 Posted February 2, 2009 Hi,I've tried to resize window by width and heigh, but its not working properly...Hotkeys :SHIFT + PageUpSHIFT + PageDownexpandcollapse popup#include <IsPressed_UDF.au3> While 1 Sleep(100) If _IsPressed('10') Then If _IsPressed('21') Then _Resize('-', 30) If _IsPressed('22') Then _Resize('+', 30) EndIf WEnd Func _Resize($resize, $size) If $resize = '-' Then $gawi = _GetActiveWindowInfo() WinMove($gawi[1], '', $gawi[2], $gawi[3], $gawi[4] - $size, $gawi[5] - $size) ElseIf $resize = '+' Then $gawi = _GetActiveWindowInfo() WinMove($gawi[1], '', $gawi[2], $gawi[3], $gawi[4] + $size, $gawi[5] + $size) EndIf EndFunc ;==>_Resize ; #FUNCTION# =================================================================== ; Name : _GetActiveWindowInfo ; Description: Get Active Window Infos ; Return Value(s): On Success - Returns $ret[1] to $ret[5] ; On Failure - Returns error ; Author(s): FireFox ;=============================================================================== Func _GetActiveWindowInfo() Local $ret[10] $ret[1] = WinGetHandle(WinGetTitle('[ACTIVE]')) $wgp = WinGetPos($ret[1]) $ret[2] = $wgp[0] $ret[3] = $wgp[1] $wgc = WinGetClientSize($ret[1]) $ret[4] = $wgc[0] $ret[5] = $wgc[1] Return $ret EndFunc ;==>_GetActiveWindowInfoCheers, FireFox.
Authenticity Posted February 2, 2009 Posted February 2, 2009 expandcollapse popupHotKeySet('{ESC}', '_EXIT') Run('Notepad.exe') WinWaitActive('Untitled -') $hDll = DllOpen('user32.dll') $GAKS = 'GetAsyncKeyState' While 1 $lshift = DllCall($hDll, 'short', $GAKS, 'int', 0xA0) $rshift = DllCall($hDll, 'short', $GAKS, 'int', 0xA1) $shiftf = BitOR(BitAND($lshift[0],0x8000), BitAND($rshift[0],0x8000)) If $shiftf Then $Pageup = DllCall($hDll, 'short', $GAKS, 'int', 0x21) $PageDown = DllCall($hDll, 'short', $GAKS, 'int', 0x22) If BitAND($Pageup[0], 0x8001) Then _Resize(30) Else If BitAND($PageDown[0], 0x8001) Then _Resize(-30) EndIf EndIf Sleep(20) WEnd Func _Resize($size) Local $gawi, $i $gawi = _GetActiveWindowInfo() WinMove($gawi[1], '', $gawi[2], $gawi[3], $gawi[4]+$size, $gawi[5]+$size) EndFunc ;==>_Resize ; #FUNCTION# =================================================================== ; Name : _GetActiveWindowInfo ; Description: Get Active Window Infos ; Return Value(s): On Success - Returns $ret[1] to $ret[5] ; On Failure - Returns error ; Author(s): FireFox ;=============================================================================== Func _GetActiveWindowInfo() Local $ret[10], $i $ret[1] = WinGetHandle(WinGetTitle('[ACTIVE]')) $wgp = WinGetPos($ret[1]) $ret[2] = $wgp[0] $ret[3] = $wgp[1] $ret[4] = $wgp[2] $ret[5] = $wgp[3] ConsoleWrite('Width = ' & $ret[4] & @TAB & 'Height = ' & $ret[5] & @CRLF) Return $ret EndFunc ;==>_GetActiveWindowInfo Func _EXIT() Exit EndFunc Func OnAutoItExit() DllClose($hDll) EndFunc Quite messy (yeah messy, Barca...)
Moderators Melba23 Posted February 2, 2009 Moderators Posted February 2, 2009 FireFox,Better refresh your memory on the return values from WinGetPos and the parameters of WinMove, mon ami!#include <Misc.au3> GUICreate("Test",100,100) GUISetState() $dll = DllOpen("user32.dll") While 1 If GUIGetMsg() = -3 Then Exit If _IsPressed('10') Then If _IsPressed('21') Then _Resize('+', 30) If _IsPressed('22') Then _Resize('-', 30) EndIf WEnd Func _Resize($resize, $size) $hWnd = WinGetHandle(WinGetTitle('[ACTIVE]')) $gawi = WinGetPos($hWnd) If $resize = '-' Then WinMove($hWnd, '', $gawi[0] + $size/2, $gawi[1] + $size/2, $gawi[2] - $size, $gawi[3] - $size) ElseIf $resize = '+' Then WinMove($hWnd, '', $gawi[0] - $size/2, $gawi[1] - $size/2, $gawi[2] + $size, $gawi[3] + $size) EndIf EndFunc ;==>_ResizeM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
FireFox Posted February 2, 2009 Author Posted February 2, 2009 @Authenticity Doesn't work for me... same hotkeys ? Cheers, FireFox.
Authenticity Posted February 2, 2009 Posted February 2, 2009 Yup, either left or right shift and pageup/pagedown. I've tested it using the notepad window.
FireFox Posted February 2, 2009 Author Posted February 2, 2009 @Melba23 Thanks its what I wanted Cheers, FireFox.
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