Home | Gallery | Forum | Services | Webmail | Archive | Links | Contact Us | About Us
OS2 World.Com Forum
OS2 World.Com Online Discussion Forum.
Index / OS/2 - General / Programming
author message
Closing window started via DosStartSession with noautoclose
Post a new topic Reply to this Topic Printable Version of this Topic Forward this Topic to your Friend Topic Commands (for administrator or moderators only)
os2rocks
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 2
since: 26 Jul, 2005
1. Closing window started via DosStartSession with noautoclose
Reply to this topic with quote Modify your message
I have a program which does a DosStartSession to start another application with the PgmControl of No Auto Close(SSF_CONTROL_NOAUTOCLOSE). The purpose of this was to ensure that the VIO window didn't disappear if the application trapped or was killed. I'm running on Warp 4 FP.

I'm trying to find a way to close the VIO window(other then manually) after it has been killed or trapped when I restart all of the applications at another time. I've tried to send a close window message(WM_CLOSE), destroy the window(WinDestroyWindow), and tried various other utilities out there to get rid of the window but nothing seems to work. Obviously I'm missing something here, anyone out there got any ideas.

Thanks......

Date: 26 Jul, 2005 on 20:33
mobybrick
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 38
since: 23 Jul, 2004
2. Re:Closing window started via DosStartSession with noautoclose
Reply to this topic with quote Modify your message
Hi,

When you start your VIO app, you could try finding out the process ID of its parent (i.e. the process ID of CMD.EXE running it).

When your VIO process ID has ended, you can then kill the process of the correct copy of CMD.EXE.

Sounds easy, but I have no idea how to program this on OS/2!!

Regards,
Moby.

Date: 27 Jul, 2005 on 13:42
os2rocks
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 2
since: 26 Jul, 2005
3. Re:Closing window started via DosStartSession with noautoclose
Reply to this topic with quote Modify your message
Moby,

The process has already been killed or trapped so killing the PID again doesn't work. The only thing still active is the VIO window.

Thanks,

os2rocks

Date: 27 Jul, 2005 on 14:29
mobybrick
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 38
since: 23 Jul, 2004
4. Re:Closing window started via DosStartSession with noautoclose
Reply to this topic with quote Modify your message
last updated at 27 Jul, 2005 15:16 (1 times)
I see.

Can't you launch the app using CMD.EXE /C first? Then CMD.EXE becomes the owner of the window and you might be able to kill it.

Alternatively, you might be left unfortunately trying to just make the window hidden, e.g. send it a WM_HIDE message.

Regards,
Moby.

Date: 27 Jul, 2005 on 15:15
cyberspittle
Premium member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 252
since: 09 Dec, 2002
5. Re:Closing window started via DosStartSession with noautoclose
Reply to this topic with quote Modify your message
The WM_ are Window Management APIs for Presentation Manager (AKA "PM") programming. You'll need to use a different set of APIs. You'll have to use one of the Dos_ APIs, perhaps DosStopSession is what you should be looking at.

Looking at the text of OS/2 2.0 Control Program Programming Guide (IBM OS/2 Technical Library published by Que)", you'll see the following:

"DosStopSession can be used by a parent session to stop one or all of its child sessions. If the child session specified in the call to DosStopSession has related sessions, the related sessions are also terminated. The parent session can be running in the foreground or the background when it calls DosStopSession. If the child session is running in the foreground when it is terminated, the parent session becomes the foreground session.

DosStopSession can only be called by a parent sesion for a child session. Neither the parent session itself, nor any grandchild, nor any other other descendant session beyond a child session, nor any unrelated session, can be the target of this call."

I hope this helps. One way to look at API programming is the same as Win32 (Win16) programming. Keep coding.

Date: 28 Jul, 2005 on 19:30
Closing window started via DosStartSession with noautoclose
Post a new topic Reply to this Topic Printable Version of this Topic Forward this Topic to your Friend Topic Commands (for administrator or moderators only)
All times are CET+1. < Prev. | P. 1 | Next >
Go to:
 

Powered by UltraBoard 2000 Standard Edition,
Copyright © UltraScripts.com, Inc. 1999-2000.
Home | Gallery | Forums | Services | Webmail | Archive | Links | Contact Us | About Us
© OS2 World.Com 2000-2004