This is not really a programming question if all you want to do is "lock-down" the OS (which, BTW, there is no documented registry hack for disabling the Start menu - it's pretty much required). If you want your program to work as a kiosk, you can implement a full-screen application (search the previous comments since this has been covered more times than necessary) and use system hooks to disable certain key combinations that allow users to bypass your application's handlers.
There are several articles here on CodeProject that deal with hooks and you can find more information about them in the Platform SDK. For one decent article, see Using Hooks from C#[^] or search CodeProject for additional articles.
thanks for the reply. But I have found the following VB code to do the job. It just hides the Start Button (true/false values passed). It doesnt disable it as you can still press the windows button on the keyboard, but thats not a problem. Is there anyone who knows how to implement this code is C#, or can I place it in the C# project as is an call it someway??
' Paste this into a Code Mode (BAS)
private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (byval hWnd1 as Long, byval hWnd2 as Long, byval lpsz1 as string, byval lpsz2 as string) as Long
private Declare Function EnableWindow Lib "user32" (byval hwnd as Long, byval fEnable as Long) as Long
public Sub EnableStartMenuButton(byval bEnable as Boolean)
' Don't forget to re-enable it !
Dim lHwnd as Long
lHwnd = FindWindowEx(0&, 0&, "Shell_TrayWnd", vbNullString)
lHwnd = FindWindowEx(lHwnd, 0&, "Button", vbNullString)
Call EnableWindow(lHwnd, bEnable)
You simply need to P/Invoke these functions, but again I warn you that this is not the correct way to make a kiosk application. If this is your goal, you should check out the Platform SDK in the MSDN Library at http://msdn.microsoft.com/library[^].
You simply need to expose the StatusBar (or better yet, the StatusBar.Text property for a better OO design in reference to encapsulation and protection) on the main form. Your child forms could so something like this, assuming that your main form (ex, MainForm) had a String property called StatusText:
MainForm form = (MainForm)this.MdiParent;
form.StatusText = "Hello, world!"
Honestly, how you provide access to status bar is completely up to your implementation. This is simply a matter of creating a good object-oriented design.
I am trying to convert an old MFC GUI which fires off a continuously running C++ program into a C# GUI which will fire off a continuously running C# program. The former used two pipes to pass information back and forth. I cannot seem to find the .Net compliment of pipes in any of the .NET documentation. Any help would be greatly appreciated. Thanks...
I looked at the zip file which was referenced in the previous reply. It appears that the code simply creates the pipe process in MFC/C++ code which is then put into a DLL and imported into the C# program. Athough I am sure that this works, I was really looking for the C# compliment to pipe processing. Once my C# GUI process spawns my C# process, is there any way for the two to pass information back and forth. I am not very familiar with channels, threads, etc. so I don't know whether these would be my solution. Once again, any assistance/direction is greatly appreciated.
I'm trying to encrypt data in a large text control on a C# windows form. Can anyone tell me how to encrypt and decrypt the data that's in just the text control? I've seen instances on how to encrypt and decrypt files, but not strings of data. I don't need any particular algorithm, but lets just say DESCryptoServiceProvider as an example.
A file is just a stream, or an array of bytes. While the examples might use a FileStream, you could use a MemoryStream or even a StringReader, all from the System.IO namespace. Instead of relying on the examples, though, make sure you read the documentation to understand what's required. After all, a string is just an array of bytes, it's only handled differently. To get a string of bytes in a particular encoding, see the documentation for System.Text.Encoding in the .NET Framework SDK as well.
I want to create a small simple app that will help our users with there day to day jobs. In delphi this exe app would be around say 200k to download and install. Now if I create this in C# does anyone know how large this app could be. I've heard that you need to install the .NET framwork to run these apps and this is 20MB!! Is this correct or do you just need a cut down version? Or does XP / 2000 SPx include this framework?
Man, how many times does this need to be addressed?!
Any language that targets the Common Language Runtime requires the .NET Framework to be installed, yes. Java requires a JRE, VB requires a VB virtual machine, and event C/C++ requires a runtime.
This was just asked and answer earlier today and I suggest you read the comments there. One person posted a link to a site that has a pre-linker but to use this is extremely BAD! See my comments below that.
In the future, please also click "Search Comments" above because chances are that someone's asked something already.
The executable size will be about the same. Yes, end users need the .NET framework redistributable, 21MB. Many people running XP will already have it as it's included in Windows Update, and Microsoft will be including it in most of their future operating systems, including Longhorn.
Windows Server 2003 comes with .NET 1.1 installed. For most smaller applications, the Framework is forward compatible (larger applications have a higher chance of using obsolete functionality). So, if you built an application for .NET 1.0, there's a chance that it'll run on .NET 1.1.
I want to draw a X axis,the X and Y data are such as following:
The first row is year-month-day format,the second is the Y data.
Now my problem is how to draw the X axis using the first row.
it will be nice to you to give me a answer,or to give me a smilar sample.
Whether it's possible or not, this should not be used! It's a .NET application and requires the .NET Framework, just like Java requires the JRE, VB (pre-.NET) requires the VB virtual machine, C/C++ requres a C runtime library, Perl requires the perl runtime, etc.
Yes, this program may allow you to pre-link the necessary assemblies but you loose practically all the benefits of the framework, such as assembly redirection, certain levels of code access security (since it could only be verified at link time) which also means malicious code targeting the CLR can now wreak havoc on your machine, and much more.
It's not like you have to install the Framework every time you install a program. More and more machines are getting it as people with half a brain use Windows Update, and if you distribute on a CD then size should've be a problem. If you have the means, you can also use an installer that downloads the .NET Framework from a server if it isn't installed yet and there are many such examples here on CodeProject, such as Enhanced .NET Bootstrap Setup[^].
If you don't want to worry about all the advantages the Framework provides, then don't use it.
I know it is possible to get the extended properties of an existing file with System.Diagnostics.FileVersionInfo.GetFileVersionInfo().
But what i want is to set these properties when i create a new file.
If you're using VS.NET, fill in the assembly attributes in your AssemblyInfo.cs file. If not, use the AssemblyTitleAttribute, AssemblyCompanyAttribute, AssemblyDescriptionAttribute, AssemblyProductAttribute, AssemblyCopyrightAttribute, AssemblyVersionAttribute (I recommend for many reasons that you not use the asterisk (*) for automatic versioning because Types as defined for a particular assembly version and you can loose control of bindings quickly), and you should use an AssemblyKeyFileAttribute or AssemblyKeyNameAttribute with the path (or the container name) of a key pair you generate using sn.exe -k KeyPair.snk and use for all your products, but keep it secure. This helps with identifying your assembly, assembly binding, and more. See http://msdn.microsoft.com/netframework/?pull=/library/en-us/dnnetsec/html/strongNames.asp[^] for more reasons to sign your assembly (to give it a strong name).
All attributes above are prefixed with the assembly: declaration to attribute the assembly itself. You can find these and more attributes (like to control the file version separate from the assembly version, but make sure you understand exactly what versioning means in reference to .NET) in the System.Reflection namespace.