Jump to content
  • Advertisement
Sign in to follow this  
UriKiller

IPicture and IStream + Question about Windows

This topic is 4829 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I got an IPicture varaible. one of IPicture's methods is SaveAsFile which gets as first parameter an IStream*. I really have no clue how to get such a thing. I tried stgCreateDocFile into an IStorage and then used the method of IStorage - CreateStream, but when i give the 2nd function the same params as the first, it fails, and besides, why should i give it the params twice?? Oh and by the way, instead of making a new thread i will ask another question: How to make a window blink in an orange color in the taskbar like usually happens in chat programs when a new message arrives until you restore that window into the focus.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
you can use CreateStreamOnHGlobal to create an IStream object associated with memory. pass a NULL for the hGlobal parm to have the initial memory allocated for you with a zero size. aftering calling the IPicture method to save the contents to the IStream you can call GetHGlobalFromStream to get a global handle to the allocated memory associated with the IStream. then save this memory off to a file using your favorite file write function/method/whatever. you'll have to call GlobalLock with the HGLOBAL returned via GetHGlobalFromStream to get a void pointer that can then be used with fwrite, for instance. then call GlobalUnlock to release the lock and Release on the IStream object to free up the memory.

flashing a taskbar button for a background app can be accomplished with the SetForegroundWindow function.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!