How do HIDETASKBAR / HIDESTARTICON functional for DIALOGs ?

Post Reply
User avatar
Arturo Lopesoria
Posts: 84
Joined: Fri Aug 10, 2007 1:47 am
Location: Mexico DF
Contact:

How do HIDETASKBAR / HIDESTARTICON functional for DIALOGs ?

Post by Arturo Lopesoria »

Hello All

I have an app with a unique main Window and some Dialogs. Main Window have only buttons.
Requirements are no menu, no taskbar neither start icon.
Already the follow code works even when user press device start button, and return to app from an external windows task
(a phone call is the clasical example):

Code: Select all

oWnd:bGotFocus:={|| SHFullScreen( GetActiveWindow(), SHFS_HIDESTARTICON), ;
                                  SHFullScreen( GetActiveWindow(), SHFS_HIDETASKBAR   ), MoveWindow( oWnd:hWnd, 0,0,240,320 ) }
 
This code works fine only if user was on main window when mentioned event happens, but not works for Dialogs case.
I mean, if user was on a Dialog, an returns from an external window to app, then Windows StartIcon and TaskBar remains on top.

I put the GotFocus method and bgotfocus var into TDialog class, likes are present in TWindow class, and then call the same code thath works for Window but this has no any effect on Dialog.

Any sugestion? (excuse my poor english)
Thanks in advance!

Arturo.
Arturo LS
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: How do HIDETASKBAR / HIDESTARTICON functional for DIALOGs ?

Post by Antonio Linares »

Arturo,

Here you have a working example,

test.prg

Code: Select all

// Full screen demo

#include "FWCE.ch" 

#define SHFS_HIDETASKBAR      0x0002
#define SHFS_HIDESTARTICON    0x0020
 
function Main() 
 
   local oWnd 
 
   DEFINE WINDOW oWnd TITLE "Test" 

   @ 2, 2 BUTTON "Exit" ACTION oWnd:End() SIZE 80, 20
   
   @ 4, 2 BUTTON "Dialog" ACTION BuildDialog() SIZE 80, 20

   oWnd:bGotFocus = { || SHFullScreen( GetActiveWindow(), SHFS_HIDESTARTICON ),;
                         SHFullScreen( GetActiveWindow(), SHFS_HIDETASKBAR ),;
                         MoveWindow( oWnd:hWnd, 0, 0, 240, 320 ) }
  
   ACTIVATE WINDOW oWnd ;
      ON INIT ( SHFullScreen( oWnd:hWnd, SHFS_HIDESTARTICON ),;
                SHFullScreen( oWnd:hWnd, SHFS_HIDETASKBAR ),;
                MoveWindow( oWnd:hWnd, 0, 0, 240, 320 ) )
 
return nil 

function BuildDialog()

   local oDlg
   
   DEFINE DIALOG oDlg

   @ 2, 2 BUTTON "Exit" ACTION oDlg:End() SIZE 40, 10
   
   ACTIVATE DIALOG oDlg ;
      ON INIT ( DlgFullScreen( oDlg:hWnd ),;
                MoveWindow( oDlg:hWnd, 0, 0, 240, 320 ) )
   
return nil    

#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>
#include <aygshell.h>

HB_FUNC( DLGFULLSCREEN )
{
   SHINITDLGINFO shidi;
 
   memset( &shidi, 0, sizeof( SHINITDLGINFO ) );
 
   shidi.dwMask  = SHIDIM_FLAGS;
   shidi.hDlg    = ( HWND ) hb_parnl( 1 );
   shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;
 
   SHInitDialog( &shidi );
}

#pragma ENDDUMP
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: How do HIDETASKBAR / HIDESTARTICON functional for DIALOGs ?

Post by Otto »

Hello Antonio,

thank you. Perfect.
Best regards,

Otto

PS:

#define SHFS_SHOWTASKBAR 1 // 0x0001
#define SHFS_HIDETASKBAR 2 // 0x0002 //2
#define SHFS_SHOWSIPBUTTON 4 // 0x0004
#define SHFS_HIDESIPBUTTON 8 // 0x0008 //8
#define SHFS_SHOWSTARTICON 16 // 0x0010
#define SHFS_HIDESTARTICON 20 // 0x0020 //32

I alway wondered what SIP is standing for: I found with Google's help:
SIP = Soft Input Panel = keyboard - I didn't knew that

If you would also like to hide the SIP
SHFullScreen( GetActiveWindow(), SHFS_HIDESIPBUTTON ),;
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
Post Reply