Like me?
OK I only did two patches... but it's an example
Sent from my iPod
Andrew Faulds
On 28 Jan 2010, at 22:29, Ged Murphy <gedmurphy(a)gmail.com> wrote:
This is a bad idea.
Ignoring the fact that the code is a serious crash hazard, you've
now got a public place which needs to be kept current.
I bet I can name at least 10 developers which aren't on this list.
On Thu, Jan 28, 2010 at 10:18 PM, <mkupfer(a)svn.reactos.org> wrote:
Author: mkupfer
Date: Thu Jan 28 23:18:31 2010
New Revision: 45302
URL:
http://svn.reactos.org/svn/reactos?rev=45302&view=rev
Log:
this log message left intentionally non-descriptive
Modified:
trunk/reactos/dll/cpl/sysdm/general.c
trunk/reactos/dll/cpl/sysdm/lang/de-DE.rc
trunk/reactos/dll/cpl/sysdm/lang/en-US.rc
trunk/reactos/dll/cpl/sysdm/resource.h
Modified: trunk/reactos/dll/cpl/sysdm/general.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/general.c?re…
===
===
===
=====================================================================
--- trunk/reactos/dll/cpl/sysdm/general.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/sysdm/general.c [iso-8859-1] Thu Jan 28
23:18:31 2010
@@ -12,6 +12,9 @@
#include "precomp.h"
+#define ANIM_STEP 2
+#define ANIM_TIME 50
+
typedef struct _IMGINFO
{
HBITMAP hBitmap;
@@ -19,6 +22,7 @@
INT cySource;
} IMGINFO, *PIMGINFO;
+PIMGINFO pImgInfo = NULL;
void
ShowLastWin32Error(HWND hWndOwner)
@@ -70,6 +74,124 @@
}
}
+LRESULT CALLBACK RosImageProc(HWND hwnd, UINT uMsg, WPARAM wParam,
LPARAM lParam)
+{
+ static UINT timerid = 0, top = 0, offset;
+ static HBITMAP hBitmap2;
+ RECT r;
+ NONCLIENTMETRICS ncm;
+ HFONT hfont;
+ BITMAP bitmap;
+ HDC dc, sdc;
+ TCHAR devtext[2048];
+ switch (uMsg)
+ {
+ case WM_LBUTTONDBLCLK:
+ if (wParam & (MK_CONTROL | MK_SHIFT))
+ {
+ if (timerid == 0)
+ {
+ top = 0; // set top
+
+ // build new bitmap
+ GetObject(pImgInfo->hBitmap,
sizeof(BITMAP), &bitmap);
+ dc = CreateCompatibleDC(GetDC
(NULL));
+ sdc = CreateCompatibleDC(dc);
+ ncm.cbSize = sizeof
(NONCLIENTMETRICS);
+ SystemParametersInfo
(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0);
+
+ hfont = CreateFontIndirect
(&ncm.lfMessageFont);
+ SelectObject(dc, hfont);
+ SetRect(&r, 0, 0, 0, 0);
+ LoadString(hApplet,
IDS_DEVS, devtext, sizeof(devtext) / sizeof(TCHAR));
+ DrawText(dc, devtext, -1,
&r, DT_CALCRECT);
+ hBitmap2 = CreateBitmap
(pImgInfo->cxSource, (2 * pImgInfo->cySource) + (r.bottom + 1 -
r.top), bitmap.bmPlanes, bitmap.bmBitsPixel, NULL);
+ SelectObject(sdc, pImgInfo-
hBitmap);
+
SelectObject(dc, hBitmap2);
+ offset = 0;
+ BitBlt(dc, 0, offset,
bitmap.bmWidth, bitmap.bmHeight, sdc, 0, 0, SRCCOPY);
+ offset += bitmap.bmHeight;
+
+ SetRect(&r, 0, offset,
bitmap.bmWidth, offset + (r.bottom - r.top) + 1);
+ FillRect(dc, &r,
GetSysColorBrush(COLOR_3DFACE));
+ SetBkMode(dc, TRANSPARENT);
+ OffsetRect(&r, 1, 1);
+ SetTextColor(dc, GetSysColor
(COLOR_BTNSHADOW));
+ DrawText(dc, devtext, -1,
&r, DT_CENTER);
+ OffsetRect(&r, -1, -1);
+ SetTextColor(dc, GetSysColor
(COLOR_WINDOWTEXT));
+ DrawText(dc, devtext, -1,
&r, DT_CENTER);
+ offset += r.bottom - r.top;
+
+ BitBlt(dc, 0, offset,
bitmap.bmWidth, bitmap.bmHeight, sdc, 0, 0, SRCCOPY);
+ offset += bitmap.bmHeight;
+ DeleteDC(sdc);
+ DeleteDC(dc);
+
+ timerid = SetTimer(hwnd, 1,
ANIM_TIME, NULL);
+ }
+ }
+ break;
+ case WM_LBUTTONDOWN:
+ if (timerid)
+ {
+ KillTimer(hwnd, timerid);
+ top = 0;
+ timerid = 0;
+ DeleteObject(hBitmap2);
+ InvalidateRect(hwnd, NULL, FALSE);
+ }
+ break;
+ case WM_TIMER:
+ top += ANIM_STEP;
+ if (top > offset - pImgInfo->cySource)
+ {
+ KillTimer(hwnd, timerid);
+ top = 0;
+ timerid = 0;
+ DeleteObject(hBitmap2);
+ }
+ InvalidateRect(hwnd, NULL, FALSE);
+ break;
+ case WM_PAINT:
+ {
+ PAINTSTRUCT PS;
+ HDC hdcMem, hdc;
+ LONG left;
+ if (wParam != 0)
+ {
+ hdc = (HDC)wParam;
+ } else
+ {
+ hdc = BeginPaint(hwnd,&PS);
+ }
+ GetClientRect(hwnd,&PS.rcPaint);
+
+ /* position image in center of dialog */
+ left = (PS.rcPaint.right - pImgInfo-
cxSource) / 2;
+
hdcMem = CreateCompatibleDC(hdc);
+
+ if (hdcMem != NULL)
+ {
+ SelectObject(hdcMem, timerid ?
hBitmap2 : pImgInfo->hBitmap);
+ BitBlt(hdc,
+ left,
+ PS.rcPaint.top,
+ PS.rcPaint.right - PS.rcPaint.left,
+ PS.rcPaint.top + pImgInfo-
cySource,
+
hdcMem,
+ 0,
+ top,
+ SRCCOPY);
+ DeleteDC(hdcMem);
+ }
+ if (wParam == 0)
+ EndPaint(hwnd,&PS);
+ break;
+ }
+ }
+ return TRUE;
+}
static VOID
SetRegTextData(HWND hwnd,
@@ -372,12 +494,9 @@
WPARAM wParam,
LPARAM lParam)
{
- PIMGINFO pImgInfo;
UNREFERENCED_PARAMETER(lParam);
UNREFERENCED_PARAMETER(wParam);
-
- pImgInfo = (PIMGINFO)GetWindowLongPtr(hwndDlg, DWLP_USER);
switch (uMsg)
{
@@ -389,9 +508,8 @@
return FALSE;
}
- SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pImgInfo);
-
InitImageInfo(pImgInfo);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_ROSIMG),
GWL_WNDPROC, (LONG)RosImageProc);
GetSystemInformation(hwndDlg);
break;
Modified: trunk/reactos/dll/cpl/sysdm/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/lang/de-DE.r…
===
===
===
=====================================================================
--- trunk/reactos/dll/cpl/sysdm/lang/de-DE.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/sysdm/lang/de-DE.rc [iso-8859-1] Thu Jan
28 23:18:31 2010
@@ -289,4 +289,5 @@
IDS_USERPROFILE_TYPE "Typ"
IDS_USERPROFILE_STATUS "Status"
IDS_USERPROFILE_MODIFIED "Geändert"
-END
+ IDS_DEVS "\nReactOS Team\n\nProjektkoordinator\n\nAleksey Bragin
\n\nEntwicklerteam\n\nAleksey Bragin\nAndrew Greenwood\nAndrey
Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel
Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHer
vé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK:
:Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupf
er\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\n
Stefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\n
Alex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitc
hell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welc
h\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJen
s Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff
\nVizzini \n\nRelease Verantwortliche\n\nColin Finck\nZ98\n\nWebseit
enteam\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedienteam\n
\nMindflyer\nWierd_W\n\nweiterer Dank geht an\n\nalle Mitwirkenden\n
Wine Team\n\n"
+END
Modified: trunk/reactos/dll/cpl/sysdm/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/lang/en-US.r…
===
===
===
=====================================================================
--- trunk/reactos/dll/cpl/sysdm/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/sysdm/lang/en-US.rc [iso-8859-1] Thu Jan
28 23:18:31 2010
@@ -284,4 +284,5 @@
IDS_USERPROFILE_TYPE "Type"
IDS_USERPROFILE_STATUS "Status"
IDS_USERPROFILE_MODIFIED "Modified"
-END
+ IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey
Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood
\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck
\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor
Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes And
erwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nM
atthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy
Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo
Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs
\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup
\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJaso
n Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\
nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nW
ebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia T
eam\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributer
s\nWine Team\n\n"
+END
Modified: trunk/reactos/dll/cpl/sysdm/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/resource.h?r…
===
===
===
=====================================================================
--- trunk/reactos/dll/cpl/sysdm/resource.h [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/sysdm/resource.h [iso-8859-1] Thu Jan 28
23:18:31 2010
@@ -156,5 +156,6 @@
#define RC_LICENSE 1502
#define RTDATA 1503
+#define IDS_DEVS 2000
#endif /* __CPL_RESOURCE_H */
_______________________________________________
Ros-dev mailing list
Ros-dev(a)reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev