|
It seems the easiest way to do this is to make the shell think file associations have changed. When it does, it redraws the desktop. Not sure how 'expensive' this is - but it works.
SHChangeNotify(SHCNE_ASSOCCHANGED, 0, 0, 0);
[DllImport("shell32.dll")]
static extern void SHChangeNotify(uint wEventId, uint uFlags, uint dwItem1, uint dwItem2);
const uint SHCNE_ASSOCCHANGED = 0x08000000;
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Invalid_Win32_app. wrote: I am trying to refresh the machine
What exactly do you mean by "refresh the machine"? Do you mean reboot?
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
molesworth wrote: What exactly do you mean by "refresh the machine"? Do you mean reboot?
Not Reboot, I am just trying to refresh the PC, like we do by right-clicking on an empty space on the desktop and clicking on the Refresh option from the menu display. Thats what I want to do.
|
|
|
|
|
Your request is totally dumb! refresh the system doesn't mean anything.
Refresh your desktop doesn't mean to refresh your system...
Try to be more explicit Rajdeep
|
|
|
|
|
I think this should do:
private void button1_Click(object sender, EventArgs e)
{
SendKeys.Send("{F5}");
}
What do you say?
PS: How did you know that I am Rajdeep?
|
|
|
|
|
Invalid_Win32_app. wrote: PS: How did you know that I am Rajdeep?
You can see the last 200 messages somebody has posted.
My current favourite word is: Delicious!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Your level of stupidity is unique.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Hey Rajdeep.NET, did you think that we wouldn't notice if you changed your name?
You're still asking strange questions.
Now I don't really know about this refresh thing, this is not normally something you even need to consider doing. Why do you even need to do this?
Anyway, I'd look into sending a F5 keypress, like you suggested..
|
|
|
|
|
Ok Ok!!! Chill now, I haven't asked any strange question this time.
|
|
|
|
|
y do u frequently change you name.... do you think that we are fools here...
Padmanabhan
|
|
|
|
|
Invalid_Win32_app. wrote: Ok Ok!!! Chill now, I haven't asked any strange question this time.
This question is very strange, to refresh your system, you need to reboot your PC (after changing registery keys...). How does windows refreshing itself after an update? It just reboot..
To press F5 on tour desktop only refresh the 'explorer.exe' program, but not your system who's loaded on startup. To press F5 on your application will do anything not even refresh your 'explorer' application.
Try to discover the basics of windows before trying to hack it...
|
|
|
|
|
now that guy has changed his name to x+y=xy?!
some one has to take care of his activities....
Padmanabhan
|
|
|
|
|
Not all are fools, rather than you!
|
|
|
|
|
sit and recollect all your posts and the replies then you will know who is a fool....MR.XYZ
Padmanabhan
|
|
|
|
|
Hello Friends
How to get list of files and folders from web server using http protocol?
|
|
|
|
|
|
Hi dear friends,
Please check out this code for editing the registry, I have tried this and it works fine:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Microsoft.Win32;
namespace Editing_the_Registry
{
class Program
{
static void Main(string[] args)
{
Microsoft.Win32.RegistryKey key;
key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Rajdeep");
key.SetValue("MyString", "CreatedbyRajdeep");
key.Close();
}
}
}
This piece of code just creates a Subkey called 'Rajdeep' in the HKEY_Current_User Key, and then creates a String value called 'MyString' within the SubKey 'Rajdeep' and sets the value data as 'CreatedbyRajdeep'.
But my issue is different. I want to change the value data of 'HKEY_CURRENT_USER\Control Panel\Desktop\MenuShowDelay\' to '200' from default '400'. It will speed up the Menu display from 400 milliseconds to 200 milliseconds, thus making the PC faster.
Your help will be truly appreciated,
Raj
PS: I am using Virtual PC, since MSDN suggests so.
|
|
|
|
|
Rajdeep.NET wrote: It will speed up the Menu display from 400 milliseconds to 200 milliseconds, thus making the PC faster.
Correction: Thus making the animation of the menu faster.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
Yes Colin you are right! My english is poor..... sorry for that.
|
|
|
|
|
Rajdeep.NET wrote: My english is poor
The statement was syntactically correct. There was nothing wrong with your English. The statement was inaccurate.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
For the love of God stop this you Doofus! I have never looked at these classes, but 0.003 secondds of intelisense gave me:
key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Is/this/difficult");
key.SetValue("OnlyWhenCalled", "Rajdeep");
Work the rest out yourself.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
You simply have to open the key as writeable and then set the value you want to use.
In your case it would be like this:
RegistryKey key = Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop", true);
key.SetValue("MenuShowDelay", 200, RegistryValueKind.String);
key.Close();
But I agree with the poster above: this would've been very easy to find out on your own..
modified on Thursday, May 28, 2009 3:53 AM
|
|
|
|
|
Thanks, this worked.
Previously I was doing this:
RegistryKey key = Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop");
But, I go exception like "UnauthorizedAccess...."
The true statement changed everything, its great. Thanks once again Calla.
|
|
|
|
|
You have to stop. Changing your name won't do anything, people are still clearly able to see who you are by checking your history, or simply catching the idiocy in your posts.
GO
READ
A
BOOK.
|
|
|
|
|
Changing you name from Rajdeep.NET to x+y=xy?! is not going to help. You will still be an idiot
Changing your brain for one that works, now that would help.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|