Jump to content

Recommended Posts

Posted

screen curtain on autoit windows 8 +
hello autoit forum please i've a question
on windows 8 and more the micro soft added the Magnification options
this future can help the blind by turn the screen black to To relax the eyes.
i searched allot in autoit but i couldn't find any way to do it
and after then i found an python addon can do that, it's an addon open source to screen reader NVDA
i hope you can help me to convert it to an autoit script
note i couldn't do that because I'm very fresh man in dealing with dll files
inadition to am 0 on python
please if any one can help me.
this is the NVDA Python Addon it very small, i need just one future that turn the screen black
thx in advance

 

screenCurtain.rarr

 

  • Moderators
Posted

@nacerbaaziz how long have you been on this forum now? Responses to your topics are always the same - no one is going to help you when you show zero effort. Come back with what you have tried, and where you are stuck, and the community will try to help. If you are going to use your typical response of "well I just don't know how" then I guess you are out of luck.

 

                                                                                      ***In case you missed it, this is a Mod stepping into a thread***

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted

i know that sir, but i have a problem with the using of dll files and working with objects in an other languages for that i cam here and asced you to help me, because for me the autoit is the easy language for the blind users and others

am sorry please

this is what i've tried

 but there is just one problem on the function i couldn't understand it

 

here  is the code

global $Open = DLLOpen("Magnification.dll")
global $call = DLLCall($Open, "BOOL", "MagInitialize")
if @error then exit
global $TRANSFORM_BLACK = TRANSFORM_BLACK()
global $setBlack = DLLCall($Open, "BOOL", "MagSetFullscreenColorEffect", "PTR", $TRANSFORM_BLACK)
sleep(5000)

DLLCall($Open, "BOOL", "MagUninitialize")
dllClose($Open)
exit

func TRANSFORM_BLACK()
;here i've the problem, I couldn't understand how to convert colors using the MAGCOLOREFFECT
;the Url doc from the microSoft is here
;https://docs.microsoft.com/en-us/windows/win32/api/magnification/ns-magnification-magcoloreffect
;i just want to transform the black color please
endFunc

 

TRANSFORM_BLACK = winMagnification.MAGCOLOREFFECT()
TRANSFORM_BLACK.transform[4][4] = 1.0
TRANSFORM_DEFAULT = winMagnification.MAGCOLOREFFECT()
TRANSFORM_DEFAULT.transform[0][0] = 1.0
TRANSFORM_DEFAULT.transform[1][1] = 1.0
TRANSFORM_DEFAULT.transform[2][2] = 1.0
TRANSFORM_DEFAULT.transform[3][3] = 1.0
TRANSFORM_DEFAULT.transform[4][4] = 1.0



class MAGCOLOREFFECT(Structure):
    _fields_ = (("transform", c_float*5*5),)

def magnificationErrCheckFactory(outputArguments=0):
    def errCheck(result, func, args):
        if result == 0:
            return False
        if outputArguments>0:
            return args[-1*outputArguments:]
        return True
    return errCheck

 i hope you can help meand here is the function from the python

 

Posted

@JLogan3o13
i posted what i tried as you said.
Do I committed any other errors?
am sorry about that, 
but I really could not do that, and I want to learn.
Forgive me if I bother you.
thx
:)

Posted
#include <GUIConstantsEx.au3>
#include <ScreenCapture.au3>
#include <WinAPIHObj.au3>

Local $tColorMatrix = _GDIPlus_ColorMatrixCreate() ;create color matrix
Local $iX, $iY
For $iX = 0 To 3 ;manipulate some values in the color matrix
    For $iY = 0 To 3
        DllStructSetData($tColorMatrix, "m", Random(0, 0.5), $iY * 5 + $iX + 1)
    Next
Next

Global $Open = DllOpen("Magnification.dll")
Global $call = DllCall($Open,"bool","MagInitialize")
If @error Then Exit @error

Global $setBlack = DllCall($Open, "BOOL", "MagSetFullscreenColorEffect", "PTR", DllStructGetPtr($tColorMatrix))
Sleep(5000)

DllCall($Open, "BOOL", "MagUninitialize")
DllClose($Open)
Exit

 

Posted

@KaFu , thx very much

there is a smalle problem on this code i hope you help me

the color of the screen woun't be black

what i need is to be the screen all black with out any think on the screen

this can help the blind users to work and They write their sensitive information without being spied on by those who sit next to them

i hope you can help

thx in advance.

Posted
#include <GUIConstantsEx.au3>
#include <ScreenCapture.au3>
#include <WinAPIHObj.au3>

Local $tColorMatrix = _GDIPlus_ColorMatrixCreate() ;create color matrix
; A 5×5 color matrix is a homogeneous matrix for a 4-space transformation.
For $i = 1 To 25
    Switch $i
        Case 25
            ; The element in the fifth row and fifth column of a 5×5 homogeneous matrix must be 1
            DllStructSetData($tColorMatrix, 1, 1, $i)
        Case 21 To 24
            ; and all of the other elements in the fifth column must be 0.
            DllStructSetData($tColorMatrix, 1, 0, $i)
        Case 5, 10, 15, 20
            ; The fifth component of a color vector is always 1.
            DllStructSetData($tColorMatrix, 1, 1, $i)
        Case Else
            ; The first four components of a color vector hold the red, green, blue, and alpha components (in that order) of a color.
            DllStructSetData($tColorMatrix, 1, 0, $i) ; rgba > black
    EndSwitch
Next



Global $Open = DllOpen("Magnification.dll")
Global $call = DllCall($Open, "bool", "MagInitialize")
If @error Then Exit @error

Global $setBlack = DllCall($Open, "BOOL", "MagSetFullscreenColorEffect", "PTR", DllStructGetPtr($tColorMatrix))
Sleep(5000)

DllCall($Open, "BOOL", "MagUninitialize")
DllClose($Open)
Exit

 

Posted
53 minutes ago, nacerbaaziz said:

this can help the blind users to work and They write their sensitive information without being spied on by those who sit next to them

Can't they just turn off their monitors? 😐 That seems like a weird way to do it.

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

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
×
×
  • Create New...