Sign in to follow this  
Followers 0
powerjuce

resize window help...

5 posts in this topic

hey all ,

i am new to this and i hav a problem with this code.

I cannot get the window to resize(like clicking near the edge and making it bigger)

here is the code

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.10.0
 Author:         PowerJuce

 Script Function:


#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
Opt("GUIOnEventMode", 1) ; Change to OnEvent mode
;Opt("GUICloseOnESC", 0); disable ESC to exit
Opt("TrayMenuMode", 1); disable tray menu
Opt("TrayOnEventMode", 1); enable tray events
Opt("RunErrorsFatal", 0); don't crash out
Opt("TrayIconHide", 1); don't show icon
Opt("GUIResizeMode", 1)
#include <GUIConstants.au3>


#cs-----------------------------------------
   -  All Variable will Go here         -
#ce-----------------------------------------

Dim $mainwindow, $width, $height, $left, $top



#cs-----------------------------------------
   -  End Variables List            -
#ce-----------------------------------------


GetOldPositions()
LoadGUI()

While 1
    Sleep(1000)
WEnd




#cs ---------------------------------------------------
    -                                                -
    -   This is where all the functions go          -
    -                                                -
#ce----------------------------------------------------
Func GetOldPositions()
    if FileExists(@ScriptDir & "\Data\positions.ini") Then
        $width = IniRead(@ScriptDir & "\Data\positions.ini", "Size", "width", "550")
        $height = IniRead(@ScriptDir & "\Data\positions.ini", "Size", "height", "330")
          $left = IniRead(@ScriptDir & "\Data\positions.ini", "position", "left", "-1")
        $top = IniRead(@ScriptDir & "\Data\positions.ini", "position", "top", "-1")
        
    Else
        $width = 550
        $height = 330
        $left = -1
        $top = -1
    EndIf
EndFunc


Func LoadGUI()
$mainwindow = GUICreate("FolderLocker", $width, $height, $left, $top, -1 + 0x00040000 + 0x00080000,0x00000018 + -1)
GUISetOnEvent($GUI_EVENT_CLOSE, "CloseWindow")
GUISwitch($mainwindow)
GUISetState(@SW_SHOW)
_ReduceMemory() 
EndFunc
Func CloseWindow()
    $size = WinGetPos("FolderLocker")
    $width = $size[2]
    $height = $size[3]
    $left = $size[0]
    $top = $size[1]
    IniWrite(@ScriptDir & "\Data\positions.ini", "position", "left", $left)
    IniWrite(@ScriptDir & "\Data\positions.ini", "position", "top", $top)
    IniWrite(@ScriptDir & "\Data\positions.ini", "Size", "width", $width)
    IniWrite(@ScriptDir & "\Data\positions.ini", "Size", "height", $height)
    Exit
EndFunc

; Reduce memory usage
; Author wOuter ( mostly )
Func _ReduceMemory($i_PID = -1)
    If $i_PID <> -1 Then
        Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
        DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
    Else
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
    EndIf
    Return $ai_Return[0]
EndFunc;==> _ReduceMemory()

any and all help will be welcome

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

and don't forget to delete your duplicit posts

how?

Edited by powerjuce

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

how?

Open the threads and click the Delete button (beside Edit) at the bottom of the post.

Edit. Creating duplicate posts will not get help any faster. Somedays it just doesn't happen that there is someone with the correct answer sitting at your beck and call to provide you with a solution.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Open the threads and click the Delete button (beside Edit) at the bottom of the post.

There is no edit or delete button

Creating duplicate posts will not get help any faster. Somedays it just doesn't happen that there is someone with the correct answer sitting at your beck and call to provide you with a solution.

I did not mean to, i created the first post, but the page expired(but the topic had been posted), and then i clicked post again(it posted), but the page expired, and when i hit post the third time i finally was posted and then i saw that there were two more posts (tat were mine)

sorry for the inconvience

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0