Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How can I create a form stay on Windows desktop ?

vndpvndp Member Posts: 6
Some tips show this:

[italic]//-------------------[/italic]
[blue]
protected
procedure CreateParams(var Params: TCreateParams); override;

[italic]//...[/italic]


procedure TForm.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
if Assigned(Application.MainForm) then
begin
Params.WndParent := GetDesktopWindow;
Params.Style := WS_CHILD;
end;
end;
[/blue]
[italic]//----------------------[/italic]

But when click icon "Show desktop" in the Windows taskbar, my form disappear. I want my form is [red]ALWAYS STAY ON WINDOWS DESKTOP[/red].
Please help me, thanks.

Comments

  • zibadianzibadian Member Posts: 6,349
    : Some tips show this:
    :
    : [italic]//-------------------[/italic]
    : [blue]
    : protected
    : procedure CreateParams(var Params: TCreateParams); override;
    :
    : [italic]//...[/italic]
    :
    :
    : procedure TForm.CreateParams(var Params: TCreateParams);
    : begin
    : inherited CreateParams(Params);
    : if Assigned(Application.MainForm) then
    : begin
    : Params.WndParent := GetDesktopWindow;
    : Params.Style := WS_CHILD;
    : end;
    : end;
    : [/blue]
    : [italic]//----------------------[/italic]
    :
    : But when click icon "Show desktop" in the Windows taskbar, my form disappear. I want my form is [red]ALWAYS STAY ON WINDOWS DESKTOP[/red].
    : Please help me, thanks.
    :
    :
    You can try to call Restore() in the OnMinimize event. This will probably create a small flicker in the form, because the application is minimized, and immediately restore. The "Show Desktop" link minimizes all windows, and I have never seen a window, except taskbars, which wasn't minimized.
  • vndpvndp Member Posts: 6
    : You can try to call Restore() in the OnMinimize event. This will probably create a small flicker in the form, because the application is minimized, and immediately restore. The "Show Desktop" link minimizes all windows, and I have never seen a window, except taskbars, which wasn't minimized.
    :

    Thank you for reply. I've seen a program (Desktop Calendar) which wasn't
    minimized when I click "Show Desktop" icon. But this program was written by VC++ 6.0
    However, I'll try with your method. Thank you very much!
Sign In or Register to comment.