Wednesday, January 03, 2007

My Shares

I was back to my WIN32 programming days after a break. Reason being that I wanted to have an easy way of inserting a link to a local shared folder into the email message. For long I've been using a signature which contains only the NETBIOS machine name (these corporate machine names are long and difficult to remember) and would insert it and then complete the path by typing in the folder name. Wish I had a tray applet that would show the list of shared folders and allow me to copy the path to clipboard. Couldn't resist waiting more and after 2 hours of meddling around with MSDN help a tiny WTL app was up and running.
It was not very hard, but finding the right API's was a bit challenging. And then I was stuck at some conversion functions.
Here's are the main functions that I chose:
NetShareEnum - Gives the list of shared resources on a given machine
wcstombs - To convert wide str to mcbs (NetShareEnum returns wide str)
OpenClipboard, EmptyClipboard, SetClipboardData, CloseClipboard- For clipboard operations
GetAsyncKeyState - Status of shift key

1 comment:

bZoy said...

hey i am bejoy too