i had searched for the articles and my first problem was solved
second problem still exists
actually i associated the file types with my application and they are the respective files are opening in my application (in a new instance) when double clicked the problem comes when i try to open the file in already opened instance of my application (something to play with command line arguments)
IIRC one of the articles covering single instance applications also covered the topic of passing command line arguments (e.g. a file name) received by a second instance to the first and (single) instance. Unfortunately I didn't bookmarked the article, but I think it should be possible to find it. Go through the search results or maybe try combining the search words.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
class App : WindowsFormsApplicationBase<br />
string fargs;<br />
public App(string args)<br />
fargs = args;<br />
// Make this a single-instance application<br />this.IsSingleInstance = true;<br />
this.EnableVisualStyles = true; <br />
// There are some other things available in the VB application model, for<br />// instance the shutdown style:<br />this.ShutdownStyle = Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses; <br />
// Add StartupNextInstance handler<br />this.StartupNextInstance += new StartupNextInstanceEventHandler(this.SIApp_StartupNextInstance);<br />
// ur code.....<br />
this solution does work fine .. but the second problem still exists for me
i want to open a file (whose type is associated with my application) and if i double clicked the file the file should be opened in the already opened instance of my application instead of opening it in the new instance.
1) You can use a static variable in yoor program befor Application.Run(MainForm) like bool _isRunning = false as initial value and upate it in Form.Closed event to false. This idea is simple but not efficient, good and professional and secure.
2) You can store a registry key and check it before Application.Run(MainForm) to see if your application is already running or not. Better but not secure.
3) use Process.GetCurrentProcesses() method and do a search in the result set to check if your process exists. Much more reliable than all but you shoul have a unique process name.
iam krishna working on .net techonologies. In my current project i have a problem in admin module ie., My admin modules consists of 26 links (anchor tag),which will redirect to specified page. each link assigned a unique id. what my problem is when iam logging on to admin panel , depending upon the role of the user who is logging onto admin panel i have to hide the links for the users depending permissions given to them. For this what i have done is i have stored the user roles,formnames , formids,permission(as enabled/disabled)into the database.for Providing the permission for the users the administartor has a user interface,while iam retrieving the enabled formids of a user iam getting the formids into a variable, but what i have to do is, i have to match the ids with the hyperlink ids and make the hyperlinks visible or invisible.
could any one give me the suggestions or solution to this problem.
Its easy but you are making your application very complicated
i don't know why are checking Id if form to control id ?
Store credentails in the database specifying which link should not display for perticular user role and make all those link disable in page load
Thanks and Regards Sandeep
If you want something you never had,
do something you have never done!
As Jon said, Windows will not allow you to disable CTRL-ALT-DEL. This is because this particular shortcut is used to signal to the Windows OS that you want to perform some critical action - log off, terminate a program, etc. In fact, in some Windows setups, you are required to press CTRL-ALT-DEL before you login to the system. This is so that you know that you're typing your username and password into a real Windows OS login dialog - not some spoofer.
That said, it sounds like you might be trying to write a screensaver program. Don't worry about those key combinations. Just write your program as a normal .EXE file, then when it is compiled change the file extension to .SCR. Then right-click on the file from Explorer and hit Install. You'll now be able to use this as a screensaver, and Windows should take care of those pesky key combinations for you automatically.
This will result in a named capture called "Text" that contains the string including < and > (but not << and >>) as you specified. I guess you'll have to try it out with a larger data set to see if it meets your needs completely.
Sorry, have to correct myself yet again! ;] My previous expression would not match at the very beginning or end of a string, so we need to use Zero-width negative lookbehind assertion (?<!) and Zero-width negative lookahead assertion (?!) to make sure that if there is not anything preceding or following the string, it'll match as well. So, here's the full expression: