[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] Anyone know how to programatically assigna file type icon on windows?
From:       Luna Tuna <fruitfulapproach () gmail ! com>
Date:       2019-05-08 2:56:49
Message-ID: CABhCPet6HExy3G3YstWrbqGThe9woPxttvcJG2EpN2+f25bUkA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/related)]

[Attachment #4 (multipart/alternative)]


I followed the canonical instructions here:

https://docs.microsoft.com/en-us/windows/desktop/shell/how-to-assign-a-custom-icon-to-a-file-type


I manually edited the registry to achieve this:
[image: image.png]

And I called this in my app's main function:

from win32com.shell import shell,
shellconshell.SHChangeNotify(shellcon.SHCNE_ASSOCCHANGED,
shellcon.SHCNF_IDLIST, None, None)

Did nothing!

Thanks.

[Attachment #7 (text/html)]

<div dir="ltr">I followed the canonical instructions here:<div><br></div><div><a \
href="https://docs.microsoft.com/en-us/windows/desktop/shell/how-to-assign-a-custom-ic \
on-to-a-file-type">https://docs.microsoft.com/en-us/windows/desktop/shell/how-to-assign-a-custom-icon-to-a-file-type</a> \
<br></div><div><br></div><div>I manually edited the registry to achieve \
this:</div><div><div><img src="cid:ii_jvems5q10" alt="image.png" width="542" \
height="305"><br></div></div><div><br></div><div>And I called this in my app&#39;s \
main function:</div><div><br></div><div><pre class="gmail-markdown-highlight" \
style="box-sizing:border-box;overflow:auto;font-family:Menlo,Monaco,Consolas,&quot;Courier \
New&quot;,monospace;font-size:13px;padding:9.5px;margin-top:1rem;margin-bottom:10px;li \
ne-height:1.42857;word-break:break-all;color:rgb(51,51,51);border:none;border-radius:0px;max-height:350px"><code \
class="gmail-hljs gmail-css" \
style="box-sizing:border-box;font-family:Menlo,Monaco,Consolas,&quot;Courier \
New&quot;,monospace;font-size:inherit;padding:0.5em;color:black;background-image:initi \
al;background-position:initial;background-size:initial;background-repeat:initial;backg \
round-origin:initial;background-clip:initial;border-radius:0px;display:inline-block;overflow-x:auto;min-width:100%"><span \
class="gmail-hljs-selector-tag" \
style="box-sizing:border-box;color:rgb(0,0,136)">from</span> <span \
class="gmail-hljs-selector-tag" \
style="box-sizing:border-box;color:rgb(0,0,136)">win32com</span><span \
class="gmail-hljs-selector-class" \
style="box-sizing:border-box;color:rgb(155,112,63)">.shell</span> <span \
class="gmail-hljs-selector-tag" \
style="box-sizing:border-box;color:rgb(0,0,136)">import</span> <span \
class="gmail-hljs-selector-tag" \
style="box-sizing:border-box;color:rgb(0,0,136)">shell</span>, <span \
class="gmail-hljs-selector-tag" \
style="box-sizing:border-box;color:rgb(0,0,136)">shellcon</span> <span \
class="gmail-hljs-selector-tag" \
style="box-sizing:border-box;color:rgb(0,0,136)">shell</span><span \
class="gmail-hljs-selector-class" \
style="box-sizing:border-box;color:rgb(155,112,63)">.SHChangeNotify</span>(<span \
class="gmail-hljs-selector-tag" \
style="box-sizing:border-box;color:rgb(0,0,136)">shellcon</span><span \
class="gmail-hljs-selector-class" \
style="box-sizing:border-box;color:rgb(155,112,63)">.SHCNE_ASSOCCHANGED</span>, <span \
class="gmail-hljs-selector-tag" \
style="box-sizing:border-box;color:rgb(0,0,136)">shellcon</span><span \
class="gmail-hljs-selector-class" \
style="box-sizing:border-box;color:rgb(155,112,63)">.SHCNF_IDLIST</span>, <span \
class="gmail-hljs-selector-tag" \
style="box-sizing:border-box;color:rgb(0,0,136)">None</span>, <span \
class="gmail-hljs-selector-tag" \
style="box-sizing:border-box;color:rgb(0,0,136)">None</span>)  </code></pre><pre \
class="gmail-markdown-highlight" \
style="box-sizing:border-box;overflow:auto;font-family:Menlo,Monaco,Consolas,&quot;Courier \
New&quot;,monospace;font-size:13px;padding:9.5px;margin-top:1rem;margin-bottom:10px;li \
ne-height:1.42857;word-break:break-all;color:rgb(51,51,51);border:none;border-radius:0px;max-height:350px"><code \
class="gmail-hljs gmail-css" \
style="box-sizing:border-box;font-family:Menlo,Monaco,Consolas,&quot;Courier \
New&quot;,monospace;font-size:inherit;padding:0.5em;color:black;background-image:initi \
al;background-position:initial;background-size:initial;background-repeat:initial;backg \
round-origin:initial;background-clip:initial;border-radius:0px;display:inline-block;overflow-x:auto;min-width:100%">Did \
nothing!</code></pre><pre class="gmail-markdown-highlight" \
style="box-sizing:border-box;overflow:auto;font-family:Menlo,Monaco,Consolas,&quot;Courier \
New&quot;,monospace;font-size:13px;padding:9.5px;margin-top:1rem;margin-bottom:10px;li \
ne-height:1.42857;word-break:break-all;color:rgb(51,51,51);border:none;border-radius:0px;max-height:350px"><code \
class="gmail-hljs gmail-css" \
style="box-sizing:border-box;font-family:Menlo,Monaco,Consolas,&quot;Courier \
New&quot;,monospace;font-size:inherit;padding:0.5em;color:black;background-image:initi \
al;background-position:initial;background-size:initial;background-repeat:initial;backg \
round-origin:initial;background-clip:initial;border-radius:0px;display:inline-block;overflow-x:auto;min-width:100%">Thanks.</code></pre></div></div>



["image.png" (image/png)]
[Attachment #9 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic