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

    • Dude, it's a .reg away from a permanent modification. If you're a power user, look it up and keep the .reg and stop being a crybaby expecting MS to include customization for everything on a generalist OS. The default is what's the best UX for the majority of the userbase, non techie people.
    • Logitech MX Creative Console is down to the lowest price by Taras Buria Having a Stream Deck-like device next to your keyboard could be a massive productivity boost. It lets you map specific actions and shortcuts to speed things up, and Logitech has such a device for you with a big 20% discount. Right now, you can save $40 on the Logitech MX Creative Console. The MX Creative Console is an unconventional accessory that consists of two modules. One module has nine customizable buttons, with each having a built-in display for mapping. You can assign apps, shortcuts, actions, or something else. There are nine buttons, plus two more for switching between "pages" of actions. The second module has no displays. Instead, there is a big twisting knob and a small roller for precise adjustments in creative apps like Photoshop, Illustrator, Affinity, and more. There are four additional buttons as well. The MX Creative Console is available in two colors: Graphite and Pale Gray. Both are now 20% off, saving you $40. Just keep in mind that the MX Creative Console requires the Logitech Options+ app, which is only available on Windows and macOS. By the way, each unit comes with three months of Adobe Creative Cloud. Logitech MX Creative Console Graphite - $159.99 | 20% off on Amazon Logitech MX Creative Console Pale Gray - $159.99 | 20% off on Amazon This Amazon deal is US-specific and not available in other regions unless specified. This is a first-party seller link (at the time of article publishing); ensure that you also purchase from a first-party seller link only. If you don't like it or want to look at more options, check out the previous deals that we have covered, OR you can also visit Amazon US deals page. Get Prime (SNAP), Prime Video, Audible Plus or Kindle / Music Unlimited. Free for 30 days. As an Amazon Associate, we earn from qualifying purchases.
    • Because someone else reported theirs was unusable, genius. But being a Linux user you should be used to that. Next time you think you have a "gotcha", check first.
    • Studio MDHR reveals Cuphead sequel and an 8-bit platformer spin-off by Pulasthi Ariyasinghe Studio MDHR has been rather silent about its next major gaming project since the release of Cuphead back in 2017. However, that ended today during the Summer Game Fest presentation, with the studio revealing not one but two project announcements. First, the studio confirmed that it is currently in the middle of developing a brand-new Cuphead game, bringing back the iconic characters for another adventure. Just like the last game, this is slated to be a fully hand-animated endeavor. This also means there isn't a release date attached to it yet. “Craftsmanship is at the heart of everything we do here at Studio MDHR,” says co-founder Chad Moldenhauer. “When it came time to peel back the curtain and share a little bit about what we’ve been up to, we couldn’t imagine a more fun way to do so than with today’s Special Bulletin. The studio is working on this new Cuphead with help from Toronto’s Stop Motion Department and Continue Agency. At the same time, Studio MDHR also revealed that another part of the team has been working on a different Cuphead installment. Dubbed the Mighty Cuphead Adventure, this is taking a different art direction to the original. "In true Studio MDHR fashion, this game goes beyond just taking inspiration from the classics of the 1980s… it is actually built with technology of the era," the studio explained. "That's right: Mighty Cuphead Adventure is programmed in assembly language and designed with the exacting specifications of the Sega Master System home gaming console in mind." Aside from releasing on PC and modern consoles, Mighty Cuphead Adventure will even be playable on the 1985-released Sega Master System. A release date has not been announced just yet.
    • Any decent ITSM will A) have a web form that allows a user to raise a ticket, if you're writing an email you can write a ticket. B) Monitor a mailbox and auto-generate tickets based on inbound mails for those users that really can't get their heads around the concept that if you have an issue you go to support.mycompany.com and fill in the box. From your description you're having users email the desk, and then having a human read each one and manually raise a ticket on behalf of the user.
  • Recent Achievements

    • Mentor
      grik went up a rank
      Mentor
    • Dedicated
      JKR earned a badge
      Dedicated
    • One Year In
      CHUNWEI earned a badge
      One Year In
    • Conversation Starter
      FBSPL earned a badge
      Conversation Starter
    • Week One Done
      I2D earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      480
    2. 2
      PsYcHoKiLLa
      272
    3. 3
      Skyfrog
      78
    4. 4
      Steven P.
      68
    5. 5
      +Edouard
      61
  • Tell a friend

    Love Neowin? Tell a friend!