File: n_svc_system.sru
Size: 1568
Date: Mon, 07 Apr 2008 21:31:27 +0200
$PBExportHeader$n_svc_system.sru
$PBExportComments$System Services
forward
global type n_svc_system from n_svc_base
end type
end forward

global type n_svc_system from n_svc_base
end type
global n_svc_system n_svc_system

type prototypes
Function boolean IsAppThemed() Library "uxtheme.DLL"
Function boolean IsThemeActive() Library "uxtheme.DLL"
end prototypes

type variables
protected:

environment ie
end variables

forward prototypes
public function environment of_getenvironment ()
public function boolean of_isxp ()
public function boolean of_issysthemed ()
public subroutine of_getresolution (ref integer w, ref integer h)
end prototypes

public function environment of_getenvironment ();RETURN ie
end function

public function boolean of_isxp ();//force non-xp if running from PB
IF Handle(GetApplication()) = 0 THEN 
   //check if running PB >= 10
   Environment le
   le = of_GetEnvironment()
   IF le.PBMajorRevision < 10 THEN
      RETURN FALSE
   END IF
END IF

RETURN ie.OSMajorRevision >= 5 AND ie.OSMinorRevision >= 1
end function

public function boolean of_issysthemed ();IF this.of_isxp() THEN
   //RETURN IsAppThemed()
   RETURN IsThemeActive() AND IsAppThemed()
ELSE
   RETURN FALSE
END IF
end function

public subroutine of_getresolution (ref integer w, ref integer h);w = ie.ScreenWidth
h = ie.ScreenHeight
end subroutine

on n_svc_system.create
call super::create
end on

on n_svc_system.destroy
call super::destroy
end on

event constructor;call super::constructor;GetEnvironment(ie)
end event