Every product of Microsoft, regardless of the function or interface design, it will bring us a certain surprise, such as the interface design of officeXP, office2003, messenger, has already become a number of software competed to imitate, and I have seen a few sets of Messenger. The software of the network video conference is drawn on its interface style. Since the time, the prompt window requires the user to pay attention to the user's attention when it is displayed, and it does not affect the user operation when it is displayed. It is very natural that Messenger has gradually popped up the message prompt form from the bottom right corner of the screen, but relative to Messenger, I prefer QQ2004 Olympic version of the QQ2004 Olympic version of the color style, anyway, I should steal more, the shortcut key prompt window Effect: This form has the following features: 1, the display is gradually popped up from the bottom right corner of the screen; The form is dragged, changing the size of the size; 4. Its title and content display area have a gradual layer color, and there are several small points in the title. When implementing the method, the method is used, and the screenshot is directly filled. Of course, the interface can steal, the code will have the old man, the following is the interface design map and implementation code:
SUMMARY interface formPSHotKey.dfm [longer content, click here to find open / folding] object frmPSHotKey: TfrmPSHotKey Left = 192 Top = 107 BorderStyle = bsNone Caption = 'KeyTips' ClientHeight = 168 ClientWidth = 343 Color = clWhite Constraints. MinWidth = 350 Font.Charset = GB2312_CHARSET Font.Color = clWindowText Font.Height = -12 Font.Name = 'Arial' Font.Style = [] FormStyle = fsStayOnTop OldCreateOrder = False OnCreate = FormCreate OnPaint = FormPaint OnResize = FormResize DesignSize = ( 343 168) Pixelsperinch = 96 textHeight = 12 Object imgtitlebar: timage left = 0 TOP = 0 width = 343 height = 12 Cursor = CrsizeAll Align = Altop AutoSize = true center = true pictures.data =
{07544269746D6170EE010000424DEE010000000000006E000000280000003900 00000C000000010004000000000080010000120B0000120B00000E0000000E00 0000D79D8B00A83A1700F8E6D600C9775E00F6DFCB00FAEDE200F4D7BE00F5DA C200EAD2BF00FCF5EE00FEFBF800BE796B00FFFFFF0000000000BBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB000D0D0888888888888 888888888888888888888888888888888888888888888000BBBB666666666666 6666666666666666666666666666666666666666666660008888777777777777 777777777777777777777777777777777777777777777000666644CC44CC44CC 44CC44CC44CC44CC44CC44CC44CC44CC44CC44CC44CC40007777231C231C231C 231C231C231C231C231C231C231C231C231C231C231C200044CC503550355035 503550355035503550355035503550355035503550355000231C999999999999 9999999999999999999999999999999999999999999990005035AAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0009999CCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC000AAAABBBBBBBBBBBB BBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB000CCCCBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB000BBBB} OnMouseDown = imgTitleBarMouseDown OnMouseMove = imgTitleBarMouseMove end object imgTitleBarBG: TImage Left = 248 Top = 32 Width = 7 Height = 12 AutoSize = True Picture.Data = {07544269746D617092000000424D920000000000000062000000280000000700 00000C000000010004000000000030000000120B0000120B00000B0000000B00 0000F4D7BE00F8E6D600F6DFCB00F5DAC200EAD2BF00FCF5EE00FEFBF800FAED E200BE796B00FFFFFF0000000000888888804444444000000000333333302222 222011111110777777705555555066666660999999908888888088888880} Visible =
False end object imgShapeBG: TImage Left = 280 Top = 48 Width = 3 Height = 56 AutoSize = True Picture.Data = {07544269746D6170DA010000424DDA01000000000000FA000000280000000300 0000380000000100080000000000E0000000120B0000120B0000310000003100 000000000000FFFFFF00FFFCFC00FFFDFD00FFF9F800FFFAF900FFFBFA00FFF6 F300FFF7F400FFF9F700FFFCFB00FFF0EA00FFF3EE00FFF5F100FFFAF800FFE5 D900FFE7DC00FFE9DF00FFEBE200FFEDE500FFEEE600FFEFE800FFF0E900FFF2 EC00FFF4EF00FFF6F200FFF8F500FFE5D800FFE6D900FFE6DA00FFE7DB00FFE8 DC00FFE8DD00FFE9DE00FFEAE000FFEBE100FFECE300FFEDE400FFEFE700FFF1 EA00FFF3ED00FFF5F000FFF7F300FFF9F600FFFBF900FFFDFC00FFE9DD00FFEC E200FFF2EB001B1B1B000F0F0F001C1C1C001D1D1D001D1D1D001E1E1E001E1E 1E00101010001F1F1F00202020002E2E2E002121210011111100222222002222 220023232300121212002F2F2F00242424002525250013131300141414001414 14002626260015151500161616000B0B0B002727270030303000171717002828 28000C0C0C00181818001818 1800292929000D0D0D0019191900070707002A2A 2A00080808001A1A1A001A1A1A002B2B2B0009090900040404000E0E0E000505 05002C2C2C0006060600060606000A0A0A000A0A0A00020202002D2D2D000303 030003030300} Visible = False end object SpeedButton1: TSpeedButton Left = 323 Top = 16 Width = 14 Height = 14 Anchors = [akTop, akRight] Flat = True Glyph.Data =
{8A000000424D8A00000000000000420000002800000009000000090000000100 04000000000048000000120B0000120B00000300000003000000BE604200FFFF FF00000000001111111110000200100111001000111110001000100010011100 0001100010001110001110001100110000011000111010001000100011001001 1100100010001111111110001001} OnClick = SpeedButton1Click end object Label1: TLabel Left = 16 Top = 24 Width = 60 Height = 12 Caption = 'KeyTips' Font.Charset = GB2312_CHARSET Font.Color = clWindowText Font.Height = -12 Font.name = 'Song Body' font.style = [] parentfont = false transparent = true end Object label2: TLABEL LEFT = 16 TOP = 99 width = 294 height = 12 caption = 'A: Cursor When the cursor is listed, switch Data Type "Step Type" 'Transparent = True End Object Label3: TLabel Left = 16 TOP = 118 Width = 318 Height = 12 CAPTION =' B: When the cursor is in the "Number" column, the switching data type is "Process Requirements Type" 'Transparent = true end object label4: TLabel Left = 16 TOP = 138 width = 294 height = 12 c Aption = 'C: When the cursor is "numbered" column, switch data type is "material type"' transparent = true end object label5: TLabel Left = 16 TOP = 42 width = 132 height = 12 caption = 'alt ↓: Open drop-down list box 'Transparent = True end object Label6: TLabel Left = 16 Top = 61 Width = 108 Height = 12 Caption =' Ctrl Ins: insert a row 'Transparent = True end object Label7: TLabel Left = 16 Top = 80 Width = 120 height = 12 capen = 'ctrl
Del: Delete the current line 'transparent = true end object label8: TLabel Left = 174 TOP = 42 width = 138 height = 12 caption =' INS: Open "Process Name" 'Transparent = true end Object Label9: TLabel Left = 174 TOP = 61 width = 90 height = 12 caption = 'f11: Insert "° C"' transparent = True End Object label10: TLabel Left = 174 TOP = 80 width = 90 height = 12 caption = 'F12: Insert "'" "" "" "" "" true end object Label11: TLabel Left = 0 Top = 165 Width = 343 Height = 3 Cursor = crSizeNS Align = alBottom AutoSize = False Transparent = true OnMouseDown = Label11MouseDown OnMouseMove = Label11MouseMove end object Label12: TLabel Left = 0 Top = 12 Width = 3 Height = 153 Cursor = crSizeWE Align = alLeft AutoSize = False Transparent = True OnMouseDown = Label12MouseDown end object Label13: TLabel Left = 340 Top = 12 Width = 3 Height = 153 Cursor = crSizeWE Align = alRight AutoSize = Fa lse Transparent = True OnMouseDown = Label13MouseDown endend codes formPSHotKey.pas content unit formPSHotKey; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, Buttons; {======= ==============================================
=================== Design by: Peng Guohui Date: http://kacarton.yeah.net/ blog: http: // blog. 9cbs.net/nhconch email: kacarton # sohu.com Article Author's original, please contact me before reprinting, please indicate the article, retain the author information, thank you for your support! ============================================================================================================================================================================================================= ================================== ; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; Label8: TLabel; Label9: TLabel; Label10: TLabel; Label11: TLabel; Label12: TLabel; Label13: TLabel; procedure FormPaint (Sender: TObject); procedure imgTitleBarMouseDown (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure FormCreate (Sender: TObject); procedure SpeedButton1Click (Sender: TObject); procedure Label11MouseDown (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure FormResize (Sender: TObject); procedure Label12MouseDown (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); Procedure label13mousedown (Sender: Tobject; Button: TMouseButton; Shift: TshiftState; x, y: integer;
procedure imgTitleBarMouseMove (Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure Label11MouseMove (Sender: TObject; Shift: TShiftState; X, Y: Integer); private {Private declarations} public {Public declarations} end; var frmPSHotKey : Tfrmpshotkey; importation {$ r * .dfm} procedure tfrmpshotkey.form; begin tag: = height; height: = 16; // positioning to the right corner of the screen Top: = Screen.Height - 40; Left: = Screen.Width - Width - 2; show; // gradually popped up from the right corner of the screen: = height 5; top: = top - 5; update; Application.ProcessMessages; SLEEP (10); End; height: = tag; tag: = 0; color: = $ f4ba9d; formresize; end; procedure tfrmpshotkey.formpaint (sender: Tobject); var i: integer; rgn: hrgn; r: TRECT; begin with Canvas Do Begin // Drawheaded Background for I: = 0 To ClientWidth Do DRAW (i * imgtitlebarbg.width, 0, imgtitlebarbg.picture.bitmap); if tag <> 0 THEN EXIT; // If the form is popping up, do not draw content panel background // Draw content panel background setRect (r, 5 , 15, Width-5, Height-5); StretchDraw (r, imgshapebg.picture.bitmap); pen.color: = $ c97f55; brush.style: = BSCLEAR; ROUNDRECT (R.LEFT, R.TOP, R. Right, R.Bottom, 6, 6); // Draw form Border RGN: = CreateRectrGN (0,0,0,0); getWindowRgn (Self.handle, RGN); brush.color: = $ be796b; windows. Framergn (Handle, RGN, Brush.Handle, 2, 2); deleteObject (RGN); end; end; procedure tfrmpshotkey.imgtitlebarmousedown (Sender: Tobject; Button: tmousebutton;
Shift: tshiftState; x, y: integer; begin // Allow mobile forms or change the form size ReleaseCapture; if x <5 Then Perform (WM_SYSCOMMAND, $ F004, 0) Else IF X > Width - 5 then Perform (WM_SYSCOMMAND, $ F005, 0) else if Y <3 then Perform (WM_SYSCOMMAND, $ F003, 0) else Perform (WM_SYSCOMMAND, $ F012, 0); end; procedure TfrmPSHotKey.FormResize (Sender: TObject VAR RGN, RGN2: HRGN; Begin IF Tag <> 0 THEN EXIT; / / Form change Baxin RGN RGN: = CreateroundRectrgn (0, 0, Width 1, Height, 4, 4); RGN2: = CreateRectRgn (0, 11, Width, Height); CombineRgn (rgn, rgn, rgn2, RGN_OR); SetWindowRgn (Handle, rgn, True); DeleteObject (rgn); DeleteObject (rgn2); Invalidate; end; procedure TfrmPSHotKey.SpeedButton1Click ( Sender: TObject); begin Close; end; // the following form for changing the size Label procedure TfrmPSHotKey.Label11MouseDown (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin ReleaseCapture; if X <5 Then Perform (WM_SYSCOMMAND, $ F007, 0) Else IF X> Width - 5 then Perform (WM_SYSCOMMAND, $ F008, 0) else Perform (WM_SYSCOMMAND, $ F006, 0); end; procedure TfrmPSHotKey.Label12MouseDown (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin ReleaseCapture; Perform (WM_SYSCOMMAND, $ F001, 0); end; procedure TfrmPSHotKey.Label13MouseDown (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin ReleaseCapture; Perform (WM_SYSCOMMAND, $ F002, 0 ); / / below the code determines where the mouse is located, and change the mouse cursor, prompting the user to drag the form or change the size procedure tfrmpshotkey.imgtitlebarmousemousemove (Sender: Tobject; Shift: TshiftState; x, y: integer; begin if X <5 Then Imgtitlebar.cursor: = Crsizenwse Else IF X>
Width - 5 then imgTitleBar.Cursor: = crSizeNESW else if Y <3 then imgTitleBar.Cursor: = crSizeNS else imgTitleBar.Cursor: = crSizeAll; end; procedure TfrmPSHotKey.Label11MouseMove (Sender: TObject; Shift: TShiftState; X, Y: Integer ); begin if X <5 then Label11.Cursor: = crSizeNESW else if X> Width - 5 then Label11.Cursor: = crSizeNWSE else Label11.Cursor:. = crSizeNS; end; end {Public declarations} end; var frmPSHotKey: TfrmPSHotKey Implementation {$ r * .dfm} procedure tfrmpshotkey.form; begin tag: = height; height: = 16; // positioning to the right corner of the screen TOP: = Screen.Height - 40; Left: = Screen .Width - width - 2; show; // From the lower right corner of the screen, while Height
Brush.Color: = $ BE796B; windows.FrameRgn (Handle, rgn, Brush.Handle, 2, 2); DeleteObject (rgn); end; end; procedure TfrmPSHotKey.imgTitleBarMouseDown (Sender: TObject; Button: TMouseButton; Shift: TShiftState ; X, y: integer; begin // When the title is pressed, the form is allowed to move the form or change the form size ReleaseCapture; IF x <5 Then Perform (WM_SYSCOMMAND, $ F004, 0) Else if x> width - 5 then Perform (WM_SYSCOMMAND, $ F005, 0) else if Y <3 then Perform (WM_SYSCOMMAND, $ F003, 0) else Perform (WM_SYSCOMMAND, $ F012, 0); end; procedure TfrmPSHotKey.FormResize (Sender: TObject); var RGN, RGN2: HRGN; Begin IF Tag <> 0 THEN EXIT; / / Form change Baxin RGN RGN: = CreateroundRectrgn (0, 0, Width 1, Height, 4, 4); RGN2: = CreateRectRgn (0 , 11, Width, Height); CombineRgn (rgn, rgn, rgn2, RGN_OR); SetWindowRgn (Handle, rgn, True); DeleteObject (rgn); DeleteObject (rgn2); Invalidate; end; procedure TfrmPSHotKey.SpeedButton1Click (Sender: TObject Begin Close; End; // The following Label is used to change the form size P rocedure TfrmPSHotKey.Label11MouseDown (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin ReleaseCapture; if X <5 then Perform (WM_SYSCOMMAND, $ F007, 0) else if X> Width - 5 then Perform (WM_SYSCOMMAND, $ F008, 0) else Perform (WM_SYSCOMMAND, $ F006, 0); end; procedure TfrmPSHotKey.Label12MouseDown (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin ReleaseCapture; Perform ( WM_SYSCOMMAND, $ F001, 0); end; procedure TfrmPSHotKey.Label13MouseDown (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin ReleaseCapture; Perform (WM_SYSCOMMAND, $ F002, 0); end;
// The following code determines that the mouse is located, and change the mouse cursor, prompting the user to drag the form or change the size procedure tfrmpshotkey.imgtitlebarmousemouse (Sender: Tobject; Shift: TshiftState; x, y: integer; begin if x <5 kil imgTitleBar.Cursor: = crSizeNWSE else if X> Width - 5 then imgTitleBar.Cursor: = crSizeNESW else if Y <3 then imgTitleBar.Cursor: = crSizeNS else imgTitleBar.Cursor: = crSizeAll; end; procedure TfrmPSHotKey.Label11MouseMove (Sender: TObject Shift: tshiftState; x, y: integer; Begin IF x <5 Then Label11.cursor: = CrsizENESW Else IF X> Width - 5 Then Label11.cursor: = Crsizenwse else label11.cursor: = Crsizens; End; End. (Finish)