64 bit tasklist lookup to see if nodialog.exe is running

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

64 bit tasklist lookup to see if nodialog.exe is running

steve.ripley10
We're running VAST 9.0 and starting to build the 64 bit image on 64 bit machines running Windows 10.
How can we determine if nodialog.exe is running?  I want to prevent the image from being started multiple times on a workstation. 
On the 32 bit image on 32 bit machines I ask the SPRDLL.DLL

tasksNamedLike: aString

| tList listSize location matchingList |

listSize := 100.

matchingList := OrderedCollection new.

tList := self new taskList: listSize.

1 to: listSize do: [ :i |

                location := (tList at: ('processName', (i printString))) indexOfSubCollection: aString startingAt: 1.

                location = 0

                                ifFalse: [matchingList add: (tList at: ('processID', (i printString))).].

].

^matchingList.

 

taskList: aSize

| tListStructure tListPointer tListFunction rc  |

tListStructure := (self taskListStructureCompoundType: aSize) newRecord.

tListPointer :=  (tListStructure abtMoveToOSMemory data).

tListFunction := PlatformFunction

                                callingConvention: 'c'

                                function: 'GetTaskList'

                                library: 'SPRDLL'

                                parameterTypes: #(pointer int32 )

                                returnType: #int32.

rc := tListFunction callWith: tListPointer  with: 100.

tListFunction := PlatformFunction

                                callingConvention: 'c'

                                function: 'GetWindowTitles'

                                library: 'SPRDLL'

                                parameterTypes: #(pointer int32 )

                                returnType: #int32.

rc := tListFunction callWith: tListPointer  with: 100.

^tListStructure.


I then look through the result for nodialog.exe.


Thanks for looking.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/6915aa3d-8164-4aaa-8bda-006251a5a4ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: 64 bit tasklist lookup to see if nodialog.exe is running

Seth Berman
Greetings Steve,

Have you tried running nodialog.exe with the "-singleinstance" command line parameter?
https://www.instantiations.com/docs/91/wwhelp/wwhimpl/js/html/wwhelp.htm#href=sg/stug50.html

I believe you are on active support with us?
If this doesn't solve your issue, send in a support case as we have some things ready-to-go that
we can offer.

Kind Regards,

- Seth

On Friday, May 17, 2019 at 10:46:22 AM UTC-4, Steve Ripley wrote:
We're running VAST 9.0 and starting to build the 64 bit image on 64 bit machines running Windows 10.
How can we determine if nodialog.exe is running?  I want to prevent the image from being started multiple times on a workstation. 
On the 32 bit image on 32 bit machines I ask the SPRDLL.DLL

tasksNamedLike: aString

| tList listSize location matchingList |

listSize := 100.

matchingList := OrderedCollection new.

tList := self new taskList: listSize.

1 to: listSize do: [ :i |

                location := (tList at: ('processName', (i printString))) indexOfSubCollection: aString startingAt: 1.

                location = 0

                                ifFalse: [matchingList add: (tList at: ('processID', (i printString))).].

].

^matchingList.

 

taskList: aSize

| tListStructure tListPointer tListFunction rc  |

tListStructure := (self taskListStructureCompoundType: aSize) newRecord.

tListPointer :=  (tListStructure abtMoveToOSMemory data).

tListFunction := PlatformFunction

                                callingConvention: 'c'

                                function: 'GetTaskList'

                                library: 'SPRDLL'

                                parameterTypes: #(pointer int32 )

                                returnType: #int32.

rc := tListFunction callWith: tListPointer  with: 100.

tListFunction := PlatformFunction

                                callingConvention: 'c'

                                function: 'GetWindowTitles'

                                library: 'SPRDLL'

                                parameterTypes: #(pointer int32 )

                                returnType: #int32.

rc := tListFunction callWith: tListPointer  with: 100.

^tListStructure.


I then look through the result for nodialog.exe.


Thanks for looking.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/71ec5082-892e-4cdc-9459-74d661d3d170%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: 64 bit tasklist lookup to see if nodialog.exe is running

Richard Sargent
Administrator
On Friday, May 17, 2019 at 8:53:11 AM UTC-7, Seth Berman wrote:
Greetings Steve,

Have you tried running nodialog.exe with the "-singleinstance" command line parameter?
<a href="https://www.instantiations.com/docs/91/wwhelp/wwhimpl/js/html/wwhelp.htm#href=sg/stug50.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.instantiations.com%2Fdocs%2F91%2Fwwhelp%2Fwwhimpl%2Fjs%2Fhtml%2Fwwhelp.htm%23href%3Dsg%2Fstug50.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDOrdzbp6CB7h4uqwNEM58Sq05cQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.instantiations.com%2Fdocs%2F91%2Fwwhelp%2Fwwhimpl%2Fjs%2Fhtml%2Fwwhelp.htm%23href%3Dsg%2Fstug50.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDOrdzbp6CB7h4uqwNEM58Sq05cQ&#39;;return true;">https://www.instantiations.com/docs/91/wwhelp/wwhimpl/js/html/wwhelp.htm#href=sg/stug50.html

I like the idea of -singleinstance, but if my memory serves, the feedback to the user is insufficient. (Possibly no feedback at all)
I seem to recall that -singleinstance did not do anything such as raise the topmost window of the already running instance, so a minimized or obscured application would remain invisible to the user. Of course, things may have changed in the decade or two since I last experimented with that command line option.

It would be good if one could configure the image to provide message text to display if -singleinstance finds it isn't the first instance.
Of course, the implementation probably doesn't even start the VM, so getting information from the image might be problematic. Perhaps an optional argument on the command line for the message to display?


Steve, I always recommend copying nodialog.exe to e.g. myappname.exe when deploying an runtime image.
a) The task list gives better indication of what it is
b) If you were to have a second image running concurrently (i.e. a different Smalltalk application), two nodialog.exes would make the task list especially confusing and eliminate any possibility of using -singleinstance.


I believe you are on active support with us?
If this doesn't solve your issue, send in a support case as we have some things ready-to-go that
we can offer.

Kind Regards,

- Seth

On Friday, May 17, 2019 at 10:46:22 AM UTC-4, Steve Ripley wrote:
We're running VAST 9.0 and starting to build the 64 bit image on 64 bit machines running Windows 10.
How can we determine if nodialog.exe is running?  I want to prevent the image from being started multiple times on a workstation. 
On the 32 bit image on 32 bit machines I ask the SPRDLL.DLL

tasksNamedLike: aString

| tList listSize location matchingList |

listSize := 100.

matchingList := OrderedCollection new.

tList := self new taskList: listSize.

1 to: listSize do: [ :i |

                location := (tList at: ('processName', (i printString))) indexOfSubCollection: aString startingAt: 1.

                location = 0

                                ifFalse: [matchingList add: (tList at: ('processID', (i printString))).].

].

^matchingList.

 

taskList: aSize

| tListStructure tListPointer tListFunction rc  |

tListStructure := (self taskListStructureCompoundType: aSize) newRecord.

tListPointer :=  (tListStructure abtMoveToOSMemory data).

tListFunction := PlatformFunction

                                callingConvention: 'c'

                                function: 'GetTaskList'

                                library: 'SPRDLL'

                                parameterTypes: #(pointer int32 )

                                returnType: #int32.

rc := tListFunction callWith: tListPointer  with: 100.

tListFunction := PlatformFunction

                                callingConvention: 'c'

                                function: 'GetWindowTitles'

                                library: 'SPRDLL'

                                parameterTypes: #(pointer int32 )

                                returnType: #int32.

rc := tListFunction callWith: tListPointer  with: 100.

^tListStructure.


I then look through the result for nodialog.exe.


Thanks for looking.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/c0d4bcb2-10bf-4c1d-8062-bb03eb2bd0fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: 64 bit tasklist lookup to see if nodialog.exe is running

Seth Berman
Hi Richard,

I don't see that there is any feedback (unless running a debug version of the the exe).

It does not start the vm, the implementation is based on the working of CreateMutex on Windows right at the beginning of main() in the exe so you would need to print to stdout.
A search on this topic shows that it is pretty much the accepted way to do it.

However, I see some other places where you can use FindWindow() to force something to the front...we just don't have that.

Looks like we have a case in our backlog on just this issue which references a google post.
The last entry in the post is interesting and worries me a little. It obviously has never rising to the level of being implementable, but I can take a second look.

- Seth

On Friday, May 17, 2019 at 1:43:13 PM UTC-4, Richard Sargent wrote:
On Friday, May 17, 2019 at 8:53:11 AM UTC-7, Seth Berman wrote:
Greetings Steve,

Have you tried running nodialog.exe with the "-singleinstance" command line parameter?
<a href="https://www.instantiations.com/docs/91/wwhelp/wwhimpl/js/html/wwhelp.htm#href=sg/stug50.html" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.instantiations.com%2Fdocs%2F91%2Fwwhelp%2Fwwhimpl%2Fjs%2Fhtml%2Fwwhelp.htm%23href%3Dsg%2Fstug50.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDOrdzbp6CB7h4uqwNEM58Sq05cQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.instantiations.com%2Fdocs%2F91%2Fwwhelp%2Fwwhimpl%2Fjs%2Fhtml%2Fwwhelp.htm%23href%3Dsg%2Fstug50.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDOrdzbp6CB7h4uqwNEM58Sq05cQ&#39;;return true;">https://www.instantiations.com/docs/91/wwhelp/wwhimpl/js/html/wwhelp.htm#href=sg/stug50.html

I like the idea of -singleinstance, but if my memory serves, the feedback to the user is insufficient. (Possibly no feedback at all)
I seem to recall that -singleinstance did not do anything such as raise the topmost window of the already running instance, so a minimized or obscured application would remain invisible to the user. Of course, things may have changed in the decade or two since I last experimented with that command line option.

It would be good if one could configure the image to provide message text to display if -singleinstance finds it isn't the first instance.
Of course, the implementation probably doesn't even start the VM, so getting information from the image might be problematic. Perhaps an optional argument on the command line for the message to display?


Steve, I always recommend copying nodialog.exe to e.g. myappname.exe when deploying an runtime image.
a) The task list gives better indication of what it is
b) If you were to have a second image running concurrently (i.e. a different Smalltalk application), two nodialog.exes would make the task list especially confusing and eliminate any possibility of using -singleinstance.


I believe you are on active support with us?
If this doesn't solve your issue, send in a support case as we have some things ready-to-go that
we can offer.

Kind Regards,

- Seth

On Friday, May 17, 2019 at 10:46:22 AM UTC-4, Steve Ripley wrote:
We're running VAST 9.0 and starting to build the 64 bit image on 64 bit machines running Windows 10.
How can we determine if nodialog.exe is running?  I want to prevent the image from being started multiple times on a workstation. 
On the 32 bit image on 32 bit machines I ask the SPRDLL.DLL

tasksNamedLike: aString

| tList listSize location matchingList |

listSize := 100.

matchingList := OrderedCollection new.

tList := self new taskList: listSize.

1 to: listSize do: [ :i |

                location := (tList at: ('processName', (i printString))) indexOfSubCollection: aString startingAt: 1.

                location = 0

                                ifFalse: [matchingList add: (tList at: ('processID', (i printString))).].

].

^matchingList.

 

taskList: aSize

| tListStructure tListPointer tListFunction rc  |

tListStructure := (self taskListStructureCompoundType: aSize) newRecord.

tListPointer :=  (tListStructure abtMoveToOSMemory data).

tListFunction := PlatformFunction

                                callingConvention: 'c'

                                function: 'GetTaskList'

                                library: 'SPRDLL'

                                parameterTypes: #(pointer int32 )

                                returnType: #int32.

rc := tListFunction callWith: tListPointer  with: 100.

tListFunction := PlatformFunction

                                callingConvention: 'c'

                                function: 'GetWindowTitles'

                                library: 'SPRDLL'

                                parameterTypes: #(pointer int32 )

                                returnType: #int32.

rc := tListFunction callWith: tListPointer  with: 100.

^tListStructure.


I then look through the result for nodialog.exe.


Thanks for looking.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/6aacb3e7-5b2e-4f54-9a4d-01ca4737d56d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: 64 bit tasklist lookup to see if nodialog.exe is running

Richard Sargent
Administrator
On Fri, May 17, 2019 at 11:09 AM 'Seth Berman' via VA Smalltalk <[hidden email]> wrote:
Hi Richard,

I don't see that there is any feedback (unless running a debug version of the the exe).

That's what I thought I remembered.

What about having the nodialog.exe display a message provided on the command line following the -singleinstance option (or using e.g. a -sim "message" option)?



It does not start the vm, the implementation is based on the working of CreateMutex on Windows right at the beginning of main() in the exe so you would need to print to stdout.
A search on this topic shows that it is pretty much the accepted way to do it.

However, I see some other places where you can use FindWindow() to force something to the front...we just don't have that.

Looks like we have a case in our backlog on just this issue which references a google post.
The last entry in the post is interesting and worries me a little. It obviously has never rising to the level of being implementable, but I can take a second look.

- Seth

On Friday, May 17, 2019 at 1:43:13 PM UTC-4, Richard Sargent wrote:
On Friday, May 17, 2019 at 8:53:11 AM UTC-7, Seth Berman wrote:
Greetings Steve,

Have you tried running nodialog.exe with the "-singleinstance" command line parameter?
https://www.instantiations.com/docs/91/wwhelp/wwhimpl/js/html/wwhelp.htm#href=sg/stug50.html

I like the idea of -singleinstance, but if my memory serves, the feedback to the user is insufficient. (Possibly no feedback at all)
I seem to recall that -singleinstance did not do anything such as raise the topmost window of the already running instance, so a minimized or obscured application would remain invisible to the user. Of course, things may have changed in the decade or two since I last experimented with that command line option.

It would be good if one could configure the image to provide message text to display if -singleinstance finds it isn't the first instance.
Of course, the implementation probably doesn't even start the VM, so getting information from the image might be problematic. Perhaps an optional argument on the command line for the message to display?


Steve, I always recommend copying nodialog.exe to e.g. myappname.exe when deploying an runtime image.
a) The task list gives better indication of what it is
b) If you were to have a second image running concurrently (i.e. a different Smalltalk application), two nodialog.exes would make the task list especially confusing and eliminate any possibility of using -singleinstance.


I believe you are on active support with us?
If this doesn't solve your issue, send in a support case as we have some things ready-to-go that
we can offer.

Kind Regards,

- Seth

On Friday, May 17, 2019 at 10:46:22 AM UTC-4, Steve Ripley wrote:
We're running VAST 9.0 and starting to build the 64 bit image on 64 bit machines running Windows 10.
How can we determine if nodialog.exe is running?  I want to prevent the image from being started multiple times on a workstation. 
On the 32 bit image on 32 bit machines I ask the SPRDLL.DLL

tasksNamedLike: aString

| tList listSize location matchingList |

listSize := 100.

matchingList := OrderedCollection new.

tList := self new taskList: listSize.

1 to: listSize do: [ :i |

                location := (tList at: ('processName', (i printString))) indexOfSubCollection: aString startingAt: 1.

                location = 0

                                ifFalse: [matchingList add: (tList at: ('processID', (i printString))).].

].

^matchingList.

 

taskList: aSize

| tListStructure tListPointer tListFunction rc  |

tListStructure := (self taskListStructureCompoundType: aSize) newRecord.

tListPointer :=  (tListStructure abtMoveToOSMemory data).

tListFunction := PlatformFunction

                                callingConvention: 'c'

                                function: 'GetTaskList'

                                library: 'SPRDLL'

                                parameterTypes: #(pointer int32 )

                                returnType: #int32.

rc := tListFunction callWith: tListPointer  with: 100.

tListFunction := PlatformFunction

                                callingConvention: 'c'

                                function: 'GetWindowTitles'

                                library: 'SPRDLL'

                                parameterTypes: #(pointer int32 )

                                returnType: #int32.

rc := tListFunction callWith: tListPointer  with: 100.

^tListStructure.


I then look through the result for nodialog.exe.


Thanks for looking.

--
You received this message because you are subscribed to a topic in the Google Groups "VA Smalltalk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/va-smalltalk/Pq5SKuLTkWQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/6aacb3e7-5b2e-4f54-9a4d-01ca4737d56d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/CAGNapEOLrH%3D7VZ53ZQ7PmmWt%2BdxhoGxQv4EW0_b7y%3DwTD2tFQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: 64 bit tasklist lookup to see if nodialog.exe is running

Noschvie
In reply to this post by steve.ripley10
Hi Steve
during the startup of the client application we are using this function call
OSSecurityAttributes>>#createMutex:lpszMutexName:
to check if the application is running. The check can be done per session (local) or per machine (global).
br
Norbert

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/74fc4c58-e6a8-4e1b-a314-71c95d30f5f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: 64 bit tasklist lookup to see if nodialog.exe is running

steve.ripley10


On Monday, May 20, 2019 at 7:04:48 AM UTC-5, Norbert Schlemmer wrote:
Hi Steve
during the startup of the client application we are using this function call
OSSecurityAttributes>>#createMutex:lpszMutexName:
to check if the application is running. The check can be done per session (local) or per machine (global).
br
Norbert

Thanks all for the responses!

Ripley

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/0d680b58-bd91-4dc2-87ec-be314f7a6bf4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: 64 bit tasklist lookup to see if nodialog.exe is running

Seth Berman
In reply to this post by Richard Sargent
Hi Richard,

Sure, that's reasonable suggestion. I'll take a look.  Thanks.

- Seth

On Friday, May 17, 2019 at 3:12:51 PM UTC-4, Richard Sargent wrote:
On Fri, May 17, 2019 at 11:09 AM 'Seth Berman' via VA Smalltalk <[hidden email]> wrote:
Hi Richard,

I don't see that there is any feedback (unless running a debug version of the the exe).

That's what I thought I remembered.

What about having the nodialog.exe display a message provided on the command line following the -singleinstance option (or using e.g. a -sim "message" option)?



It does not start the vm, the implementation is based on the working of CreateMutex on Windows right at the beginning of main() in the exe so you would need to print to stdout.
A search on this topic shows that it is pretty much the accepted way to do it.

However, I see some other places where you can use FindWindow() to force something to the front...we just don't have that.
see <a href="http://www.bcbjournal.org/articles/vol3/9911/Single-instance_applications.htm" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.bcbjournal.org%2Farticles%2Fvol3%2F9911%2FSingle-instance_applications.htm\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFnwEy6xKfld0vfZwOPjM613MqN8w&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.bcbjournal.org%2Farticles%2Fvol3%2F9911%2FSingle-instance_applications.htm\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFnwEy6xKfld0vfZwOPjM613MqN8w&#39;;return true;">http://www.bcbjournal.org/articles/vol3/9911/Single-instance_applications.htm

Looks like we have a case in our backlog on just this issue which references a google post.
The last entry in the post is interesting and worries me a little. It obviously has never rising to the level of being implementable, but I can take a second look.
<a href="https://groups.google.com/forum/#!topic/va-smalltalk/DVFuwIH-0uE" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/forum/#!topic/va-smalltalk/DVFuwIH-0uE&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/forum/#!topic/va-smalltalk/DVFuwIH-0uE&#39;;return true;">https://groups.google.com/forum/#!topic/va-smalltalk/DVFuwIH-0uE

- Seth

On Friday, May 17, 2019 at 1:43:13 PM UTC-4, Richard Sargent wrote:
On Friday, May 17, 2019 at 8:53:11 AM UTC-7, Seth Berman wrote:
Greetings Steve,

Have you tried running nodialog.exe with the "-singleinstance" command line parameter?
<a href="https://www.instantiations.com/docs/91/wwhelp/wwhimpl/js/html/wwhelp.htm#href=sg/stug50.html" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.instantiations.com%2Fdocs%2F91%2Fwwhelp%2Fwwhimpl%2Fjs%2Fhtml%2Fwwhelp.htm%23href%3Dsg%2Fstug50.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDOrdzbp6CB7h4uqwNEM58Sq05cQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.instantiations.com%2Fdocs%2F91%2Fwwhelp%2Fwwhimpl%2Fjs%2Fhtml%2Fwwhelp.htm%23href%3Dsg%2Fstug50.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDOrdzbp6CB7h4uqwNEM58Sq05cQ&#39;;return true;">https://www.instantiations.com/docs/91/wwhelp/wwhimpl/js/html/wwhelp.htm#href=sg/stug50.html

I like the idea of -singleinstance, but if my memory serves, the feedback to the user is insufficient. (Possibly no feedback at all)
I seem to recall that -singleinstance did not do anything such as raise the topmost window of the already running instance, so a minimized or obscured application would remain invisible to the user. Of course, things may have changed in the decade or two since I last experimented with that command line option.

It would be good if one could configure the image to provide message text to display if -singleinstance finds it isn't the first instance.
Of course, the implementation probably doesn't even start the VM, so getting information from the image might be problematic. Perhaps an optional argument on the command line for the message to display?


Steve, I always recommend copying nodialog.exe to e.g. myappname.exe when deploying an runtime image.
a) The task list gives better indication of what it is
b) If you were to have a second image running concurrently (i.e. a different Smalltalk application), two nodialog.exes would make the task list especially confusing and eliminate any possibility of using -singleinstance.


I believe you are on active support with us?
If this doesn't solve your issue, send in a support case as we have some things ready-to-go that
we can offer.

Kind Regards,

- Seth

On Friday, May 17, 2019 at 10:46:22 AM UTC-4, Steve Ripley wrote:
We're running VAST 9.0 and starting to build the 64 bit image on 64 bit machines running Windows 10.
How can we determine if nodialog.exe is running?  I want to prevent the image from being started multiple times on a workstation. 
On the 32 bit image on 32 bit machines I ask the SPRDLL.DLL

tasksNamedLike: aString

| tList listSize location matchingList |

listSize := 100.

matchingList := OrderedCollection new.

tList := self new taskList: listSize.

1 to: listSize do: [ :i |

                location := (tList at: ('processName', (i printString))) indexOfSubCollection: aString startingAt: 1.

                location = 0

                                ifFalse: [matchingList add: (tList at: ('processID', (i printString))).].

].

^matchingList.

 

taskList: aSize

| tListStructure tListPointer tListFunction rc  |

tListStructure := (self taskListStructureCompoundType: aSize) newRecord.

tListPointer :=  (tListStructure abtMoveToOSMemory data).

tListFunction := PlatformFunction

                                callingConvention: 'c'

                                function: 'GetTaskList'

                                library: 'SPRDLL'

                                parameterTypes: #(pointer int32 )

                                returnType: #int32.

rc := tListFunction callWith: tListPointer  with: 100.

tListFunction := PlatformFunction

                                callingConvention: 'c'

                                function: 'GetWindowTitles'

                                library: 'SPRDLL'

                                parameterTypes: #(pointer int32 )

                                returnType: #int32.

rc := tListFunction callWith: tListPointer  with: 100.

^tListStructure.


I then look through the result for nodialog.exe.


Thanks for looking.

--
You received this message because you are subscribed to a topic in the Google Groups "VA Smalltalk" group.
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/va-smalltalk/Pq5SKuLTkWQ/unsubscribe" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/topic/va-smalltalk/Pq5SKuLTkWQ/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/va-smalltalk/Pq5SKuLTkWQ/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/va-smalltalk/Pq5SKuLTkWQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at <a href="https://groups.google.com/group/va-smalltalk" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/va-smalltalk&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/va-smalltalk&#39;;return true;">https://groups.google.com/group/va-smalltalk.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/va-smalltalk/6aacb3e7-5b2e-4f54-9a4d-01ca4737d56d%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/va-smalltalk/6aacb3e7-5b2e-4f54-9a4d-01ca4737d56d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/va-smalltalk/6aacb3e7-5b2e-4f54-9a4d-01ca4737d56d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/va-smalltalk/6aacb3e7-5b2e-4f54-9a4d-01ca4737d56d%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/160760b5-db8f-4319-a80f-3a93e5ab5386%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: 64 bit tasklist lookup to see if nodialog.exe is running

Louis LaBrunda
Hi Guys,

I've used "-singleinstance" on windows and it works fine.  It would be nice if the image could in someway be informed that an attempt to start the same program again occurred.  If say, the program is a GUI and the main window is minimized, the image could then display the window.  This would probably get the user where they want to be.

Lou



On Monday, May 20, 2019 at 10:09:31 AM UTC-4, Seth Berman wrote:
Hi Richard,

Sure, that's reasonable suggestion. I'll take a look.  Thanks.

- Seth

On Friday, May 17, 2019 at 3:12:51 PM UTC-4, Richard Sargent wrote:
On Fri, May 17, 2019 at 11:09 AM 'Seth Berman' via VA Smalltalk <<a href="javascript:" rel="nofollow" target="_blank" gdf-obfuscated-mailto="0PiGd8QnBQAJ" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">va-sma...@...> wrote:
Hi Richard,

I don't see that there is any feedback (unless running a debug version of the the exe).

That's what I thought I remembered.

What about having the nodialog.exe display a message provided on the command line following the -singleinstance option (or using e.g. a -sim "message" option)?



It does not start the vm, the implementation is based on the working of CreateMutex on Windows right at the beginning of main() in the exe so you would need to print to stdout.
A search on this topic shows that it is pretty much the accepted way to do it.

However, I see some other places where you can use FindWindow() to force something to the front...we just don't have that.
see <a href="http://www.bcbjournal.org/articles/vol3/9911/Single-instance_applications.htm" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.bcbjournal.org%2Farticles%2Fvol3%2F9911%2FSingle-instance_applications.htm\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFnwEy6xKfld0vfZwOPjM613MqN8w&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.bcbjournal.org%2Farticles%2Fvol3%2F9911%2FSingle-instance_applications.htm\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFnwEy6xKfld0vfZwOPjM613MqN8w&#39;;return true;">http://www.bcbjournal.org/articles/vol3/9911/Single-instance_applications.htm

Looks like we have a case in our backlog on just this issue which references a google post.
The last entry in the post is interesting and worries me a little. It obviously has never rising to the level of being implementable, but I can take a second look.
<a href="https://groups.google.com/forum/#!topic/va-smalltalk/DVFuwIH-0uE" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/forum/#!topic/va-smalltalk/DVFuwIH-0uE&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/forum/#!topic/va-smalltalk/DVFuwIH-0uE&#39;;return true;">https://groups.google.com/forum/#!topic/va-smalltalk/DVFuwIH-0uE

- Seth

On Friday, May 17, 2019 at 1:43:13 PM UTC-4, Richard Sargent wrote:
On Friday, May 17, 2019 at 8:53:11 AM UTC-7, Seth Berman wrote:
Greetings Steve,

Have you tried running nodialog.exe with the "-singleinstance" command line parameter?
<a href="https://www.instantiations.com/docs/91/wwhelp/wwhimpl/js/html/wwhelp.htm#href=sg/stug50.html" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.instantiations.com%2Fdocs%2F91%2Fwwhelp%2Fwwhimpl%2Fjs%2Fhtml%2Fwwhelp.htm%23href%3Dsg%2Fstug50.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDOrdzbp6CB7h4uqwNEM58Sq05cQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.instantiations.com%2Fdocs%2F91%2Fwwhelp%2Fwwhimpl%2Fjs%2Fhtml%2Fwwhelp.htm%23href%3Dsg%2Fstug50.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDOrdzbp6CB7h4uqwNEM58Sq05cQ&#39;;return true;">https://www.instantiations.com/docs/91/wwhelp/wwhimpl/js/html/wwhelp.htm#href=sg/stug50.html

I like the idea of -singleinstance, but if my memory serves, the feedback to the user is insufficient. (Possibly no feedback at all)
I seem to recall that -singleinstance did not do anything such as raise the topmost window of the already running instance, so a minimized or obscured application would remain invisible to the user. Of course, things may have changed in the decade or two since I last experimented with that command line option.

It would be good if one could configure the image to provide message text to display if -singleinstance finds it isn't the first instance.
Of course, the implementation probably doesn't even start the VM, so getting information from the image might be problematic. Perhaps an optional argument on the command line for the message to display?


Steve, I always recommend copying nodialog.exe to e.g. myappname.exe when deploying an runtime image.
a) The task list gives better indication of what it is
b) If you were to have a second image running concurrently (i.e. a different Smalltalk application), two nodialog.exes would make the task list especially confusing and eliminate any possibility of using -singleinstance.


I believe you are on active support with us?
If this doesn't solve your issue, send in a support case as we have some things ready-to-go that
we can offer.

Kind Regards,

- Seth

On Friday, May 17, 2019 at 10:46:22 AM UTC-4, Steve Ripley wrote:
We're running VAST 9.0 and starting to build the 64 bit image on 64 bit machines running Windows 10.
How can we determine if nodialog.exe is running?  I want to prevent the image from being started multiple times on a workstation. 
On the 32 bit image on 32 bit machines I ask the SPRDLL.DLL

tasksNamedLike: aString

| tList listSize location matchingList |

listSize := 100.

matchingList := OrderedCollection new.

tList := self new taskList: listSize.

1 to: listSize do: [ :i |

                location := (tList at: ('processName', (i printString))) indexOfSubCollection: aString startingAt: 1.

                location = 0

                                ifFalse: [matchingList add: (tList at: ('processID', (i printString))).].

].

^matchingList.

 

taskList: aSize

| tListStructure tListPointer tListFunction rc  |

tListStructure := (self taskListStructureCompoundType: aSize) newRecord.

tListPointer :=  (tListStructure abtMoveToOSMemory data).

tListFunction := PlatformFunction

                                callingConvention: 'c'

                                function: 'GetTaskList'

                                library: 'SPRDLL'

                                parameterTypes: #(pointer int32 )

                                returnType: #int32.

rc := tListFunction callWith: tListPointer  with: 100.

tListFunction := PlatformFunction

                                callingConvention: 'c'

                                function: 'GetWindowTitles'

                                library: 'SPRDLL'

                                parameterTypes: #(pointer int32 )

                                returnType: #int32.

rc := tListFunction callWith: tListPointer  with: 100.

^tListStructure.


I then look through the result for nodialog.exe.


Thanks for looking.

--
You received this message because you are subscribed to a topic in the Google Groups "VA Smalltalk" group.
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/va-smalltalk/Pq5SKuLTkWQ/unsubscribe" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/topic/va-smalltalk/Pq5SKuLTkWQ/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/va-smalltalk/Pq5SKuLTkWQ/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/va-smalltalk/Pq5SKuLTkWQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to <a href="javascript:" rel="nofollow" target="_blank" gdf-obfuscated-mailto="0PiGd8QnBQAJ" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">va-sma...@googlegroups.com.
To post to this group, send email to <a href="javascript:" rel="nofollow" target="_blank" gdf-obfuscated-mailto="0PiGd8QnBQAJ" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">va-sma...@....
Visit this group at <a href="https://groups.google.com/group/va-smalltalk" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/group/va-smalltalk&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/va-smalltalk&#39;;return true;">https://groups.google.com/group/va-smalltalk.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/va-smalltalk/6aacb3e7-5b2e-4f54-9a4d-01ca4737d56d%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/va-smalltalk/6aacb3e7-5b2e-4f54-9a4d-01ca4737d56d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/va-smalltalk/6aacb3e7-5b2e-4f54-9a4d-01ca4737d56d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/va-smalltalk/6aacb3e7-5b2e-4f54-9a4d-01ca4737d56d%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/6bdc63ea-fde3-4c0f-9abf-445197b6e144%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.