| 风格标识符 | 意义 | |
|---|---|---|
| SBS_HORZ | 创建一个水平滚动条。当没有指定 SBS_BOTTOMALIGN 或 SBS_TOPALIGN,滚动条的范围根据 CreateWindowEx2? 参数x,y,w,h决定。 | |
| SBS_VERT | 创建一个垂直滚动条。当没有指定 SBS_LEFTALIGN 或 SBS_RIGHTALIGN,滚动条的范围根据 CreateWindowEx2? 参数x,y,w,h决定。 | |
| SBS_BOTTOMALIGN | 与 SBS_HORZ一起使用。放置水平滚动条在 CreateWindowEx2? 指定范围的底部。 | |
| SBS_TOPALIGN | 与 SBS_HORZ一起使用。放置水平滚动条在 CreateWindowEx2? 指定范围的顶部。 | |
| SBS_LEFTALIGN | 与 SBS_VERT一起使用。放置垂直滚动条在 CreateWindowEx2? 指定范围的左边。 | |
| SBS_RIGHTALIGN | 与 SBS_VERT一起使用,放置垂直滚动条在 CreateWindowEx2? 指定范围的右边。 | |
| SBS_NOARROWS | 没有箭头,不能与 SBS_NOSHAFT 一起使用 | |
| SBS_NOSHAFT | 没有 shaft,不能与 SBS_NOARROWS 一起使用 | |
| SBS_FIXEDBARLEN | 水平滚动条的 thumb 长度固定,或者垂直滚动条的 thumb 长度固定 | |
| SBS_NOTNOTIFYPARENT | 向父窗口的通知发送方式不是发送通知码,而是发送消息;默认发送通知码 |
/*
* Scroll bar information structure.
*/
typedef struct _SCROLLINFO
{
/** Size of the structrue in bytes */
UINT cbSize;
/**
* A flag indicates which fields contain valid values,
* can be OR'ed value of the following values:
* - SIF_RANGE\n
* Retrives or sets the range of the scroll bar.
* - SIF_PAGE\n
* Retrives or sets the page size of the scroll bar.
* - SIF_POS\n
* Retrives or sets the position of the scroll bar.
* - SIF_DISABLENOSCROLL\n
* Hides the scroll when disabled, not implemented so far.
*/
UINT fMask;
/** The minimum position value of the scroll bar */
int nMin;
/** The maximum position value of the scroll bar */
int nMax;
/** The page size of the scroll bar */
UINT nPage;
/** The position value of the scroll bar */
int nPos;
} SCROLLINFO, *PSCROLLINFO;| 信息标识符 | 意义 |
|---|---|
| SIF_RANGE | 获取滚动条的取值范围 |
| SIF_PAGE | 获取滚动条的页数 |
| SIF_POS | 获取滚动条的当前位置 |
| SIF_ALL | 获取上面所有的信息 |
SCROLLINFO scinfo = {0};
scinfo.fMask = SIF_ALL;
SendMessage (hwnd_scrollbar, SBM_GETSCROLLINFO, (wParam)&scinfo, 0);
SCROLLINFO scinfo = {0};
scinfo.fMask = SIF_ALL;
scinfo.nMin = 0;
scinfo.nMax = 10;
scinfo.nPage = 2;
scinfo.nPos = 0;
BOOL redraw = FALSE;
SendMessage (hwnd_scrollbar, SBM_SETCROLLINFO, (wParam)&scinfo, redraw);int pos = SendMessage (hwnd_scrollbar, SBM_GETPOS, 0, 0);
int pos = 10; SendMessage (hwnd_scrollbar, SBM_SETPOS, pos, TRUE);
int min, max; SendMessage (hwnd_scrollbar, SBM_GETRANGE, &min, &max);
SendMessage (hwnd_scrollbar, SBM_SETRANGE, 0, 100);
SendMessage (hwnd_scrollbar, SBM_SETRANGEREDRAW, 0, 100);
| 箭头标识符 | 意义 |
|---|---|
| SB_ARROW_LTUP | 代表水平滚动条的左方向键或者垂直滚动条的上方向键 |
| SB_ARROW_BTDN | 代表水平滚动条的右方向键或者垂直滚动条的下方向键 |
| SB_ARROW_BOTH | 所有方向键 |
SendMessage (hwnd_scrollbar, SBM_ENABLE_ARROW, SB_ARROW_BOTH, FALSE);
| 属性标识符 | 说明 |
|---|---|
| WE_MAINC_THREED_BODY | 绘制滚动条滚槽的颜色以及游标的颜色 |
| WE_FGC_THREED_BODY | 绘制箭头的颜色 |
| WE_FGC_DISABLED_ITEM | 绘制无效箭头的颜色 |
| WE_METRICS_SCROLLBAR | 滚动条的尺寸,即水平滚动条的高度、垂直滚动条的宽度 |
DWORD color_3d, fgc_3d, fgc_dis; gal_pixel old_brush_color; //获取绘制滚动条各个部分的颜色属性值 color_3d = GetWindowElementAttr(hWnd, WE_MAINC_THREED_BODY); fgc_3d = GetWindowElementAttr(hWnd, WE_FGC_THREED_BODY); fgc_dis = GetWindowElementAttr(hWnd, WE_FGC_DISABLED_ITEM); //绘制滚动条滚槽 old_brush_color = SetBrushColor(hdc, RGBA2Pixel(hdc,GetRValue(color_3d), GetGValue(color_3d), GetBValue(color_3d), GetAValue(color_3d))); FillBox(hdc, rect.left, rect.top, RECTW(rect), RECTH(rect)); SetBrushColor(hdc, old_brush_color); //绘制滚动条箭头 draw_3dbox(hdc, &rect, color_3d, bn_status | LFRDR_3DBOX_THICKFRAME | LFRDR_3DBOX_FILLED); if(sb_status & SBS_DISABLED_LTUP || sb_status & SBS_DISABLED) draw_arrow(hWnd, hdc, &rect, fgc_dis, LFRDR_ARROW_LEFT); else draw_arrow(hWnd, hdc, &rect, fgc_3d, LFRDR_ARROW_LEFT);
| 通知码标识符 | 意义 |
|---|---|
| SB_LINEUP | 垂直滚动条向上滚一行 |
| SB_LINEDOWN | 垂直滚动条向下滚一行 |
| SB_PAGEUP | 垂直滚动条向上滚一页 |
| SB_PAGEDOWN | 垂直滚动条向下滚一页 |
| SB_LINELEFT | 水平滚动条向左滚一列 |
| SB_LINERIGHT | 水平滚动条向右滚一列 |
| SB_PAGELEFT | 水平滚动条向左滚一列页 |
| SB_PAGERIGHT | 水平滚动条向右滚一页 |
| SB_THUMBPOSITION | 当游标被鼠标左键按住拖动,然后释放,此时的游标位置将由此通知码传给父窗口 |
| SB_THUMBTRACK | 当游标被鼠标左键按住,在拖动游标的过程中,游标的位置将由此通知码不断的传给父窗口 |
| SB_TOP | 游标到了水平滚动条的最左边或者是垂直滚动条的最上边,即到了滚动条的最小值 |
| SB_BOTTOM | 游标到了水平滚动条的最右边或者是垂直滚动条的最下边,即到了滚动条的最大值 |
| 按键 | 通知码 |
|---|---|
| PAGEUP 键 | 水平滚动条发送 SB_PAGELEFT ;垂直滚动条发送 SB_PAGEUP |
| PAGEDOWN 键 | 水平滚动条发送 SB_PAGERIGHT ;垂直滚动条发送 SB_PAGEDOWN |
| 上方向键 | 垂直滚动条发送 SB_LINEUP |
| 左方向键 | 水平滚动条发送 SB_LINELEFT |
| 下方向键 | 垂直滚动条发送 SB_LINEDOWN |
| 右方向键 | 水平滚动条发送 SB_LINERIGHT |
| HOME 键 | SB_TOP |
| END 键 | SB_BOTTOM |
#include <stdio.h>
#include <string.h>
#include <minigui/common.h>
#include <minigui/minigui.h>
#include <minigui/gdi.h>
#include <minigui/window.h>
#include <minigui/control.h>
#ifdef _LANG_ZHCN
#include "scrollbar_ctrl_res_cn.h"
#elif defined _LANG_ZHTW
#include "scrollbar_ctrl_res_tw.h"
#else
#include "scrollbar_ctrl_res_en.h"
#endif
/** define scrollbar data */
#define SB_MAX 20
#define SB_MIN 0
#define SB_PAGE 6
/** define circle data */
#define CC_CENTER_X 400
#define CC_CENTER_Y 100
#define CC_RADIUS_MAX 50
#define CC_RADIUS_MIN 0
/** define box data */
#define BOX_WIDTH 40
#define BOX_HEIGHT 20
#define BOX_Y_MAX 300
#define BOX_Y_MIN 200
/** x position of separator */
#define SEP 300
/** radius of circle */
int _radius;
/** y position of box */
int _box_pos_y;
/** invalidate rect */
RECT _rect_invalid;
static int ScrollbarProc(HWND hwnd, int message, WPARAM wParam, LPARAM lParam)
{
/** IDC of SCROLLBAR control */
static int _my_scroll_idc = 100;
/** scrollbar handle of main window */
static HWND hwnd_sb_main;
/** scrollbar handle of control */
HWND hwnd_sb_ctrl;
switch (message)
{
case MSG_CREATE:
{
_rect_invalid.left = SEP;
_rect_invalid.top = 0;
_rect_invalid.right = g_rcScr.right;
_rect_invalid.bottom = g_rcScr.bottom;
SCROLLINFO scinfo = {0};
scinfo.fMask = SIF_ALL;
scinfo.nMin = SB_MIN;
scinfo.nMax = SB_MAX;
scinfo.nPage = SB_PAGE;
scinfo.nPos = SB_MIN;
calc_circle_pos (scinfo.nPos);
calc_box_pos (scinfo.nPos);
/** classic VSCROLL with SBS_NOTNOTIFYPARENT */
hwnd_sb_main = CreateWindowEx2 (CTRL_SCROLLBAR, "",
WS_VISIBLE |
SBS_VERT | SBS_LEFTALIGN
| SBS_NOTNOTIFYPARENT
,
0,
++_my_scroll_idc,
20, 50, 20, 150, hwnd,
"classic", 0,
0);
SendMessage (hwnd_sb_main, SBM_SETSCROLLINFO, (WPARAM)&scinfo, TRUE);
SendMessage (hwnd_sb_main, MSG_SETFOCUS, 0, 0);
/** flat VSCROLL */
hwnd_sb_ctrl = CreateWindowEx2 (CTRL_SCROLLBAR, "",
WS_VISIBLE |
SBS_VERT | SBS_LEFTALIGN
,
0,
++_my_scroll_idc,
43, 50, 20, 150, hwnd,
"flat", 0,
0);
SendMessage (hwnd_sb_ctrl, SBM_SETSCROLLINFO, (WPARAM)&scinfo, TRUE);
SendMessage (hwnd_sb_ctrl, MSG_SETFOCUS, 0, 0);
/** fashion VSCROLL */
hwnd_sb_ctrl = CreateWindowEx2 (CTRL_SCROLLBAR, "",
WS_VISIBLE |
SBS_VERT | SBS_LEFTALIGN
,
0,
++_my_scroll_idc,
66, 50, 20, 150, hwnd,
"fashion", 0,
0);
SendMessage (hwnd_sb_ctrl, SBM_SETSCROLLINFO, (WPARAM)&scinfo, TRUE);
SendMessage (hwnd_sb_ctrl, MSG_SETFOCUS, 0, 0);
/** tiny VSCROLL */
hwnd_sb_ctrl = CreateWindowEx2 (CTRL_SCROLLBAR, "",
WS_VISIBLE |
SBS_VERT | SBS_LEFTALIGN
,
0,
++_my_scroll_idc,
92, 50, 20, 150, hwnd,
"tiny", 0,
0);
SendMessage (hwnd_sb_ctrl, SBM_SETSCROLLINFO, (WPARAM)&scinfo, TRUE);
SendMessage (hwnd_sb_ctrl, MSG_SETFOCUS, 0, 0);
/** classic NOSHAFT VSCROLL */
hwnd_sb_ctrl = CreateWindowEx2 (CTRL_SCROLLBAR, "",
WS_VISIBLE | SBS_VERT | SBS_NOSHAFT | SBS_LEFTALIGN
,
0,
++_my_scroll_idc,
120, 50, 20, 34, hwnd,
"classic", 0,
0);
SendMessage (hwnd_sb_ctrl, SBM_SETSCROLLINFO, (WPARAM)&scinfo, TRUE);
SendMessage (hwnd_sb_ctrl, MSG_SETFOCUS, 0, 0);
/** flat NOSHAFT VSCROLL */
hwnd_sb_ctrl = CreateWindowEx2 (CTRL_SCROLLBAR, "",
WS_VISIBLE | SBS_VERT | SBS_NOSHAFT | SBS_LEFTALIGN
,
0,
++_my_scroll_idc,
140, 50, 20, 34, hwnd,
"flat", 0,
0);
SendMessage (hwnd_sb_ctrl, SBM_SETSCROLLINFO, (WPARAM)&scinfo, TRUE);
SendMessage (hwnd_sb_ctrl, MSG_SETFOCUS, 0, 0);
/** fashion NOSHAFT VSCROLL */
hwnd_sb_ctrl = CreateWindowEx2 (CTRL_SCROLLBAR, "",
WS_VISIBLE | SBS_VERT | SBS_NOSHAFT | SBS_LEFTALIGN
,
0,
++_my_scroll_idc,
160, 50, 20, 34, hwnd,
"fashion", 0,
0);
SendMessage (hwnd_sb_ctrl, SBM_SETSCROLLINFO, (WPARAM)&scinfo, TRUE);
SendMessage (hwnd_sb_ctrl, MSG_SETFOCUS, 0, 0);
/** tiny NOSHAFT VSCROLL */
hwnd_sb_ctrl = CreateWindowEx2 (CTRL_SCROLLBAR, "",
WS_VISIBLE | SBS_VERT | SBS_NOSHAFT | SBS_LEFTALIGN
,
0,
++_my_scroll_idc,
184, 50, 20, 34, hwnd,
"tiny", 0,
0);
SendMessage (hwnd_sb_ctrl, SBM_SETSCROLLINFO, (WPARAM)&scinfo, TRUE);
SendMessage (hwnd_sb_ctrl, MSG_SETFOCUS, 0, 0);
/** classic NOARROW VSCROLL */
hwnd_sb_ctrl = CreateWindowEx2 (CTRL_SCROLLBAR, "",
WS_VISIBLE | SBS_VERT | SBS_NOARROW | SBS_LEFTALIGN
,
0,
++_my_scroll_idc,
210, 50, 20, 150, hwnd,
"classic", 0,
0);
SendMessage (hwnd_sb_ctrl, SBM_SETSCROLLINFO, (WPARAM)&scinfo, TRUE);
SendMessage (hwnd_sb_ctrl, MSG_SETFOCUS, 0, 0);
/** flat NOARROW VSCROLL */
hwnd_sb_ctrl = CreateWindowEx2 (CTRL_SCROLLBAR, "",
WS_VISIBLE | SBS_VERT | SBS_NOARROW | SBS_LEFTALIGN
,
0,
++_my_scroll_idc,
232, 50, 20, 150, hwnd,
"flat", 0,
0);
SendMessage (hwnd_sb_ctrl, SBM_SETSCROLLINFO, (WPARAM)&scinfo, TRUE);
SendMessage (hwnd_sb_ctrl, MSG_SETFOCUS, 0, 0);
/** fashion NOARROW VSCROLL */
hwnd_sb_ctrl = CreateWindowEx2 (CTRL_SCROLLBAR, "",
WS_VISIBLE | SBS_VERT | SBS_NOARROW | SBS_LEFTALIGN
,
0,
++_my_scroll_idc,
254, 50, 20, 150, hwnd,
"fashion", 0,
0);
SendMessage (hwnd_sb_ctrl, SBM_SETSCROLLINFO, (WPARAM)&scinfo, TRUE);
SendMessage (hwnd_sb_ctrl, MSG_SETFOCUS, 0, 0);
/** tiny NOARROW VSCROLL */
hwnd_sb_ctrl = CreateWindowEx2 (CTRL_SCROLLBAR, "",
WS_VISIBLE | SBS_VERT | SBS_NOARROW | SBS_LEFTALIGN
,
0,
++_my_scroll_idc,
276, 50, 20, 150, hwnd,
"tiny", 0,
0);
SendMessage (hwnd_sb_ctrl, SBM_SETSCROLLINFO, (WPARAM)&scinfo, TRUE);
SendMessage (hwnd_sb_ctrl, MSG_SETFOCUS, 0, 0);
/** classic HSCROLL */
hwnd_sb_ctrl = CreateWindowEx2 (CTRL_SCROLLBAR, "",
WS_VISIBLE | SBS_HORZ
| SBS_TOPALIGN
,
0,
++_my_scroll_idc,
20, 220, 150, 20, hwnd,
"classic", 0,
0);
SendMessage (hwnd_sb_ctrl, SBM_SETSCROLLINFO, (WPARAM)&scinfo, TRUE);
SendMessage (hwnd_sb_ctrl, MSG_SETFOCUS, 0, 0);
/** flat HSCROLL */
hwnd_sb_ctrl = CreateWindowEx2 (CTRL_SCROLLBAR, "",
WS_VISIBLE | SBS_HORZ
| SBS_TOPALIGN
,
0,
++_my_scroll_idc,
20, 240, 150, 20, hwnd,
"flat", 0,
0);
SendMessage (hwnd_sb_ctrl, SBM_SETSCROLLINFO, (WPARAM)&scinfo, TRUE);
SendMessage (hwnd_sb_ctrl, MSG_SETFOCUS, 0, 0);
/** fashion HSCROLL */
hwnd_sb_ctrl = CreateWindowEx2 (CTRL_SCROLLBAR, "",
WS_VISIBLE | SBS_HORZ
| SBS_TOPALIGN
,
0,
++_my_scroll_idc,
20, 260, 150, 20, hwnd,
"fashion", 0,
0);
SendMessage (hwnd_sb_ctrl, SBM_SETSCROLLINFO, (WPARAM)&scinfo, TRUE);
SendMessage (hwnd_sb_ctrl, MSG_SETFOCUS, 0, 0);
/** tiny HSCROLL */
hwnd_sb_ctrl = CreateWindowEx2 (CTRL_SCROLLBAR, "",
WS_VISIBLE | SBS_HORZ
| SBS_TOPALIGN
,
0,
++_my_scroll_idc,
20, 280, 150, 20, hwnd,
"tiny", 0,
0);
SendMessage (hwnd_sb_ctrl, SBM_SETSCROLLINFO, (WPARAM)&scinfo, TRUE);
SendMessage (hwnd_sb_ctrl, MSG_SETFOCUS, 0, 0);
}
break;
case MSG_COMMAND:
{
int code = HIWORD(wParam);
HWND scroll = (HWND)lParam;
int pos = 0;
switch (code)
{
case SB_LINELEFT:
{
pos = SendMessage (scroll, SBM_GETPOS, 0, 0);
SendMessage (scroll, SBM_SETPOS, --pos, TRUE);
}
break;
case SB_LINERIGHT:
{
pos = SendMessage (scroll, SBM_GETPOS, 0, 0);
SendMessage (scroll, SBM_SETPOS, ++pos, TRUE);
}
break;
case SB_PAGELEFT:
{
pos = SendMessage (scroll, SBM_GETPOS, 0, 0);
pos -= SB_PAGE;
SendMessage (scroll, SBM_SETPOS, pos, TRUE);
}
break;
case SB_PAGERIGHT:
{
pos = SendMessage (scroll, SBM_GETPOS, 0, 0);
pos += SB_PAGE;
SendMessage (scroll, SBM_SETPOS, pos, TRUE);
}
break;
case SB_LINEUP:
{
pos = SendMessage (scroll, SBM_GETPOS, 0, 0);
SendMessage (scroll, SBM_SETPOS, --pos, TRUE);
}
break;
case SB_LINEDOWN:
{
pos = SendMessage (scroll, SBM_GETPOS, 0, 0);
SendMessage (scroll, SBM_SETPOS, ++pos, TRUE);
}
break;
case SB_PAGEUP:
{
pos = SendMessage (scroll, SBM_GETPOS, 0, 0);
pos -= SB_PAGE;
SendMessage (scroll, SBM_SETPOS, pos, TRUE);
}
break;
case SB_PAGEDOWN:
{
pos = SendMessage (scroll, SBM_GETPOS, 0, 0);
pos += SB_PAGE;
SendMessage (scroll, SBM_SETPOS, pos, TRUE);
}
break;
case SB_THUMBPOSITION:
{
pos = SendMessage (scroll, SBM_GETPOS, 0, 0);
}
break;
case SB_THUMBTRACK:
{
pos = SendMessage (scroll, SBM_GETPOS, 0, 0);
}
break;
case SB_TOP:
{
pos = SB_MIN;
}
break;
case SB_BOTTOM:
{
pos = SB_MAX;
}
break;
default:
break;
}
draw_shape (hwnd, pos);
}
break;
case MSG_HSCROLL:
{
int pos = 0;
switch (wParam)
{
case SB_LINELEFT:
{
pos = SendMessage (hwnd_sb_main, SBM_GETPOS, 0, 0);
SendMessage (hwnd_sb_main, SBM_SETPOS, --pos, TRUE);
}
break;
case SB_LINERIGHT:
{
pos = SendMessage (hwnd_sb_main, SBM_GETPOS, 0, 0);
SendMessage (hwnd_sb_main, SBM_SETPOS, ++pos, TRUE);
}
break;
case SB_PAGELEFT:
{
pos = SendMessage (hwnd_sb_main, SBM_GETPOS, 0, 0);
pos -= SB_PAGE;
SendMessage (hwnd_sb_main, SBM_SETPOS, pos, TRUE);
}
break;
case SB_PAGERIGHT:
{
pos = SendMessage (hwnd_sb_main, SBM_GETPOS, 0, 0);
pos += SB_PAGE;
SendMessage (hwnd_sb_main, SBM_SETPOS, pos, TRUE);
}
break;
case SB_THUMBPOSITION:
{
pos = (int)lParam;
}
break;
case SB_THUMBTRACK:
{
pos = (int)lParam;
}
break;
case SB_TOP:
{
pos = SB_MIN;
}
break;
case SB_BOTTOM:
{
pos = SB_MAX;
}
break;
default:
break;
}
draw_shape (hwnd, pos);
}
break;
case MSG_VSCROLL:
{
int pos = 0;
switch (wParam)
{
case SB_LINEUP:
{
pos = SendMessage (hwnd_sb_main, SBM_GETPOS, 0, 0);
SendMessage (hwnd_sb_main, SBM_SETPOS, --pos, TRUE);
}
break;
case SB_LINEDOWN:
{
pos = SendMessage (hwnd_sb_main, SBM_GETPOS, 0, 0);
SendMessage (hwnd_sb_main, SBM_SETPOS, ++pos, TRUE);
}
break;
case SB_PAGEUP:
{
pos = SendMessage (hwnd_sb_main, SBM_GETPOS, 0, 0);
pos -= SB_PAGE;
SendMessage (hwnd_sb_main, SBM_SETPOS, pos, TRUE);
}
break;
case SB_PAGEDOWN:
{
pos = SendMessage (hwnd_sb_main, SBM_GETPOS, 0, 0);
pos += SB_PAGE;
SendMessage (hwnd_sb_main, SBM_SETPOS, pos, TRUE);
}
break;
case SB_THUMBPOSITION:
{
pos = (int)lParam;
}
break;
case SB_THUMBTRACK:
{
pos = (int)lParam;
}
break;
case SB_TOP:
{
pos = SB_MIN;
}
break;
case SB_BOTTOM:
{
pos = SB_MAX;
}
break;
default:
break;
}
draw_shape (hwnd, pos);
}
break;
case MSG_PAINT:
{
HDC hdc = BeginPaint(hwnd);
/** separator */
MoveTo (hdc, SEP, 0);
LineTo (hdc, SEP, g_rcScr.bottom);
/** circle */
Circle (hdc, CC_CENTER_X, CC_CENTER_Y, _radius);
/** top and bottom line of box */
MoveTo (hdc, SEP + 20, BOX_Y_MIN);
LineTo (hdc, SEP + 20 + BOX_WIDTH + 40, BOX_Y_MIN);
MoveTo (hdc, SEP + 20, BOX_Y_MAX);
LineTo (hdc, SEP + 20 + BOX_WIDTH + 40, BOX_Y_MAX);
/** box */
SetBrushColor (hdc, PIXEL_black);
FillBox (hdc, SEP + 40, _box_pos_y, BOX_WIDTH, BOX_HEIGHT);
EndPaint (hwnd, hdc);
}
break;
case MSG_CLOSE:
{
DestroyMainWindow (hwnd);
PostQuitMessage (hwnd);
return 0;
}
}
return DefaultMainWinProc(hwnd, message, wParam, lParam);
}
int MiniGUIMain (int argc, const char* argv[])
{
MSG Msg;
HWND hMainWnd;
MAINWINCREATE CreateInfo;
#ifdef _MGRM_PROCESSES
JoinLayer(NAME_DEF_LAYER , "scrollbar" , 0 , 0);
#endif
CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER | WS_CAPTION;
CreateInfo.dwExStyle = WS_EX_NONE;
CreateInfo.spCaption = SCB_ST_CAP;
CreateInfo.hMenu = 0;
CreateInfo.hCursor = GetSystemCursor(0);
CreateInfo.hIcon = 0;
CreateInfo.MainWindowProc = ScrollbarProc;
CreateInfo.lx = 0;
CreateInfo.ty = 0;
CreateInfo.rx = g_rcScr.right;
CreateInfo.by = g_rcScr.bottom;
CreateInfo.iBkColor = COLOR_lightwhite;
CreateInfo.dwAddData = 0;
CreateInfo.hHosting = HWND_DESKTOP;
hMainWnd = CreateMainWindowEx (&CreateInfo, "flat", 0, 0, 0);
if (hMainWnd == HWND_INVALID)
{
return -1;
}
ShowWindow(hMainWnd, SW_SHOWNORMAL);
while (GetMessage(&Msg, hMainWnd)) {
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
MainWindowThreadCleanup (hMainWnd);
return 0;
}
#ifdef _MGRM_THREADS
#include <minigui/dti.c>
#endif
| I | Attachment | Action | Size | Date | Who | Comment |
|---|---|---|---|---|---|---|
| | scrollbar_notif.gif | manage | 3.6 K | 12 May 2009 - 13:30 | FeynmanHejian | |
| | scrollbar_sample.png | manage | 7.8 K | 12 May 2009 - 15:23 | FeynmanHejian | |
| | scrollbar_specific.gif | manage | 2.1 K | 10 May 2009 - 23:29 | FeynmanHejian |