如何创建不带XP样式的窗口?

AI1982 2005-08-25 12:45:34
如何创建不带XP样式的窗口?就像控制台窗口那样?不带任何修饰?
...全文
101 点赞 收藏 7
写回复
7 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
goodboyws 2005-08-25
没做过,关注一下
回复
everandforever 2005-08-25
HMODULE hUxTheme = ::LoadLibrary( _T( "UxTheme.dll" ) );
if( hUxTheme != NULL )
{
typedef void ( __stdcall *PfnSetThemeAppProperties )( DWORD );
PfnSetThemeAppProperties pfnSetThemeAppProperties = ( PfnSetThemeAppProperties )::GetProcAddress( hUxTheme, "SetThemeAppProperties" );
if( pfnSetThemeAppProperties != NULL )
{
pfnSetThemeAppProperties( 0 );
::SendMessage( hWnd, 0x031A, 0, 0 );// WM_THEMECHANGED : 0x031A
}
::FreeLibrary( hUxTheme );
}
回复
yajyjy 2005-08-25
顶一下
回复
fisker0303 2005-08-25
MFC只在xp下才有xp样式吧,好像工程里有个xml的配置文件可以指定这些,lz可以研究下。
回复
tufaqing 2005-08-25
大概这样写:

void Run()
{
MSG msg;
BOOL fMessage;
msg.message = WM_NULL;
PeekMessage( &msg, NULL, 0U, 0U, PM_NOREMOVE );
while( msg.message != WM_QUIT )
{
fMessage = PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE );
if( fMessage )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
else
{
//添加代码
}
}
}

LRESULT WINAPI WinProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
switch( msg )
{
case WM_SIZE:
if( wParam != SIZE_MINIMIZED )
{
...
}
break;
case WM_DESTROY:
PostQuitMessage( 0 );
return 0;
case WM_KEYUP:
switch( wParam )
{
case VK_ESCAPE:
DestroyWindow( hWnd );
return 0;
}
break;
}
return DefWindowProc( hWnd, msg, wParam, lParam );
}

INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, INT )
{
WNDCLASS wc =
{
0, WinProc, 0L, 0L, hInst, NULL,
LoadCursor( NULL, IDC_ARROW ),
NULL, NULL, TEXT("DXP1")
};
RegisterClass( &wc );

HWND hWnd = CreateWindow( TEXT("DXP1"), TEXT("My Window"), WS_OVERLAPPEDWINDOW,
50, 50, 500, 500,
GetDesktopWindow(), NULL, hInst, NULL );
ShowWindow( hWnd, SW_SHOWDEFAULT );
UpdateWindow( hWnd );
Run();
return 0;
回复
ShiGang 2005-08-25
只有自繪窗口吧.或用其它的皮膚包.
回复
hyg2008 2005-08-25
用SDK吧
回复
发帖
界面
创建于2007-09-28

1.5w+

社区成员

VC/MFC 界面
申请成为版主
帖子事件
创建了帖子
2005-08-25 12:45
社区公告
暂无公告