flat assembler
Message board for the users of flat assembler.

Index > Windows > Loading an exefile only once

Author
Thread Post new topic Reply to topic
clamicun



Joined: 04 Dec 2013
Posts: 77
Location: Muenster NRW Germany
clamicun 18 Jan 2014, 13:54
Simple question !?

How do I tell my computer not to load a loaded exefile the second time?
(That means code in the exefile of course)
Post 18 Jan 2014, 13:54
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20357
Location: In your JS exploiting you and your system
revolution 18 Jan 2014, 14:10
There are many ways to do it. One common method is to use a mutex.

CreateMutex
Post 18 Jan 2014, 14:10
View user's profile Send private message Visit poster's website Reply with quote
clamicun



Joined: 04 Dec 2013
Posts: 77
Location: Muenster NRW Germany
clamicun 18 Jan 2014, 14:53
Yes ok. Thanks
There is enough information on MUTEX in this site.

And obviously it is not very important how many times a program starts. I checked 8 in the last minutes and most of them started a second time - inclusive FASMW.EXE and FRESH.EXE .
My PARAGON BACKUP did not, but started to blink on the taskbar. Very elegant.
Post 18 Jan 2014, 14:53
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1178
Location: Unknown
HaHaAnonymous 18 Jan 2014, 16:01
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 18:28; edited 1 time in total
Post 18 Jan 2014, 16:01
View user's profile Send private message Reply with quote
clamicun



Joined: 04 Dec 2013
Posts: 77
Location: Muenster NRW Germany
clamicun 18 Jan 2014, 17:06
Sarcasm? If yes, then please use the "sarcasm" bbcode tags ([sarcasm]-[/sarcasm]). So, everyone can understand you better.

Why Sarcasm ? It is elegant. I would like to know how they do it.
Post 18 Jan 2014, 17:06
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20357
Location: In your JS exploiting you and your system
revolution 18 Jan 2014, 17:15
You can use SetActiveWindow or SetForegroundWindow to activate the process if it has a window.
Post 18 Jan 2014, 17:15
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 18 Jan 2014, 18:28
clamicun wrote:
I checked 8 in the last minutes and most of them started a second time - inclusive FASMW.EXE and FRESH.EXE .
In case of fasmw you need to declare "OneInstanceOnly=1" in the "Options" section of fasmw.ini if you don't want it to create a new instance each time.
Post 18 Jan 2014, 18:28
View user's profile Send private message Visit poster's website Reply with quote
clamicun



Joined: 04 Dec 2013
Posts: 77
Location: Muenster NRW Germany
clamicun 20 Jan 2014, 11:22
In case of fasmw you need to declare "OneInstanceOnly=1" in the "Options" section of fasmw.ini if you don't want it to create a new instance each time.

Dzien dobry T.G.,
thank you for your advce with the .ini file. My comment was in no way a criticism on your beautiful tool. Every time I look into the sourcecode of FASMW I imagine the many lonely days and nights you had - creating it.

I am making a German version of FASMW for a young friend who does not understand English very well. When I am absolutely finished with that I send it to you.
C.M.C.
Post 20 Jan 2014, 11:22
View user's profile Send private message Reply with quote
clamicun



Joined: 04 Dec 2013
Posts: 77
Location: Muenster NRW Germany
clamicun 20 Jan 2014, 15:53
I am making a German version of FASMW for a young friend who does not understand English very well. When I am absolutely finished with that I send it to you.
C.M.C.
;-------------------
Well - actually it is ready. Here it is attached for everyone who is interested.

FASMW_de.ZIP


Description:
Download
Filename: FASMW_de.zip
Filesize: 21.92 KB
Downloaded: 650 Time(s)

Post 20 Jan 2014, 15:53
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 21 Jan 2014, 13:34
clamicun wrote:
Every time I look into the sourcecode of FASMW I imagine the many lonely days and nights you had - creating it.
Writing fasmw did not actually take so much time, even when I was rewriting the text editor core from scratch, it went fairly quickly.

But it was only made possible by the lonely days and nights spent on writing the precedessing projects, as I gathered the experience needed to program the same things a bit better each next time. As I look back at it now, I really should have called the Assembly Editor core (the one that is now used by fasmw and fasmd) the "flat editor 3.0", because it actually is just that.

The original flat editor was the one I created when I was in high school (and I really had a lot of fun spending lonely days and nights either playing "Betrayal at Krondor" or "Privateer", or programming in assembly). I made it for my Titan OS so I could develop programs directly in that system (with fasm being ported already). I have lost the sources of Titan (except for some very early versions that had no fasm/fedit yet), but the editor was preserved because I ported it back to DOS after I gave up on my own OS. Later I created a new version of this editor in form of the Windows control, which I used first to create a simple IDE for fasm called Assembler Workplace, and then the integrated fasmw. Even though the earlier experience allowed me to program the text editing parts quickly and easily, it still was a lot of work because of the problems related to GUI and Windows - it was the first time I was writing a complex control for Win32. But the editor engine was still very similar to the original flat editor - for example it still had a limit of 255 characters per line. It could be called flat editor 2.0. And then in July 2004 I created a completely new version of it - a new portable core (which allowed me to create fasmd two years later) with no limit for the line length and many other improvements. And this is the current state, the one that could be called "flat editor 3.0".

So the fasmw that you see today did not really take a long time to create, thanks to the experience that earlier projects gave me. And I have dedicated to it not early enough time. I should have worked on it much more and finish at least the plugin system, if not a debugger module (which I promised at first but never even started working on it - well, my motivation declined after the Fresh project emerged).
Post 21 Jan 2014, 13:34
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.