- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to switch from one application to another give...
Operating System - HP-UX
1755839
Members
4464
Online
108838
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2002 10:04 AM
тАО08-20-2002 10:04 AM
How to switch from one application to another given its pid
Given that I have obtained the PID of another process running how can I force that process to come to the foreground
1) an executable, foo, has been launched then locked using fcntl.
2) when a user attempts to launch foo a second time a shared lib (the
one i am working on) checks and see that there is a file lock on foo
and therefore will not allow it to be launched a second time.
when the user launched foo the second time i am trying do the following:
the second foo brings the first foo to the top of current workspace.
the problem is that i can not figure out, using c and motif, how to switch to a process that is already running given its pid or trapping a signal. any help would be great.
thanks
john
1) an executable, foo, has been launched then locked using fcntl.
2) when a user attempts to launch foo a second time a shared lib (the
one i am working on) checks and see that there is a file lock on foo
and therefore will not allow it to be launched a second time.
when the user launched foo the second time i am trying do the following:
the second foo brings the first foo to the top of current workspace.
the problem is that i can not figure out, using c and motif, how to switch to a process that is already running given its pid or trapping a signal. any help would be great.
thanks
john
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2002 10:08 AM
тАО08-20-2002 10:08 AM
Re: How to switch from one application to another given its pid
If you are looking for simple solutions, then use 'bg' and 'fg' commands to switch processes back ground and fore ground with their job IDs:
# man bg
# man fg
# man bg
# man fg
learn unix ..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2002 10:41 AM
тАО08-20-2002 10:41 AM
Re: How to switch from one application to another given its pid
Sajid,
thanks but i don't think this would be an acceptable solution at my work place.
john
thanks but i don't think this would be an acceptable solution at my work place.
john
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2002 11:47 AM
тАО08-20-2002 11:47 AM
Re: How to switch from one application to another given its pid
By "background" and "foreground" you're talking
about window stacking and focus and not the
process state, right? I believe window stacking
and focus are the responsibilities of the window
manager, so you're going to have to figure out
what method your window manager uses.
If you're using CDE, it appears that you can
use the Raise message (see "man Raise")
to raise a window. You'll have to poke around
in the CDE docs to figure out how to use it.
As for signalling a process by PID, it's probably
easiest to just send it a SIGUSR1 or SIGUSR2
using the kill() syscall (not the "kill" command).
Set up a signal handler in your process which
invokes your raise/focus function when the
process receives SIGUSR.
HTH
about window stacking and focus and not the
process state, right? I believe window stacking
and focus are the responsibilities of the window
manager, so you're going to have to figure out
what method your window manager uses.
If you're using CDE, it appears that you can
use the Raise message (see "man Raise")
to raise a window. You'll have to poke around
in the CDE docs to figure out how to use it.
As for signalling a process by PID, it's probably
easiest to just send it a SIGUSR1 or SIGUSR2
using the kill() syscall (not the "kill" command).
Set up a signal handler in your process which
invokes your raise/focus function when the
process receives SIGUSR.
HTH
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP