Click here to Skip to main content
15,917,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello friends.
my program must be executed immediately after windows's Login screen.for this purpose i changed some registry values and now this program launch on start-up instead of Explorer.exe
in my program users enter their username and password and then login to system. after login, i want to run explorer.exe and taskbar and start menu, appear to user. so i use this code to execute system command:
C#
string cmd = "/C explorer.exe ";
System.Diagnostics.Process.Start("CMD.exe", cmd);


but after execute this command, just My Computer window appear and taskbar and start menu not visible.
I would be grateful if you could answer me how can i see taskbar and start menu after execute explorer.exe command.
Posted
Comments
Thanks7872 17-Jul-13 5:50am    
Which operating system you are using?
hamed1991 17-Jul-13 6:34am    
Windows 7
Richard MacCutchan 17-Jul-13 7:48am    
Why are you starting explorer in a command window, why not just start it direct? Also, explain what happens in your login program after starting this process.

1 solution

Hi,

Check this one

C#
using System.Runtime.InteropServices;


  private void button1_Click(object sender, EventArgs e)
        {
        
            string cmd = "/C explorer.exe ";
            System.Diagnostics.Process.Start("CMD.exe", cmd);
            DisplayStartMenu();
           
        }

        private static void DisplayStartMenu()
        {
            // 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);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900