Sign in to follow this  
Followers 0
A. Percy

NVRotate

1 post in this topic

#1 ·  Posted (edited)

Hello all

In my work I'm using a NVIDIA video card with a SyncMaster 740n monitor that I can rotate 90º. Very usefull when I coding anything, cause I need more vertical than horizontal space.

Laziness is the mother of the invention and I wrote the bellow script to make ease (more!) rotate NVIDIA image to fit 90º rotated monitor.

But it's especific: I use a "three level" windows bar and the script can work with 2 or more levels, cause I put a button to rotate bellow the start button.

Edit: you need ANYGUIv2.8 at AnyGui by quaizywabbit

Here it is:

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

 AutoIt Version: 3.2.2.0
 Author:         Alexsandro Percy

 Script Function:
    Rotate NVIDIA

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

; Script Start - Add your code below here

#include <ANYGUIv2.8.au3>

AutoItSetOption( "TrayIconHide", 1 )
AutoItSetOption( "WinTitleMatchMode", 4 )
$ShellClassName = "classname=Shell_TrayWnd"
If WinExists( $ShellClassName ) = 0 Then
    Exit
EndIf
$TargetWin = _GuiTarget ( $ShellClassName )
$BtnRotate = _TargetAddButton( "Rotate", 0, 24, 39, 22, -1, -1, $TargetWin )
GUISetState( @SW_SHOW )
$BtnClose = _TargetAddButton( "X", 39, 24, 13, 22, -1, -1, $TargetWin )
GUISetState( @SW_SHOW )

Global $RotationZero = 1

While 1
    sleep( 100 )
    $msg = GUIGetMsg()
    Select
        Case $msg = $BtnRotate[0]
            #Region --- CodeWizard generated code Start ---
            If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
            $iMsgBoxAnswer = MsgBox(4356,"Rotate Desktop","Would you like rotate the Desktop?")
            Select
                Case $iMsgBoxAnswer = 6 ;Yes
                    DisplayRotate( )
                Case $iMsgBoxAnswer = 7 ;No

            EndSelect
            #EndRegion --- CodeWizard generated code End ---
        Case $msg = $BtnClose[0]
            Exit
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case Not WinExists( $TargetWin )
            Exit
    EndSelect
WEnd

Func DisplayRotate( )
    Local $ShortSystem = FileGetShortName ( @SystemDir )
    If $RotationZero = 1 Then
        $RotationZero = 0
        run( "RUNDLL32.EXE NvCpl.dll,dtcfg rotate 1 90" )
    Else
        $RotationZero = 1
        run( "RUNDLL32.EXE NvCpl.dll,dtcfg rotate 1 0" )
    EndIf
EndFunc

:)

Edited by A. Percy

Só o que posso lhe dizer, bom é quando faz mal!My work:Au3Irrlicht - Irrlicht for AutoItMsAgentLib - An UDF for MSAgentAu3GlPlugin T2 - A 3D plugin for AutoIt...OpenGl Plugin - The old version of Au3GlPlugin.MAC Address Changer - Changes the MAC AddressItCopter - A dragonfly R/C helicopter simulator[center] VW Bug user[/center]Pinheiral (Pinewood) city: http://pt.wikipedia.org/wiki/Pinheiral

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