Jump to content

Recommended Posts

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

 

Share this post


Link to post
Share on other sites

@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!

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

If someone wants to go through the headache of trying to help you, they are welcome to.


"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!

Share this post


Link to post
Share on other sites

@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
:)

Share this post


Link to post
Share on other sites
#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

 

Share this post


Link to post
Share on other sites

@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.

Share this post


Link to post
Share on other sites
#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

 

Share this post


Link to post
Share on other sites
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.

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

  • Similar Content

    • By nacerbaaziz
      hello sirs, i've created a tool to the blind users, this tool helps the blind to listen to a audio effect when moving between the GUIs controls on they computers
      where this tool can get the class for the current focus control and play a sound from a folder
      i've added all the knowne classes, but i found some problems i hope any one can help me.
      this is the code that i created

      #include <WinAPISys.au3> Global $h_CurrentHWNDFocus = "", $h_CurrentControlHWNDFocus = "" AdlibRegister("WindowAudioFocus", 50) Func WindowAudioFocus()     Local $h_NewHWNDFocus = WinGetHandle("[active]", "")     Local $h_NewControlHWNDFocus = ControlGetFocus($h_NewHWNDFocus, "")     If ($h_NewHWNDFocus = $h_CurrentHWNDFocus) And ($h_NewControlHWNDFocus = $h_CurrentControlHWNDFocus) Then Return 0     AdlibUnRegister("WindowAudioFocus")     If Not ($h_NewHWNDFocus = $h_CurrentHWNDFocus) Then         SoundPlay(@ScriptDir & "\focus_Audio\WindowChanged.wav")     Else         Switch _WinAPI_GetClassName(ControlGetHandle($h_NewHWNDFocus, "", $h_NewControlHWNDFocus))             Case "Button", "Start", "TrayButton", "TrayShowDesktopButtonWClass", "sbutton", "CirrussButton", "ODbcButton", "ThunderRTCommandButton", "ThunderSSOption", "ThunderSSCommand", "ThunderCommandButton", "ThunderRT6CommandButton", "ThunderRT5CommandButton", "TButton", "TBitBtn", "TAdvGlowButton", "ButtonWndClass", "afx:0:376:baa946", "_AOL_Button"                 If _IsCheckBox(ControlGetHandle($h_NewHWNDFocus, "", $h_NewControlHWNDFocus)) Then                     SoundPlay(@ScriptDir & "\focus_Audio\checkBox.wav")                 ElseIf _IsRadio(ControlGetHandle($h_NewHWNDFocus, "", $h_NewControlHWNDFocus)) Then                     SoundPlay(@ScriptDir & "\focus_Audio\radio.wav")                 Else                     SoundPlay(@ScriptDir & "\focus_Audio\button.wav")                 EndIf             Case "ComboBox", "ComboBoxEx32", "MSOBALLOONREComboBox20W", "REComboBox20W", "ThunderComboBox", "ThunderDriveListBox", "ThunderRT6ComboBox", "TORComboEdit", "TCombobox", "TComboBoxEx", "TORComboBox", "TColorBox", "TNFComboBox", "Internet Explorer_TridentCmbobx", "ComboWndClass", "_AOL_ComboBox", "ThunderRT5ComboBox", "ComboLBox"                 SoundPlay(@ScriptDir & "\focus_Audio\list.wav")             Case "Edit", "SearchBox", "TChatRichEdit", "_WwN", "_WwO", "RichEdit20A", "RichEdit20WPT", "RICHEDIT60W", "OKttbx", "RichEditA", "ThunderTextBox", "ThunderRT6TextBox", "ThunderRT5TextBox", "TEdit", "TRichEdit", "TRichEditViewer", "TMemo", "TInplaceEditList", "TLabeledEdit", "TMaskEdit", "TDateTimePicker", "TRichEdit", "TCaptionMemo", "TAddictRichEdit", "TCaptionEdit", "RichTextWndClass", "TextWndClass", "PasswordWndClass", "TextAreaWndClass", "MSWorksDoc", "_AOL_Edit", "SysDateTimePick32"                 SoundPlay(@ScriptDir & "\focus_Audio\edit.wav")             Case "ListBox", "ComboLBox", "REListBox20W", "SUPERGRID", "OUTEXVLB", "WMSUIVLB", "SchdmapiVLB", "VLBClass", "ThunderDirListBox", "ThunderFileListBox", "ThunderListBox", "ThunderRT6ListBox", "ThunderRT5ListBox", "TListbox", "TValueListEditor", "TORCalendar", "TColorListBox", "TCheckListBox", "Internet Explorer_TridentLstBox", "ListBoxWndClass", "ListWndClass", "hh_kwd_vlist", "afx:8:376:0:946", "_AOL_ListBox", "_AOL_Tree", ""                 SoundPlay(@ScriptDir & "\focus_Audio\List.wav")             Case "SysListView32", "OpenListView", "wuDuiListView", "ListView20WndClass", "TcxGridSite", "TListView", "TSystemListView", "ListViewWndClass", ""                 SoundPlay(@ScriptDir & "\focus_Audio\ListView.wav")             Case "SysTreeView32", "SearchTreeList", "FeatureTree", "TreeView20WndClass", "TSystemTreeView", "TTreeView", ""                 SoundPlay(@ScriptDir & "\focus_Audio\TreeView.wav")             Case Else                 SoundPlay(@ScriptDir & "\focus_Audio\focus.wav")         EndSwitch     EndIf     $h_CurrentHWNDFocus = $h_NewHWNDFocus     $h_CurrentControlHWNDFocus = $h_NewControlHWNDFocus     AdlibRegister("WindowAudioFocus", 50)     Return 1 EndFunc   ;==>WindowAudioFocus Func _IsCheckBox($ctrl_hwnd)     $Style = _WinAPI_GetWindowLong($ctrl_hwnd, $GWL_STYLE)     Return BitAND($Style, $BS_CHECKBOX) = $BS_CHECKBOX EndFunc   ;==>_IsCheckBox Func _IsRadio($ctrl_hwnd)     $Style = _WinAPI_GetWindowLong($ctrl_hwnd, $GWL_STYLE)     Return BitAND($Style, $BS_AUTORADIOBUTTON) = $BS_AUTORADIOBUTTON EndFunc   ;==>_IsRadio
      what i need from you is :
      play a sound when a menu item focus, that sound named menu.wav
      play a sound named items.wav when the users move on list box items or list view or treeview items or a combobox items
      please if can any one help me i'll very happy
      thanks on advance
    • By nacerbaaziz
      Hello
      I designed this code To help the blind
      Where screen readers users can  Identify the sefocus  item with audio files
      In this code i define some elements
      Unfortunately, I did not know how to define the other elements
      I am waiting for your initiative to  define the other elements
      Thank you in advance
      Global $CFocus = "" Func focus($window) Local $focusing = ControlGetFocus($window) Local $handle = ControlGetHandle($window, "", $focusing) If Not ($focusing = $CFocus) Then Switch StringTrimRight($focusing, 1) Case "button" If IsCheckBox($handle) Then play("checkBox") ElseIf IsRadio($handle) Then play("RadioButton") Else play("focus") EndIf $CFocus = $focusing Case "comboBox", "ListBox" play("list") $CFocus = $focusing Case "edit", "input" play("edit") $CFocus = $focusing Case Else play("focus") $CFocus = $focusing EndSwitch EndIf EndFunc ;==>focus Func IsCheckBox($ctrl_hwnd) $Style = _WinAPI_GetWindowLong($ctrl_hwnd, $GWL_STYLE) Return BitAND($Style, $BS_CHECKBOX) = $BS_CHECKBOX EndFunc ;==>IsCheckBox Func IsRadio($ctrl_hwnd) $Style = _WinAPI_GetWindowLong($ctrl_hwnd, $GWL_STYLE) Return BitAND($Style, $BS_AUTORADIOBUTTON) = $BS_AUTORADIOBUTTON EndFunc ;==>IsRadio Func play($name, $wait = 0) Local Const $SND_RESOURCE = 0x00040004 Local Const $SND_ASYNC = 1 ; Play the file - the script will pause as it sounds If $wait = 0 Then DllCall("winmm.dll", "int", "PlaySound", "str", $name, "hwnd", 0, "int", BitOR($SND_RESOURCE, $SND_ASYNC)) Else DllCall("winmm.dll", "int", "PlaySound", "str", $name, "hwnd", 0, "int", $SND_RESOURCE) EndIf Return 1 EndFunc ;==>play  
    • By fatpig
      can anyone tell me how I stop this from occuring when I place a jpg in my GUI?
      White parts become black. might be transparent, too. Not sure.
      thanks

    • By nacerbaaziz
      hellow guys
      I am a blind young man
      I started a project to make an audio player
      with recorder
      I ended the player and i did not know how to recorder
      This player is Compatible with the blind and visually impaired and ordinary users
      Unfortunately I do not see so I could not merge images and icons
      So I hope you will be able to help me in this matter
      I will bring you the open source project and please help me to add images, icons and recorder, the project is requires easy access in order to be compatible with the screen readers, Please take this into account.
      the software is organized so the recorder is In a special  menu that Contains stop and start and pause and save.
      The same is true for player
      Please help
      And greetings to all
      easy player.zip
    • By Apfelkiller
      Hello,

      i need help with my script here.

      I want to detect when my Screen is nearly or completly dark/black.
      I'm using PixelChecksum(0,0,1919,1079) and it's giving me random numbers (e.g. 2690216355, 2589900821, 854331631, 481460664)
      How can i compare that with a Black like 0xFFFFFF ?
×
×
  • Create New...