私は一つのソースファイルの中に #if 〜 #endif のプリプロセッサ機能を使用して
幾つも WinMain を書いています( テスト用プログラムなど )
ただ、たろさんご提案の記述ほど丁寧ではなくて、
実行したいプログラムのみ #if 1 〜 #endif で囲んでプログラムを有効にして、
実行したくないプログラムは #if 0 〜 #endif で囲みプログラムを無効にするという適当な対処をしています (・・;
<例>
// 実行したくないプログラムなので #if 0 〜 #endif で囲む
#if 0
#include "DxLib.h"
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
{
ChangeWindowMode( TRUE ) ;
if( DxLib_Init() < 0 ) return -1 ;
DxLib_End() ;
return 0 ;
}
#endif
// 実行したいプログラムは #if 1 〜 #endif で囲む
#if 1
#include "DxLib.h"
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
{
ChangeWindowMode( TRUE ) ;
if( DxLib_Init() < 0 ) return -1 ;
DrawBox( 0, 0, 640, 480, GetColor( 255,255,255 ), TRUE );
WaitKey();
DxLib_End() ;
return 0 ;
}
#endif
// これも実行したくないプログラムなので #if 0 〜 #endif で囲む
#if 0
#include "DxLib.h"
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
{
ChangeWindowMode( TRUE ) ;
if( DxLib_Init() < 0 ) return -1 ;
DrawPixel( 320, 240, GetColor( 255,255,255 ) );
WaitKey();
DxLib_End() ;
return 0 ;
}
#endif