Jump to content

Prevent Dotted Focus Lines on Controls


Melba23
 Share

Recommended Posts

Melba23:

The code uses _WinAPI_SetWindowLong, which according to MSDN means that it will not work on x64 systems. If anyone wants to modify the code for x64, please do so.

I'm currently using your UDF to remove focus lines on some radio controls. I'm using it on an x64 Win7 system just fine. Thought I'd let you know.

Link to comment
Share on other sites

  • Moderators

therms,

Thanks for that info. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 1 year later...

The example crashes when I select "specific" and then "OK" followed by "Hide upper control focus lines" twice.

I get a "(101) : ==> "ContinueLoop" statement with no matching "While", "Do" or "For" statement.:" error.

Either than that, great UDF!

Edited by DatMCEyeBall

"Just be fred, all we gotta do, just be fred."  -Vocaliod

"That is a Hadouken. A KAMEHAMEHA would have taken him 13 days and 54 episodes to form." - Roden Hoxha

@tabhooked

Clock made of cursors ♣ Desktop Widgets ♣ Water Simulation

Link to comment
Share on other sites

Go to the line in question and change to...

If $hHandle = $aHandle_Proc[$j][0] Then 
ContinueLoop 2
EndIf

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

  • Moderators

DatMCEyeBall,

Sorry about that - the error was introduced into AutoIt with v3.3.8.1 and was fixed in v3.3.9.x. I will update the UDF to prevent it erroring in future. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

[bUGFIX VERSION] - 25 Jun 13

Fixed: A bug in AutoIt v3.3.6.1 could crash the UDF under certain circumstances - other releases do not show the same error. Small code change to prevent error in any release. :)

Thanks to DatMCEyeBall for finding it. :thumbsup:

New UDF and zip in first post. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

DatMCEyeBall,Sorry about that - the error was introduced into AutoIt with v3.3.8.1 and was fixed in v3.3.9.x. I will update the UDF to prevent it erroring in future. :)M23

I should start using beta - it's just that my laziness is eternal...

"Just be fred, all we gotta do, just be fred."  -Vocaliod

"That is a Hadouken. A KAMEHAMEHA would have taken him 13 days and 54 episodes to form." - Roden Hoxha

@tabhooked

Clock made of cursors ♣ Desktop Widgets ♣ Water Simulation

Link to comment
Share on other sites

  • 1 year later...

Hello, even the issue i have is not caused by this udf, it's somewhat still related, and maybe you can give some help.

At normal use, with the udf, (_NoFocusLines_Global_Set() before the creation os the controls)

i click controls and there are no dotted lines, but when i set "GUICtrlSetBkColor" on every control

the last slider (and only the slider, no buttons or anything else) changing color gets the dotted lines, with udf!

On top of that, the slider doesn't change color, without the udf, it has the dotted lines but changes the color.

Got a stripped out script for you to test.

How to reproduce:, msg opens asking for a color, since it's the first run, choose any color, gui appears, click the button "color"

select any color. Done.

#Region ;Wrapper
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Run_Tidy=y
#AutoIt3Wrapper_Res_SaveSource=y
#AutoIt3Wrapper_Icon=BPlayer.ico
#AutoIt3Wrapper_Res_Comment=By: Careca
#AutoIt3Wrapper_Res_Fileversion=2.0
#AutoIt3Wrapper_Res_Icon_Add=BPlayer.ico
#AutoIt3Wrapper_Outfile=Beats Player 2.0.exe
#AutoIt3Wrapper_Res_Description=Audio Player
#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7
#EndRegion ;Wrapper
#Region ;Includes
#include <Misc.au3>
#include <File.au3>
#include <Array.au3>
#include <WinAPI.au3>
#include <GuiEdit.au3>
#include <WinAPIEx.au3>
#include <WinAPISys.au3>
#include <GuiButton.au3>
#include <Constants.au3>
#include <GuiSlider.au3>
#include <GuiToolTip.au3>
#include <GUIListBox.au3>
#include <GuiListView.au3>
#include <GuiStatusBar.au3>
#include <GUIConstants.au3>
#include <GuiImageList.au3>
#include <NoFocusLines.au3>
#include <GuiComboBoxEx.au3>
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#EndRegion ;Includes
#Region ;Opt
OnAutoItExitRegister("Quit")
Opt("TrayMenuMode", 1)
Opt("TrayIconHide", 0)
Opt("GUICoordMode", 1)
Opt("GUIResizeMode", 1)
Opt("TrayIconDebug", 1)
Opt("TrayAutoPause", 0)
Opt("MouseCoordMode", 2)
Opt("GUIOnEventMode", 1)
Opt("MustDeclareVars", 1)
Opt("GUIEventOptions", 0)
Opt("TrayOnEventMode", 1)
Opt("ExpandEnvStrings", 1)
Opt("WinDetectHiddenText", 1)
#EndRegion ;Opt
#Region ;Vars
Local $GUI, $cListView, $Input_4, $Box2, $Box3, $Box4, $Box5, $Box6, $Box7, $Box9, $Slider1, $Slider2, $Copy2Folder
Local $Button_4, $Button_5, $Button_6, $SaveList, $LoadList, $InfoTrack, $InfoT, $InfoVol, $ContextMenu, $DelSelected, $DelSelectedHdd
Local $ClearList, $Highlight, $Copy2Dsktp, $Playlistno, $Button_Find, $Button_1, $Button_2, $Button_3_P, $Button_3_C, $SourceFolder, $PlayerFolder
Local $PLTray, $PSTray, $STTray, $NTray, $PTray, $CTTray, $ExitItem, $ColorBtn, $Color, $LoadLastFolder
Local $Read, $Clear, $SliderC, $Vol, $MusicHandle, $StartTray, $STrayRecurIniRead, $STrayIniRead, $STrayStartWIniRead, $LastFolderLoadCtrlRead, $LastFolderLoadIniRead
Local $Play, $ListClick, $iMsgBoxAnswer, $Vol2, $Bass, $Continue, $StartRecur, $StartWin, $Rdm, $Perc, $GetLTLV, $iIdleTime, $LastFile, $ColorPick, $ColorPicked
Local $aList, $array, $array2, $array3, $array4, $arrayL, $arrayR, $End, $Recur, $Recursive, $DoneSW, $FindText, $FindText1, $FindText2, $GetItemTxt, $__aGUIDropFiles, $WinState
Local $Opened_File, $iFile, $PFile, $PFile1Handle, $File, $FileT, $Files, $iFileReadS, $SearchStart, $TrR, $StrLen, $StrL, $Folder, $Line, $LineCount, $Shuffle
Local $PlayPLLoadIniRead, $PlayAfterPLLoad, $LT, $LTP, $Lenght, $Pos, $pHour, $pMin, $pSec, $lHour, $lMin, $lSec, $ConvP, $ConvL, $ShuffleIniRead, $SubTextFolder, $SubTextFile
Local $Title, $Seek, $SeekB2Secs, $PLNo, $PLName, $CursorInfo, $Stop, $LLoadIniRead, $PLLoadAfterStart, $aMpos, $Window, $LastSavedFolder, $SavePath, $SingleFFCtx, $Button_ToTray
#EndRegion ;Vars
#Region ;Gui
_NoFocusLines_Global_Set()
TraySetIcon("BPlayer\BPlayer.ico")
$PFile = (@ScriptDir & '\BPlayer\Playlist' & $PLNo & '.txt')
$iFile = (@ScriptDir & '\BPlayer\Settings.ini')
$Bass = (@ScriptDir & "\BPlayer\BASS\Bass.dll")
$Title = ("123")
$GUI = GUICreate($Title, 600, 440, 100, 100, -1, $WS_EX_ACCEPTFILES)
GUISetIcon(@ScriptDir & "\BPlayer\BPlayer.ico", -1)
GUISetOnEvent($GUI_EVENT_CLOSE, "Quit")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Minimize")
GUISetOnEvent($GUI_EVENT_RESTORE, "Restore")
#EndRegion ;Gui
#Region ;Buttons
;=============================================================================
$ColorBtn = GUICtrlCreateButton("Color", 547, 395, 26, 13)
GUICtrlSetTip($ColorBtn, 'Select the main color of the player', "Tip", 1)
GUICtrlSetOnEvent($ColorBtn, "ColorPick")
#EndRegion ;Buttons
#Region ;Slider
$Slider1 = GUICtrlCreateSlider(10, 270, 475, 20, $TBS_AUTOTICKS)
_GUICtrlSlider_SetTicFreq($Slider1, 5)
GUICtrlSetTip($Slider1, 'Drag with mouse or click somewhere on the slider to jump in the track', "Tip", 1)
$Slider2 = GUICtrlCreateSlider(540, 290, 24, 100, $TBS_VERT)
GUICtrlSetTip($Slider2, '0 + Arrow Up OR Down To change volume', "Tip", 1)
GUICtrlSetLimit($Slider2, 100, 0)
$InfoTrack = GUICtrlCreateLabel('Track nº: NA' & @CRLF & 'Folder: NA' & @CRLF & 'File: NA', 10, 390, 530, 42)
$InfoVol = GUICtrlCreateLabel('', 565, 335, 30, 16)
$InfoT = GUICtrlCreateLabel('00:00:00\00:00:00', 490, 273, 95, 16, -1, $WS_EX_TRANSPARENT)
#EndRegion ;Slider
#Region ;Top
Call('ColorStart')
GUISetState()
TraySetState(1)
TraySetClick(8)
Local $hDLL = DllOpen("user32.dll")
$Vol2 = IniRead($iFile, 'Volume', 'Vol', '')
If $Vol2 = '' Then
    $Vol = 100
Else
    $Vol = $Vol2
EndIf
GUICtrlSetData($InfoVol, $Vol & '%')
GUICtrlSetData($Slider2, 100 - $Vol)
GUICtrlSetState($Button_3_P, $GUI_HIDE)
GUICtrlSetState($Button_3_C, $GUI_HIDE)
TrayItemSetState($CTTray, $GUI_HIDE)
$Stop = 1
$Play = 0
#EndRegion ;Top
;=============================================================================
Do
    ;=============================================================================
    $Vol = 100 - GUICtrlRead($Slider2)
    If $Vol <> $Vol2 Then
        SoundSetWaveVolume($Vol)
        GUICtrlSetData($InfoVol, $Vol & '%')
        $Vol2 = $Vol
    EndIf
    ;=============================================================================
    Sleep(100)
Until GUIGetMsg() = $GUI_EVENT_CLOSE
;=============================================================================

;=============================================================================
Func Minimize()
    WinSetState($GUI, '', @SW_MINIMIZE)
EndFunc   ;==>Minimize
;=============================================================================
Func Restore()
    WinSetState($GUI, '', @SW_RESTORE)
EndFunc   ;==>Restore
;=============================================================================
Func ColorStart()
    $ColorPick = IniRead($iFile, 'MainColor', 'Color', 'Default')
    If $ColorPick <> 'Default' And $ColorPick <> '-1' Then
        GUISetBkColor($ColorPick, $GUI)
        GUICtrlSetBkColor($ColorBtn, $ColorPick)
        GUICtrlSetBkColor($Button_ToTray, $ColorPick)
        GUICtrlSetBkColor($Playlistno, $ColorPick)
        GUICtrlSetBkColor($Box2, $ColorPick)
        GUICtrlSetBkColor($Box3, $ColorPick)
        GUICtrlSetBkColor($Box4, $ColorPick)
        GUICtrlSetBkColor($Box5, $ColorPick)
        GUICtrlSetBkColor($Box6, $ColorPick)
        GUICtrlSetBkColor($Box7, $ColorPick)
        GUICtrlSetBkColor($Box9, $ColorPick)
        GUICtrlSetBkColor($Slider1, $ColorPick)
        GUICtrlSetBkColor($Slider2, $ColorPick)
        GUICtrlSetBkColor($InfoTrack, $ColorPick)
        GUICtrlSetBkColor($InfoVol, $ColorPick)
        GUICtrlSetBkColor($InfoT, $ColorPick)
    Else
        MsgBox(64, 'First Start', 'Select color of player interface')
        Call('ColorPick')
    EndIf
EndFunc   ;==>ColorStart
;=============================================================================
Func ColorPick()
    $ColorPicked = IniRead($iFile, 'MainColor', 'Color', '0x7F7F7F')
    $ColorPick = _ChooseColor(2, $ColorPicked, 2, $GUI)
    If $ColorPick <> '-1' Then
        IniWrite($iFile, 'MainColor', 'Color', $ColorPick)
        GUISetBkColor($ColorPick, $GUI)
        GUICtrlSetBkColor($ColorBtn, $ColorPick)
        GUICtrlSetBkColor($Button_ToTray, $ColorPick)
        GUICtrlSetBkColor($Slider2, $ColorPick)
        GUICtrlSetBkColor($Slider1, $ColorPick)
        GUICtrlSetBkColor($InfoVol, $ColorPick)
        GUICtrlSetBkColor($InfoT, $ColorPick)
        GUICtrlSetBkColor($InfoTrack, $ColorPick)
    Else
        $ColorPicked = IniRead($iFile, 'MainColor', 'Color', '0x7F7F7F')
    EndIf
EndFunc   ;==>ColorPick
;=============================================================================
Func Quit()
    _NoFocusLines_Global_Exit()
    Exit
EndFunc   ;==>Quit
;=============================================================================
Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Moderators

careca,

No focus lines appear for me after changing the colour, which makes debugging a bit difficult. :(

But I do see that one of the sliders does not change colour, so I can help with that - try adding "GUICtrlSetState($ColorBtn, $GUI_FOCUS)" at the end of the ColorPick function. That will move the focus from the slider and allow the colour change to take place as the control is redrawn - it then recolours for me. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

DatMCEyeBall,

Sorry about that - the error was introduced into AutoIt with v3.3.8.1 and was fixed in v3.3.9.x. I will update the UDF to prevent it erroring in future. :)

[bUGFIX VERSION] - 25 Jun 13

Fixed: A bug in AutoIt v3.3.6.1

...

Is that a typo, or was it done on purpose?

Edited by DatMCEyeBall

"Just be fred, all we gotta do, just be fred."  -Vocaliod

"That is a Hadouken. A KAMEHAMEHA would have taken him 13 days and 54 episodes to form." - Roden Hoxha

@tabhooked

Clock made of cursors ♣ Desktop Widgets ♣ Water Simulation

Link to comment
Share on other sites

@Melba23

That's odd, it's the same code, maybe the version of autoit is different? anyway, that solved the issue, which is weird, since the focus was never on any of the sliders, at the most, the focus should be in the button "color".

It's solved, thank you Melba.

Edited by careca
Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Moderators

careca,

Great - hearing that I fixed a problem I could not even reproduce is wonderful news! :D

As I mentioned above, I imagine the problem was caused because the UDF blocks the "I now have focus" redraw message as that is the one which draws the focus lines. My guess was that setting the focus to another control would then force a "I no longer have focus" redraw and so change the colour - it seems I was right. :graduated:

DatMCEyeBall,

Does it matter? ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Well, a lot has changed since those versions, so you could say: 「Nah, it doesn't matter」.

"Just be fred, all we gotta do, just be fred."  -Vocaliod

"That is a Hadouken. A KAMEHAMEHA would have taken him 13 days and 54 episodes to form." - Roden Hoxha

@tabhooked

Clock made of cursors ♣ Desktop Widgets ♣ Water Simulation

Link to comment
Share on other sites

  • Moderators

DatMCEyeBall,

 

[...] my laziness is eternal...

Seeing as you took over a year to notice the inconsistency, I would say you have proved that beyond any reasonable doubt. :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 5 months later...
  • 1 year later...

Hi,

I love the code as it makes my gui feel so much more professional but I am running into a slight problem.

I am trying to run it along side _uSkin.au3

https://www.autoitscript.com/forum/topic/132864-_uskinlibraryau3-udf-skin-with-dll-free-no-ads-and-fully-functional/

Your code removes the dots but as soon as the skin loads, the dots return.

I have even tired calling your script after the skin loads but still no effect.

Would you have any ideas?

Link to comment
Share on other sites

  • Moderators

IanN1990,

I am afraid not. I imagine that uSkin interferes with the various focus messages that are being intercepted by the UDF - but as I do not use uSkin I cannot really comment.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

IanN1990,

If only it were that simple!

The UDF actually sub-classes the controls - that is to say that it runs its own code (the _NoFocusLines_Proc function) in place of the code that Windows normally runs (the Windows Procedure for that type of control) when messages are sent to the control. This is how the UDF manages to intercept the "focus lines" message at such an early stage - it stops it dead while passing on all the other messages to the existing Procedure for the control so that Windows can still deal with everything else. This "focus lines" message is resent to the focused control every time that the control is redrawn - by intercepting it at the Procedure level, the UDF prevents the message from being actioned every time. Even if there were some way of resetting the focus lines once they were set (and I do not see how this could be the case as the control would need to be redrawn and hence the "focus lines" message would be sent again!) you would need to continually check for their return and remove them again when they appeared, which would add quite a bit of overhead to the script.

I hope the above makes clear why the UDF uses such a complicated approach as sub-classing the control to deal with the problem. It would appear that the uSkin code interferes with this sub-classing - hardly surprising given that it is replacing the standard Windows redrawing code with its own - which means that the additional UDF procedure code is also bypassed. So not a lot I or you can do, I am afraid.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 2 years later...

This is great work MeLba23.

I did run into a problem however. It would seem you lose control of the right mouse click on the button.

Just happen to need that in a code I'm working on. But this is really interesting stuff.
learned a lot, so thanks for that!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...