views:

465

answers:

3

Does anyone know of a good tutorial/e-book that goes in depth on the System.Runtime.InteropServices namespace? I just got through reading this tutorial on how to make the UAC shield show up in a button and now I really want to learn this.

P.S. How do look in the windows system files to know that a method exist to show a UAC shield in a button?

+8  A: 

There are lots of practical examples at http://pinvoke.net.

jeffamaphone
I'm sorry for taking the answer away from you, but scotty2012 gave me exactly what I was looking for. However, I love P/Invoke.net its great. Thanks for all your help.
Lucas McCoy
+3  A: 

Check out the P/Invoke Interop Assistant, as well. There's some great code there, and a very useful tool. It makes it much easier to learn.

Reed Copsey
+1  A: 

As for your p.s., the code you need is in the information you provided. You use the SendMessage method to send the BCM_SETSHIELD message to a handle (in this case, the handle of your button) that should show it.

EDIT

pinvoke.net is a good place to get the prototypes of native functions, but if you don't know what you are looking for, it's not the best. I would suggest the Windows API reference section of MSDN. You can browse functions in alphabetical order, by category, and by Windows Release, all with descriptions of what they do, what they return and the flag options that control their actions.

scottm
Sorry but you misunderstood me, I was wanting to know how people find these methods in the native dll's, not specifically the SendMessage method.
Lucas McCoy
@Lucas, I edited my answer to include another reference you should look into.
scottm
Thanks this was really nice! So nice in fact that I'm actually gonna give you the answer. This is exactly what I wanted.
Lucas McCoy