g_wc_Flash.cbSize = sizeof( WNDCLASSEX );
g_wc_Flash.style = CS_CLASSDC;
g_wc_Flash.lpfnWndProc = MsgProc_Flash;
g_wc_Flash.cbClsExtra = 0L;
g_wc_Flash.cbWndExtra = 0L;
g_wc_Flash.hInstance = GetModuleHandle( NULL );
g_wc_Flash.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( IDI_ICON_MAIN ) );
g_wc_Flash.hCursor = LoadCursor( hInst, IDC_ARROW );
g_wc_Flash.hbrBackground = ( HBRUSH )GetStockObject( LTGRAY_BRUSH );
g_wc_Flash.lpszMenuName = NULL;
g_wc_Flash.lpszClassName = _T( "Flash" );
g_wc_Flash.hIconSm = NULL;
RegisterClassEx( &g_wc_Flash ); g_hWnd_Flash = CreateWindow( _T( "" ), _T( "" ), WS_VISIBLE | WS_POPUP, 355, 120, 497, 430, NULL, NULL, g_wc_Flash.hInstance, NULL );
SetWindowLong(g_hWnd_Flash, GWL_EXSTYLE, GetWindowLong(g_hWnd_Flash, GWL_EXSTYLE) | WS_EX_LAYERED);

SetLayeredWindowAttributes( g_hWnd_Flash, RGB( 255, 255, 255 ), 255, LWA_COLORKEY ); ShowWindow( g_hWnd_Flash, SW_SHOWDEFAULT );
UpdateWindow( g_hWnd_Flash );这么写有什么错误吗?窗口总是全灰一片,什么都显示不出来

解决方案 »

  1.   

    CreateWindow( _T( "" ), _T( "" )??
      

  2.   

    1、CreateWindow中用你前面注册的类名
    2、调用SetLayeredWindowAttributes()函数时,可以指定按照colorKey方式还是Alpha方式混合。
    使用Alpha方式比较容易,直接指定透明度;
    使用colorkey方式,你需要指定第二个参数--扣象颜色:在窗体中如果和这个颜色相同,就会透明效果,具体的你试试就知道了
      

  3.   

    要使用Flash可以用ATL中的AtlAxWindow.
    先看AtlAxWinInit();