Click here to Skip to main content
15,896,063 members
Articles / Desktop Programming / Windows Forms

Cool, Semi-transparent and Shaped Dialogs with Standard Controls for Windows 2000 and Above

Rate me:
Please Sign up or sign in to vote.
4.85/5 (95 votes)
28 Sep 2012CPOL3 min read 2.9M   32.8K   350  
This article tries to find a way to show Windows standard controls on layered windows. Provides both Native MFC and WinForms source code.
/**************************************************************************
*
* Copyright (c) 2000 Microsoft Corporation
*
* Module Name:
*
*   CachedBitmap class definition
*
* Abstract:
*
*   CachedBitmap is a representation of an accelerated drawing
*   that has restrictions on what operations are allowed in order
*   to accelerate the drawing to the destination.
*
**************************************************************************/

#ifndef _GDIPLUSCACHEDBITMAP_H
#define _GDIPLUSCACHEDBITMAP_H

/**************************************************************************
*
* Class Name:
*
*   CachedBitmap
*
* Abstract:
*
*   An object to store a bitmap prepared for rendering on a particular
*   Graphics object. The memory storage for the CachedBitmap is opaque
*   to the other Engine code, so the only operations supported are
*   initializing the data (with a bitmap) and using the graphics to
*   draw it on the screen with an integer offset.
*
*   Look for the class definition in GdiplusHeaders.h
*
* Created:
*
*   04/23/2000 asecchia
*      Created it.
*
**************************************************************************/
inline 
CachedBitmap::CachedBitmap(
    IN Bitmap *bitmap, 
    IN Graphics *graphics)
{
    nativeCachedBitmap = NULL;    

    lastResult = DllExports::GdipCreateCachedBitmap(
        (GpBitmap *)bitmap->nativeImage,
        graphics->nativeGraphics,
        &nativeCachedBitmap
    );
}

inline 
CachedBitmap::~CachedBitmap()
{
    DllExports::GdipDeleteCachedBitmap(nativeCachedBitmap);
}

inline Status 
CachedBitmap::GetLastStatus() const 
{
    Status lastStatus = lastResult;
    lastResult = Ok;    
    return (lastStatus);
}

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader
China China
Jerry is from China. He was captivated by computer programming since 13 years old when first time played with Q-Basic.



  • Windows / Linux & C++
  • iOS & Obj-C
  • .Net & C#
  • Flex/Flash & ActionScript
  • HTML / CSS / Javascript
  • Gaming Server programming / video, audio processing / image & graphics


Contact: vcer(at)qq.com
Chinese Blog: http://blog.csdn.net/wangjia184

Comments and Discussions