Hi

I've done an application using SDL and Win32 which runs fine in Windows XP but when running it in Vista it closes immediately during startup.

Heres the code used to start the application and initialize SDL & Win32:

Code:
	try
	{
    	char *msg;
    	int done;
    	
    	SDL_Init(SDL_INIT_VIDEO);
    	TTF_Init();
    	
    	atexit(SDL_Quit);
    	screen = SDL_SetVideoMode(800, 600, 32, SDL_SWSURFACE | SDL_HWSURFACE);
    	cur_hand = init_system_cursor(hand);
    	cur_orig = SDL_GetCursor();
    	SDL_SetCursor(cur_orig);
    	
    	SDL_WM_SetCaption("Gallery Viewer 1.0", NULL);
		
    	loadBinaryFile(&dataHeader);
    	pages = dataHeader.pictures / 8;
    	if(((float)dataHeader.pictures / 8) > (float)(dataHeader.pictures / 8))
    		pages ++;
    	
    	// Load Thumbnails
    	for(int i = 0; i < dataHeader.pictures; i++)
    	{
			loadImage(i, &dataHeader.thumbs[i], "thumbs.bin");	
		}
		
    	hhkLowLevelKybd  = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, hThisInstance, 0);
    	done = 0;
    	draw ();
        
    	while(!done)
    	{
        	SDL_Event event;
        	
        	while (SDL_PollEvent(&event))
        	{
            	switch (event.type)
            	{
                	case SDL_MOUSEMOTION:
                    	mouseX = event.motion.x;
                    	mouseY = event.motion.y;
                    	checkHover();
                    	break;
                	case SDL_MOUSEBUTTONDOWN:
                    	clicked = true;
                    	break;
                	case SDL_MOUSEBUTTONUP:
						if(clicked) checkAreaClick();
                    	clicked = false;
                    	break;
                	case SDL_QUIT:
                    	done = 1;
                    	break;
                	default:
                    	break;
            	}
        	}
        	Sleep(50);
    	}
    	SDL_Quit();
    	return 0;
	}
    catch(std::exception e) 
	{
		exit(0);	
	}
Any ideas why this code causes problems in Vista?

Thanks
// Lasse