 |
|
 |
Hi, I tried your program, but 'Display settings' doesn't function. Are there for Vista other parameters? I wanted to go to the window control panel-adjustment-display, but when I use the button nothing happened.
regards- Dietrich
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Add these three lines under Class frmUtilities
Public Declare Function WinExec Lib "kernel32" Alias "WinExec" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As Long Public Const SW_NORMAL As Long = 1 Dim strSysPath As String = Environment.GetFolderPath(Environment.SpecialFolder.System)
Then goto the btnDisplaySettings_Click() event and remove the contents inside and replace it with this...
WinExec(strSysPath & "\control.exe desk.cpl,Settings,@Settings", SW_NORMAL)
THNX for pointing this out...
Hope this helps
Regards
rspercy 1 + 1 = 186,440....Depending on the species.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Oh, thank you very much for the very fast answer!! It functions now.
Can you tell, what other parameters you can use at: ...desk.cpl,............
And have you any idea, how I can program, that a secondary screen, numbered '2', should be moved from the right side of the desk to the left side? (this I need, because Vista doesnt hold this setting!)
regards- Dietrich from Salzburg/Austria
PS. I saw, that you are retired and learn about VB. Great idea! I'm not retired yet but of the good vintage of 1948... 
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Give me your e-mail address and I'll send you an extensive list on all the control panel applets
rspercy 1 + 1 = 186,440....Depending on the species.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Nice article with Windows 7 now in beta. Consider putting filename and arguements in .Tag property of button...
cmButton001.Tag = "rundell.exe|param1, param1"
then you have generic handler like so.
cmButton001_Click (..) Handles cmButton001.Click,cmButton002.Click,cmButton003.Click,cmButton004.Click
dim s() as string
s=sender.tag.tostring.split("|") p.filename= s(0) p.arguements=s(1)
Also, try some groupboxes, they are in tool box.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Have already done that. The article is in the February VB.NET Best Article. "Access Control panel Apps in 2 clicks". I have also re-did this program with a Lisview and some buttons in a scrolling Panel. I also did it in a system tray utility. I have not put them on CodeProject as of yet. I am currently working on a DirectX AVI Player.
THNX 4 The Comment Regards, rspercy58
rspercy 1 + 1 = 186,440....Depending on the species.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Did you code each button click event? You could have used one event to handle all the button click events. The handles clause at the end of a sub caters for this. i.e
Private Sub btnAddRemove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddRemove.Click,Handles btnContAdvisor.Click if sender.name = "btnAddRemove" then fileArgs = "shell32.dll,Control_RunDLL appwiz.cpl,,0" ElseIf sender.name = "btnContAdvisor.Click" Then fileArgs = "msrating.dll,RatingSetupUI"
... End if
cmdProcess.StartInfo.Arguments = fileArgs cmdProcess.StartInfo.WorkingDirectory = path cmdProcess.StartInfo.FileName = "RunDll32.exe" cmdProcess.Start() cmdProcess.WaitForExit() Me.Focus() Me.Show() End Sub
Then in one sub you all you would have to do is change the 'fileArgs' value. sender.name would give you which button was clicked.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I just tried this, It cuts out a lot of code. Works great. THNX. I am new to VB, only been programming on and off for about 6 - 7 months now and am learning as I go. Once again, A BIG THANK YOU.
rspercy 1 + 1 = 186,440....Depending on the species.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Good work, keep them coming.
cheers, Donsw My Recent Article : Optimistic Concurrency with C# using the IOC and DI Design Patterns
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I just finished a new version of this app with a new UI. It has a MDI Parent form w/ 6 MDIchild forms categorized. The first 5 forms are the most commonly used apps and the CompleteList form Is a complete list of all the control panel apps. I cant upload it as it exceeds the upload limit. It is 8.18 meg in size because of all the jpeg files that are used in picture boxes.
If you would like to examine it, please leave your e-mail and I will upload it to you.
THNX everyone for such a good response to this article, over 4000 views in 4 days.
rspercy 1 + 1 = 186,440....Depending on the species.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi. Nice program. I have one issue though that you may want to address; you have hardcoded the path to the windows system directory. This is ok if the user has indeed installed windows on the C: drive. However, in the case of a dual boot configuration it cannot be guaranteed that the system folder will reside on C:. I have a threeway boot configuration of XP, Vista, and Windows 7beta, all on different partitions.
There is an article at this URL http://vbnet.mvps.org/index.html?code/system/windirs.htm[^] that explains how to obtain the current system folder path. Please do not think that I am trying to insult your intelligence if you already know how to find the system folder.
I was always told that whenever I wrote program code "never assume anything with regard to the users' setup configuration as there will always be one user who has altered their configuration from the norm."
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
 |
I think I know what you are talking about. Code would look something like this...WinExec("%windir%\system32\control.exe ........", SW_NORMAL)
rspercy 1 + 1 = 186,440....Depending on the species.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I do not use VB myself, but it appears to me that the method used in the linked article is for pre-VB.NET versions of the language (it was originally written 12 years ago) while the project in this article is a modern VB.NET project. In VB.NET, I assume Environment.GetFolderPath(Environment.SpecialFolder.System) is the most simple way to retrieve the path to the system folder.
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
 |
Yes, you are correct. I have just tried your method and it works fine. I'm relatively new to VB.net and consequently didn't know the environment class existed.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I am creating a new version with all control panel apps in it. I have the most used categorized and the last one is all the apps. I will have to try this. THNX for the tip.
rspercy 1 + 1 = 186,440....Depending on the species.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
If you use this code Dim path As String = Environment.GetFolderPath(Environment.SpecialFolder.System) inplace of Dim path As String = "C:\windows\system32\" this will solve the potential hardcoded path problem.
One other thing I noticed in your code that is unnecessary is in your msgbox answer code. You are converting an integer return value to a string ans = CStr(MsgBox("Are you sure you want to delete these files?", MsgBoxStyle.YesNo, "Ready to Delete Files?")) and then converting that string to a double to check the return value; If CDbl(ans) = vbYes Then
This isn't needed. the easiest way to do this is either to declare ans as an integer because that is what the msgbox function returns and compare this to vbYes; see this link http://msdn.microsoft.com/en-us/library/139z2azd(VS.80).aspx[^] Or to do an explicit comparison without declaring the ans variable.
So your code would look like this in the first example
Dim ans As Integer .... .... ....
Private Sub btnDeleteTIF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDeleteTIF.Click ans = MsgBox("Are you sure you want to delete these files?", MsgBoxStyle.YesNo, "Ready to Delete Files?")) If ans = vbYes Then fileArgs = "InetCpl.cpl,ClearMyTracksByProcess 8" cmdProcess.StartInfo.Arguments = fileArgs cmdProcess.StartInfo.WorkingDirectory = path cmdProcess.StartInfo.FileName = "RunDll32.exe" cmdProcess.Start() cmdProcess.WaitForExit()
Me.Show() Else MessageBox.Show("Process Cancelled!") Exit Sub End If End Sub
in the second example you can do an explicit comparison using
Private Sub btnDeleteTIF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDeleteTIF.Click
If MsgBox("Are you sure you want to delete these files?", MsgBoxStyle.YesNo, "Ready to Delete Files?") = vbYes Then fileArgs = "InetCpl.cpl,ClearMyTracksByProcess 8" cmdProcess.StartInfo.Arguments = fileArgs cmdProcess.StartInfo.WorkingDirectory = path cmdProcess.StartInfo.FileName = "RunDll32.exe" cmdProcess.Start() cmdProcess.WaitForExit()
Me.Show() Else MessageBox.Show("Process Cancelled!") Exit Sub End If End Sub
There is also no need for the Exit Sub statement in the Else clause. The Sub will be exited after the Messagebox.Show statement anyway. You would only need the Exit Sub if you were doing more processing after the Endif statement and didn't want this to be processed once the logic was inside the else clause.
Regards, Paul
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
 |
THNX. I am fairly new to VB. I have been programming for about 6 months now. I am learning by doing as I dont have any books on the subject. I visit this site quite often for info.
I have redone the program and I implimented the Environment.GetFolderPath(...) in the program and it added 3.2 meg to my program. Now, I cannot upload it to the site because it is now to big. The site only allows 6.0 meg and my program is 7.312 megs. I did a real nice job on it too. I also added ... (If MsgBox("Are you sure you want to delete these files?", MsgBoxStyle.YesNo, "Ready to Delete Files?") = vbYes Then...) this code you that you left and it works a lot better. The Environment.GetFolderPath(...) is also a lot faster.
Once again, THNX for the Lesson.
rspercy 1 + 1 = 186,440....Depending on the species.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
No problem. If you want to email me your email address I can send you an eBook on VB.net programming which may be useful to you. You can always email me a copy of your new source code as well; I'd be interested in seeing how you've implemented the changes. My email address is paulwilcox@ymail.com. This is my public email address.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
something must be wrong.. An with only buttons for an interface should never be 6MB.
I have some very sophisticated apps full of graphics that are only 2MB. Are there other screens besides the one shown for a screenshot or other reasons it is so big?
Shane
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
My other app is 9.23 meg in size because of the Environment Class. It added 3.3 meg to the app. This app how ever is only 250+ kb's
rspercy 1 + 1 = 186,440....Depending on the species.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I gave you a 5 for the concept. Vista can be a pain in the ass when it comes to finding things like utilities in the user interface. There are a whole lot of different approaches one can take in a "launcher" application like this. But guys who see a problem and think of a concept solution get a 5 from me (even if the UI is ugly for now 
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
THNX for the globes. I am currently designing a new UI with 100+ commands or about 90% of the control panel. All commands are being put into categories using the WinExec() Function. I found this to be more stable. Once again THNX.
rspercy 1 + 1 = 186,440....Depending on the species.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |