@abberration here is a way to disable / enable $WS_TABSTOP (or another style) using a function named Alter_Style . You can indicate several controls when calling the function, as shown in the script lines that are commented out. After the style is disabled, the TAB key won't select anymore the control(s) which don't have this style. A similar function should be easy to script to take care of Extended styles.
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPISysWin.au3>
Opt("MustDeclareVars", 1) ;0=no, 1=require pre-declaration
Local $hGUI = GUICreate("TabStop", 316, 207)
Local $Label1 = GUICtrlCreateLabel("Input1", 40, 40, 50, 17, $SS_CENTERIMAGE)
Local $Input1 = GUICtrlCreateInput("123", 100, 40, 170, 20)
Local $Label2 = GUICtrlCreateLabel("Input2", 40, 88, 50, 20, $SS_CENTERIMAGE)
Local $Input2 = GUICtrlCreateInput("456", 100, 90, 170, 20)
Local $idRemoveStyle = GUICtrlCreateButton("Remove TabStop ", 25, 155, 125, 25)
Local $idAddStyle = GUICtrlCreateButton("Add TabStop", 170, 155, 125, 25)
GUISetState(@SW_SHOW)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $idRemoveStyle
Alter_Style(0, $WS_TABSTOP, $Input1)
; Alter_Style(0, $WS_TABSTOP, $Input1, $Input2)
; Alter_Style(0, $WS_TABSTOP, $Input1, $Input2, $idRemoveStyle)
Case $idAddStyle
Alter_Style(1, $WS_TABSTOP, $Input1)
; Alter_Style(1, $WS_TABSTOP, $Input1, $Input2)
; Alter_Style(1, $WS_TABSTOP, $Input1, $Input2, $idRemoveStyle)
EndSwitch
WEnd
;===========================================
Func Alter_Style($iRemoveOrAdd, $iStyleToAlter, $id1, $id2 = 0, $id3 = 0, $id4 = 0, $id5 = 0, _
$id6 = 0, $id7 = 0, $id8 = 0, $id9 = 0, $id10 = 0)
Local $hControl, $iStyle
For $i = 1 To @NumParams - 2
$hControl = GUICtrlGetHandle(Eval("id" & $i))
$iStyle = _WinAPI_GetWindowLong($hControl, $GWL_STYLE)
Switch $iRemoveOrAdd
Case 0 ; remove style
If BitAND($iStyle, $iStyleToAlter) = $iStyleToAlter Then
_WinAPI_SetWindowLong($hControl, $GWL_STYLE, BitXOR($iStyle, $iStyleToAlter))
Endif
Case 1 ; add style
If BitAND($iStyle, $iStyleToAlter) <> $iStyleToAlter Then
_WinAPI_SetWindowLong($hControl, $GWL_STYLE, BitOR($iStyle, $iStyleToAlter))
Endif
Case Else
MsgBox(0, "", "Scripter, wake up :)")
EndSwitch
Next
EndFunc ;==>Alter_Style