Sign in to follow this  
Followers 0
Bert

Resize desktop

5 posts in this topic

#1 ·  Posted (edited)

I need to resize the desktop to run a marquee. I tried this, but it doesn't work. Anyone got a idea on how to do this? I need it so if all the windows are minimized, the icons on the desktop are not covered up. I thought resizing the desktop using winmove would do this. Code I tried, and failed....

$1 = WinGetPos("Program Manager", "")
;MsgBox(0, "", "X= "&$1[0]&",  Y= "&$1[1]&",  Width= "&$1[2]&",  Height= "&$1[3]) ;testing
sleep(1000)
WinMinimizeAll()
sleep(1000)
Winmove("Program Manager", "", 0, 18, $1[2], $1[3]-18)
sleep(3000)
Winmove("Program Manager", "", 0, 18, $1[2], $1[3]+18)

Edit:In doing some research with Google, I think (focusing the problem I'm trying to solve) is changing the icon positioning grid on the desktop to allow for the marquee, and seeing all the icons.

Edited by Volly

Share this post


Link to post
Share on other sites



I am not sure I understand what you are trying to do but if it is to change desktop resolution you may want to look at This Topic



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Maybe you want this? (This is Larrys stuff, don't know where I got it from...)

CODE

_DisplayChangeRes(1152,864,@DesktopDepth,@DesktopRefresh)

Func _DisplayChangeRes($width, $height, $bpp, $freq)
    Local Const $DM_PELSWIDTH = 0x00080000
    Local Const $DM_PELSHEIGHT = 0x00100000
    Local Const $DM_BITSPERPEL = 0x00040000
    Local Const $DM_DISPLAYFREQUENCY = 0x00400000
    Local Const $CDS_TEST = 0x00000002
    Local Const $CDS_UPDATEREGISTRY = 0x00000001
    Local Const $DISP_CHANGE_RESTART = 1
    Local Const $DISP_CHANGE_SUCCESSFUL = 0
    Local Const $HWND_BROADCAST = 0xffff
    Local Const $WM_DISPLAYCHANGE = 0x007E
    
    Local $DEVMODE = DllStructCreate("byte[32];int[10];byte[32];int[6]")
    
    Local $b = DllCall("user32.dll", "int", "EnumDisplaySettings", "ptr", 0, "long", 0, "ptr", DllStructGetPtr($DEVMODE))
    If @error Then
        $b = 0
    Else
        $b = $b[0]
    EndIf
    If $b <> 0 Then
        DllStructSetData($DEVMODE, 2, BitOR($DM_PELSWIDTH, $DM_PELSHEIGHT, $DM_BITSPERPEL, $DM_DISPLAYFREQUENCY), 5)
        DllStructSetData($DEVMODE, 4, $width, 2)
        DllStructSetData($DEVMODE, 4, $height, 3)
        DllStructSetData($DEVMODE, 4, $bpp, 1)
        DllStructSetData($DEVMODE, 4, $freq, 5)
        
        $b = DllCall("user32.dll", "int", "ChangeDisplaySettings", "ptr", DllStructGetPtr($DEVMODE), "int", $CDS_TEST)
        
        If @error Then
            $b = -1
        Else
            $b = $b[0]
        EndIf
        
        Select
            Case $b = $DISP_CHANGE_RESTART
                $DEVMODE = 0
                Return 2
            Case $b = $DISP_CHANGE_SUCCESSFUL
                DllCall("user32.dll", "int", "ChangeDisplaySettings", "ptr", DllStructGetPtr($DEVMODE), "int", $CDS_UPDATEREGISTRY)
                DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND_BROADCAST, "int", $WM_DISPLAYCHANGE, _
                        "int", $bpp, "int", $height * 2 ^ 16 + $width)
                $DEVMODE = 0
                Return 1
            Case Else
                $DEVMODE = 0
                Return $b
        EndSelect
    EndIf
EndFunc  ;==>_DisplayChangeRes

Edited by dabus

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I don't think you understand. I don't need to change the size of the desktop. The best way to explain it is think of a window that is maxiumized. Now, change it's size so that there is a small gap at the top. This is where the marquee will run. I know how to do this part, and have it working fine. The problem lies with when all the window are minimized, and you see the desktop. The icons in the top part of the screen are being covered by the marquee. I want to move the icons down slightly, allowing room for the marquee. I"m thinking the best way is to compress the icon grid so that they maintain their positions as far as alignment, but a small space is created to allow for the marquee. When the marquee is closed, the grid is decompressed, and the icons move back.

I included a pic showing what is currently happening when the marquee is running. You will see the icons partly covered up.

Edited by Volly

Share this post


Link to post
Share on other sites

If you have the office tool bar, you can see what I'm looking to do. Put the bar at the top. Make sure you do not have it so it fits into the title bar. Now turn on the auto hide. If you have it on, turn it off. You will see the icons reposition themselfs to keep from getting covered up. This concept is what I'm trying to do with the marquee program I'm designing. Anyone got a idea how to solve this one?

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