Click here to Skip to main content
15,890,690 members
Home / Discussions / C#
   

C#

 
AnswerRe: Show a console window for 10sec in C# console application Pin
Mbah Dhaim20-Mar-09 11:14
Mbah Dhaim20-Mar-09 11:14 
GeneralRe: Show a console window for 10sec in C# console application Pin
abbd20-Mar-09 11:49
abbd20-Mar-09 11:49 
GeneralRe: Show a console window for 10sec in C# console application Pin
Mbah Dhaim20-Mar-09 12:55
Mbah Dhaim20-Mar-09 12:55 
AnswerRe: Show a console window for 10sec in C# console application Pin
Ravadre20-Mar-09 16:40
Ravadre20-Mar-09 16:40 
QuestionVerify if a processes exist Pin
abbd20-Mar-09 9:59
abbd20-Mar-09 9:59 
QuestionHow do I cast a LPARAM? Pin
bbranded20-Mar-09 8:41
bbranded20-Mar-09 8:41 
QuestionRe: How do I cast a LPARAM? Pin
led mike20-Mar-09 8:53
led mike20-Mar-09 8:53 
AnswerRe: How do I cast a LPARAM? [modified] Pin
bbranded20-Mar-09 8:56
bbranded20-Mar-09 8:56 
1) Since I posted in the c# forum, assume I'm using C#
2) I'm not sure I'm using the right terminology by using the word "cast." I tried it, it's not working.
3) Great.

I'm trying to refresh the desktop icon cache and found this page[^] (see "Flushing Cache Entries").

This is[^] what I'm working on doing at this moment. I have hopes it will work.

[FYI: this[^] works fine]


private static extern long SendMessageTimeout(
	int hWnd,
	int Msg,
	int wParam,
	string lParam,
	int fuFlags,
	int uTimeout,
	out int lpdwResult
);


RegistryKey k = Registry.CurrentUser.OpenSubKey("Control Panel").OpenSubKey("Desktop").OpenSubKey("WindowMetrics", true);
k.SetValue("Shell Icon Size", "33");
k.Flush(); k.Close();

int res = 0;
SendMessageTimeout(0xffff, 0x001A, 0, "", 0x0002, 5000, out res);

k = Registry.CurrentUser.OpenSubKey("Control Panel").OpenSubKey("Desktop").OpenSubKey("WindowMetrics", true);
k.SetValue("Shell Icon Size", "32");
k.Flush(); k.Close();

SendMessageTimeout(0xffff, 0x001A, 0, "", 0x0002, 5000, out res);


I believe the common misconception with this strategy of icon cache clearing is that all of the icons move to the left side, to their "default" position (as if you click on the "align icons by name" verb in the progman context menu, etc). However, it is notable that this is only the case when (like TweakUI) you originally resize the icons to a very low number (let's say 4), causing their "foot print" to be very small (but in the same "positions" as you were before (like zooming out on a picture), before calling WM_SETTINGCHANGE. Therefore, when you resize them again (let's say to 32), then call WM_SETTINGCHANGE; all of your icons will assume this size and "force each other out of the way," and they will now appear to be aligned on the left side of the screen.

That's why it's suggested in both the Microsoft KB, and in various other sources, to resize the icon size value one lesser than or one greater than you current size.

Hope that's clear. Laugh | :laugh:

modified on Friday, March 20, 2009 6:33 PM

GeneralRe: How do I cast a LPARAM? Pin
Dan Neely20-Mar-09 9:24
Dan Neely20-Mar-09 9:24 
GeneralRe: How do I cast a LPARAM? Pin
led mike20-Mar-09 11:04
led mike20-Mar-09 11:04 
AnswerRe: How do I cast a LPARAM? Pin
Eslam Afifi20-Mar-09 8:59
Eslam Afifi20-Mar-09 8:59 
QuestionIntegrate MS Project into .net Application Pin
kcadella20-Mar-09 7:12
kcadella20-Mar-09 7:12 
AnswerRe: Integrate MS Project into .net Application Pin
led mike20-Mar-09 8:48
led mike20-Mar-09 8:48 
GeneralRe: Integrate MS Project into .net Application Pin
kcadella20-Mar-09 10:12
kcadella20-Mar-09 10:12 
GeneralRe: Integrate MS Project into .net Application Pin
kcadella23-Mar-09 14:57
kcadella23-Mar-09 14:57 
QuestionSound Recording in C# Pin
Emre Gürbüz20-Mar-09 5:41
Emre Gürbüz20-Mar-09 5:41 
AnswerRe: Sound Recording in C# Pin
led mike20-Mar-09 8:45
led mike20-Mar-09 8:45 
GeneralRe: Sound Recording in C# Pin
Emre Gürbüz20-Mar-09 8:55
Emre Gürbüz20-Mar-09 8:55 
GeneralRe: Sound Recording in C# Pin
Dan Neely20-Mar-09 9:28
Dan Neely20-Mar-09 9:28 
GeneralRe: Sound Recording in C# Pin
led mike20-Mar-09 10:53
led mike20-Mar-09 10:53 
GeneralRe: Sound Recording in C# Pin
led mike20-Mar-09 10:52
led mike20-Mar-09 10:52 
AnswerRe: Sound Recording in C# Pin
Ravadre20-Mar-09 8:48
Ravadre20-Mar-09 8:48 
QuestionAttachng Database Pin
Paresh Soni20-Mar-09 4:05
Paresh Soni20-Mar-09 4:05 
AnswerRe: Attachng Database Pin
Yusuf20-Mar-09 4:42
Yusuf20-Mar-09 4:42 
AnswerRe: Attachng Database Pin
Colin Angus Mackay20-Mar-09 5:13
Colin Angus Mackay20-Mar-09 5:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.