I've been experiencing an issue with #cs/#ce block comments and AutoIt code highlighting in ScITE. When I insert the comments-start line, the subsequent lines in the file become comment-colored (green) as expected. Much of the time, when I insert the #ce line, the lines following the comments-end revert to normal code highlighting as expected. But other times, the subsequent lines (to the end of the file) stay green until I save, close, and re-open the file. This seems to occur most often when I am using #cs/#ce to comment-out a section of code, but IIRC it can also occur in cases where I'm just inserting a large comment.
So far, I haven't noticed any pattern to this behavior. The only thing that I can think of is the way I'm entering the #cs & #ce lines when commenting-out code; I often do the following;
Insert the #cs line, something like: #cs ======== Explanation for commenting-out ======== Text below the line turns green Copy the entire #cs line Paste it after the code section (as #cs ...) Edit the pasted line to start with #ce instead of #cs The text below the #ce either reverts to normal ScITE/AutoIt highlighting OR remains green, in which case I have to close and reopen the file to restore normal highlighting. I'm using ScITE Version 3.6.0 (Aug 4 2015 17:34:27).
Any thoughts or suggestions?
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
I am trying to identify the window based on the window title and text.
The title will be the "erwin DM - filename"
It is working till date, but some operating systems our application is displaying window as "erwin DM - [filename]"
I tried "erwin DM - *filename*" But this regular expression is not working.
$sModelFile = "C:\Users\Administrator\Documents\My Models\eMovies.erwin" $wdModel = _WinWaitActivate1("erwin DM - "&FileNameOnly($sModelFile),"") Func _WinWaitActivate1($title,$text,$timeout=0);Will Return the window Handler Logging("Waiting for "&$title&":"&$text) $dHandle = WinWait($title,$text,$timeout) if not ($dHandle = 0) then If Not WinActive($title,$text) Then WinActivate($title,$text) return WinWaitActive($title,$text,$timeout) Else Logging("Timeout occured while waiting for the window...") Exit EndIf EndFunc Func FileNameOnly($sFilePath) Local $sDrive = "", $sDir = "", $sFileName = "", $sExtension = "" Local $aPathSplit = _PathSplit($sFilePath, $sDrive, $sDir, $sFileName, $sExtension) ;_ArrayDisplay($aPathSplit, "_PathSplit of " & @ScriptFullPath) return $sFileName EndFunc
When we run our exe from any service or through any background process, it won't interact with the applications running in the foreground, I mean launched when the user is logged in or in GUI mode.
Let's say, the onedrive sync app can't be detected from the exe we created and running it in background.
I tried both options below.
Any Idea how to interact with foreground processes using AuotIT code.
Other than telling to launch the exe also in foreground.