I have a program app1 which launches another application using:
app2Server := CreateOleObject('app2.Server');
-
On ocassion it passes data and control to app2 by calling a procedure app2Server.SendData and then call app2Server.TopMost and sets a variable dataSent = True
-
When the user returns to app1 the Form1.OnPaint event checks if dataSent = True and then retreives some data from app2.
Basically on Windows7 step 2 is not working. It seems to me that two things are not working in Window7 – the app2 OleObject is not being set to TopMost and the app1 Form is not being painted (after the initial creation).
Is this a known issue with Win7 and if so can anyone suggest a way to
- Set my app2 as TopMost and
- Get my app1 form to recognise when it’s back in in real time.
Thanks alot
Edit: To change the Z-order of the app1 and app2 I use the following:
SetWindowPos(Form1.Handle,HWND_BOTTOM,0,0,0,0,swp_NOMOVE or swp_NOSIZE);
app2Server.TopMost;
It doesn’t appear as if either are working.
ps I inherited this code I just need to make it work 🙂
My solution is pretty much this
I used a timer within app1 to continually check for payment in app 2 as OnPaint doesn’t seem to be working in Win7.
Form1.TopMost is infact working on Win7 but only if the application is minimised. Any suggestions welcome.
thanks