Hide Xbase++ application

This forum is for general support of Xbase++
Post Reply
Message
Author
dougtanner
Posts: 32
Joined: Fri Jan 20, 2012 9:24 am

Hide Xbase++ application

#1 Post by dougtanner »

How can I hide an xBase++ application so it is not visible on the desktop and on the windows task bar. I want an application to wake up when a file appears at a network location.

Doug

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Hide Xbase++ application

#2 Post by Tom »

Create the app as a service (look at ..\XPPW32\source\samples\apps\SimpleService).
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Hide Xbase++ application

#3 Post by Tom »

Another solution: DCGET OPTIONS ... NOTASKLIST. This will prevent your app from to be shown in the task list. DCGET OPTIONS ... HIDE will hide the dialog unless oDialog:Show() is called (DCREAD GUI ... PARENT @oDialog).
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Hide Xbase++ application

#4 Post by rdonnay »

I think this is what you want:

Code: Select all

#INCLUDE "dcdialog.CH"

FUNCTION Main()

LOCAL GetList[0], oMenuBar, oMenu1, oMenu2, oDlg, GetOptions

DCMENUBAR oMenuBar
  DCSUBMENU oMenu1 PROMPT 'File' PARENT oMenuBar
    DCMENUITEM 'New' PARENT oMenu1
  DCSUBMENU oMenu1 PROMPT 'Edit' PARENT oMenuBar
    DCMENUITEM 'New' PARENT oMenu2

DCGETOPTIONS HIDE
DCREAD GUI TITLE 'Wakeup Test' OPTIONS GetOptions PARENT @oDlg ;
   EVAL {|o|o := Thread():new(),Sleep(5),o:start({||Check4WakeUp(oDlg)})}

RETURN nil

* --------------

PROC appsys ; return

* --------------

STATIC FUNCTION Check4WakeUp( oDialog )

DO WHILE .t.
   Sleep(100)
   IF FExists('Wakeup.Txt') 
     IF !oDialog:isVisible()
       oDialog:show()
     ENDIF
   ELSEIF oDialog:isVisible()
     oDialog:hide()
   ENDIF
ENDDO

RETURN nil
The eXpress train is coming - and it has more cars.

dougtanner
Posts: 32
Joined: Fri Jan 20, 2012 9:24 am

Re: Hide Xbase++ application

#5 Post by dougtanner »

Thanks Roger,

That code does what I wanted to do. I like Tom's idea of creating a service too.

Doug

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Hide Xbase++ application

#6 Post by Tom »

Doug,

services are limited if they try to interact with the desktop. Network shares and other installed hardware may not be visible to services. This is an elegant solution for lots of issues, but it may not be first choice for everything.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

bwolfsohn
Posts: 648
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: Hide Xbase++ application

#7 Post by bwolfsohn »

We have tried and failed numerous times to create a service with a built-in UI. We ended up building two separate apps to communicate, a service and a UI. The service app if for multiple services, each on it's own tab.. it's based on roger's service app (which doesn't run as an actual service). It's a maintenance/debugging nightmare when trying to deal with messaging between the apps..

Brian
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

Post Reply