Firemonkey hiding the taskbar icon

Source: Internet
Author: User

FMX (Firemonkey) can easily achieve a lot of VCL cannot or difficult to implement special effects, so the FMX program as an interface, packaged into the DLL by the VCL program call, is a good solution. For the completeness of the program, you do not want to see the FMX program displaying icons on the taskbar. However, normal Windows functions do not seem to work, such as after you get the FMX form handle, using the ShowWindow function to hide the taskbar icon, the result is useless. In fact, the reason is very simple, but you use the handle is not correct.

The correct source code I paste out, specifically I will not explain, I believe that the basis of the people can read.

UnitUnit1;Interfaceuseswinapi.windows, Winapi.messages, System.sysutils, System.types, System.uitypes, system.classes, System.Variants, FMX. Platform.win, FMX. Types, FMX. Controls, FMX. Forms, FMX. Graphics, FMX. Dialogs, FMX. Controls.presentation, Fmx.stdctrls;typeTForm1=class(tform) Button1:tbutton; procedureButton1Click (Sender:tobject); Private    {Private Declarations}   Public    {Public Declarations}  End;varForm1:tform1;Implementation{$R *.FMX}procedureTform1.button1click (sender:tobject);begin  //Hide the main program icon in the taskbarShowWindow (Applicationhwnd, sw_hide); //Hide the main program icon in ALT + TABSetWindowLong (Applicationhwnd, Gwl_exstyle, Ws_ex_toolwindow Or getwindowlong (Applicationhwnd, GWL_EXSTYLE));End;End.

This code is compiled in Delphi XE8 and is correctly debugged.

Firemonkey hiding the taskbar icon

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.