|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
RogerLampert
Joined: 11 May 2005 Posts: 12
|
Posted: Thu Jan 17, 2008 4:09 pm Post subject: Refreshing the screen after sdbg |
|
|
I am using some software written in C++ by someone else. They have used the code below to start a batch file (with a token 'EnTmpBase1') that contains my programs. I can run sdbg successfully within the batch file, but when I exit it, it closes and leaves a white rectangle where the window used to be. Behind this, the C++ is still running, but of course, I cannot see the interface or messages that it puts up as these are underneath the white rectangle. The screen does come back at completion of the program.
I presume that there must be a way to get the screen to refresh on exit from sdbg, but can anyone tell me what it is, please?
Thanks
Roger
The code used was:
CreateProcess(NULL, �cycle.bat EnTmpBase1.db", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pInfo); //Start the process
WaitForSingleObject(pInfo.hProcess, INFINITE); // Halt this program until child process finished
Where si and pInfo are such that:
STARTUPINFO si; //Structure for starting proc
PROCESS_INFORMATION pInfo; //Environment & run info
si.cb = sizeof(si);
si.lpReserved = NULL;
si.lpDesktop = NULL;
si.cbReserved2 = 0;
si.lpReserved2 = NULL;
si.dwFillAttribute = STARTF_USESHOWWINDOW;
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOWMINIMIZED|SW_SHOWNOACTIVATE|SW_SHOWMINNOACTIVE;
and pInfo is filled in by CreateProcess. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8036 Location: Salford, UK
|
Posted: Thu Jan 17, 2008 7:41 pm Post subject: |
|
|
From your description it is not obvious what is happening nor what you would like to do.
If the screen is not refreshing as it should then this will be evident when you force a refresh by dragging another application across the relevant area.
If you want to do a screen refresh under program control then one way is to use the API function GetDesktopWindow in conjuction with InvalidateRect.
Code: |
include <windows.ins>
logical k
integer ih
ih=GetDesktopWindow()
k=InvalidateRect(ih, core4(0), 1)
|
|
|
Back to top |
|
|
RogerLampert
Joined: 11 May 2005 Posts: 12
|
Posted: Fri Jan 18, 2008 11:44 am Post subject: |
|
|
Paul,
We are trying to marry together our old optimisation software (a mixture of home-written and purchased software contained in a batch file) with a new interface, which is both an interface and a lot of maths/equations, the results of which are passed to the batch file in the form of a database. Thus we want to run the equations and pass the results to the optimisation routines in the batch file. When the batch file is finished, control should return to the interface program to do various other calculations.
The debugger is used within the batch file, but once it has finished I would like to be able to see the interface again as this posts messages about the progress of further modelling. I know that the interface is actually running as I can follow the progress from the various things appearing on the task bar but I cannot actually see it behind the remnants of the debugger window which does not go away. (This of course is the large white rectangle that I referred to. You can just see the edge of the interface around it, but clicking on it does not bring it to the foreground)
I don't really know how to use the code that you suggest. Maybe there should be some code inserted into the code for the interface to refresh the screen, rather than into my Fortran?
Roger |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8036 Location: Salford, UK
|
Posted: Fri Jan 18, 2008 1:46 pm Post subject: |
|
|
I suggest that you get a copy of the Microsoft Spy application Spy++ and use it to identify the white window that you mention. If it is still there when you drag other applications over it then it must be a window rather than an unrefreshed part of the screen.
Also the "interface" should come to top anyway when you click on it.
Clearly something odd is happening and at the moment there is no apparent reason to put the fault down to FTN95/SDBG etc. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|