Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var HwndTip: HWND := CreateWindowEx(WS_EX_NOACTIVATE or WS_EX_TOPMOST
- ,TOOLTIPS_CLASS
- ,nil // Same as NULL in C or Zero
- ,TTS_ALWAYSTIP or TTS_BALLOON
- ,0,0,0,0
- ,Self.Handle // Handle of Window containing the buttons
- ,0
- ,HInstance // Handle of Application (Application Instance Handle)
- ,nil);
- SendMessage(HwndTip,TTM_SETTITLE,TTI_INFO,LPARAM(PChar('Title')));
- SendMessage(HwndTip,TTM_SETMAXTIPWIDTH,0,300);
- var TI: TToolInfo;
- ZeroMemory(@TI,SizeOf(TToolInfo));
- TI.cbSize := SizeOf(TToolInfo);
- TI.hwnd := Self.Handle; // Handle of Window containing the buttons
- // Configuring a ToolTip for the First Button
- TI.uId := BUTN1.Handle; // Handle of the first button
- TI.lpszText := 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tincidunt dictum dui vel luctus. Duis ornare arcu a varius pharetra. Curabitur tempor sit amet dui id malesuada. Aliquam efficitur, massa consectetur tristique iaculis, dolor diam tincidunt.';
- TI.uFlags := TTF_IDISHWND or TTF_SUBCLASS;
- SendMessage(HwndTip,TTM_ADDTOOL,0,LPARAM(@TI));
- // Configuring a ToolTip for the Second Button
- TI.uId := BUTN2.Handle; // Handle of the second button
- TI.lpszText := 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tincidunt dictum dui vel luctus. Duis ornare arcu a varius pharetra. Curabitur tempor sit amet dui id malesuada. Aliquam efficitur, massa consectetur tristique iaculis, dolor diam tincidunt.';
- TI.uFlags := TTF_IDISHWND or TTF_SUBCLASS or TTF_CENTERTIP;
- SendMessage(HwndTip,TTM_ADDTOOL,0,LPARAM(@TI));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement