Jump to content

Recommended Posts

How interesting.

I wrote a very similar app last year (which got me some 15 minutes of fame on a mobile site).

http://www.autoitscript.com/forum/index.ph...c=38259&hl=

http://codescribes.blogspot.com/2007/07/roll-up-app_23.html

Your functions are somewhat similar to the ones i used.

The name resemblance is even uncanny.

#include<array.au3>
#include<guiconstants.au3>

$sExist=0
Opt("MouseCoordMode", 0)
Opt("GUIoneventmode", 1)
dim $aWinSize[1],$aWinHwnd[1], $aCurWinSize[1], $aNewWinSize
if @OSVersion == "WIN_VISTA" Then
    $iSize = 130
    $btnposx = 130
    $btnposy = 2
Else
    $iSize = 100
    $btnposx = 75
    $btnposy = 5
EndIf
$curapp = WinGetHandle("")
$aCurWinSize= WinGetPos($curapp)
While 1
    $newapp = WinGetHandle("")
    $aNewWinSize = WinGetPos($newapp)
    if WinGetTitle($newapp ) <> "RollupWindow" then
        If $newapp <> $curapp Then
            $curapp = $newapp
            $sExist =0
        Else
            if winactive($curapp) Then
                If _IsPressed('01')=1 then
                    sleep(150)
                    While _IsPressed('01')
                        GUIDelete(WinGetHandle("RollupWindow"))
                        $sExist =0
                        Sleep(150)
                    WEnd
                EndIf
                while winactive($curapp)
                    if $sExist =0 then
                        RollupBtn()
                        Send("!{TAB}")
                        if winactive($curapp)=0 then ExitLoop
                    EndIf
                    sleep(50)
                WEnd
            Else
                GUIDelete(WinGetHandle("RollupWindow"))
                $sExist =0
            EndIf
        Endif
    EndIf
    If _IsPressed("23") Then
        ExitLoop
    EndIf
    sleep(250)
WEnd
Func toggleRoll()
    sleep(200)
    if WinExists("RollupWindow") then GUIDelete(WinGetHandle("RollupWindow"))
    $sExist = 0
    dim $aWinpos
    $winhwnd = $curapp
    $aWinpos = WinGetPos($winhwnd)
    if $aWinpos[3] > $iSize then
        ConsoleWrite($aWinpos[3] &">" &$iSize&@lf)
        _ArrayAdd($aWinHwnd,$winhwnd)
        _ArrayAdd($aWinSize,$aWinpos[3])
        WinMove($winhwnd,"",$aWinpos[0],$aWinpos[1],$aWinpos[2],27)
    Else
        if $aWinpos[3] <= $iSize then
            $iArInx = _ArraySearch($aWinHwnd,$winhwnd)
            If not @error then
                $iNewSize = $aWinSize[$iArInx]
                WinMove($winhwnd,"",$aWinpos[0],$aWinpos[1],$aWinpos[2],$iNewSize)
                _ArrayDelete($aWinSize,$iArInx)
                _ArrayDelete($aWinHwnd,$iArInx)
            Else
                WinMove($winhwnd,"",$aWinpos[0],$aWinpos[1],$aWinpos[2],400)
            EndIf
        EndIf
    EndIf
EndFunc
Func RollupBtn()
    if WinExists("RollupWindow") then
        GUIDelete(WinGetHandle("RollupWindow"))
        $sExist = 0
    EndIf
    if $sExist = 0 Then
        $sExist =1
        $winhwnd = WinGetHandle("")
        $aWinpos = WinGetPos($winhwnd)
        While WinActive($curapp)
            $rollupwdw = GUICreate("RollupWindow",17,17,$aWinpos[0]+$aWinpos[2]-$btnposx,$aWinpos[1]+$btnposy,$WS_POPUP,$WS_EX_TOOLWINDOW)
            $rollupbtn=GUICtrlCreateButton(chr(175),0,0,17,17,$BS_CENTER )
            GUICtrlSetOnEvent($rollupbtn,"toggleRoll")
            GUISetState(@SW_SHOW)
            WinSetOnTop($rollupwdw,"",1)
            sleep(10)
        WEnd
    Else
    EndIf
EndFunc
Edited by blademonkey

---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Link to comment
Share on other sites

Edit: Posts deleted here.

I was being defensive for no reason, and the above poster wasn't accusing me (although I thought at the time he was :)).

Edited by crashdemons

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Link to comment
Share on other sites

no worries. I was actually genuinely fascinated by the coincidence.

I have no need to ask you to discontinue your script, that seems rather petty.

In fact you seem to have put in a little more time and thought into it.

carry on.

:)

---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Link to comment
Share on other sites

Her are two Funcs to calculate the TitleBar Height :) :

; Author: Prog@ndy
Func _Win_TitlebarHeight($hWnd)
    Local $iHeight = _WinAPI_GetClientHeight($hWnd)
    Local $iBorder = _Win_BorderWidth($hWnd)
    Local $iTitle = Int(_WinAPI_GetWindowHeight($hWnd)-$iHeight-$iBorder)
    Return $iTitle
EndFunc
; Author: Prog@ndy
Func _Win_BorderWidth($hWnd)
    Local $iWidth = _WinAPI_GetClientWidth($hWnd)
    Local $iBorder = Int((_WinAPI_GetWindowWidth($hWnd)-$iWidth)/2)
    Return $iBorder
EndFunc

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Ok, blademonkey :D

Her are two Funcs to calculate the TitleBar Height :( :

I might have to incorporate these into the next update :D

Edit: the only problem I find with this function is that Windows does not include the height taken up by the Menus as part of the client area or the border area - so the TitleBar Height includes the menu height while the window is large enough to display menus - but then again, showing menus when rolled-up may not be a bad thing.... :)

Edited by crashdemons

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Link to comment
Share on other sites

Update 10:

-Thanks to Prog@ndy I am now checking the titlebar height as the minimum rolled-up height.

-I have also added an option as a manual override to the automatic rolled-up height.

-Windows will now roll-down nomatter the current height as long as a height value over 0 was saved for that hWnd.

-The icon file is now saved in the the same folder as the script so it isnt cleared if 'temp' is cleared - this should also make it easier to replace.

Notes:

you can use a value under 1 or the string 'auto' to set the rolled-up height to the titlebar height again if you unset it.

Edited by crashdemons

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Link to comment
Share on other sites

Update 11:

-Transparency of Rollup Pro can now be changed from the icon context menu

-Transparency of the Active Window (aka Active Transparency) can also now be set.

(Note: unlike the original transparency option, this sets the focused window to a transparency automatically and reverts to solid once defocused - if it makes the window flash black on your system, don't use it :) )

-Rolled-up height is now saved to the INI (duh :( )

-Dropped a replacement icon into the ZIP, if you choose to use it - place it in the same folder as the program/script before it's ran.

Edited by crashdemons

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Link to comment
Share on other sites

Update 12:

-Setting a state has been fixed so minimize/restore/maximize states do not unset the Hidden state.

-The Process menu item under the "Window" Menu is now a menu which contains several subitems.

--Priority - You can now easily see/select a priority for the active window's process directly from the menu (radio menu items)

--Suspend/Resume Process, using some functions found to be posted 'The Kandie Man' this option is available to instantly suspend or resume the process of the window.

Note: If you suspend a process, you *may* not be able to focus the window again once it loses focus. This would restrict Rollup Pro from seeing the window, and restrict you from accessing the "Resume" function for that process.

Moral of the Story - Use "Suspend" Wisely (or just don't focus another window).

Edited by crashdemons

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Link to comment
Share on other sites

Update 12:

-Setting a state has been fixed so minimize/restore/maximize states do not unset the Hidden state.

-The Process menu item under the "Window" Menu is now a menu which contains several subitems.

--Priority - You can now easily see/select a priority for the active window's process directly from the menu (radio menu items)

--Suspend/Resume Process, using some functions found to be posted 'The Kandie Man' this option is available to instantly suspend or resume the process of the window.

Note: If you suspend a process, you *may* not be able to focus the window again once it loses focus. This would restrict Rollup Pro from seeing the window, and restrict you from accessing the "Resume" function for that process.

Moral of the Story - Use "Suspend" Wisely (or just don't focus another window).

Hi crashdemons,

Thanks alot for this awesome script. - Also, you're doing a great job with the versioning!

One question though: I noticed you had an option in your script "#AutoIt3Wrapper_Allow_Decompile=n" which I don't have available (using the latest Scite Package).

Can you tell us where you got that option from? Did you modify the original Wrapper?

thx in advance

You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time. Abraham Lincoln - http://www.ae911truth.org/ - http://www.freedocumentaries.org/
Link to comment
Share on other sites

AutoIt can't be decompiled any more so it's not needed. And it's called a Compiler Directive :)

What do you mean "can't be decompiled anymore"?? - Not with the Wrapper maybe, but there are definitely other ways.

I just decompiled one of my previously compiled scripts and even the "Directives" :) are in there after decompiling.

I asked because in his last version (v11) he didn't have that directive in his script but now he has.

You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time. Abraham Lincoln - http://www.ae911truth.org/ - http://www.freedocumentaries.org/
Link to comment
Share on other sites

What do you think? :)

-John

Func _rollup()
    $wgp=WinGetPos($hWnd)
    If IsArray($wgp)=0 Then Return 0
    $height=$wgp[3]
    $varname ='wh'&Execute($hWnd)
    $newheight=Eval($varname)
    If $newheight>0 Then
        Assign($varname,0,2)
    Else
        If $minimumheight='auto' Then
            $newheight=_Win_TBHeight($hWnd)
        Else
            $newheight=$minimumheight
        EndIf
        Assign($varname,$height,2)
    EndIf

    $i = $height
    if $height > $newheight then
        $delta = ($height - $newheight + 1 ) / 10
        while $i > $newheight
            $i -= $delta
            WinMove($hWnd,'',$wgp[0],$wgp[1],$wgp[2],$i,1)
            sleep(20)
        wend
    elseif $height < $newheight then
        $delta = ($newheight - $height + 1 ) / 10
        while $i < $newheight
            $i += $delta
            WinMove($hWnd,'',$wgp[0],$wgp[1],$wgp[2],$i,1)
            sleep(20)
        wend
    endif
    WinMove($hWnd,'',$wgp[0],$wgp[1],$wgp[2],$newheight,1)
    WinActivate($hWnd)
EndFunc
Link to comment
Share on other sites

@All

the "Allow To Decompile" option is still on my AutoItWrapper GUI although AutoIt was updated to not allow decompilable applications.

(3.2.10 install package; AutoItWrapper_GUI 1.9.2)

I accidentally unticked it on the last compile I made. - but since the directive isn't valid it doesn't make any difference

Also, Sorry I haven't checked back for replies sooner, I got a couple PC towers I've been playing with.

@Zedna

As for the Caption Height, I'd have to test out your method

- also, is there a way to check if the window is, in fact, an MDI Window?

- if I can check if the window is MDI, I'll just set Rollup Pro to ignore that the window is active (stay on last valid window)

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Link to comment
Share on other sites

What do you think? :)

-John

*snip*

Wow, that's pretty smooth :) I think I'll add it as a default option when v13 comes out. :)

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Link to comment
Share on other sites

Update 13:

  • re-arranged items on the menu. (Main menus: Settings, All Windows, Current Window)
  • added visual roll-up motion (enabled by default); thank you jftuga. (See under 'Settings')
  • added the option to disable Rollup Pro for the current window. (See under 'Current Window')
  • added a timer in the main loop to re-apply the 'OnTop' flag (keeps Rollup Pro above topmost windows)
  • changed the way Rollup Pro determines titlebar height; thank you Zedna; sorry Prog@ndy.

@Zedna, can't detect MDI windows yet, but at least you can disable Rollup Pro from appearing on specific windows now.

Edited by crashdemons

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Link to comment
Share on other sites

changed the way Rollup Pro determines titlebar height; thank you Zedna; sorry Prog@ndy.

Why Sorry? I like the new way. Mine was just a workaround, that didn't work properly with Menubars, Scrollbars and so on ... :)

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
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
 Share

×
×
  • Create New...