source: branches/v2.9/mediafolder/ProgFolder/separatorwindow.cpp

Last change on this file was 2, checked in by stevenhl, 8 years ago

Import sources from cwmm-full.zip dated 2005-03-21

File size: 1.5 KB
Line 
1#include <stdlib.h>
2#include "progfolder.h"
3#include "progfolder.hh"
4
5MRESULT EXPENTRY separatorProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
6{
7 switch(msg)
8 {
9 case WM_PAINT:
10 {
11 MRESULT mr;
12 HPS hps;
13 RECTL rcl;
14
15 WinQueryWindowRect(hwnd, &rcl);
16 if(rcl.yTop-rcl.yBottom<2)
17 break;
18
19 mr=WinDefWindowProc(hwnd, msg, mp1, mp2);
20 if((hps=WinGetPS(hwnd))!=NULLHANDLE) {
21 POINTL ptl;
22
23 ptl.y=(rcl.yTop-rcl.yBottom)/2;
24 ptl.x=0;
25 GpiMove(hps, &ptl);
26 ptl.x=rcl.xRight;
27 GpiSetColor(hps, CLR_DARKGRAY);
28 GpiLine(hps,&ptl);
29 GpiSetColor(hps, CLR_WHITE);
30 ptl.y-=1;
31 GpiMove(hps, &ptl);
32 ptl.x=0;
33 GpiLine(hps,&ptl);
34 WinReleasePS(hps);
35 }
36 return mr;
37 break;
38 }
39 default:
40 break;
41 }
42 return WinDefWindowProc(hwnd, msg, mp1, mp2);
43}
44
45
46
47BOOL cwRegisterSeparatorWindowClass(void)
48{
49 CLASSINFO ci;
50
51 if(WinQueryClassInfo(WinQueryAnchorBlock(HWND_DESKTOP),
52 WC_STATIC,
53 &ci))
54 {
55 if(WinRegisterClass(WinQueryAnchorBlock(HWND_DESKTOP),
56 (PSZ)"CW_SEPARATOR",
57 separatorProc,
58 (ci.flClassStyle) &~(CS_PUBLIC | CS_PARENTCLIP),
59 0))
60 return TRUE;
61 }
62 return FALSE;
63}
Note: See TracBrowser for help on using the repository browser.