Alaska Software Inc. - Codejock tray icon
Username: Password:
AuthorTopic: Codejock tray icon
eldhoseCodejock tray icon
on Mon, 23 Mar 2009 13:13:59 +0530
hello All,

 I use following code for codejock activex control tray icon but i can,t set 
the icon .It return error 'Parameter has Wrong data type'
Can anyone help me ?

In codejock symbol reference showing  Public Property Icon() As Picture

 otray:= XbpActiveXControl():new(oDlg:drawingArea, , {165,228}, {311,55})
otray:CLSID := "Codejock.TrayIcon.12.1.1"
otray:create()
oSkin:MinimizeToTray(oDlg:getHWND())
oSkin:Icon := odlg:icon

Thanks
Elldhose
AUGE_OHRRe: Codejock tray icon
on Mon, 23 Mar 2009 09:34:10 +0100
hi,

> I use following code for codejock activex control tray icon but i can,t 
> set the icon .It return error 'Parameter has Wrong data type'
> Can anyone help me ?

http://www.xbaseforum.de/viewtopic.php?f=16&t=3080

> In codejock symbol reference showing  Public Property Icon() As Picture
>
> otray:= XbpActiveXControl():new(oDlg:drawingArea, , {165,228}, {311,55})
> otray:CLSID := "Codejock.TrayIcon.12.1.1"
> otray:create()
> oSkin:MinimizeToTray(oDlg:getHWND())
> oSkin:Icon := odlg:icon

you try to set a "Xbase++ Resource Icon" to a activeX 
if you got it work, please tell Roger and me how to do ...

you have to use Codejock Imagemanager to load Icon or Bitmap into.

   ::oGLobSet:icons:LoadIcon( xValue, 1, 0 )
*  ::oGLobSet:icons:LoadBitMap(xValue, 1, 0 )
   oPicture := ::oGLobSet:icons:getImage(1,16):createPicture(0)  VB 0
   ::setproperty("Icon", oPicture )

but again, WHY do you want to go that "hard" Way ?
Why not support as "beta" Tester for XCodejock or HX_Class ?

we now are at 2nd Step to "optimize" LIB/DLL "Wrapper" Class
for more Speed and better integration into Xbase++/Express++
Source.

greeintgs by OHR
Jimmy
eldhoseRe: Codejock tray icon
on Tue, 24 Mar 2009 13:55:19 +0530
Hello Jimmy,

 I can't understand the laungage used in xbase forum .Is any option to 
change the laungage to English .

Thanks & Regards
Eldhose


"AUGE_OHR" <AUGE_OHR*AT*WEB.DE> wrote in message 
news:55742c28$345a3af1$d72@news.alaska-software.com...
> hi,
>
>> I use following code for codejock activex control tray icon but i can,t 
>> set the icon .It return error 'Parameter has Wrong data type'
>> Can anyone help me ?
>
> http://www.xbaseforum.de/viewtopic.php?f=16&t=3080
>
>> In codejock symbol reference showing  Public Property Icon() As Picture
>>
>> otray:= XbpActiveXControl():new(oDlg:drawingArea, , {165,228}, {311,55})
>> otray:CLSID := "Codejock.TrayIcon.12.1.1"
>> otray:create()
>> oSkin:MinimizeToTray(oDlg:getHWND())
>> oSkin:Icon := odlg:icon
>
> you try to set a "Xbase++ Resource Icon" to a activeX 
> if you got it work, please tell Roger and me how to do ...
>
> you have to use Codejock Imagemanager to load Icon or Bitmap into.
>
>   ::oGLobSet:icons:LoadIcon( xValue, 1, 0 )
> *  ::oGLobSet:icons:LoadBitMap(xValue, 1, 0 )
>   oPicture := ::oGLobSet:icons:getImage(1,16):createPicture(0)  VB 0
>   ::setproperty("Icon", oPicture )
>
> but again, WHY do you want to go that "hard" Way ?
> Why not support as "beta" Tester for XCodejock or HX_Class ?
>
> we now are at 2nd Step to "optimize" LIB/DLL "Wrapper" Class
> for more Speed and better integration into Xbase++/Express++
> Source.
>
> greeintgs by OHR
> Jimmy
>
Pablo BotellaRe: Codejock tray icon
on Tue, 24 Mar 2009 11:59:55 +0100
> I can't understand the laungage used in xbase forum .Is any option to 
> change the laungage to English .
I've read the forum by time to time using this link
http://translate.google.com/translate?u=http%3A//www.xbaseforum.de/&hl=ens&langpair=de|en&tbb=1&ie=utf-8
Martin AltmannRe: Codejock tray icon
on Tue, 24 Mar 2009 18:01:18 +0100
Eldhose,
you just registered today but you have not activated your account yet.
You received a mail with an activation link inside which you should click on 
to get you going.

Regards,
Martin

______________________________

Deutschsprachiges Xbase-Forum:
http://www.xbaseforum.de/
______________________________
AUGE_OHRRe: Codejock tray icon
on Wed, 25 Mar 2009 00:05:08 +0100
hi,

> I can't understand the laungage used in xbase forum .Is any option to 
> change the laungage to English .

sorry no, it is a German Xbaseforum.

> otray:CLSID := "Codejock.TrayIcon.12.1.1"

in this "spezial" Case you can use XbpIcon() if you have v350.
use oPicture:LoadFile("my.Ico") and ::setproperty("Icon", oPicture )

>>    ::oGLobSet:icons:LoadIcon( xValue, 1, 0 )
>> *  ::oGLobSet:icons:LoadBitMap(xValue, 1, 0 )

forgot to say that Globalsettings have a own CLSID which
you do not "see" with COMLicenceFinder.exe so you have
to search in Registry for it.

greetings by OHR
Jimmy
Roger DonnayRe: Codejock tray icon
on Mon, 30 Mar 2009 09:09:46 -0600
Here's a little TrayIcon sample app I wrote.
The dialog commands are using eXpress++ so you can ignore them.
The info you need about setting the icon is in the code.
You also need to determine the position of the Tray Icon on the desktop so 
you can display a menu.
See GetCoords() to get the position.

#INCLUDE "dcdialog.CH"
#INCLUDE "xcodejock.CH"
#INCLUDE "suite.CH"

#Pragma Library("ascom10.lib")

FUNCTION Main()

LOCAL GetList[0], GetOptions, oTrayIcon, oPicture, oDlg, cBalloonTitle, ;
      cBalloonText, oMenu, cText, oGlobal, oIcon, iconArray[10], ;
      oIconImage, oDesktop := AppDesktop()

 Use this technique to create icon using CodeJock
oGlobal := CreateObject('Codejock.SuiteControlsGlobalSettings' + 
CJ_Version())
CJLoadIcon '..\..\..\icons\object.ico' ID 1 STATE xtpImageNormal PARENT 
oGlobal:icons
CJLoadBitmap '..\..\..\bitmaps\bug.bmp' ID 2 STATE xtpImageNormal PARENT 
oGlobal:icons
oPicture := oGlobal:icons:getImage(2,16):createPicture(xtpImageNormal)

 use this technique to create Icon using XbpIcon() - Xbase++ build 350 or 
later
 oPicture := XbpIcon():new():create()
 oPicture:loadFile('..\..\..\Icons\express.ico')
 Sleep(5)
 oPicture := oPicture:getIPicture()

cBalloonTitle := 'CodeJock.TrayIcon Control'
TEXT INTO cBalloonText WRAP
Good morning, Mr. Phelps.

Click this Balloon Tip before it disappears to show
the test application.

This balloon will self-destruct in 10 seconds.
ENDTEXT

TEXT INTO cText WRAP
This Xbase++ window can be controlled from the
TrayIcon menu or Balloon.  Click on the Minimize
button to minimize the window to the tray, then
click on the tray icon for a menu of options.
ENDTEXT

@ 0,0 DCSAY cText SAYWORDBREAK SAYSIZE 80,5 FONT '12.Lucida Console'

@ 5,0 DCPUSHBUTTON CAPTION 'Minimize' SIZE 10 ;
      ACTION {||oTrayIcon:minimizeToTray(oDlg:getHWnd())}

@ DCGUI_ROW, DCGUI_COL + 10 DCPUSHBUTTON CAPTION 'Show Balloon' SIZE 15 ;
      ACTION 
{||oTrayIcon:showBalloonTip(3,cBalloonTitle,cBalloonText,xtpToolTipIconInfo)}

DCSUBMENU oMenu PROMPT 'Menu' OWNERDRAW
  DCMENUITEM 'Show Window' PARENT oMenu ACTION 
{||oTrayIcon:MaximizeFromTray(oDlg:getHWnd())} ;
     WHEN {||!oDlg:isVisible()}
  DCMENUITEM 'Minimize Window to tray' PARENT oMenu ACTION 
{||oTrayIcon:MinimizeToTray(oDlg:getHWnd())} ;
     WHEN {||oDlg:isVisible()}
  DCMENUITEM SEPARATOR PARENT oMenu
  DCMENUITEM 'Exit' PARENT oMenu ACTION 
{||DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)}

@ 0,0 DCACTIVEXCONTROL oTrayIcon SIZE 1,1 PIXEL ;
      CLSID 'Codejock.TrayIcon' + CJ_Version() ;
      PARENT oDeskTop ;
      EVAL {|o|o:icon := oPicture, ;
               o:text := 'CodeJock.TrayIcon Application', ;
               o:showBalloonTip(11,cBalloonTitle,cBalloonText,xtpToolTipIconInfo), 
;
               o:balloonTipClicked := {||oDlg:show()}, ;
               o:subscribeEvent('mouseUp',{|a,b,c,d|MouseUp(a,b,c,d,oTrayIcon,oDlg,oMenu)}) 
 }

DCGETOPTIONS HIDE

DCREAD GUI FIT TITLE 'CodeJock TrayIcon' PARENT @oDlg OPTIONS GetOptions

oTrayIcon:destroy()

RETURN nil

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

STATIC FUNCTION GetCoords( oDlg, aMousePos )

LOCAL aPos, aDlgPos := oDlg:currentPos()

aMousePos[2] := AppDeskTop():currentSize()[2] + aMousePos[2]

aPos := { aMousePos[1] - aDlgPos[1], aMousePos[2] - aDlgPos[2] }

RETURN aPos

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

PROC appsys ; return

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

STATIC FUNCTION MouseUp( nButton, nShift, X, Y, oTrayIcon, oDlg, oMenu )

IF nButton == 1 .AND. !oDlg:isVisible()  left button
  oTrayIcon:MaximizeFromTray(oDlg:getHwnd())
ELSEIF nButton = 2  right button
  oMenu:PopUp(oDlg, GetCoords(oDlg,{ X, Y }), 2, ;
              XBPMENU_PU_DEFAULT + XBPMENU_PU_MOUSE_RBDOWN  )
ENDIF

RETURN nil












"eldhose" <eldhoseparakattu@gmail.com> wrote in message 
news:407624d3$1cad0f$d50@news.alaska-software.com...
> hello All,
>
> I use following code for codejock activex control tray icon but i can,t 
> set the icon .It return error 'Parameter has Wrong data type'
> Can anyone help me ?
>
> In codejock symbol reference showing  Public Property Icon() As Picture
>
> otray:= XbpActiveXControl():new(oDlg:drawingArea, , {165,228}, {311,55})
> otray:CLSID := "Codejock.TrayIcon.12.1.1"
> otray:create()
> oSkin:MinimizeToTray(oDlg:getHWND())
> oSkin:Icon := odlg:icon
>
> Thanks
> Elldhose
>
eldhoseRe: Codejock tray icon
on Wed, 01 Apr 2009 17:01:57 +0530
hi,

 i tried your sample but i can't get it work

 oXbp:=CreateObject('Codejock.SuiteControlsGlobalSettings.12.1.1')
 oXbp:Icons:LoadIcon('E:\test\xise.ico',1,1) always return nil

Many thanks
Eldhose



"Roger Donnay" <rogerdonnay@donnay-software.com> wrote in message 
news:48868b97$7f44e21d$bff@news.alaska-software.com...
> Here's a little TrayIcon sample app I wrote.
> The dialog commands are using eXpress++ so you can ignore them.
> The info you need about setting the icon is in the code.
> You also need to determine the position of the Tray Icon on the desktop so 
> you can display a menu.
> See GetCoords() to get the position.
>
> #INCLUDE "dcdialog.CH"
> #INCLUDE "xcodejock.CH"
> #INCLUDE "suite.CH"
>
> #Pragma Library("ascom10.lib")
>
> FUNCTION Main()
>
> LOCAL GetList[0], GetOptions, oTrayIcon, oPicture, oDlg, cBalloonTitle, ;
>      cBalloonText, oMenu, cText, oGlobal, oIcon, iconArray[10], ;
>      oIconImage, oDesktop := AppDesktop()
>
>  Use this technique to create icon using CodeJock
> oGlobal := CreateObject('Codejock.SuiteControlsGlobalSettings' + 
> CJ_Version())
> CJLoadIcon '..\..\..\icons\object.ico' ID 1 STATE xtpImageNormal PARENT 
> oGlobal:icons
> CJLoadBitmap '..\..\..\bitmaps\bug.bmp' ID 2 STATE xtpImageNormal PARENT 
> oGlobal:icons
> oPicture := oGlobal:icons:getImage(2,16):createPicture(xtpImageNormal)
>
>  use this technique to create Icon using XbpIcon() - Xbase++ build 350 
> or later
>  oPicture := XbpIcon():new():create()
>  oPicture:loadFile('..\..\..\Icons\express.ico')
>  Sleep(5)
>  oPicture := oPicture:getIPicture()
>
> cBalloonTitle := 'CodeJock.TrayIcon Control'
> TEXT INTO cBalloonText WRAP
> Good morning, Mr. Phelps.
>
> Click this Balloon Tip before it disappears to show
> the test application.
>
> This balloon will self-destruct in 10 seconds.
> ENDTEXT
>
> TEXT INTO cText WRAP
> This Xbase++ window can be controlled from the
> TrayIcon menu or Balloon.  Click on the Minimize
> button to minimize the window to the tray, then
> click on the tray icon for a menu of options.
> ENDTEXT
>
> @ 0,0 DCSAY cText SAYWORDBREAK SAYSIZE 80,5 FONT '12.Lucida Console'
>
> @ 5,0 DCPUSHBUTTON CAPTION 'Minimize' SIZE 10 ;
>      ACTION {||oTrayIcon:minimizeToTray(oDlg:getHWnd())}
>
> @ DCGUI_ROW, DCGUI_COL + 10 DCPUSHBUTTON CAPTION 'Show Balloon' SIZE 15 ;
>      ACTION 
> {||oTrayIcon:showBalloonTip(3,cBalloonTitle,cBalloonText,xtpToolTipIconInfo)}
>
> DCSUBMENU oMenu PROMPT 'Menu' OWNERDRAW
>  DCMENUITEM 'Show Window' PARENT oMenu ACTION 
> {||oTrayIcon:MaximizeFromTray(oDlg:getHWnd())} ;
>     WHEN {||!oDlg:isVisible()}
>  DCMENUITEM 'Minimize Window to tray' PARENT oMenu ACTION 
> {||oTrayIcon:MinimizeToTray(oDlg:getHWnd())} ;
>     WHEN {||oDlg:isVisible()}
>  DCMENUITEM SEPARATOR PARENT oMenu
>  DCMENUITEM 'Exit' PARENT oMenu ACTION 
> {||DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)}
>
> @ 0,0 DCACTIVEXCONTROL oTrayIcon SIZE 1,1 PIXEL ;
>      CLSID 'Codejock.TrayIcon' + CJ_Version() ;
>      PARENT oDeskTop ;
>      EVAL {|o|o:icon := oPicture, ;
>               o:text := 'CodeJock.TrayIcon Application', ;
> 
> o:showBalloonTip(11,cBalloonTitle,cBalloonText,xtpToolTipIconInfo), ;
>               o:balloonTipClicked := {||oDlg:show()}, ;
> 
> o:subscribeEvent('mouseUp',{|a,b,c,d|MouseUp(a,b,c,d,oTrayIcon,oDlg,oMenu)}) 
>  }
>
> DCGETOPTIONS HIDE
>
> DCREAD GUI FIT TITLE 'CodeJock TrayIcon' PARENT @oDlg OPTIONS GetOptions
>
> oTrayIcon:destroy()
>
> RETURN nil
>
> * ------------
>
> STATIC FUNCTION GetCoords( oDlg, aMousePos )
>
> LOCAL aPos, aDlgPos := oDlg:currentPos()
>
> aMousePos[2] := AppDeskTop():currentSize()[2] + aMousePos[2]
>
> aPos := { aMousePos[1] - aDlgPos[1], aMousePos[2] - aDlgPos[2] }
>
> RETURN aPos
>
> * ------------
>
> PROC appsys ; return
>
> * ------------
>
> STATIC FUNCTION MouseUp( nButton, nShift, X, Y, oTrayIcon, oDlg, oMenu )
>
> IF nButton == 1 .AND. !oDlg:isVisible()  left button
>  oTrayIcon:MaximizeFromTray(oDlg:getHwnd())
> ELSEIF nButton = 2  right button
>  oMenu:PopUp(oDlg, GetCoords(oDlg,{ X, Y }), 2, ;
>              XBPMENU_PU_DEFAULT + XBPMENU_PU_MOUSE_RBDOWN  )
> ENDIF
>
> RETURN nil
>
>
>
>
>
>
>
>
>
>
>
>
> "eldhose" <eldhoseparakattu@gmail.com> wrote in message 
> news:407624d3$1cad0f$d50@news.alaska-software.com...
>> hello All,
>>
>> I use following code for codejock activex control tray icon but i can,t 
>> set the icon .It return error 'Parameter has Wrong data type'
>> Can anyone help me ?
>>
>> In codejock symbol reference showing  Public Property Icon() As Picture
>>
>> otray:= XbpActiveXControl():new(oDlg:drawingArea, , {165,228}, {311,55})
>> otray:CLSID := "Codejock.TrayIcon.12.1.1"
>> otray:create()
>> oSkin:MinimizeToTray(oDlg:getHWND())
>> oSkin:Icon := odlg:icon
>>
>> Thanks
>> Elldhose
>>
>
>
AUGE_OHRRe: Codejock tray icon
on Wed, 01 Apr 2009 13:56:01 +0200
hi,

> i tried your sample but i can't get it work
>
> oXbp:=CreateObject('Codejock.SuiteControlsGlobalSettings.12.1.1')
> oXbp:Icons:LoadIcon('E:\test\xise.ico',1,1) always return nil

it will just add a Icon to ImageManager. you have to get-back it with

oPicture := oGlobal:icons:getImage(2,16):createPicture(0)

and assign it to

oTray:setproperty("Icon", oPicture )

if you have SL1 you can use XbpIcon() too

greetings by OHR
Jimmy
eldhoseRe: Codejock tray icon
on Thu, 02 Apr 2009 13:24:18 +0530
hi jimmy,

Sorry to disturbing again
Now i had get the error parameter has wrong data type create picture
oXbp:=CreateObject('Codejock.SuiteControlsGlobalSettings.12.1.1')
oXbp:Icons:LoadIcon('E:\test\xise.ico',1,1)
oPic:=oXbp:Icons:getImage(2,16):createPicture(0)
Error file is
oError:args         :
          -> VALTYPE: U VALUE: NIL
          -> VALTYPE: N VALUE: 0
oError:canDefault   : N
oError:canRetry     : N
oError:canSubstitute: Y
oError:cargo        : NIL
oError:description  : Parameter has a wrong data type
oError:filename     :
oError:genCode      :          2
oError:operation    : createPicture
oError:osCode       :          0
oError:severity     :          2
oError:subCode      :       1025
oError:subSystem    : BASE
oError:thread       :          1
oError:tries        :          0
------------------------------------------------------------------------------
CALLSTACK:
------------------------------------------------------------------------------
Called from MAIN(63)

Thanks in advance
Eldhose



"AUGE_OHR" <AUGE_OHR*AT*WEB.DE> wrote in message 
news:480074ec$62796256$18110@news.alaska-software.com...
> hi,
>
>> i tried your sample but i can't get it work
>>
>> oXbp:=CreateObject('Codejock.SuiteControlsGlobalSettings.12.1.1')
>> oXbp:Icons:LoadIcon('E:\test\xise.ico',1,1) always return nil
>
> it will just add a Icon to ImageManager. you have to get-back it with
>
> oPicture := oGlobal:icons:getImage(2,16):createPicture(0)
>
> and assign it to
>
> oTray:setproperty("Icon", oPicture )
>
> if you have SL1 you can use XbpIcon() too
>
> greetings by OHR
> Jimmy
>
>
>
AUGE_OHRRe: Codejock tray icon
on Thu, 02 Apr 2009 14:24:08 +0200
hi,

> oXbp:Icons:LoadIcon('E:\test\xise.ico',1,1)
> oPic:=oXbp:Icons:getImage(2,16):createPicture(0)

ok my mistake. if you have only 1 Icon ist must be

:getImage(Command,Width):createPicture(state)
where Command  = 1, Width = 16 and state = xtpImageNormal

if you have SL1 you can use XbpIcon() too and assign Icon direct

greetings by OHR
Jimmy