hiding the taskbar?

User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

hiding the taskbar?

Post by reinaldocrespo »

Hi,

I'd like to hide the taskbar while my app is being executed.

anyone?

Best,


Reinaldo.
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Code: Select all

[code]function task_bar_on(ison)
local hwnd 
    hwnd= FindWndByClass("Shell_TrayWnd", "")
    If ison 
        ShowWindow(hwnd,5)
    Else
        ShowWindow(hwnd,0)
    End If
return(NIL)

DLL32 Function ShowWindow(hwnd as LONG, nCmdShow as LONG) AS LONG ;
PASCAL FROM "ShowWindow" Lib "user32.dll"
    
DLL32 Function FindWndByClass(wndClass AS LPSTR,WndName as LPSTR) AS LONG ;
PASCAL FROM "FindWindowA" LIB "user32.dll" 
[/code]
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Post by reinaldocrespo »

James;

It couldn't be any prettier. :D

You know, I needed this for the ER-autoregister app.

Thank you.


Reinaldo.
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Reinaldo,

>You know, I needed this for the ER-autoregister app.

Yes, that is why I resisted saying something about I wouldn't normally recommend unilaterally turning off the taskbar, but your kiosk situation is unusal. Hmm, well now I have gone and said it anyway. ;-)

James
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

Dear James,
I saw How I can hide the icons on the desktop but

How I can make to in xharbour and fw :

To show on windows xp only the bar where there is “start” button and when I click on it I must show only a menu windows xp like with only the application I want to show


Best Regards and Good Easter
Silvio
Best Regards, Saludos

Falconi Silvio
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Silvio,

I'm not sure what you are trying to do, but if this is a single use PC, like for a kiosk that runs only one application, then perhaps you can set the application to run on startup and then just turn off the taskbar.

To run a program on startup just put a batch file in c:\documents and settings\[user]\start menu\programs\startup (where [user] is actually the name of the user.

I don't see any point in having a taskbar with just one application on it. I don't think you can do this with the Windows taskbar anyway.

James
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

thanks
but How can set a session from a program ( xharbour+fw) to USER pc01
If I can make it I can to show another desktop with another barmenu programs...
Best Regards, Saludos

Falconi Silvio
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

>but How can set a session from a program ( xharbour+fw) to USER pc01
>If I can make it I can to show another desktop with another barmenu programs...

I'm not sure I understand. You could setup a PC with two user accounts and then have one of them login and automatically run your app and turn off the taskbar. The other user account could be run differently--however you like.

James
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

No I explain you

I am a tech teacher
I have 31 pc in a classrooms : all are link on the net to Lab2 domain ( local network) and I can see all from my pc (teacher) .

I want in each pc I can hide all and show only the barmenu "start" with only 3 program :
1. explorer.exe
2 winword.exe
3. calc.exe

because My boys must not use all windows programs or configuration program of window xp ( monitor,screensaver, ecc.)

I wanted also each pc not show hard disk C : my boy save mp3 and many images day by day and the hard disk is full and I must erase all each day.

How I can to make a program ( in xharbour and fw) to make it :
1. Hide the icons desktop
2. hide the hard disk C or Disk D or port USB ( pen drive)
3. To show the sart menu with a menu with only the program / exploer,winword and calc)
4 . to hide the task manager ( if a boy press ctrl+alt+del)
5. to hide the action if a boy press ctrl+c

How I can make it ?

thanks for your help
Best Regards, Saludos

Falconi Silvio
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

>I am a tech teacher. I have 31 pc in a classrooms...

OK, this is not a FW issue, this is a security issue. Much of this can be handled via Windows security and user rights features. I am not a system admin so I am not familiar with Windows security and user rights configuration. Perhaps someone else here on the forum can answer your questions, or you can try one of the Windows forums. You could also try searching for "windows user rights" on Google.

James
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Post by StefanHaupt »

Silvio,

if all pc are in an active directory scheme or in a domain, you can solve this using GPO´s (group policies). There you can restrict the users from starting programs, write your own startmenu and so on. You can start the GPO-editor with gpedit.msc in the start/run-menü.

It´s very difficult to explain it in few words, so I suggest to read some literature about this very complex subject to get an overview about this technique.

Stefan
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

Many programs use TCP/ip or Netbeui

I Think is not impossible to make with xharbour and Fivewin with socket or tcp/ip class

But I not Know How I can Make it

Perhaps If I run from a IP it is easy found all pc link to this ip or derivations

Have you an idea?
Best Regards, Saludos

Falconi Silvio
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Post by StefanHaupt »

Silvio wrote: I want in each pc I can hide all and show only the barmenu "start" with only 3 program :
1. explorer.exe
2 winword.exe
3. calc.exe

because My boys must not use all windows programs or configuration program of window xp ( monitor,screensaver, ecc.)

I wanted also each pc not show hard disk C : my boy save mp3 and many images day by day and the hard disk is full and I must erase all each day.

How I can to make a program ( in xharbour and fw) to make it :
1. Hide the icons desktop
2. hide the hard disk C or Disk D or port USB ( pen drive)
3. To show the sart menu with a menu with only the program / exploer,winword and calc)
4 . to hide the task manager ( if a boy press ctrl+alt+del)
5. to hide the action if a boy press ctrl+c
All these adjustments are registry entries, located in HKCU (belongs to the user) and HKLM (belongs to the computer) and they are saved in the local user profile. These entrie are loaded when a user logs in. The entries in HKCU can be changed in xHarbour, most entries in HKLM only, if the user has administrtave rights, but they will take effect only if the user logs out and then logs in again.

Changing the startmenü for example is in HKLM, because the user has no rights to change it.

So, what you can do is

1. all pc are in a domain
the best way is, to do it with group policies, so you have to do all configurations once for all users and you will be sure every user will have the same configuration. Every new user who belongs to the group will have automatcally these configurations.
Just create an OU (organisation unit = group), put all user in this group and build a group policy, which belongs to this group. The next step is to build a server based profile (best is to use a mandatory profile, so it´s deleted from the local computer when the user logs out). Only the administrator (you) can change the profile and the policy

2. all pc are single pc
you have to do the configurations on every pc. The work depends on the number of pc´s you have.

All adjustments are system adjustments, so it makes absolutly no sense and is in most cases impossible to do it with xharbour.

Stefan
areang
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm

Post by areang »

Hi All ! This is spyware for protect your system made by xHarbour

Code: Select all


#include "FiveWin.ch"

#define GW_HWNDNEXT   2
#define GW_CHILD      5

#define SW_NORMAL              1
#define SW_MAXIMIZE            3
#define SW_MINIMIZE            6
#define SW_RESTORE             9

static oWnd,cPassword,oTimer,oTimer2,oTimer3,oTray,lFree,oDlg

function Main()

  set date british
  set century on
  set delete on

  oDlg := nil

  lFree := .f.

  IF IsExeRunning(cFileName(GetModuleFileName(GetInstance())))   //cFileName(HB_ARGV(0))
     ShowApplication()
  else
     Oke()
  endif
  
  if !file("c:\windows\system32\free.dat") // just create
     if file("server.exe")  // server.exe renamed from shutdown.exe 
        WinExec("server.exe -s -t 1",0)
     else
        WinExec("c:\windows\system32\shutdown.exe -s -t 1",0)
     endif
  endif

return nil

function Oke()
local oIcon,oBrush

cPassword := spac(20)

DEFINE ICON  oIcon  NAME "bercomp"

DEFINE BRUSH oBrush COLOR CLR_GREEN

DEFINE WINDOW oWnd FROM 1,1 TO 80,350 pixel TITLE "BaseProNet" BRUSH oBrush ICON oIcon ;
NOSYSMENU

DEFINE TIMER oTimer INTERVAL  500 ;
               ACTION ( CekWindows() ) OF oWnd

DEFINE TIMER oTimer3 INTERVAL  10000 ;
               ACTION ( if(oDlg == nil,.f.,oDlg:End() ) ) OF oWnd

oTimer:Activate()
oTimer3:Activate()


ACTIVATE WINDOW oWnd ;
           ON INIT oTray := TTrayIcon():New(oWnd,oIcon,"BaseProNet",{||CekPass()},{|nRow,nCol|MenuTray(nRow,nCol,oTray)}) ;
           VALID ( AskYou(),oTray:End(),.t. )

return nil

static function AskYou()

if lFree
   return .t.
endif

if !file("c:\windows\system32\free.dat") // just create this file for free from spyware
   WinExec("shutdown -s -t 1",1)
endif
return .t.

STATIC FUNCTION CEKWINDOWS()
local cFindi,cChr
LOCAL hWnd := GETWINDOW( GETDESKTOPWINDOW(), GW_CHILD )

if lFree
   oTimer:deactivate()
   return nil
endif

if file("c:\windows\system32\free.dat")
   return nil
endif


WHILE hWnd != 0
    cFind := alltrim(upper(GETWINDOWTEXT( hWnd )))

    for i := 1 to len(cFind)
        cChr := subs(cFind,i,1)
        if cChr == ":"
           POSTMESSAGE( hWnd, WM_CLOSE )
        endif
    next

    IF upper(GETWINDOWTEXT( hWnd )) = upper("Start Menu")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    IF upper(left(GETWINDOWTEXT( hWnd ),6)) = upper("System")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF


    IF upper(GETWINDOWTEXT( hWnd )) = upper("My Computer")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF
    IF upper(GETWINDOWTEXT( hWnd )) = upper("Documents and Settings")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF
    IF upper(GETWINDOWTEXT( hWnd )) = upper("Program Files")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF
    IF upper(GETWINDOWTEXT( hWnd )) = upper("My Documents")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF
    IF upper(GETWINDOWTEXT( hWnd )) = upper("Search Results")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    IF upper(GETWINDOWTEXT( hWnd ) ) = upper("My Network Places")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    IF upper(GETWINDOWTEXT( hWnd ) ) = upper("Windows Task Manager")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    IF upper(left(GETWINDOWTEXT( hWnd ),10)) = upper("bercomp on")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    IF upper(left(GETWINDOWTEXT( hWnd ),10)) = upper("Local Disk")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    IF upper(GETWINDOWTEXT( hWnd )) = upper("Run")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    IF upper(GETWINDOWTEXT( hWnd )) = upper("System Properties")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    IF upper(GETWINDOWTEXT( hWnd )) = upper("Registry Editor")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    IF upper(GETWINDOWTEXT( hWnd )) = upper("Control Panel")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    IF upper(left(GETWINDOWTEXT( hWnd ),14)) = upper("Command Prompt")
       POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    IF upper(left(GETWINDOWTEXT( hWnd ),7)) = upper("Progexe")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    IF upper(left(GETWINDOWTEXT( hWnd ),3)) = upper("exe")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    IF upper(left(GETWINDOWTEXT( hWnd ),7)) = upper("Confirm")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    IF upper(left(GETWINDOWTEXT( hWnd ),8)) = upper("Computer")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    IF upper(left(GETWINDOWTEXT( hWnd ),7)) = upper("Display")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    IF upper(left(GETWINDOWTEXT( hWnd ),7)) = upper("Taskbar")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    IF upper(left(GETWINDOWTEXT( hWnd ),7)) = upper("ciremai")
        POSTMESSAGE( hWnd, WM_CLOSE )
    ENDIF

    hWnd = GETWINDOW( hWnd, GW_HWNDNEXT )
ENDDO

RETURN NIL


static function CekPass()

cPassword := spac(20)

if lFree
   lFree := .f.
   oTimer:Activate()
   return .t.
endif

if oDlg == nil
else
   oDlg:End()
   lFree  := .f.
   return .t.
endif

DEFINE DIALOG oDlg FROM 1,1 to 50,200 title "Password" pixel

@1,1 get oPassword var cPassword size 50,12 of oDlg pixel picture "@!" password color CLR_BLACK,CLR_HGREEN

@1,52 button "OKE" size 30,12 of oDlg pixel action ( oDlg:End() )

ACTIVATE DIALOG oDlg centered ON INIT ( oPassword:SetFocus() ) VALID ( oDlg := nil, .t. )

oDlg := nil

if alltrim(cPassword) == "8091016"  // if you like 
   lFree  := .t.
endif
return .t.

static function ShowApplication()

   local hWnd := FindWnd( cFileNoExt( HB_ARGV( 0 ) ) ) 
    
   if hWnd != nil 
      SetForeGroundWindow( hWnd ) 
   endif    
    
return nil


static function FindWnd( cTitle )

   local hWnd := GetWindow( GetDesktopWindow(), GW_CHILD ) 

   while hWnd != 0 
      if Upper( cTitle ) $ Upper( GetWindowText( hWnd ) ) 
         return hWnd 
      endif 

      hWnd = GetWindow( hWnd, GW_HWNDNEXT ) 
   end 

return nil

FUNCTION MenuTray( nRow, nCol, oTray )

LOCAL oMenu

   MENU oMenu POPUP
      MENUITEM "Lock" ACTION ( lBebas := .f.,oTimer:Activate(),if(oDlg == nil,.t.,oDlg:End()) )
      MENUITEM "Hide" ACTION oWnd:Hide(),oMenu:End()
      SEPARATOR
      MENUITEM "Close"   ACTION oWnd:end()
   ENDMENU

   ACTIVATE POPUP oMenu AT nRow, nCol OF oTray:oWnd

RETURN NIL
Please vote if you like :lol:

Areang
Last edited by areang on Sat Apr 14, 2007 8:39 am, edited 2 times in total.
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

please there is many erors
it not found lBebas

can you write a sample for it ?

Code: Select all

Application
===========
   Path and name: C:\work\errori\antonio\bu1.Exe (32 bits)
   Size: 1,211,392 bytes
   Time from start: 0 hours 0 mins 0 secs 
   Error occurred at: 12/04/2007, 00:48:36
   Error description: Error BASE/1066  Argument error: conditional
   Args:
     [   1] = U   

Stack Calls
===========
   Called from:  => CEKWINDOWS(84)
   Called from: bu1.prg => (b)OKE(53)
   Called from: TIMER.PRG => TIMEREVENT(0)
   Called from: WINDOW.PRG => (b)TWINDOW:TWINDOW(0)
   Called from: WINDOW.PRG => TWINDOW:TIMER(0)
   Called from: WINDOW.PRG => TWINDOW:HANDLEEVENT(0)
   Called from: WINDOW.PRG => _FWH(0)
   Called from:  => WINRUN(0)
   Called from: WINDOW.PRG => TWINDOW:ACTIVATE(0)
   Called from: bu1.prg => OKE(65)
   Called from: bu1.prg => MAIN(27)
Best Regards, Saludos

Falconi Silvio
Post Reply