mirror of
https://github.com/reactos/reactos.git
synced 2024-11-06 06:33:08 +00:00
eb3b62597d
modified winetests/advpack/advpack.rbuild modified winetests/browseui/browseui.rbuild modified winetests/cabinet/cabinet.rbuild modified winetests/comcat/comcat.rbuild modified winetests/comdlg32/comdlg32.rbuild modified winetests/gdiplus/gdiplus.rbuild modified winetests/hlink/hlink.rbuild modified winetests/imm32/imm32.rbuild modified winetests/lz32/lz32.rbuild modified winetests/mapi32/mapi32.rbuild modified winetests/mlang/mlang.rbuild modified winetests/msacm32/msacm32.rbuild modified winetests/mshtml/mshtml.rbuild modified winetests/msi/msi.rbuild modified winetests/mstask/mstask.rbuild modified winetests/netapi32/netapi32.rbuild modified winetests/odbccp32/odbccp32.rbuild modified winetests/ole32/ole32.rbuild modified winetests/rsabase/rsabase.rbuild modified winetests/rsaenh/rsaenh.rbuild modified winetests/schannel/schannel.rbuild modified winetests/shell32/shell32.rbuild modified winetests/shlwapi/shlwapi.rbuild modified winetests/urlmon/urlmon.rbuild modified winetests/usp10/usp10.rbuild modified winetests/uxtheme/uxtheme.rbuild modified winetests/version/version.rbuild modified winetests/winhttp/winhttp.rbuild modified winetests/wininet/wininet.rbuild -Wno-format no longer necessary Some obsolete flags removed, some useless compiler flags removed & shit. Nothing earth-shattering <insert ginormous commit message ruined by TortoiseSVN's shitty GUI> svn path=/trunk/; revision=40623
163 lines
3.1 KiB
C
163 lines
3.1 KiB
C
/*
|
|
* Copyright 2006 Saveliy Tretiakov
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
*/
|
|
|
|
/* This testapp demonstrates WS_SYSMENU + WS_EX_DLGMODALFRAME
|
|
* behavior and shows that DrawCaption does care
|
|
* about WS_EX_DLGMODALFRAME and WS_EX_TOOLWINDOW
|
|
*/
|
|
|
|
#include "windows.h"
|
|
#include "stdio.h"
|
|
#include "resource.h"
|
|
|
|
WCHAR WndClass[] = L"sysicon_class";
|
|
|
|
LRESULT CALLBACK WndProc(HWND hWnd,
|
|
UINT msg,
|
|
WPARAM wParam,
|
|
LPARAM lParam)
|
|
{
|
|
|
|
switch (msg)
|
|
{
|
|
|
|
case WM_PAINT:
|
|
{
|
|
HDC hDc;
|
|
PAINTSTRUCT Ps;
|
|
RECT Rect;
|
|
GetClientRect(hWnd, &Rect);
|
|
|
|
Rect.left = 10;
|
|
Rect.top = 10;
|
|
Rect.right-=10;
|
|
Rect.bottom = 25;
|
|
|
|
hDc = BeginPaint(hWnd, &Ps);
|
|
SetBkMode( hDc, TRANSPARENT );
|
|
|
|
DrawCaption(hWnd, hDc, &Rect, DC_GRADIENT | DC_ACTIVE | DC_TEXT | DC_ICON);
|
|
|
|
EndPaint(hWnd, &Ps);
|
|
|
|
return 0;
|
|
}
|
|
|
|
case WM_DESTROY:
|
|
PostQuitMessage(0);
|
|
return 0;
|
|
}
|
|
|
|
return DefWindowProc(hWnd, msg, wParam, lParam);
|
|
}
|
|
|
|
int APIENTRY wWinMain(HINSTANCE hInst,
|
|
HINSTANCE hPrevInstance,
|
|
LPWSTR lpCmdLine,
|
|
int nCmdShow)
|
|
{
|
|
HWND hWnd1, hWnd2, hWnd3;
|
|
MSG msg;
|
|
WNDCLASSEX wcx;
|
|
UINT result;
|
|
|
|
memset(&wcx, 0, sizeof(wcx));
|
|
wcx.cbSize = sizeof(wcx);
|
|
wcx.lpfnWndProc = (WNDPROC) WndProc;
|
|
wcx.hInstance = hInst;
|
|
wcx.hbrBackground = (HBRUSH)COLOR_WINDOW;
|
|
wcx.lpszClassName = WndClass;
|
|
|
|
if(!(result = RegisterClassEx(&wcx)))
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
/* WS_EX_DLGMODALFRAME */
|
|
hWnd1 = CreateWindowEx(WS_EX_DLGMODALFRAME,
|
|
WndClass,
|
|
L"WS_SYSMENU | WS_EX_DLGMODALFRAME",
|
|
WS_CAPTION | WS_SYSMENU ,
|
|
CW_USEDEFAULT,
|
|
CW_USEDEFAULT,
|
|
400,
|
|
100,
|
|
NULL,
|
|
0,
|
|
hInst,
|
|
NULL);
|
|
|
|
if(!hWnd1)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
ShowWindow(hWnd1, SW_SHOW);
|
|
UpdateWindow(hWnd1);
|
|
|
|
hWnd2 = CreateWindowEx(WS_EX_TOOLWINDOW,
|
|
WndClass,
|
|
L"WS_SYSMENU | WS_EX_TOOLWINDOW",
|
|
WS_CAPTION | WS_SYSMENU ,
|
|
CW_USEDEFAULT,
|
|
CW_USEDEFAULT,
|
|
400,
|
|
100,
|
|
NULL,
|
|
0,
|
|
hInst,
|
|
NULL);
|
|
|
|
if(!hWnd2)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
ShowWindow(hWnd2, SW_SHOW);
|
|
UpdateWindow(hWnd2);
|
|
|
|
hWnd3 = CreateWindowEx(0,
|
|
WndClass,
|
|
L"WS_SYSMENU ",
|
|
WS_CAPTION | WS_SYSMENU ,
|
|
CW_USEDEFAULT,
|
|
CW_USEDEFAULT,
|
|
400,
|
|
100,
|
|
NULL,
|
|
0,
|
|
hInst,
|
|
NULL);
|
|
|
|
if(!hWnd3)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
ShowWindow(hWnd3, SW_SHOW);
|
|
UpdateWindow(hWnd3);
|
|
|
|
while(GetMessage(&msg, NULL, 0, 0 ))
|
|
{
|
|
TranslateMessage(&msg);
|
|
DispatchMessage(&msg);
|
|
}
|
|
|
|
UnregisterClass(WndClass, hInst);
|
|
return 0;
|
|
}
|