Code: Select all
Let>ONERROR=PROCESS_ERROR
//DBQuery>dbH,,rset,NumRecs,NumFields,0
Let>VALUE=string
Let>CALCULATE={Round(%VALUE%)}
SRT>PROCESS_ERROR
**BREAKPOINT**
END>PROCESS_ERROR
Moderators: Dorian (MJT support), JRL
Code: Select all
Let>ONERROR=PROCESS_ERROR
//DBQuery>dbH,,rset,NumRecs,NumFields,0
Let>VALUE=string
Let>CALCULATE={Round(%VALUE%)}
SRT>PROCESS_ERROR
**BREAKPOINT**
END>PROCESS_ERROR
Code: Select all
//check is a number
RegEx>^\d+(\.\d+)?$,VALUE,0,matches,nm,0
If>nm>0
Let>CALCULATE={Round(%VALUE%)}
Else
// not a number
Gosub>PROCESS_ERROR
Endif
Code: Select all
//check is a number
VBEval>IsNumeric("%VALUE%"),isNumber
If>isNumber=True
Let>CALCULATE={Round(%VALUE%)}
Else
// not a number
Gosub>PROCESS_ERROR
Endif
Code: Select all
Let>TEMP_check=VALUE*0
If>TEMP_check=0
Let>VALUE_round={Round(%VALUE%)}
Else>
Gosub>PROCESS_ERROR
Endif>
Code: Select all
Let>ONERROR=LOG_ERROR
Let>WIN_USEHANDLE=1
Let>WIN_REGEX=1
Let>HIDDEN_WINDOW_FOUND=false
Let>TIMER_ltc_last_added=0
Let>LIST_OF_ALREADY_PROCESSED_HIDDEN_WINDOWS=
Let>LIST_OF_POTENTIAL_HIDDEN_WINDOWS=
Let>HIDDEN_WINDOW_CMD_PATH=C:\Windows\System32\cmd.exe
LowerCase>HIDDEN_WINDOW_CMD_PATH,HIDDEN_WINDOW_CMD_PATH
OnEvent>CUSTOM,LOOP_TO_CHECK_IF_THERES_ANY_HIDDEN_WINDOWS,HIDDEN_WINDOW_FOUND,RUN_THIS_ONLY_WHEN_HIDDEN_WINDOW_IS_FOUND
Label>start_of_main_loop
Wait>10
Goto>start_of_main_loop
SRT>LOOP_TO_CHECK_IF_THERES_ANY_HIDDEN_WINDOWS
GetWindowList>ALL_WINDOW_HANDLES_CURRENTLY_OPEN
Separate>ALL_WINDOW_HANDLES_CURRENTLY_OPEN,CRLF,TEMP_list_open_window_handle
If>TEMP_list_open_window_handle_count>0
Let>ltc_k=0
Repeat>ltc_k
Let>ltc_k=ltc_k+1
Let>TEMP_ltc_handle=TEMP_list_open_window_handle_%ltc_k%
IfNot>TEMP_ltc_handle=
LibFunc>User32,IsIconic,TEMP_ltc_minimized,TEMP_ltc_handle
If>TEMP_ltc_minimized<>0
Let>TEMP_ltc_minimized=1
Endif>
Position>TEMP_ltc_handle,LIST_OF_ALREADY_PROCESSED_HIDDEN_WINDOWS,1,TEMP_ltc_check_first
If>TEMP_ltc_check_first<>0
Let>TEMP_ltc_check_first=1
Endif>
GetWindowProcess>TEMP_ltc_handle,TEMP_ltc_pid,TEMP_ltc_process
LowerCase>TEMP_ltc_process,TEMP_ltc_process
If>TEMP_ltc_process<>HIDDEN_WINDOW_CMD_PATH
Let>TEMP_ltc_process=1
Else>
Let>TEMP_ltc_process=0
Endif>
Let>TEMP_ltc_check_combined={%TEMP_ltc_minimized%+%TEMP_ltc_check_first%+%TEMP_ltc_process%}
If>TEMP_ltc_check_combined=0
GetWindowNames>TEMP_ltc_handle,TEMP_ltc_title,TEMP_ltc_class
LowerCase>TEMP_ltc_title,TEMP_ltc_title
Position>HIDDEN_WINDOW_CMD_PATH,TEMP_ltc_title,1,TEMP_ltc_check_1
Position>{"hidden_window"},TEMP_ltc_title,1,TEMP_ltc_check_2
Position>{"\\bracke-fs01\it\program\task scheduler\"},TEMP_ltc_title,1,TEMP_ltc_check_3
Let>TEMP_ltc_check={%TEMP_ltc_check_1%+%TEMP_ltc_check_2%+%TEMP_ltc_check_3%}
If>TEMP_ltc_check>0
ConCat>LIST_OF_POTENTIAL_HIDDEN_WINDOWS,%TEMP_ltc_handle%%CRLF%
Timer>TIMER_ltc_last_added
Let>HIDDEN_WINDOW_FOUND=true
Endif>
Endif>
Endif>
Until>ltc_k=TEMP_list_open_window_handle_count
Endif>
Timer>TIMER_ltc_now
Let>TIMER_ltc_check=TIMER_ltc_now-TIMER_ltc_last_added
If>TIMER_ltc_check>60000
Let>LIST_OF_ALREADY_PROCESSED_HIDDEN_WINDOWS=
Endif>
END>LOOP_TO_CHECK_IF_THERES_ANY_HIDDEN_WINDOWS
SRT>RUN_THIS_ONLY_WHEN_HIDDEN_WINDOW_IS_FOUND
Separate>LIST_OF_POTENTIAL_HIDDEN_WINDOWS,CRLF,TEMP_ltc_potential_window
Let>LIST_OF_POTENTIAL_HIDDEN_WINDOWS=
If>TEMP_ltc_potential_window_count>0
Let>ltchw_k=0
Repeat>ltchw_k
Let>ltchw_k=ltchw_k+1
Let>TEMP_window_handle_to_process_ltc=TEMP_ltc_potential_window_%ltchw_k%
WindowAction>2,TEMP_window_handle_to_process_ltc
ConCat>LIST_OF_ALREADY_PROCESSED_HIDDEN_WINDOWS,%TEMP_window_handle_to_process_ltc%%CRLF%
Until>ltchw_k=TEMP_ltc_potential_window_count
Endif>
Let>HIDDEN_WINDOW_FOUND=false
END>RUN_THIS_ONLY_WHEN_HIDDEN_WINDOW_IS_FOUND
SRT>PROCESS_ERROR
**BREAKPOINT**
END>PROCESS_ERROR
Code: Select all
LibFunc>User32,IsIconic,TEMP_ltc_minimized,TEMP_ltc_handle
If>TEMP_ltc_minimized<>0
Let>TEMP_ltc_minimized=1
Endif>
Position>TEMP_ltc_handle,LIST_OF_ALREADY_PROCESSED_HIDDEN_WINDOWS,1,TEMP_ltc_check_first
If>TEMP_ltc_check_first<>0
Let>TEMP_ltc_check_first=1
Endif>
GetWindowProcess>TEMP_ltc_handle,TEMP_ltc_pid,TEMP_ltc_process
LowerCase>TEMP_ltc_process,TEMP_ltc_process
If>TEMP_ltc_process<>HIDDEN_WINDOW_CMD_PATH
Let>TEMP_ltc_process=1
Else>
Let>TEMP_ltc_process=0
Endif>
Let>TEMP_ltc_check_combined={%TEMP_ltc_minimized%+%TEMP_ltc_check_first%+%TEMP_ltc_process%}
If>TEMP_ltc_check_combined=0
Code: Select all
LibFunc>User32,IsIconic,TEMP_ltc_minimized,TEMP_ltc_handle
Position>TEMP_ltc_handle,LIST_OF_ALREADY_PROCESSED_HIDDEN_WINDOWS,1,TEMP_ltc_first_check
GetWindowProcess>TEMP_ltc_handle,TEMP_ltc_pid,TEMP_ltc_process
LowerCase>TEMP_ltc_process,TEMP_ltc_process
If>{(%TEMP_ltc_minimized% = 0) AND (%TEMP_ltc_first_check% = 0) AND (%TEMP_ltc_process% = %HIDDEN_WINDOW_CMD_PATH%)}
Code: Select all
Let>ONERROR=PROCESS_ERROR
Let>VALUE=string
Let>CALCULATE={Round(%VALUE%)}
SRT>PROCESS_ERROR
**BREAKPOINT**
END>PROCESS_ERROR