Ok thanks, great answer =)
I don't really mind doing it the native way it's
not gonna be a problem for me.. But I'm not really big on windows .dll programming. Do you have any hints / directions as how to do this 'the native way'? Any good links for tutorials or so?
Also I once found some kind of solution to this problem my combining multiple windows and make them look like just one. Since I only need to add a component rightmost in the dialog, this would be a possible solution for me... Any ideas as to how this can be done?
For an example of encapsulating a custom method and struct, use a decompiler like .NET Reflector[^] and see how the FileDialog and its derivative classes work. That's the best thing I can tell you.
You could just have a simple native function in a native DLL that you can call, passing parameters as necessary or use a struct like the OPENFILENAME struct, though you could cut down on the members needed for your implementation.
As for the other idea, neither the GetOpenFileName, GetSaveFileName, or the OPENFILENAME struct accept positional values. Since the FileDialogs merely use these functions and structs, it won't know either (nor does it have positional properties of its own). You'll have to get a HWND of the dialog instead, most likely using FindWindow, and you could try encapsulating this by extending the NativeWindow class (a managed wrapper for existing windows) and use AssignHandle, passing the HWND that you got from FindWindow. You could then figure out the position and track it with another window.
There might be an easier way to do this alternative, but this is just off the top of my head and without any research. You could search to see if an easier / better way exists.
Guinness4Strength wrote: How do I prevent the user from resizing my Form ?
Set your Form.FormBorderStyle to FormBorderStyle.FixedDialog. Also, this question was just asked and answered this morning. Please search comments before posting.
Guinness4Strength wrote: How do I resize a Tab Control ?
Same as any other control - just set its TabControl.Size (as a Size struct - setting the individual properties will not work since it's a value type), or set the TabControl.Width and TabControl.Height properties. All these properties inherit from Control.
This question doesn't make sense. Are you trying to start a normal application? See Process.Start. Are you trying to start a Windows Service? See the ServiceController class. You can find more information about these in the .NET Framework SDK.
I already have a console application, that controls a RH DB, and need to be started from a logged user into a w2k server. For this reason, I was thinkin' create a Windows Service, that run this application without a logged user, like any service as IIS.
I will check Process.Start but it could be helpful any extra information that you can give me about.
Windows Services do run under user credentials, be they SYSTEM, SERVICE, IUSR_COMPUTERNAME (default for IIS), or a specified user. It just doesn't have to be executed by a logged-in user.
You could use a Windows Service, but you should then use the ServiceController class. If you want to allow interaction by controller applications by the user (like a Control Panel applet or some application), you'll need to allow for desktop interaction. If you use the ServiceInstaller and ServiceProcessInstaller classes to install the service, you'll have to use the Microsoft.Win32.Registry class and related classes to set this property in the registry. If you don't need to use an installer (for example, for mass deployment) then you could just use the Services snap-in to do it manually.
Now, the Services run on my machine, I'm trying to make a Installer with the Deploy Template, but isn't work, the application installutil is installed with the .NET Distribution???, I don't wanna install de .NET Framework SDK into the server.
Yes it is, but you have to add the Framework path to your PATH environment variable or execute installutil.exe using the fully-qualified path. The path for .NET 1.0 is %WINDIR%\Microsoft.NET\Framework\v1.0.3705 and for .NET 1.1 %WINDIR%\Microsoft.NET\Framework\v1.1.4322.
Make sure your Installer class is attributed with the RunInstallerAttribute. For an example, see the ServiceInstaller class documentation (for the class itself).
Today I start some playing with Cryptograhy classes and I encounterd a problem,I hope someone can display it for me.
I create a file and encrypt it to another file to see the value. It works Ok,then I do it again with the same key but changed the value of IV for the key,the output changed ! Now I decrypt these two output with the same key but different IV and they decrypt to original values correctly. The question is:
I changed vectors(IV) for the key and I get different ENCRYPTED value but changing IV return the same DECRYPTED value.
Different initialization vectors (IV) should produce different content with symmetric encryption. It's the key that is important and must remain the same. The encrypted content is often different - especially with asymmetric algorithms - because a number of factors are used to encrypt the content. For example, often the IV is randomly generated, and random generators are often seeded with an aspect (like ticks) of the current time.
If you're interested in cryptography, you should read Applied Cryptography, 2nd Edition[^] by Bruce Schneier, one of the leading cryptoanalysts (and a good writer to boot) today.
ResX files. Read about localization in the .NET Framework and see the ResourceManager class documentation for details and examples. Basically, you use ResX files to store localized strings for your application. For properly named ResX files (like ClassName.de.resx for culture-neutral German language), a satellite assembly is created that the CLR loads when the Thread.CurrentUICulture is set to something other than the neutral resources language (the language of the resource in your source code, see also the NeutralResourcesLanguageAttribute for more information and use this to increase assembly resolution performance).
You'll have to put all the values for Cut, Copy, Paste, and anything else in the ResX files. I recommend using a Singleton pattern for the ResourceManager like Microsoft does so that you can 1) eliminate wasted memory resources by having a single instance of a ResourceManager, and 2) easily share localized resources amongst many classes. If you use a disassembler or decompiler to look at Microsoft's BCL assemblies, you'll notice this in their SR classes (usually one per assembly).
This won't get them from Windows, but there really isn't a way to do that. Windows MUI usually stores localized resources per application or library. This way with .NET is pretty much the same thing (specially named libraries or similarly named libraries in specially name directories is common).
Alex Ngai wrote: 2.) Also, I wonder if it is possible to include a link to my e-mail in
the Message Box?
No. You'll have to create your own dialog class that looks like the dialog that MessageBox.Show displays. Otherwise, just put your email address in a LinkLabel in a Form to be used as your About box from the Help menu.
Since you're a newbie and asking pretty basic questions, you should also read the .NET Framework SDK, especially reviewing the class library to see what's available. Many of the properties on the Form class are easily set (as Colin showed you). Being familar with the class library (not necessarily memorizing it) and truly understanding the .NET Framework (like that all compilers for all languages targeting the CLR produce IL so the source language really doesn't matter, which is a common misunderstanding) is important.