We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

MDI,create child window when command line execution.

rnxotj
rnxotj asked
on
Medium Priority
251 Views
Last Modified: 2010-04-06
Hi!

I'm making a simple MDI text editor.It based on text editor
sample program in '..\delphi 3\demos\doc'.

How can I create child window when parent window is already
running?
My question is like this.
1.running my 'test.exe sample.txt'
2.at this time my test.exe has one child window about
  sample.txt.
3.at windows explore,I click right mouse button at some txt
  file and send to my test.exe.
4.My test.exe running already and how can I create just
  only a child window? I don't want to execute another
  test.exe.

Sorry about my poor english...
Comment
Watch Question

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
It might be a good idea to add a small 4 character prefix to the name of the Atom. This to prevent doubles.

Author

Commented:
Hi! Jacco.

When UPrevMultiple.pas used?
On create event or on show event at MDI parent Form ?

Would you explain relationship between MDI parent and UPrevMultiple.pas ?

Commented:
Hi rnxotj,

The unit does everything itself.

The initialisation/finalization part of the unit is responsible for it.

The initialisation part is executed when the application starts

It checks if there is a previous instance running. If not it registers a special message. If so it broadcasts this special message to the previous instance. If they is is add a global atom and broadcast a message that the atom is there.

The finalisation part is executed when the application ends

This unregisters the special message.

Try it!

Regards Jacco

Author

Commented:
Thank you,Jacco!
It woks very well.
Have a nice day!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.