chtulu Posted July 26, 2024 Posted July 26, 2024 I have the following script: expandcollapse popup; Script Start - Add your code below here #include <MsgBoxConstants.au3> #include <WinAPIMem.au3> #include <WinAPIProc.au3> #include <WinAPISys.au3> Opt("MouseCoordMode", 2) $UpTo = 3360 ;+1 NEXT TIME ; Retrieve a handle to the current desktop and create a new desktop named "MyDesktop" Local $hPrev = _WinAPI_GetThreadDesktop(_WinAPI_GetCurrentThreadId()) Local $hDesktop = _WinAPI_CreateDesktop('MyDesktop10', BitOR($DESKTOP_CREATEWINDOW, $DESKTOP_SWITCHDESKTOP)) If Not $hDesktop Then MsgBox(($MB_ICONERROR + $MB_SYSTEMMODAL), 'Error', 'Unable to create desktop.') Exit EndIf ; Switch to the newly created desktop ;_WinAPI_SwitchDesktop($hDesktop) ; Run "notepad.exe" on "MyDesktop" and wait until a process will not be closed by user Local $pText = _WinAPI_CreateString('MyDesktop10') Local $tProcess = DllStructCreate($tagPROCESS_INFORMATION) Local $tStartup = DllStructCreate($tagSTARTUPINFO) DllStructSetData($tStartup, 'Size', DllStructGetSize($tStartup)) DllStructSetData($tStartup, 'Desktop', $pText) ;If _WinAPI_CreateProcess('', 'J:\Program Files (x86)\Visual Recurrence Analysis\VisualRecurrenceAnalysis.exe', 0, 0, 0, $CREATE_NEW_PROCESS_GROUP, 0, 0, $tStartup, $tProcess) And _WinAPI_CreateProcess("", 'C:\Program Files (x86)\AutoIt3\Beta\AutoIt3_x64.exe "N:\DOWNLOADS\JUSTTOMAKE SPACE\VISUAL RECURRENCE ANALYSIS\00.au3"', 0, 0, 0, $CREATE_NEW_PROCESS_GROUP, 0, 0, $tStartup, $tProcess) Then $count = 1 for $i = 3 to 10 for $j = 2 to 10 If _WinAPI_CreateProcess('', 'N:\DOWNLOADS\JUSTTOMAKE SPACE\VISUAL RECURRENCE ANALYSIS\10\PostQuitMessage.exe 1.txt' & " " & $i & " " & $j & " " & $count & '.csv', 0, 0, 0, $CREATE_NEW_PROCESS_GROUP, 0, 0, $tStartup, $tProcess) then ProcessWaitClose(DllStructGetData($tProcess, 'ProcessID')) EndIf $count = $count + 1 next Next ;sleep(5000) ;FileChangeDir("J:\Program Files (x86)\Visual Recurrence Analysis\") ;Run("VisualRecurrenceAnalysis.exe", "") ;sleep(50) ;$Program = @SystemDir&"\cmd.exe" ;ShellExecute("J:\Program Files (x86)\Visual Recurrence Analysis\VisualRecurrenceAnalysis.exe", "", "", "") ;ShellExecute ( "start.bat" ) ; Switch to previous desktop and close "MyDesktop" ;_WinAPI_SwitchDesktop($hPrev) _WinAPI_CloseDesktop($hDesktop) ; Free memory allocated for a string _WinAPI_FreeMemory($pText) exit(0) but it stops suddenly, sometimes write 7 files, sometime 3 files, unless I switch to the hidden desktop, which I do not want to do, since I have to work on the default desktop, the script also works in full if I keep opened task manager. Is there any way I can run the process in a hidden desktop and make it finishing writing all the 72 output files?
Nine Posted July 26, 2024 Posted July 26, 2024 Have you tried with virtual desktop ? I made an example how to use it (see my signature for Virtual Desktop Management). Since we cannot run your code, it is going to be hard for us to find what is the problem. You should consider making it runable to us if you want further help. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
chtulu Posted July 26, 2024 Author Posted July 26, 2024 where is your virtual desktop management? I have attached the exe file, but I do not know if it will work, since is heavily patched, basically the problem is that it stops at one point, unless this line is used or task manager is kept open. the issue can be easily reproducible you can use any process that keep doing something for some time and producing output to the directory. ;_WinAPI_SwitchDesktop($hDesktop) PostQuitMessage.rar
Nine Posted July 26, 2024 Posted July 26, 2024 Sorry I am not copying/installing anything on my computer that I absolutely need. Just click on Reveal hidden contents at the bottom of my post to get access at my examples/UDF. 7 minutes ago, chtulu said: the issue can be easily reproducible you can use any process that keep doing something why don't you make a snippet that is not working if it is that easy ... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
chtulu Posted July 26, 2024 Author Posted July 26, 2024 ok, your example number two, what does do? Is the name of the new desktop it creates a random number?
chtulu Posted July 26, 2024 Author Posted July 26, 2024 also this indicates, that you can not have more than 1 desktop already: Quote ; gives the number of virtual desktops $iHresult = $oVirtualDesktopManagerInternal.GetCount($iCount) ConsoleWrite("Number of Desktop = " & $iCount & "/" & $iHresult & @CRLF) If $iCount > 1 Then Exit MsgBox($MB_SYSTEMMODAL, "", "Please close all additional Virtual Desktops")
Nine Posted July 26, 2024 Posted July 26, 2024 no it simply means that to run my example and you already have more than 1 opened desktop, it might fail. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
chtulu Posted July 26, 2024 Author Posted July 26, 2024 so, is useless to me. Basically I found out that even if I create a new desktop through windows 10, any application stops running unless you stay on that desktop, which I do not see the point of doing, since I do not want to see the application running. Is there any solution?
Nine Posted July 26, 2024 Posted July 26, 2024 35 minutes ago, chtulu said: any application stops running unless you stay on that desktop Very False Easy to prove it : play a song in first desktop, manually create a new virtual desktop, go to second desktop, music continues to play. You can do whatever in the second desktop, music will continue to play... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
chtulu Posted July 26, 2024 Author Posted July 26, 2024 then is only with this borland c++ builder software and there is nothing I can do. I can not even run it hidden, I can run notepad hidden but not this application, maybe someone knows why if I am not on the desktop where the application run and I keep task manager open it runs in full, otherwise it does not do his job, I mean I was wrong saying it stops running, it just do not give any output unless you either switch to the desktop or you open task manager. What the application does, is taking an input file, two other variables and an output file as command line arguments, do some calculation and put the output files into the directory, it starts and then stops putting files until you do one of those two things.
Nine Posted July 26, 2024 Posted July 26, 2024 Anyway, it is not an issue with AutoIt. You should ask the author of your C++ app to tell you how to perform what you want to do. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
chtulu Posted July 26, 2024 Author Posted July 26, 2024 no is not an issue with the application, because with dexpot you can assign an application to a desktop and it works, but unfortunately at the beginning it shows the application in the desktop where you are.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now