MSFN Forum: And cmd or API call to get the Modern UI to appear? - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

And cmd or API call to get the Modern UI to appear?

#1 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,670
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 04 October 2012 - 02:21 PM

I've been working on porting my app installer program to work on Windows 8. I'm just about done but there is left one little issue which is mainly cosmetic. In previous version of Windows, I run a program at first boot by putting it in here:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce


Windows 8 is different because it isn't supposed to boot to the Desktop, but instead show the ModernUI/Start Screen instead. It seems that if you put a program in that registry key, Windows will "sort-of" boot to the desktop. My program puts up a messagebox on the screen saying that it is done working and clicking OK will exit the program. But the screen is black with a blue (unpopulated) taskbar on the screen. I can get back to the Start Screen by pressing the Windows key, but I would rather be able to send some sort of command that puts that back up instead.

So is there any other way to open/close the Start Screen without sending keypresses?

EDIT: it appears that registry key is not erased at boot like in Windows 7 and earlier OSes.

This post has been edited by Tripredacus: 05 October 2012 - 10:55 AM



#2 User is offline   Tihiy 

  • the creator
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,608
  • Joined: 19-November 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 05 October 2012 - 09:50 AM

View PostTripredacus, on 04 October 2012 - 02:21 PM, said:

So is there any other way to open/close the Start Screen without sending keypresses?
Call programmatically PostMessage(HWND_BROADCAST,RegisterWindowMessage("SHELLHOOK"),HSHELL_TASKMAN,GetDesktopWindow()); after closing your messagebox. That won't work however if other windows are open on desktop.

Quote

EDIT: it appears that registry key is not erased at boot like in Windows 7 and earlier OSes.
It is for me.

#3 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,670
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 05 October 2012 - 10:57 AM

View PostTihiy, on 05 October 2012 - 09:50 AM, said:

View PostTripredacus, on 04 October 2012 - 02:21 PM, said:

So is there any other way to open/close the Start Screen without sending keypresses?
Call programmatically PostMessage(HWND_BROADCAST,RegisterWindowMessage("SHELLHOOK"),HSHELL_TASKMAN,GetDesktopWindow()); after closing your messagebox. That won't work however if other windows are open on desktop.

Quote

EDIT: it appears that registry key is not erased at boot like in Windows 7 and earlier OSes.
It is for me.


Thanks, I'll try that. I could even just not show the messagebox I guess.

You are right about the reg key, I found the issue....

#4 User is offline   Stoic Joker 

  • I Hate Titles
  • PipPip
  • Group: Members
  • Posts: 280
  • Joined: 16-August 05
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 05 October 2012 - 11:02 AM

Why not just send a WM_KEYDOWN message specifying the Win key to the shell?

#5 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,670
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 05 October 2012 - 11:35 AM

View PostStoic Joker, on 05 October 2012 - 11:02 AM, said:

Why not just send a WM_KEYDOWN message specifying the Win key to the shell?


I'm going to try that too, but with some OS detection since all my apps are designed to run on multiple OSes. We'll see which is the easiest to handle.

Hmmm does even sending the Windows key cause a problem if another application is open? In my case there is.... sysprep.exe. Does the problem sending the key occur because that program is in focus?

This post has been edited by Tripredacus: 05 October 2012 - 11:51 AM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy