Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/30/2024 in all areas

  1. Nine

    window invert color

    @ioa747 I thought about it but, to be honest, never tried it seriously. Using your code (with modification to the UDF) solves the issue mentioned before, but created (in my perspective) larger problems. Invert the colors, you will see that submenus and popup windows do not display correctly. Maximize does not produce proper result, same goes with resizing larger than initial display. I stopped testing at this point. I have invested enough of my time on my proposal, sorry to say, I will not try to solve the problems of yours. Thanks for sharing. PS. I need a good night sleep, maybe tomorrow I will be more likely to further analyse your solution...
    2 points
  2. Unicode codepoint 0x0275A (❚ HEAVY VERTICAL BAR) has no special effect on subsequent text. In other codepages, it's difficult to determine out of the blue what the character renderer will do.
    1 point
  3. ioa747

    _EnterSetName issues...

    I don't know if you needed the other functions for anything else during the course, but for this round they can be omitted, to simplify ; ----------------------------------------------- #include <MsgBoxConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- Global $g_SetName = "" ; e.g. F:\Audio\Type_1\[Set_New_Name] ; ----------------------------------------------- _EnterSetName() ; ----------------------------------------------- Func _EnterSetName() Local $hGuiEnterName = GUICreate("Notice!", 206, 120, -1, -1, -1, $WS_EX_TOOLWINDOW) GUICtrlCreateLabel("Enter the Type_# and Set_Name...", 15, 10, 174, 17, $SS_CENTER) Local $ButtonCancel = GUICtrlCreateButton("cancel", 115, 85, 75, 25) Local $ComboType = GUICtrlCreateCombo("Type_1", 15, 30, 176, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Type_2") Local $sNotion = "[Set_New_Name]" Local $InputSetName = GUICtrlCreateInput($sNotion, 15, 55, 176, 21, $ES_CENTER) Local $ButtonOk = GUICtrlCreateButton("ok", 15, 85, 75, 25) GUISetState(@SW_SHOW) Local $nMsg While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $ButtonCancel ExitLoop Case $ButtonOk Local $sNewName = GUICtrlRead($InputSetName) ConsoleWrite("$sNewName=" & $sNewName & @CRLF) ; Remove illegal characters from $sNewName $sNewName = StringRegExpReplace($sNewName, '[\/:*?"<>|]', '') If StringLen($sNewName) < 1 Or $sNewName = $sNotion Then MsgBox($MB_ICONWARNING, "Notice!", "Please enter the correct name!" & @CRLF & "or press cancel, to cancel") Else $g_SetName = "F:\Audio\" & GUICtrlRead($ComboType) & "\" & $sNewName ConsoleWrite("$g_SetName=" & $g_SetName & @CRLF) ; Create the directory DirCreate($g_SetName) ShellExecute($g_SetName) GUIDelete($hGuiEnterName) Return EndIf EndSwitch WEnd MsgBox($MB_ICONWARNING, "Notice!", "The operation was cancelled. Exiting!") Exit EndFunc ;==>_EnterSetName ; -----------------------------------------------
    1 point
  4. ioa747

    window invert color

    @Nine as an idea putting an additional parameter in WinMagnifier.au3 in the function Func _MagnifierGUICreate($nWidth, $nHeight, $iX1, $iY1, $bInvertColors = False, $bShowCursor = False, $hParent = 0 ) and filling in the following $hMagnifyGUI = GUICreate("", $nWidth, $nHeight, $iX1, $iY1, 0x80000000, BitOR(0x08000000, 0x080000, 0x80, 0x20), $hParent) that simplifies things ? #include <WindowsConstants.au3> #include "WinMagnifier.au3" _MagnifierInit() Run("Notepad") Sleep(100) Local $hWnd = WinGetHandle("[CLASS:Notepad]"), $aPos[4], $aPosTmp[4] Local $hDesktop = WinGetHandle("[CLASS:Progman]") WinGetPosEx($hDesktop, $aPos) Local $aHndl = _MagnifierGUICreate($aPos[2], $aPos[3], $aPos[0], $aPos[1], True, False, $hWnd) Local $hMagnifyGUI = $aHndl[0], $hMagnifyCtrl = $aHndl[1] _MagnifierSetSource($hMagnifyCtrl, $aPos[0], $aPos[1], $aPos[2], $aPos[3]) GUISetState(@SW_SHOWNOACTIVATE, $hMagnifyGUI) While WinExists($hWnd) If WinActive($hWnd) Then WinGetPosEx($hWnd, $aPosTmp) If $aPos[0] <> $aPosTmp[0] Or $aPos[1] <> $aPosTmp[1] Or $aPos[2] <> $aPosTmp[2] Or $aPos[3] <> $aPosTmp[3] Then $aPos = $aPosTmp WinMove($hMagnifyGUI, "", $aPos[0], $aPos[1], $aPos[2], $aPos[3]) _MagnifierSetSource($hMagnifyCtrl, $aPos[0], $aPos[1], $aPos[2], $aPos[3]) EndIf _WinAPI_RedrawWindow($hMagnifyCtrl) Sleep(10) Else Sleep(300) EndIf WEnd _WinAPI_DestroyWindow($hMagnifyCtrl) GUIDelete($hMagnifyGUI) Func WinGetPosEx($hWnd, ByRef $aPos) Local $aTmp = WinGetPos($hWnd) If @error Then Return $aPos = $aTmp ; adjust magnifier to the edge of the window $aPos[0] += 8 $aPos[1] += 1 $aPos[2] -= 16 $aPos[3] -= 9 EndFunc ;==>WinGetPosEx Edit: after the observation made below by the @Nine Maximize does not produce proper result, same goes with resizing larger than initial display. I added the initialization in start Local $hDesktop = WinGetHandle("[CLASS:Progman]") WinGetPosEx($hDesktop, $aPos) as a temporary solution
    1 point
×
×
  • Create New...