bubblewindow.c

来自「WinCE下绝好的工具条软件」· C语言 代码 · 共 31 行

C
31
字号
HWND createBubbleWindow(HINSTANCE hInstance, LPTSTR title, LPTSTR clss, int x, int y, int width, int height)
{
  // Create the window 
  HWND hBubble = CreateWindowEx( WS_EX_TOOLWINDOW|WS_EX_TOPMOST,clss,title,WS_CLIPSIBLINGS,x,y,
                                 width+2,height,NULL,NULL,hInstance,0 );

  HDC hDC = GetDC( hBubble );

  // Fill with a purple background
  HBRUSH hBrush = CreateSolidBrush( RGB(255,0,255) );
  HBRUSH hOldBr = (HBRUSH)SelectObject( hDC,hBrush );
  Rectangle( hDC,0,0,width+2,height );
  SelectObject( hDC,hOldBr );
  DeleteObject( hBrush );

  // Create the main part of the window
  hBrush = CreateSolidBrush( RGB(0,0,0) );
  hOldBr = (HBRUSH)SelectObject( hDC,hBrush);
  RoundRect( hDC,1,11,width-2,height-11,6,6 );
  SelectObject( hDC,hOldBr );
  DeleteObject( hBrush );

  // Create the arrow
  Rectangle( hDC,width-22,0,width-17,11 );
  Rectangle( hDC,width
  // Leftmost pos is width - 17
  // Create the region
  
  ReleaseDC( hBubble,hDC );
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?