-
August 2nd, 2006, 02:34 AM
#1
Change Windows Display Settings
Hi,
I want to uncheck the following option programatically.
Desktop->Properties->Appearance->Effects->Hide Underlined Letters for keyboard novigation until i press the Alt key.
is there any api available to change the same.Please help me out in this.Thanks in advance.
Vinoth
-
August 3rd, 2006, 03:56 AM
#2
Re: Change Windows Display Settings
Originally Posted by nvinoth123
Hi,
I want to uncheck the following option programatically.
Desktop->Properties->Appearance->Effects->Hide Underlined Letters for keyboard novigation until i press the Alt key.
Have you checked allAPi net ? If not here is the link
http://www.allapi.net/agnet/apiviewer.shtml
Also maybe at VBAccelerator is maybe something of interest
http://www.vbaccelerator.com/home/index.asp
Good luck
Jonny Poet
To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
If anyone felt he has got help, show it in rating the post.
Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
My latest articles :
Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7
-
August 3rd, 2006, 07:29 AM
#3
Re: Change Windows Display Settings
thanks jonny
i've tried those sites, there is no such in them, can u further help me out in this.
thanks in advance
vinoth
-
August 3rd, 2006, 08:19 AM
#4
Re: Change Windows Display Settings
Hello Vinoth
You can use the SystemParametersInfo API alongwith the SPI_GETMENUUNDERLINES and SPI_SETMENUUNDERLINES Constants.
You can declare it like so :
Code:
Private Declare Function SystemParametersInfo Lib "user32" Alias _
"SystemParametersInfoA" (ByVal uAction As Long, _
ByVal uParam As Long, ByRef lpvParam As Any, _
ByVal fuWinIni As Long) As Long
Private Const SPI_GETMENUUNDERLINES = &H100A
Private Const SPI_SETMENUUNDERLINES = &H100B
Private Const SPIF_SENDWININICHANGE = &H2
Private Const SPIF_UPDATEINIFILE = &H1
I am attaching a project with with which you can play with!
Just note, that you might see the change immediately, but as soon as you open another window, you should see the effect, at least it is what it does with me.
Last edited by HanneSThEGreaT; December 19th, 2008 at 03:09 AM.
-
August 3rd, 2006, 10:29 AM
#5
Re: Change Windows Display Settings
thanks hannes,
it worked for me, i'm trying to do it in c# and it really worked. thanks again.
vinoth
-
August 3rd, 2006, 10:51 AM
#6
Re: Change Windows Display Settings
You're welcome Vinoth!
The SystemParametersInfo API is extremely powerful, if not the most. You can change wallpaper, even disable system keys
Enjoy!
-
August 4th, 2006, 03:30 AM
#7
Re: Change Windows Display Settings
hi hannes,
I got it, thanks, with ur sample i'm able to uncheck the option, but i'm not able to find the code to check the option. can u please help me out in this. this is bit urgent.thanks in advance.
Vinoth
-
August 4th, 2006, 03:52 AM
#8
Re: Change Windows Display Settings
Hello again Vinoth!
Here's a much more simpler example for you!
Set - will set the Underlines
Unset - Will remove the underlines
Enjoy!!
Last edited by HanneSThEGreaT; December 19th, 2008 at 03:09 AM.
-
August 4th, 2006, 04:42 AM
#9
Re: Change Windows Display Settings
thanks,
but the example that u gave recently is the same one that u gave earlier.i'm able to unchech it, i just wanted to know how to check the same.i'll provide what i have done(its a c# coding). i know some constant/flag should be changed, but i dont know waht that is. pls help me out in this.
public static extern int SystemParametersInfo(int uAction, int uParam, ref int lpvParam, int fuWinIni);
private const string SPI_GETMENUUNDERLINES = "100A" ;
private const string SPI_SETMENUUNDERLINES = "100B";
private const string SPIF_SENDWININICHANGE = "2";
private const string SPIF_UPDATEINIFILE = "1";
//API Call
SystemParametersInfo((int)Convert.ToUInt32(SPI_SETMENUUNDERLINES, 16), 0, ref iOutputVal, (int)Convert.ToUInt32(SPIF_SENDWININICHANGE, 16));
u pls tell me the change in Vb, i'll convert it to c#
thanks in advance
-
August 4th, 2006, 05:42 AM
#10
Re: Change Windows Display Settings
Hello again Vinoth! It seems as if my 2 versions I worked out for you gout mixed up, sorry about that.
Here is the new one.
It is much more simpler than the first one!
Enjoy!
Last edited by HanneSThEGreaT; December 19th, 2008 at 03:09 AM.
-
August 4th, 2006, 07:41 AM
#11
Re: Change Windows Display Settings
thanks hanees,
but its not working in c#, i dont have vb installed in my mac, i'm trying to convert as such in c#, its working for unchecking but its not checking that option.i'm working on that.thanks a lot.
-
August 4th, 2006, 08:01 AM
#12
Re: Change Windows Display Settings
Originally Posted by nvinoth123
thanks hanees,
but its not working in c#, i dont have vb installed in my mac, i'm trying to convert as such in c#, its working for unchecking but its not checking that option.i'm working on that.thanks a lot.
Hello again Vinoth!
I'm not a C# expert. I'm also definitely not a VB expert. But at a guess, you have implemented something wrongly. It does work in VB. Maybe, hopefully a C# expert can answer it.
Last edited by HanneSThEGreaT; August 4th, 2006 at 08:05 AM.
-
August 4th, 2006, 08:23 AM
#13
Re: Change Windows Display Settings
This isn't really a Visual Basic issue if you're trying to make a Windows API call in C#, but that isn't to say we can't try to help. This is C# code from VS2005:
Code:
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern int SystemParametersInfo(int uAction, int uParam, int lpvParam, int fuWinIni);
private const int SPI_GETMENUUNDERLINES = 4106; //100A
private const int SPI_SETMENUUNDERLINES = 4107; //100B
private const int SPIF_SENDWININICHANGE = 2;
private const int SPIF_UPDATEINIFILE = 1;
private void setCheckState(bool setCheck)
{
if (setCheck) {
// This sets it so the accelerator keys (underlines under the letter) always appear
SystemParametersInfo(SPI_SETMENUUNDERLINES, 0, 1, SPIF_SENDWININICHANGE);
}
else {
// This sets it so the accelerator keys (underlines under the letter) only appear when Alt is pressed
SystemParametersInfo(SPI_SETMENUUNDERLINES, 0, 0, SPIF_SENDWININICHANGE);
}
}
The key thing is that in VB, the SPI consts are actually numbers, they're just written as Hex (the &H before denotes that in Visual Basic). So you only need to convert those consts to actual numeric values (and you can just use Calc to do that) and use those instead.
-
August 4th, 2006, 08:25 AM
#14
Re: Change Windows Display Settings
Originally Posted by HanneSThEGreaT
Hello again Vinoth! It seems as if my 2 versions I worked out for you gout mixed up, sorry about that.
I have just tested your version you had given it worked nice
the code which changes the underline in Hannes Applcation is
Code:
Call SystemParametersInfo(SPI_SETMENUUNDERLINES, 0, _
ByVal lngMenuUnderlines, SPIF_SENDWININICHANGE Or _
lngUpdateINIFile)
where lngMenuUnderlines is 0 or 1 depending if you are on or off.
As much as I have read this code.
BTW as you are doing C# why you didn't ask there we have a special forum for that I think. So you would not need to tranlate code
Jonny Poet
To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
If anyone felt he has got help, show it in rating the post.
Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
My latest articles :
Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7
-
August 4th, 2006, 08:44 AM
#15
Re: Change Windows Display Settings
Originally Posted by ChaosTheEternal
This isn't really a Visual Basic issue if you're trying to make a Windows API call in C#, but that isn't to say we can't try to help. This is C# code from VS2005:
Nicely done Chaos!
Originally Posted by JonnyPoet
I have just tested your version you had given it worked nice
the code which changes the underline in Hannes Applcation is
Code:
Call SystemParametersInfo(SPI_SETMENUUNDERLINES, 0, _
ByVal lngMenuUnderlines, SPIF_SENDWININICHANGE Or _
lngUpdateINIFile)
Ah, that's good news. I was a bit worried.
Last edited by HanneSThEGreaT; August 4th, 2006 at 08:48 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|