Windows 8 Start Menu Modifier


Recommended Posts

Hello everyone, I thought I'd play around with some C# in Windows 8 and came up with the idea for an app. With this you can choose which screen the start menu should appear and allows you to dock it in top or bottom configuration non-full screen on any monitor. You can toggle between full screen and docked states with the press of a button and force your start menu to appear on a certain screen if you wish (moving a metro app to another screen will push the start menu to that screen as well but using the hotkey will force it back to the screen of choice).

Also if anyone knows how to simulate the keystroke or bring up the start menu via code let me know. I tried this using a keyboard event but it didn't bring up the start menu and did the ^{ESC} send keys trick but it doesn't seen to work in Windows 8. Would be cool to allow the hot key to bring up the start menu as well.

Screenshots are attached to the post.

Download: http://www.diablocra...MModifier1b.zip

post-250262-0-56066300-1347140129_thumb.

post-250262-0-80012700-1347140147_thumb.

post-250262-0-89085400-1347140386.jpg

Link to comment
https://www.neowin.net/forum/topic/1104241-windows-8-start-menu-modifier/
Share on other sites


private static void ShowStartMenu()
{
// key down event:
const byte keyControl = 0x11;
const byte keyEscape = 0x1B;
keybd_event(keyControl, 0, 0, UIntPtr.Zero);
keybd_event(keyEscape, 0, 0, UIntPtr.Zero);
// key up event:
const uint KEYEVENTF_KEYUP = 0x02;
keybd_event(keyControl, 0, KEYEVENTF_KEYUP, UIntPtr.Zero);
keybd_event(keyEscape, 0, KEYEVENTF_KEYUP, UIntPtr.Zero);
}
[DllImport("user32.dll")]
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags,
UIntPtr dwExtraInfo);
[/CODE]

Also, awesome idea. I really want to know how it works. Would you mind posting some snippets or source?

  On 08/09/2012 at 21:57, devHead said:

Wow. Now this looks pretty cool. So, the Start menu slides down after clicking an app shortcut or moving away from it?

Yeah, if you click off the start screen it goes away just like if you were launching an app from the start menu. You can also toggle it and see it resize for a second when the start menu is up (so it'd be possible to do an animation/fade on the window if someone wanted to code it in, though not sure how it'd actually work in practice).

  On 08/09/2012 at 22:05, phailyoor said:

		private static void ShowStartMenu()
		{
			// key down event:
			const byte keyControl = 0x11;
			const byte keyEscape = 0x1B;
			keybd_event(keyControl, 0, 0, UIntPtr.Zero);
			keybd_event(keyEscape, 0, 0, UIntPtr.Zero);
			// key up event:
			const uint KEYEVENTF_KEYUP = 0x02;
			keybd_event(keyControl, 0, KEYEVENTF_KEYUP, UIntPtr.Zero);
			keybd_event(keyEscape, 0, KEYEVENTF_KEYUP, UIntPtr.Zero);
		}
		[DllImport("user32.dll")]
		static extern void keybd_event(byte bVk, byte bScan, uint dwFlags,
		   UIntPtr dwExtraInfo);
[/CODE]

Also, awesome idea.  I really want to know how it works.  Would you mind posting some snippets or source?

Thanks, I used Spy++ to get the window handle of the start menu (had it right next to it on second monitor then toggled it and dragged really fast). From there I just played with some windows APIs to see what types of things I could do with the start menu and this is what I came up with.
I'll also try that code soon and see if I can get it implemented so people can bring up the start menu simultaneously if they are using this.
As for some of the code it's pretty simple (could probably leave flags null) -
[code]
UInt32 flags = SWP_SHOWWINDOW;
IntPtr hwnd = FindWindow("ImmersiveLauncher", null);
SetWindowPos(hwnd, HWND_TOP, x, y, width, height, flags);

Imports:

[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SetWindowPos(IntPtr hWnd,
  IntPtr hWndInsertAfter,
  int x,
  int y,
  int cx,
  int cy,
  UInt32 uFlags);

[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

I tried getting the class name/handle of the search bar too and got "DirectUIHWND" but can't seem to adjust or resize that just yet. The search bar will appear on the last window a metro-style app was launched. Also if you're interested the class name for the metro band (the divider between a metro app/desktop) is called "ImmersiveGutter" with "Application Arrangement Bar" as the window title. Just by having the class names/handles to these windows you can do quite a bit of manipulation. Most of the code involved in this app is taskbar positioning/screen size calculations and settings-related stuff.

  On 08/09/2012 at 23:13, phailyoor said:

That's pretty cool. I tried to do the same, but I guess I'm just not fast enough with spy++ to do it all....can you also use this to reposition metro apps?

The API is capable so it's just a matter of doing more research to see if the metro apps have classes/titles/parent windows/or other attributes that distinguish them from the rest and retrieving the handles to send the proper API calls to. I'll see what I can find but if anyone else can find out more information that'd be great too :)

Update: I also found the "ImmersiveBackgroundWindow" class with the caption "Immersive Background" which is the solid background used when snapping metro windows to the side and there is nothing in the main container. I couldn't find a lot on the metro apps yet but did notice they all have the "EdgeUiInputWndClass" class at the top point of the screen (which should be responsible for the touch gestures/closing the app). It should be possible to detect using FindWindow if that class exists and to then find the main handle to the window below it though I haven't tested this yet.

Oops

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.IO.FileNotFoundException: Could not find file 'E:\My Downloads\sm.ico'.

File name: 'E:\My Downloads\sm.ico'

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)

at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)

at System.Drawing.Icon..ctor(String fileName, Int32 width, Int32 height)

at System.Drawing.Icon..ctor(String fileName)

at SMModifier.frmSMModifier.createTaskTray()

at SMModifier.frmSMModifier.frmMain_Load(Object sender, EventArgs e)

at System.Windows.Forms.Form.OnLoad(EventArgs e)

at System.Windows.Forms.Form.OnCreateControl()

at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

at System.Windows.Forms.Control.CreateControl()

at System.Windows.Forms.Control.WmShowWindow(Message& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

at System.Windows.Forms.ContainerControl.WndProc(Message& m)

at System.Windows.Forms.Form.WmShowWindow(Message& m)

at System.Windows.Forms.Form.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************

mscorlib

Assembly Version: 4.0.0.0

Win32 Version: 4.0.30319.17929 built by: FX45RTMREL

CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

----------------------------------------

StartMenuModifier

Assembly Version: 1.0.0.0

Win32 Version: 1.0.0.0

CodeBase: file:///E:/My%20Downloads/StartMenuModifier.exe

----------------------------------------

System.Windows.Forms

Assembly Version: 4.0.0.0

Win32 Version: 4.0.30319.17929 built by: FX45RTMREL

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

----------------------------------------

System.Drawing

Assembly Version: 4.0.0.0

Win32 Version: 4.0.30319.17929 built by: FX45RTMREL

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

----------------------------------------

System

Assembly Version: 4.0.0.0

Win32 Version: 4.0.30319.17929 built by: FX45RTMREL

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

----------------------------------------

************** JIT Debugging **************

To enable just-in-time (JIT) debugging, the .config file for this

application or computer (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.

For example:

<configuration>

<system.windows.forms jitDebugging="true" />

</configuration>

When JIT debugging is enabled, any unhandled exception

will be sent to the JIT debugger registered on the computer

rather than be handled by this dialog box.

  On 09/09/2012 at 13:08, SuperKid said:

I love how all the apps I am seeing right now for Windows 8 are Start menu apps.

But what is there to add (as a 3rd party dev)? There wasn't any 'revolutionary' application that has popped up for a while now, even for Win7, at least not that I remember of.

  On 09/09/2012 at 13:08, SuperKid said:

I love how all the apps I am seeing right now for Windows 8 are Start menu apps.

All of the other good apps for windows 8 also work in windows 7 and usually vista.

  On 08/09/2012 at 22:05, phailyoor said:


private static void ShowStartMenu()
{
// key down event:
const byte keyControl = 0x11;
const byte keyEscape = 0x1B;
keybd_event(keyControl, 0, 0, UIntPtr.Zero);
keybd_event(keyEscape, 0, 0, UIntPtr.Zero);
// key up event:
const uint KEYEVENTF_KEYUP = 0x02;
keybd_event(keyControl, 0, KEYEVENTF_KEYUP, UIntPtr.Zero);
keybd_event(keyEscape, 0, KEYEVENTF_KEYUP, UIntPtr.Zero);
}
[DllImport("user32.dll")]
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags,
UIntPtr dwExtraInfo);
[/CODE]

Also, awesome idea. I really want to know how it works. Would you mind posting some snippets or source?

I tried this code and it doesn't work with Windows 8 -- doesn't bring up the start menu at all. I also tried using 0x5B for the left windows key button using keybd_event and it didn't work either. Are there any other hot keys that bring up the start menu?

Also progress-wise I'll have an updated version with some bug fixes soon.

Won't let me update my original post but here's the updated version for anyone who's interested - http://www.diablocra...MModifier1d.zip

Bug fixes/changes include:

* Single display configurations are now supported (crashed prior due to combo box not being loaded properly)

* Single .exe (no external icon needed)

* "ImmersiveBackgroundWindow" background now positioned off screen on toggle.

* Added support for launching start menu on toggle.

  On 09/09/2012 at 17:37, KDapp said:

That is just strange. I tested the keybd event I sent you as well as the one above and both worked for me.

I'll try it in a separate project and give it a go. Maybe there's something I'm missing in my code that is conflicting with it.

Edit: Yep it worked. I'll take a look at my code now should be able to add this in.

Edit #2: Figured it out -- pressing the hot key then invoking another hot key simultaneously was causing the conflict so I set a 60ms delay before invoking it. Updated version to 1d.

Edited by svnO.o

Version 1e is now available: http://www.diablocrafts.com/uploads/SMModifier1e.zip

Updates include -

* Trimmed down dock size from 360px to 325px

* Added auto-dock option which will dock to primary screen's taskbar (thanks to KDapp for the suggestion)

Oh god PLEASE let us choose a custom height!

I have been dreaming of allowing my taskbar to appear WHILE the windows 8 start menu is up - using your app will let me do this!

Please allow custom startmenu height! That way I can select to have a height of say - 1000px and the start menu (OR MY DOCK) will still show up in a full start screen - YES!

Please! :woot:

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I commented on ONE thing, the rest is just an explanation for the unintroduced. The distinction between Skype and SfB was not cloud vs on-prem, period. That's all I refuted.
    • "that supports both AMD and Intel" Why even say such a thing? That's like saying an HDMI cable that supports both LG and Dell displays or something.
    • since when was a xx50 series GPU "good" this is another one of those "duh" what did you expect, kinda reviews.
    • Giga Computing launches liquid- and air‑cooled AI servers built on NVIDIA HGX B200 platform by Fiza Ali Giga Computing has today expanded its enterprise‑grade GPU server portfolio with four new systems built upon NVIDIA’s HGX B200 platform. These servers combine advanced cooling options with support for Intel’s latest AI‑optimised Xeon 6 processors. According to NVIDIA, HGX B200, powered by the company's Blackwell architecture, delivers up to 15 times faster real‑time inference, where the trained AI model makes predictions or decisions based on new data, on trillion‑parameter models compared to the previous generations. The 4U GIGABYTE G4L3 Series features separate CPU and GPU chambers and employs an advanced direct liquid‑cooling (DLC) system. According to the tech giant, this approach not only sustains peak performance during demanding AI training and inference tasks but it also drives down both power consumption and data‑centre cooling costs. The two variants which are currently available are the G4L3‑SD1‑LAX5, which supports the latest Intel Xeon processors, and the G4L3‑ZD1‑LAX5, which supports AMD EPYC CPUs. On the other hand, the GIGABYTE G894 Series uses optimised airflow and works with a variety of x86 platforms and baseboard GPU setups, including NVIDIA’s HGX B200. It comes in two models: the G894‑AD1‑AAX5, which supports Intel Xeon 6900‑Series processors such as the 6962P, and the G894‑SD1‑AAX5, which supports Intel Xeon 6700‑ and 6500‑Series processors, including the 6776P. GIGAPOD, Giga Computing’s AI supercomputing solution, has also been updated to include the new NVIDIA HGX B200 platforms. Built for the rigours of training large language models and generative AI, it promises improved throughput, higher energy efficiency, and a range of cooling options to accommodate advancing AI demands. With the addition of these HGX B200-powered systems to its lineup, Giga Computing is expanding its server offerings to better support demanding AI workloads. The focus on efficient cooling, compute density, and compatibility with the latest processors positions these new models as options for enterprises scaling up AI infrastructure.
    • OpenHashTab 3.1.1 by Razvan Serea OpenHashTab is a convenient shell extension that allows users to easily calculate and verify file hashes using file properties. It offers support for 28 different algorithms, ensuring compatibility with a wide range of hash types. With its high-performance hash calculation capabilities, OpenHashTab delivers efficient results. The extension seamlessly integrates with the Windows operating system, providing a native look and feel. It also offers support for high DPI screens and long paths. Additional features include multilingual support, the ability to check hashes against VirusTotal, hash checking against checksum files, hash export to file or clipboard, and optional context menu options for faster access. OpenHashTab supports file associations and can be used in standalone mode. OpenHashTab is compatible with Windows 7 or newer versions, supporting x86, x64, and ARM64 architectures. Usage Most of the actions should be obvious. Some not-so-obvious features are listed here: You can select multiple files or folders, all files will be hashed, directories traversed Double click hash to copy it Double click name or algorithm to copy the line in sumfile format Right click for popup menu: copy hash, copy filename, copy line, copy everything The counters next to the status text is in the format (match/mismatch/nothing to check against/error) Columns sort lexicographically, except the hash column which sorts by match type Selecting the tab on a sumfile will interpret it as such and hash the files listed in it. If a hashed file has a sumfile with same filename plus one of the recognized sumfile extensions and the option for it is enabled, the file hash is checked against it. Algorithms CRC32, CRC64 (xz) xxHash (XXH32, XXH64) xxHash3 (64 and 128 bit variants) MD4, MD5 RipeMD160 Blake2sp SHA-1 SHA-2 (SHA-224, SHA-256, SHA-384, SHA-512) SHA-3 (SHA3-224, SHA3-256, SHA3-384, SHA3-512) BLAKE3 (256 bit, 512 bit) KangarooTwelve (264 bit, 256 bit, 512 bit) ParallelHash128 (264 bit) and ParallelHash256 (528 bit) Streebog (GOST R 34.11-12) (256 bit, 512 bit) OpenHashTab 3.1.1 changelog: This release fixes a build problem with 3.1.0 causing StandaloneStub to be unable to start. Reduce the size of AlgorithmsDll Move installer to WiX, overall register components better Build x86 so that 32-bit explorer replacements can also have the extension Reintroduce x86 version since we're building it anyway Translation updates Download: OpenHashTab 64-bit | OpenHashTab 32-bit | ~8.0 MB (Open Source) Download: OpenHashTab ARM64 | 8.3 MB View: OpenHashTab Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • Week One Done
      956400 earned a badge
      Week One Done
    • First Post
      loose_observer earned a badge
      First Post
    • Week One Done
      BeeJay_Balu earned a badge
      Week One Done
    • Week One Done
      filminutz earned a badge
      Week One Done
    • Reacting Well
      SteveJaye earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      446
    2. 2
      ATLien_0
      157
    3. 3
      +FloatingFatMan
      148
    4. 4
      Nick H.
      65
    5. 5
      +thexfile
      62
  • Tell a friend

    Love Neowin? Tell a friend!