Jump to content
Sign in to follow this  
A. Percy


Recommended Posts

A. Percy

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:
 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
$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()
        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?")
                Case $iMsgBoxAnswer = 6 ;Yes
                    DisplayRotate( )
                Case $iMsgBoxAnswer = 7 ;No

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

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


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