Click here to Skip to main content
15,891,409 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Linux Feasibility Question Pin
David O'Neil7-Nov-19 13:04
professionalDavid O'Neil7-Nov-19 13:04 
GeneralRe: Linux Feasibility Question Pin
charlieg7-Nov-19 17:09
charlieg7-Nov-19 17:09 
GeneralRe: Linux Feasibility Question Pin
Chris C-B7-Nov-19 20:43
Chris C-B7-Nov-19 20:43 
GeneralRe: Linux Feasibility Question Pin
Mike Hankey7-Nov-19 10:53
mveMike Hankey7-Nov-19 10:53 
GeneralRe: Linux Feasibility Question Pin
David O'Neil7-Nov-19 11:25
professionalDavid O'Neil7-Nov-19 11:25 
GeneralRe: Linux Feasibility Question Pin
Dar Brett7-Nov-19 12:36
Dar Brett7-Nov-19 12:36 
GeneralRe: Linux Feasibility Question Pin
David O'Neil7-Nov-19 13:07
professionalDavid O'Neil7-Nov-19 13:07 
GeneralThe unholy hell of trying to disable Pinning... Pin
Dave Kreskowiak7-Nov-19 9:15
mveDave Kreskowiak7-Nov-19 9:15 
An app I'm working on needs to disable the option to pin the app to the Start and Taskbar. Why? Security concerns. I know, right?!

OK, dig into Google to find out what's involved.

Hmmmm... not much on this except for Raymond Chen's blog post on it with a tiny little C snippet that does it, and the WindowsAPICodePack.

Aight. The codepack is HUGE for what I need it for. One of the restrictions on my app is to make the resulting .EXE as small as possible. The codepack weighs in at almost 700K. This is not an option for an app that has to stay small.

Next option. Write up Raymond's code into a tiny little C++ CLI library and just reference that from the main app.

Crap! Can't do that either. The C++ library targets Win32, not straight-up IL. This is a problem because I also need to keep the app as a single .EXE file with no external .DLL's. To do this, I use ILMerge as a post-build step to roll in my library .DLLs, but it won't throw a Win32 .DLL into a .NET .EXE (and still work.)

Soooooo.... last option. Get the source for the WindowsAPICodePack and strip it down to the ... HOLY ELEPHANTING HELL! Over 50,000 lines of code in this thing! [mutters to self] Is there any part of Windows this thing doesn't wrap?

OK, start digging through and learning the code base. It turns out the thing is nicely organized, but every class is seemingly dependent on every other class. Apparently, complexity was a design requirement. Basically, this library is a massive pile of manually written COM-interop without all the automated helpers Visual Studio and the tools generates for you when you add a reference to a COM .DLL. All this work is necessary because the Windows .DLL that handles this, PropSys.dll, is not COM-exposed.

It took me two days, and a bunch of Beer | [beer] , to slash and burn the code like a Brazilian rain forest with the final result down to about 100 lines of code and a 19K .DLL that ILMerge can deal with. With a bit more time I don't have, I can make it smaller.

Three days to remove one little option on the Taskbar.

GeneralRe: The unholy hell of trying to disable Pinning... Pin
OriginalGriff7-Nov-19 9:26
mveOriginalGriff7-Nov-19 9:26 
GeneralRe: The unholy hell of trying to disable Pinning... Pin
Dave Kreskowiak7-Nov-19 9:42
mveDave Kreskowiak7-Nov-19 9:42 
GeneralRe: The unholy hell of trying to disable Pinning... Pin
OriginalGriff7-Nov-19 9:54
mveOriginalGriff7-Nov-19 9:54 
GeneralRe: The unholy hell of trying to disable Pinning... Pin
Nelek7-Nov-19 13:27
protectorNelek7-Nov-19 13:27 
GeneralRe: The unholy hell of trying to disable Pinning... Pin
RickZeeland7-Nov-19 9:58
mveRickZeeland7-Nov-19 9:58 
GeneralRe: The unholy hell of trying to disable Pinning... Pin
Phil J Pearson7-Nov-19 22:46
Phil J Pearson7-Nov-19 22:46 
GeneralRe: The unholy hell of trying to disable Pinning... Pin
Dave Kreskowiak8-Nov-19 2:29
mveDave Kreskowiak8-Nov-19 2:29 
QuestionDesigner or No Designer? What say you? Pin
MSBassSinger7-Nov-19 6:58
professionalMSBassSinger7-Nov-19 6:58 
AnswerRe: Designer or No Designer? What say you? Pin
ZurdoDev7-Nov-19 7:03
professionalZurdoDev7-Nov-19 7:03 
AnswerRe: Designer or No Designer? What say you? PinPopular
Marc Clifton7-Nov-19 7:19
mvaMarc Clifton7-Nov-19 7:19 
GeneralRe: Designer or No Designer? What say you? Pin
Gary Wheeler8-Nov-19 1:39
Gary Wheeler8-Nov-19 1:39 
GeneralRe: Designer or No Designer? What say you? Pin
Matt McGuire12-Nov-19 6:56
professionalMatt McGuire12-Nov-19 6:56 
GeneralRe: Designer or No Designer? What say you? Pin
Gary Wheeler13-Nov-19 1:46
Gary Wheeler13-Nov-19 1:46 
AnswerRe: Designer or No Designer? What say you? Pin
Jacquers7-Nov-19 7:32
Jacquers7-Nov-19 7:32 
GeneralRe: Designer or No Designer? What say you? Pin
Mario Luis7-Nov-19 21:39
Mario Luis7-Nov-19 21:39 
AnswerRe: Designer or No Designer? What say you? Pin
Richard Deeming7-Nov-19 7:35
mveRichard Deeming7-Nov-19 7:35 
GeneralRe: Designer or No Designer? What say you? Pin
Jacquers7-Nov-19 21:38
Jacquers7-Nov-19 21:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.