These things are very much depending on the Operating System you are using. On Windows you have to bring in functions from the Kernel32.dll. Pretty hairy code though!
You are much better off using one of the GUI toolkits.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.