Recent

Author Topic: How to remove consoleApp in my aplication?  (Read 790 times)

d2010

  • Sr. Member
  • ****
  • Posts: 264
How to remove consoleApp in my aplication?
« on: March 09, 2026, 08:26:15 pm »
Help me, I need remove console-Win, direct from  "Lazarus"
Code: [Select]
program coimagevi;
{$mode objfpc}{$H+}

uses
  Interfaces,
  h_types in 'C:\Vlaxcompil\Srcincpa\h_types.pas',
  hc_types in 'C:\Vlaxcompil\Srcincpa\hc_types.pas',
  h_aduiport in 'C:\Vlaxcompil\Srcincpa\h_aduiport.pas',
  hc_exprecon in 'C:\Vlaxcompil\Srcincpa\hc_exprecon.pas',
  windows,
  Forms, MainForm;

begin
  Application.Title:='jpegexample';
  Application.Initialize;
  Application.CreateForm(TJPEGExampleForm, JPEGExampleForm);
  JPEGExampleForm.PostCreateFrom();
  Application.Run;
end.
« Last Edit: March 09, 2026, 08:32:12 pm by d2010 »

Thaddy

  • Hero Member
  • *****
  • Posts: 18918
  • Glad to be alive.
Re: How to remove consoleApp in my aplication?
« Reply #1 on: March 09, 2026, 08:51:40 pm »
Help me, I need remove console-Win, direct from  "Lazarus"
Code: [Select]
program coimagevi;
{$mode objfpc}{$H+}

uses
  Interfaces,
  h_types in 'C:\Vlaxcompil\Srcincpa\h_types.pas',
  hc_types in 'C:\Vlaxcompil\Srcincpa\hc_types.pas',
  h_aduiport in 'C:\Vlaxcompil\Srcincpa\h_aduiport.pas',
  hc_exprecon in 'C:\Vlaxcompil\Srcincpa\hc_exprecon.pas',
  windows,
  Forms, MainForm;

begin
  Application.Title:='jpegexample';
  Application.Initialize;
  Application.CreateForm(TJPEGExampleForm, JPEGExampleForm);
  JPEGExampleForm.PostCreateFrom();
  Application.Run;
end.

{$APPTYPE GUI}
or check in options win32 gui application (also for 64 bit)
« Last Edit: March 09, 2026, 08:56:18 pm by Thaddy »
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

d2010

  • Sr. Member
  • ****
  • Posts: 264
Re: How to remove consoleApp in my aplication?
« Reply #2 on: March 17, 2026, 10:28:33 am »
Thank you. your solution if good. 8)

Fred vS

  • Hero Member
  • *****
  • Posts: 3871
    • StrumPract is the musicians best friend
Re: How to remove consoleApp in my aplication?
« Reply #3 on: March 17, 2026, 01:59:28 pm »
Help me, I need remove console-Win, direct from  "Lazarus"

Hello.

In your program source:

Code: Pascal  [Select][+][-]
  1. program coimagevi;
  2. {$mode objfpc}{$H+}
  3.  
  4. {$ifdef mswindows} {$apptype gui} {$endif} // add this
  5.  
  6. uses
  7. ...
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

 

TinyPortal © 2005-2018