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.
  • Posts

    • My wish list is: A trailer for Final Fantasy VII part 3 and a proper look at Intergalactic: The Heretic Prophet. Not happening, but I'd kill for would be another game of any genre in the Frostpunk world and another game in the Detroit: Become Human world.
    • I tried Wino-Mail and had the same issue with it that I have with New Outlook: My two centurylink.net email accounts (one of which is my primary email account) refuse to work with either one, and sometimes refuse to even log in, even though ALL the relevant information is accurate. Thunderbird does not have this problem, so I'll stick with what works, thank you.
    • For me it has everything feature wise that I want. But boy the app sucks big time. This and Teams. Ever since they made the transition to WebView it has been slow AF. I mostly use both apps in the browser now because of too much memory being used by these 2 apps. Hoping that native versions are being worked upon.
    • Nearly 70% of Steam users now run Windows 11 by Taras Buria The May 2026 Steam Hardware & Software Survey results are now available on the official Steam website, showing Windows 11's continuous growth among the gaming audience. As of early June 2026, nearly 70% of all participants reported having a Windows 11-powered PC, while Windows 10's market share is steadily declining. According to Valve, in May 2026, Windows 11 increased its market share to 69.76% (+2.02 points), while Windows 10 dropped to 23.99% (-1.64 points). 64-bit Windows 7 is still showing up in Valve's reports, and apparently, about 0.07% of all survey participants still use the 17-year-old operating system. Valve no longer updates its client for Windows 7, but it still can access the platform, so the Windows 7 holdouts can stay away from newer Windows versions. Overall, 93.85% of all users run Windows (+0.38 points), while Linux is second with 3.99% (-0.53 points). macOS is third with at 2.16% (+0.15 points). The most popular Linux flavor is Arch Linux (0.35%), while macOS 26.4.1 is currently the dominant macOS release. On the hardware side, the most popular picks include an Intel processor (53.94% against AMD's 46.06%) with six cores (28.02%, -0.6 points), 16 GB of memory (41.14%, -0.28 points), and an NVIDIA graphics card (72.42%, with AMD having 19.13% and Intel 8.05%). The most popular graphics card on Steam is the desktop NVIDIA GeForce RTX 3060 (3.85%, -0.14 points), while the laptop RTX 4060 is second with 3.77%, and the RTX 3050 is third with 3.10%. The average amount of VRAM is 8GB (25.89%), and the dominant display resolution is the classic 1920x1080 pixels (51.89%, -0.32 points). As usual, you can find more details from the latest survey on the official website. The results for April 2026 are available here.
  • Recent Achievements

    • Conversation Starter
      FBSPL earned a badge
      Conversation Starter
    • Week One Done
      I2D earned a badge
      Week One Done
    • Week One Done
      Dr Jared Dental Studio earned a badge
      Week One Done
    • Week One Done
      RG INVESTMENT GROUP earned a badge
      Week One Done
    • Very Popular
      The Norwegian Drone Pilot earned a badge
      Very Popular
  • Popular Contributors

    1. 1
      +primortal
      487
    2. 2
      PsYcHoKiLLa
      262
    3. 3
      Skyfrog
      85
    4. 4
      FloatingFatMan
      64
    5. 5
      Michael Scrip
      62
  • Tell a friend

    Love Neowin? Tell a friend!