C/C++ Allegro程序使Windows 7切换到Aero Basic

Mat*_*w H 2 c c++ windows allegro

我只是试用了allegro库,这是我到目前为止的代码:

#include <allegro.h>

int main(int argc, char *argv[]) {
    allegro_init();  // initialize the allegro libraries
    install_keyboard(); // initialize keyboard functions

    set_color_depth(16); // set the color depth
    set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0); // set up 640*480px window

    BITMAP *pic = NULL;
    pic = load_bitmap("C:/picture.bmp", NULL); // load the picture
    blit(pic, screen, 0, 0, 0, 0, 1000, 1000);

    readkey();
    destroy_bitmap(pic);
    return 0;
} 
END_OF_MAIN()
Run Code Online (Sandbox Code Playgroud)

它工作正常,但当我运行它时,程序的窗口打开,Windows 7将主题从Aero更改为Aero基本.如果你不确定我的意思,就会弹出(我从谷歌那里得到了这个,这就是它说Vista而不是Windows 7的原因):

http://www.suitedcowboys.com/wp-content/uploads/2007/01/010607_0906_HelloVistai28.png http://www.suitedcowboys.com/wp-content/uploads/2007/01/010607_0906_HelloVistai28.png#

1)为什么?2)我怎样才能确保不会发生这种情况?

Rei*_*ica 5

Aero需要将颜色设置为32位,但您将其设置为16:

set_color_depth(16);