[PR]

『新妻LOVELY×CATION』を応援しています!
水無瀬の部屋 > Programming > sample > goddess > setwall.cpp
最終更新日: 2007/03/17

   1: //*********************************************************
   2: // プロジェクト: ああっ壁神さまっ
   3: //   ファイル名: setwall.cpp
   4: //*********************************************************
   5: #include "goddess.h"
   6: 
   7: 
   8: //*********************************************************
   9: // RegSetWallPaperMode
  10: //*********************************************************
  11: void 
  12: RegSetWallPaperMode
  13: 	(
  14: 		HKEY hKey,
  15: 		WALLPAPAER_t *pwp
  16: 	)
  17: {
  18: 	// パラメタの仮定
  19: 	ASSERT( IsValidPtr( pwp, sizeof( *pwp ) ) );
  20: 
  21: 	VERIFY( SetRegKeyString( hKey, "Wallpaperstyle", pwp->Style ) );
  22: 	VERIFY( SetRegKeyString( hKey, "TileWallpaper",  pwp->Tiling ) );
  23: 	VERIFY( ERROR_SUCCESS == RegFlushKey( hKey ) );
  24: }//RegSetWallPaperMode
  25: 
  26: //*********************************************************
  27: // RegGetWallPaperInfo
  28: //*********************************************************
  29: void
  30: RegGetWallPaperInfo
  31: 	(
  32: 		HKEY hKey,
  33: 		WALLPAPAER_t *pwp
  34: 	)
  35: {
  36: 	// パラメタの仮定
  37: 	ASSERT( IsValidPtr( pwp, sizeof( *pwp ) ) );
  38: 
  39: 	VERIFY( GetRegKeyString( hKey, "Wallpaperstyle", pwp->Style,    sizeof(pwp->Style) ) );
  40: 	VERIFY( GetRegKeyString( hKey, "TileWallpaper",  pwp->Tiling,   sizeof(pwp->Tiling) ) );
  41: 	VERIFY( GetRegKeyString( hKey, "Wallpaper",      pwp->FileName, MAX_PATH ) );
  42: }//RegGetWallPaperInfo
  43: 
  44: //*********************************************************
  45: // SetWallPaperFileEx
  46: //*********************************************************
  47: bool
  48: SetWallPaperFileEx
  49: 	(
  50: 		const char *filename, 
  51: 		      UINT  uFlags,
  52: 		const char *plugin
  53: 	)
  54: {
  55: 	// パラメタの仮定
  56: 	ASSERT( IsValidStringPtr( plugin ) );
  57: 	ASSERT( IsValidStringPtr( filename ) );
  58: 
  59: 	// 直接壁紙として指定
  60: 	if ( SetWallPaperFile( filename, uFlags ) )
  61: 	{
  62: 		return true;
  63: 	}
  64: 
  65: 	// Susie plug-in があれば、
  66: 	// Susie plug-in で bmp に変換してから壁紙に指定
  67: 	if ( IsPathDirectory( plugin ) )
  68: 	{
  69: 		char bitmap[ MAX_PATH_BUF ];
  70: 		GetModuleFile( bitmap, numof(bitmap), ".bmp" );
  71: 		if ( ConvertToBitmap( bitmap, filename, plugin ) )
  72: 		{
  73: 			return 0 != SetWallPaperFile( bitmap, uFlags );
  74: 		}
  75: 	}
  76: 	return false;
  77: }//SetWallPaperFileEx
  78: 
  79: 
  80: //** end **
  81: 

参照:


Google
ご意見・ご感想をお聞かせ下さい。匿名で送信できます。

 * 返信が必要な場合には postmaster@katsura-kotonoha.sakura.ne.jp へ直接メールしてください。

水無瀬の部屋 > sample > goddess > setwall.cpp

このページは cpp2web が出力しました。
水無瀬 優 postmaster@katsura-kotonoha.sakura.ne.jp
http://katsura-kotonoha.sakura.ne.jp/prog/code/goddess/setwall_cpp.shtml
『新妻LOVELY×CATION』を応援しています!