Recent

Author Topic: Fullscreen Application  (Read 11592 times)

xqtr

  • New Member
  • *
  • Posts: 21
Fullscreen Application
« on: August 16, 2009, 04:48:01 pm »
I found the solution on how to make a PPC aplication run in fullscreen and i am posting it, cause i didn't find any 100% correct solution on the forum.

1) In your project include the windows unit (uses windows;)
2) Add the following code:
Code: [Select]
interface

const
  //ShFullScreen
      SHFS_SHOWTASKBAR   = $01;
      SHFS_HIDETASKBAR   = $02;
      SHFS_SHOWSIPBUTTON = $04;
      SHFS_HIDESIPBUTTON = $08;
      SHFS_SHOWSTARTICON = $10;
      SHFS_HIDESTARTICON = $20; 

  function SHFullScreen(hwndRequester: hWnd; dwState: DWord): WINBOOL;
   stdcall; external 'aygshell.dll' name 'SHFullScreen';
3) Finally at your forms create event add the following code:

Code: [Select]
procedure TForm1.FormCreate(Sender: TObject);
var
rect:trect;
htaskbar:thandle;
menuh:integer;
begin
 hTaskBar := findwindow('HHTaskBar','');
 GetWindowRect(htaskbar,rect);
 menuh:=rect.Bottom-rect.Top;
 GetWindowRect(form1.handle,rect);
 SHFullScreen(form1.handle,SHFS_HIDETASKBAR or SHFS_HIDESTARTICON or SHFS_HIDESIPBUTTON);
 movewindow(form1.handle,rect.left,rect.Top-menuh,rect.Right,rect.bottom+menuh,true);
end;                   

The End!

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Fullscreen Application
« Reply #1 on: August 16, 2009, 11:54:47 pm »
It would be good if you could also post this on the wiki:

http://wiki.lazarus.freepascal.org/WinCE_Programming_Tips

In this page we have all wince programming tips in one single place for easy reference

lyh1

  • New Member
  • *
  • Posts: 19
Re: Fullscreen Application
« Reply #2 on: August 18, 2009, 10:27:06 am »
I am working on fullscreen directdraw and also facing the same problem.

aygshell.pp have the defination of function SHFullScreen, just put aygshell in uses section is ok.

but SHFullScreen will not work properly on WM5 or above machine, you also need showwindow and findwindow to hide the sip button and taskbar.
class name of taskbar and sip are:

HHTaskbar
SipWndClass
MS_SIPBUTTON

xqtr

  • New Member
  • *
  • Posts: 21
Re: Fullscreen Application
« Reply #3 on: August 18, 2009, 10:57:43 am »
Quote
I am working on fullscreen directdraw and also facing the same problem.
This way is not for directdraw,

Quote
aygshell.pp have the defination of function SHFullScreen, just put aygshell in uses section is ok.
Didn't know  :D Thanx...

Quote
but SHFullScreen will not work properly on WM5 or above machine, you also need showwindow and findwindow to hide the sip button and taskbar.
class name of taskbar and sip are:

HHTaskbar
SipWndClass
MS_SIPBUTTON

I tested with WM6.1 in a Samsung i780 and also at a WM5 emulator and it works fine. If you read the documentation of SHFullScreen at MSDN, it says that this function, only sends the taskbar,sip below yours... it is not hiding them. Thats why you have to put your form above them after calling the function.

I agree that if you want to completely hide them you have to use the functions you suggested.

lyh1

  • New Member
  • *
  • Posts: 19
Re: Fullscreen Application
« Reply #4 on: August 18, 2009, 12:04:30 pm »
I just find out, I have not set the form size to cover all the screen, so the SHFullScreen have no effect on the sip button. :P
I am using a HTC touch pro and WM6 pro emu.


Some correction: To hide the SIP button, 'menu_worker' is the correct classname, not MS_SIPBUTTON.
showwindow(findwindow('menu_worker',nil),sw_hide);     

ss6763

  • Newbie
  • Posts: 1
Re: Fullscreen Application
« Reply #5 on: August 19, 2009, 10:48:27 am »
try, this code...

procedure mm_ShowIme(Value : boolean);
var
  hTaskBar : THandle;
begin
     {$ifdef wince}
        hTaskBar := findwindow('HHTaskBar','');

        if Value  then ShowWindow(hTaskBar,SW_SHOW)
        else ShowWindow(hTaskBar,SW_HIDE);
     {$endif}
end; 

procedure TFrmSale.FormCreate(Sender: TObject);
begin
      mm_ShowIme(False);
end;  

procedure TFrmSale.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
     mm_ShowIme(True);
end;  
« Last Edit: August 19, 2009, 10:50:07 am by ss6763 »

BlueIcaro

  • Hero Member
  • *****
  • Posts: 792
    • Blog personal
Re: Fullscreen Application
« Reply #6 on: August 20, 2009, 03:32:16 pm »
Hello, the code posted by xqtr, in this theard works (for me) in my ipaq rx3715 with WM5.0. Also works on WM6 (classic emulator).

But the code post by ss6763, it's doesn't work on my ipaq also it's doesn't work on Wm6 (classic emulator)

/BlueIcaro

 

TinyPortal © 2005-2018