Page 1 of 1

How to force Windows 8 to open second instance?

Posted: Fri Sep 05, 2014 2:37 pm
by Kukulkan
Hello,

By default, if a second instance of an already running application is started by typing its name and pressing Enter, Windows 8 just switches to the already running application. For example, if you have one window of Notepad open, running Notepad again from the Start screen by typing its name and pressing Enter switches you back to the Notepad window already open.

For my application, this is very bad behaviour, as the same executable is displaying and composing. So if someone opened a file for displaying, he might want to open a second instance for composing (which happens quite often). But Windows 8 is always only bringing the first instance on top instead of opening a second instance!

Is there a way I can force Windows to open my PureBasic executable each time, even multiple times?

There is a Registry hack that forces Windows 8 to do this in general, but I need it only for my application. I'm not allowed to change the default settings of Windows...

Any idea?

Kukulkan

Re: How to force Windows 8 to open second instance?

Posted: Fri Sep 05, 2014 3:01 pm
by ebs
Kukulkan,

I know for some applications you can do it by pressing Shift + Enter (instead of just Enter).

Regards,
Eric

Re: How to force Windows 8 to open second instance?

Posted: Fri Sep 05, 2014 3:15 pm
by Kukulkan
Hello Eric,

yes, this is what I tell my customers today. But this is annoying and they complain about. Is there a way to force Windows to do this for my application by default? Registry? Manifest?

Or do I get a windows event in the existing instance that allows me to react on this?

Kukulkan

Re: How to force Windows 8 to open second instance?

Posted: Fri Sep 05, 2014 3:54 pm
by ebs
Kukulkan,

The only registry hack I know of is this one (which you probably also know),
but it changes the behavior for all programs, which you said you're not allowed to do:

http://teamwindows8.com/2013/04/launch- ... windows-8/

Re: How to force Windows 8 to open second instance?

Posted: Fri Sep 05, 2014 5:08 pm
by Kukulkan
Eric,

yes, this is the Registry-hack I mentioned in my first post. I'm not allowed to change Windows behaviour just for my application.

I looking for a manifest value, mime-type setting, link parameter etc. to avoid the "one instance" policy for only my application. Or at least an event that I can handle in my application...

Kukulkan

Re: How to force Windows 8 to open second instance?

Posted: Fri Sep 05, 2014 5:12 pm
by Danilo
What about creating a desktop shortcut? And a button/menu within your app to start a new instance.

It is the new behavior of the "Start Menu", and was already the same on Windows 7 for apps docked to the Windows TaskBar.
Shift + Enter or Middle Mouse Button Click to start new instance.

#WM_ACTIVATE with (wParam & $FFFF) = #WA_ACTIVE
returns the old window in lParam. Check if you get a hWnd there,
maybe it sends the hWnd of the start menu screen.

Re: How to force Windows 8 to open second instance?

Posted: Fri Sep 05, 2014 11:27 pm
by PB
> if a second instance of an already running application is started
> by typing its name and pressing Enter, Windows 8 just switches
> to the already running application

Is this for real? Windows 8 no longer multitasks the same app?
What happens if you want to open two Notepads, or two Calcs?

Re: How to force Windows 8 to open second instance?

Posted: Sat Sep 06, 2014 2:01 am
by Danilo
PB wrote:Is this for real? Windows 8 no longer multitasks the same app?
What happens if you want to open two Notepads, or two Calcs?
You open a second instance by pressing Shift + Return if you are typing, or press Middle Mouse Button, is it that hard to understand?
That's only in the start menu and its 'Search' feature. Double click on a .EXE or Shortcut still opens the app twice or more.
I guess you still use 13 years old XP, or even Windows ME or older... :lol:

Re: How to force Windows 8 to open second instance?

Posted: Sat Sep 06, 2014 8:46 am
by PB
> You open a second instance by pressing Shift + Return
> is it that hard to understand?

Yes, very hard to understand if you don't use Windows 8 and
didn't know that's the way it's done now. The original post made
it sound like multitasking was gone. How was I supposed to know
any different if I don't use Windows 8?

> I guess you still use 13 years old XP, or even Windows ME or older

See my sig before LOL at me.

Re: How to force Windows 8 to open second instance?

Posted: Sat Sep 06, 2014 9:42 am
by Danilo
PB wrote:> You open a second instance by pressing Shift + Return
> is it that hard to understand?

Yes, very hard to understand if you don't use Windows 8 and
didn't know that's the way it's done now.
OK, understand. It is the basically the same feature already available with your Win7 Taskbar:
- The Power User's Guide to the Windows 7 Taskbar

Code: Select all

;         Win + number (1-9): Starts the application pinned to the taskbar in that position, or switches to that program.
; Shift + Win + number (1-9): Starts a new instance of the application pinned to the taskbar in that position.
;
;         Click on a taskbar button: Open a program or switch to the already running instance of a program.
; Shift + Click on a taskbar button: Open a program or quickly open another instance of a program.
;
; Middle-Click on a taskbar button: to open a new instance of the application.
The addition in Windows 8 is the search feature in the start menu screen. Just begin to type when the
start screen is opened. Enter on a search result switches to the program if already running or opens a new instance,
and Shift + Enter always opens a new instance, like "Shift+" behavior in Win7 taskbar.

Re: How to force Windows 8 to open second instance?

Posted: Mon Sep 08, 2014 7:40 am
by Kukulkan
Hello all,

thank you for all the tips, but this does not answer my question :-( Yes I know the hack to turn off this behaviour for all programs. As mentioned in my first post, I know this but I can't do this for all applications.

As mentioned in my second post, I also know the SHIFT+Enter and other hotkey/mouse solutions on users view. But my customers simply click the icon without reading any manuals. And they are calling my support if it does not work like expected.

I only complain about the Metro-Style start screen in Windows 8. Interestingly, my customers do not complain about this behaviour from the Win7 Taskbar. It is the Windows 8 screen only (the one with the coloured rectangles).

Therefore, my questions are still the same like in my other posts in this thread:
- Is there a way I can force Windows to open my PureBasic executable each time, even multiple times?
- Is there a way to force Windows to do this for my application by default? Registry? Manifest?
- Or do I get a windows event in the existing instance that allows me to react on this?

Is anyone knowing some solution for this? Thank you for trying to help me!

Best,

Kukulkan

Re: How to force Windows 8 to open second instance?

Posted: Mon Sep 08, 2014 12:36 pm
by p2hicy
I solved this problem some time ago by using a separate launcher for the main program.