How to force Windows 8 to open second instance?

Everything else that doesn't fall into one of the other PB categories.
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

How to force Windows 8 to open second instance?

Post 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
ebs
Enthusiast
Enthusiast
Posts: 557
Joined: Fri Apr 25, 2003 11:08 pm

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

Post by ebs »

Kukulkan,

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

Regards,
Eric
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

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

Post 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
ebs
Enthusiast
Enthusiast
Posts: 557
Joined: Fri Apr 25, 2003 11:08 pm

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

Post 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/
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

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

Post 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
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

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

Post 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.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

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

Post 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?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

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

Post 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:
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

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

Post 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.
Last edited by PB on Sat Sep 06, 2014 9:42 am, edited 1 time in total.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

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

Post 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.
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

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

Post 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
User avatar
p2hicy
User
User
Posts: 11
Joined: Fri Apr 25, 2003 5:31 pm
Location: Iceland
Contact:

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

Post by p2hicy »

I solved this problem some time ago by using a separate launcher for the main program.
Post Reply