whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1541)

Database (90)
Files (137)
Forms (107)
Graphic (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Math (76)
Misc (126)
Multimedia (45)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (266)
VCL (242)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

46 Visitors Online


 
...show a form in full-screen mode?
Autor: Babak Sateli
Homepage: http://www.cdcenterco.com
[ Print tip ]  

Tip Rating (17):  
     


{
  Make your application like a game. Full Screen.
  Disable all of the system keys.
}

procedure TForm1.FormCreate(Sender: TObject);
var
  
HTaskbar: HWND;
  OldVal: LongInt;
begin
  try
    
// Find handle of TASKBAR
    
HTaskBar := FindWindow('Shell_TrayWnd', nil);
    // Turn SYSTEM KEYS off, Only Win 95/98/ME
    
SystemParametersInfo(97, Word(True), @OldVal, 0);
    // Disable the taskbar
    
EnableWindow(HTaskBar, False);
    // Hide the taskbar
    
ShowWindow(HTaskbar, SW_HIDE);
  finally
    with 
Form1 do 
    begin
      
BorderStyle := bsNone;
      FormStyle   := fsStayOnTop;
      Left        := 0;
      Top         := 0;
      Height      := Screen.Height;
      Width       := Screen.Width;
    end;
  end
end
;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
var
  
HTaskbar: HWND;
  OldVal: LongInt;
begin
  
//Find handle of TASKBAR
  
HTaskBar := FindWindow('Shell_TrayWnd', nil);
  //Turn SYSTEM KEYS Back ON, Only Win 95/98/ME
  
SystemParametersInfo(97, Word(False), @OldVal, 0);
  //Enable the taskbar
  
EnableWindow(HTaskBar, True);
  //Show the taskbar
  
ShowWindow(HTaskbar, SW_SHOW);
end;


{
  Hope you like it !
  So if you have any problem using these codes
  please e-mail me at :
  babak_sateli@yahoo.com
  Babak Sateli
  www.cdcenterco.com
}


 

Rate this tip:

poor
very good


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners