Discussion:
How do I un-group my GUI from other python scripts in the MSW taskbar?
Nathan McCorkle
2014-09-16 17:30:44 UTC
Permalink
When I open one GUI, my Frame name shows up with the icon I set to it in
the Windows taskbar. But when I open more than one GUI, the icon changes to
the default Python icon, and the name changes from the Frame title to
'pythonw' (pythonw.exe is the interpreter I'm calling the scripts with).

Online I found a win32/ctypes fix, but it only seems to work for >WinXP
(and I'm developing for WinXP). That fix is
the SetCurrentProcessExplicitAppUserModelID call.

Werner recommended I try wx.App.SetAppName(myWxApp, 'newAppNameString')
but that had no effect.

In #winapi on Freenode IRC, someone said I could copy the pythonw.exe and
rename it every time I launch a GUI... but said that some virus scanner
programs might not be happy about that. I haven't tried it to see if the
corporate-wide virus protection would complain or not, but I'd prefer a
more pythonic way of doing this. Even if it's a bunch of C-looking
win32-specific code (I only have to worry about this working on Windows).
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nathan McCorkle
2014-09-17 17:47:00 UTC
Permalink
Here's my failed (at least currently) attempt at trying to change the
process name. This was adapted from some Visual Basic code I found online.
While it does change the process name in task manager, I don't think I'm
converting the string correctly as the process name changes to garbage or
non-English characters.

http://pastebin.com/zPhadEqn
(apparently some people don't like pastebin so
here http://paste.pound-python.org/show/rY6OzCpK6NmDlUYAdhl5/ )

Now I'm not sure if it is a result of the garbage characters, or that
something else is fundamentally wrong with this approach, but my GUI
processes didn't seem to ungroup (when I had a break call just after
SetItemText so only the first .EXE item was getting changed). I also didn't
see the taskbar group name 'pythonw' change to garbage with the code
as-pasted (i.e. without a break after SetItemText, so it will change all
pythonw.exe process names)


Can some win32 wizard see the error in my idea/implementation?
Post by Nathan McCorkle
When I open one GUI, my Frame name shows up with the icon I set to it in
the Windows taskbar. But when I open more than one GUI, the icon changes to
the default Python icon, and the name changes from the Frame title to
'pythonw' (pythonw.exe is the interpreter I'm calling the scripts with).
Online I found a win32/ctypes fix, but it only seems to work for >WinXP
(and I'm developing for WinXP). That fix is
the SetCurrentProcessExplicitAppUserModelID call.
Werner recommended I try wx.App.SetAppName(myWxApp, 'newAppNameString')
but that had no effect.
In #winapi on Freenode IRC, someone said I could copy the pythonw.exe and
rename it every time I launch a GUI... but said that some virus scanner
programs might not be happy about that. I haven't tried it to see if the
corporate-wide virus protection would complain or not, but I'd prefer a
more pythonic way of doing this. Even if it's a bunch of C-looking
win32-specific code (I only have to worry about this working on Windows).
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Tim Roberts
2014-09-17 17:54:41 UTC
Permalink
Post by Nathan McCorkle
Here's my failed (at least currently) attempt at trying to change the
process name. This was adapted from some Visual Basic code I found
online. While it does change the process name in task manager, I don't
think I'm converting the string correctly as the process name changes
to garbage or non-English characters.
Are you on a 64-bit operating system? The LVITEM structure you're
building assumes it will be used in a 32-bit process. (The
SharedProcMemString is being encoded as a 32-bit value.) If you're on a
64-bit system, Explorer is a 64-bit process, so the pointer needs to be
a 64-bit field.
--
Tim Roberts, ***@probo.com
Providenza & Boekelheide, Inc.
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nathan McCorkle
2014-09-17 18:01:49 UTC
Permalink
Post by Tim Roberts
Post by Nathan McCorkle
Here's my failed (at least currently) attempt at trying to change the
process name. This was adapted from some Visual Basic code I found
online. While it does change the process name in task manager, I don't
think I'm converting the string correctly as the process name changes
to garbage or non-English characters.
Are you on a 64-bit operating system?
Nope, Windows XP, Version 2002, SP3
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nathan McCorkle
2014-09-17 18:07:38 UTC
Permalink
Post by Nathan McCorkle
Post by Tim Roberts
Post by Nathan McCorkle
Here's my failed (at least currently) attempt at trying to change the
process name. This was adapted from some Visual Basic code I found
online. While it does change the process name in task manager, I don't
think I'm converting the string correctly as the process name changes
to garbage or non-English characters.
Are you on a 64-bit operating system?
Nope, Windows XP, Version 2002, SP3
P.S. this is where I got VB code:
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=66443&lngWId=1

Repasted the source files here:
prjTaskHider.vbp
https://bpaste.net/show/eba90dd1366e

mSharedMemory.bas
https://bpaste.net/show/12eba4a4e82f

mTask.bas
https://bpaste.net/show/ca3adf9d2bf7

frmTask.frm
https://bpaste.net/show/9deaf894dda5
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...