Recommended Posts

- Wasn't is so, like you need to declare kinda a buffer for it, so the flickering stops (richtextbox)

- The single instance thingy... I had code for it, if I'll find it, I'll post it. (It was 1 line of code, I remeber it was in the System.Diagnostics namespace.... anyway, lemme search.)

Nice Application :) (Y)

585231989[/snapback]

Double buffering did nothing for the flicker. Trust me, I tried everything.

As for single instance, the basic code would be easy, but sending the command line arguments to the already running instance is the tough part. In .net 2.0, Visual Studio provides a way of doing this, but I need to read over some documentation of the features before I can implement them.

Double buffering did nothing for the flicker. Trust me, I tried everything.

As for single instance, the basic code would be easy, but sending the command line arguments to the already running instance is the tough part. In .net 2.0, Visual Studio provides a way of doing this, but I need to read over some documentation of the features before I can implement them.

585232189[/snapback]

Ok, I see :) ... Harder, than I thought.

Anyway, I remember, I had an editor (.NET 1.1), with kinda buffer, there was been no flinker. I also belive you... A bit confused now.

Anyway, keep it up :) Nice application (as I said b4 :p) (Y)

Ok, I see :) ... Harder, than I thought.

Anyway, I remember, I had an editor (.NET 1.1), with kinda buffer, there was been no flinker. I also belive you... A bit confused now.

Anyway, keep it up :) Nice application (as I said b4 :p) (Y)

585232358[/snapback]

Thank you and the flicker was machine dependant. It happened for some and didn't for others. It drove me nuts, though, when typing longer pieces and I had to fix it.

single instance:

RusDzanmahmudov was sorta right, but he wasn't going in the right direction

creating a mutex gives us our single-instance ability

Sub main()
	Dim mutexOwned As Boolean = False
	Dim OurMutex As Threading.Mutex

	Try
  OurMutex = New Threading.Mutex(True, "OUR APP NAME", mutexOwned)

  If Not mutexOwned Then
  	'application is already open and we didn't get an error =)
  	Application.Exit()
  	End
  End If

	Catch ex As Exception
  'application already open
  Application.Exit()
  End
	End Try

	'must change this to suit your app
	Application.Run(New Form)

	'finally, release mutex so app can be started again once it is closed
	OurMutex.ReleaseMutex()
End Sub

Richard Deeming, on codeproject.com, wrote an excellent article that enables us to send our command-line args to the initial instance

article link

i'd just use this because it's implemented and ready to go =)

(besides, i haven't exactly found it in .net 2.0)

Iammac45: I actually tried using that but ran into problems with wndproc. I eventually gave up. In 2.0, if you let it create its own custom "sub main", there are options that come available. I know this will wind up being how I implement single instance properly, it's just a matter of the documentation being released on how to use some of it.

hey bangbang023

very nice program

not a problem from what i can tell

what i would like to see is(up to you what you want to do just suggesting)

1:an installer to install it(would be nice but not recommended)

2:offer the ability to take over .txt extensions(i know i can do that myself)so this could replace notepad

otherwise program looks good

I know that someone already mentioned this but i would really like to see Syntax Highlighting (at least for webpage languages), the thing that i really need from Notepad is just Line numbering and syntax highlighting, tabs are a bonus and i think your app is great, but highlighting would make NexPad a default app for most text files :)

Double buffering did nothing for the flicker. Trust me, I tried everything.

585232189[/snapback]

I can imagine the problem with 1.1 was that the underlying mechanisms (Microsoft's text control) didn't use double buffering so regardless what you did, it was still just workarounds applied "on top" and it still flickered because the refreshs were basically beyond your control. The thing is -- on low enough level, double buffering should always work per definition, since it's then impossible for Windows to even clear the area, as you're "blitting" an image on top of another without redraws in between. The only thing getting cleared would be your invisible buffer.

single instance:

RusDzanmahmudov was sorta right, but he wasn't going in the right direction

creating a mutex gives us our single-instance ability

Sub main()
	Dim mutexOwned As Boolean = False
	Dim OurMutex As Threading.Mutex

	Try
 ?OurMutex = New Threading.Mutex(True, "OUR APP NAME", mutexOwned)

 ?If Not mutexOwned Then
 ?	'application is already open and we didn't get an error =)
 ?	Application.Exit()
 ?	End
 ?End If

	Catch ex As Exception
 ?'application already open
 ?Application.Exit()
 ?End
	End Try

	'must change this to suit your app
	Application.Run(New Form)

	'finally, release mutex so app can be started again once it is closed
	OurMutex.ReleaseMutex()
End Sub

Richard Deeming, on codeproject.com, wrote an excellent article that enables us to send our command-line args to the initial instance

article link

i'd just use this because it's implemented and ready to go? ? =)

(besides, i haven't exactly found it in .net 2.0)

585233786[/snapback]

:)hank you :)

Ah the Mutex... It's in C++ why didn't I though about it. (But I didn't knew .NET 1.1 can Mutex... Or is it only in .NET 2.0?)

Anyway, I was going for this code:

 ?private void frmMain_Load(object sender, System.EventArgs e)
 ?{
 ?	// Checking if the process is already running.
 ?	if (System.Diagnostics.Process.GetProcessesByName(Application.ProductName).Length > 1)
 ?	{
 ? ?// If application is already running.
 ? ?MessageBox.Show("An instance of this application is already running");
 ? ?// Exit the application.
 ? ?Application.Exit();
 ?	}
 ?	else
 ?	{
 ? ?// Do all as befor.
 ?	}
 ?}

hey bangbang023

very nice program

not a problem from what i can tell

what i would like to see is(up to you what you want to do just suggesting)

1:an installer to install it(would be nice but not recommended)

2:offer the ability to take over .txt extensions(i know i can do that myself)so this could replace notepad

otherwise program looks good

585234997[/snapback]

1) There will be an installer once it's widely released (not just on Neowin).

2) I will consider including something of the sort. Thank you.

I know that someone already mentioned this but i would really like to see Syntax Highlighting (at least for webpage languages), the thing that i really need from Notepad is just Line numbering and syntax highlighting, tabs are a bonus and i think your app is great, but highlighting would make NexPad a default app for most text files :)

585235466[/snapback]

Thank you for the kind words. Syntax highlighting is nothing simple and is therefore on the back burner until I do some more research on it and possibly figure out how to bring my level of skill up to the neccessary level to do such a thing. It is definitely taken into consideration though as I know it would be very convenient.

As far as line numbering goes, you can see the current line in the status bar (Options/Status Bar). I will not, unfortunately, be adding line numbers to the side of the actual text window, sorry. It's something I'm not too fond of in term of looks.

Nice little app.

Maybe I missed the point of the single instance discussion, but it seems like you are making it harder than it is.

Can't you ensure only a single instance of NexPad is running with the following?

Imports System.Diagnostics

Dim aModuleName As String = Diagnostics.Process.GetCurrentProcess.MainModule.ModuleName

Dim aProcName As String = System.IO.Path.GetFileNameWithoutExtension(aModuleName)

    If Process.GetProcessesByName(aProcName).Length > 1 Then
        Application.Exit()
    End If

If you want to pass command line arguments to the running instance, you could use the reference you now have with Process.GetProcessesByName(aProcName).

By the way, is this an open source project?

Nice little app.

Maybe I missed the point of the single instance discussion, but it seems like you are making it harder than it is.

Can't you ensure only a single instance of NexPad is running with the following?

Imports System.Diagnostics

Dim aModuleName As String = Diagnostics.Process.GetCurrentProcess.MainModule.ModuleName

Dim aProcName As String = System.IO.Path.GetFileNameWithoutExtension(aModuleName)

    If Process.GetProcessesByName(aProcName).Length > 1 Then
        Application.Exit()
    End If

If you want to pass command line arguments to the running instance, you could use the reference you now have with Process.GetProcessesByName(aProcName).

By the way, is this an open source project?

585239547[/snapback]

It's not as simple as that. Don't worry, it will be in soon enough.

As far as open source goes, technically, it's not as I don't want people to see how crappy a programmer I am, lol, but if someone requests, I'll send the source to them personally.

When lauched it beeps and crashes.... well it doesnt crash, just beeps and doesnt launch.

585258023[/snapback]

beeps? it should do nothing of the sort. Are you sure you have .net 2.0 installed and have both a nexpad.exe and settings.xml file in the directory?

 private void frmMain_Load(object sender, System.EventArgs e)
 {
  // Checking if the process is already running.
  if (System.Diagnostics.Process.GetProcessesByName(Application.ProductName).Length > 1)
  {
   // If application is already running.
   MessageBox.Show("An instance of this application is already running");
   // Exit the application.
   Application.Exit();
  }
  else
  {
   // Do all as befor.
  }
 }

But there is something right with that code, when there are more than one people on the computer and they use fast user switching, because if one user has your program running the secord user can not use your programat all.. :(

beeps? it should do nothing of the sort. Are you sure you have .net 2.0 installed and have both a nexpad.exe and settings.xml file in the directory?

585258037[/snapback]

Genius! Works like... like... something that works really well... :blush:

Just have to reshack your icon again.

I don't know if it has already been reported, but when I close all the tabs and I open a document, in the taskbar the close/minimize buttons for the document don't appear.

Minimizing and maximizing the window solves the problem.

post-58664-1106680814_thumb.jpg

585356627[/snapback]

thanks, I know what the problem is and I'll fix it as soon as my health improves.

  • 1 month later...

wow, this is some awesome software.

a question, though:

- is there any way to turn off the addresses changing into links feature? i just want to stay as close to classic notepad as possible, except in tabbed form. but maybe i'll get used to it, who knows. it is sort of helpful...

- does anyone know if there's an easy way to make nexpad open through the commandline (like you can with notepad, by typing "notepad")?

and a bug report:

when changing fonts, the links change from clickable to unclickable, unless you repaste everything that was once inside. this bug probably won't bother people very often, but it's a bug nonetheless.

good job, i think i will be using this instead of notepad, from now on.

are you sick? :no: hope u get well soon!

585553008[/snapback]

Sorry, I forgot to update people. Being that there is a bug in the beta 2.0 framework that directly affects NexPad, I have to wait for the bug to be fixed before releasing another version. It can actually lead to a program crash if the right clicks are made, so I'd rather be safe than sorry.

wow, this is some awesome software.

a question, though:

- is there any way to turn off the addresses changing into links feature?  i just want to stay as close to classic notepad as possible, except in tabbed form.  but maybe i'll get used to it, who knows.  it is sort of helpful...

- does anyone know if there's an easy way to make nexpad open through the commandline (like you can with notepad, by typing "notepad")?

and a bug report:

when changing fonts, the links change from clickable to unclickable, unless you repaste everything that was once inside.  this bug probably won't bother people very often, but it's a bug nonetheless.

good job, i think i will be using this instead of notepad, from now on.

585570858[/snapback]

Thank you very much. As for the links being highlighted, I'll see if I make that optional or not. Also, the link being lost in a font change may be a richtextbox thing that I may not be able to correct, but I will assuredly look into it.

If you wish to make nexpad open in the command line, just copy the three files (Nexpad.exe, nexpad.exe.manifest, settings.xml) to your windows/system32 directory.

If you wish to make nexpad open in the command line, just copy the three files (Nexpad.exe, nexpad.exe.manifest, settings.xml) to your windows/system32 directory.

585570903[/snapback]

Oh please no. That is not the way you should be doing that!!

You add the folder to the PATH environment variable. No reason to stuff your Windows folders with stuff that doesn't belong there.

post-20437-1110014243_thumb.jpg

Oh please no. That is not the way you should be doing that!!

You add the folder to the PATH environment variable. No reason to stuff your Windows folders with stuff that doesn't belong there.

585571515[/snapback]

true, I didn't even think of that when posting it.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.