Void creategrphicmenuwin ()
{
Wndclass WC;
Rect;
Zeromemory (& WC, sizeof (WC ));
...
WC. lpfnwndproc = (wndproc) menuwinproc;
...
// Registerclass (& WC)
// Createwindow
// Showwindow
// Updatewindow
}
Bool callback menuwinproc (hwnd, uint MSG, wparam, lparam)
{
Lresult = 0;
Paintstruct pS;
Switch (MSG)
{
...
Case wm_paint:
{
HDC = beginpaint (hwnd, & PS );
Drawgraphicmenubar (hwnd, HDC );
Endpaint (hwnd, & PS );
}
Return 0;
...
}
Return (defwindowproc (hwnd, MSG, wparam, lparam ));
}
Void drawgraphicmenubar (hwnd, HDC)
{
HDC hmemdc = createcompatibledc (HDC );
HDC hdrawdc = createcompatibledc (HDC );
Hbitmap, holdbmp;
Hbitmap hbgtitle, hplay, hstop;
Hbitmap holdbgtitle, holdplay, holdstop;
Hbitmap = createcompatiblebitmap (HDC, phonewidth, menuheight );
Holdbmp = (hbitmap) SelectObject (hmemdc, hbitmap );
Hbgtitle = loadbitmap (context-> hinst, makeintresource (idb_sbgtitle ));
Holdbgtitle = (hbitmap) SelectObject (hdrawdc, hbgtitle );
Bitblt (hmemdc, 0, 0, phonewidth, menuheight, hdrawdc, 0, 0, srccopy );
SelectObject (hdrawdc, holdbgtitle );
Deleteobject (hbgtitle );
Hplay = loadbitmap (context-> hinst, makeintresource (idb_splay ));
Holdplay = (hbitmap) SelectObject (hdrawdc, hplay );
Bitblt (hmemdc, leftspace, topspace, playpausewidth, iconheight, hdrawdc, 0, 0, srccopy );
SelectObject (hdrawdc, holdplay );
Deleteobject (hplay );
Hstop = loadbitmap (context-> hinst, makeintresource (idb_sstop ));
Holdstop = (hbitmap) SelectObject (hdrawdc, hstop );
Bitblt (hmemdc, playpausewidth + leftspace, topspace, stopwidth, iconheight, hdrawdc, 0, 0, srccopy );
SelectObject (hdrawdc, holdstop );
Deleteobject (hstop );
Bitblt (HDC, 0, 0, phonewidth, menuheight, hmemdc, 0, 0, srccopy );////
SelectObject (hmemdc, holdbmp );
Deleteobject (hbitmap );
Deletedc (hmemdc );
Deletedc (hdrawdc );
}