Page 9 of 9

Posted: Mon Jun 02, 2008 8:43 pm
by Karbon
Thanks!

Posted: Thu Jun 12, 2008 11:31 am
by zikitrake
:? About PureXLS, any form to set an Auto-Filter with PureXLS_Style or other method?
-----
Solved!

Code: Select all

 PureXLS_WriteString(id, "<AutoFilter x:Range="+Chr(34)+"R3C1:R3C11"+Chr(34)+" xmlns="+Chr(34)+"urn:schemas-microsoft-com:office:excel"+Chr(34)+">" )
  
PureXLS_WriteStringN(id, "</AutoFilter>")

SysTrayIcon library...

Posted: Thu Nov 06, 2008 1:11 pm
by jpd
Hi Flype,

at first thank for the nice library SysTrayIcon.

In one of my project I need to use unicode

and the SysTrayIconBalloonEx2 procedure not works,

I'm analyzed the code and found out that you use

byte value on the NOTIFYICONDATA Structure

if you use character value

then the structure size not have a fix value on boot case ANSI/Unicode


and this constant are not ready anymore

#NOTIFYICONDATA_V1_SIZE = 88 ; 95+
#NOTIFYICONDATA_V2_SIZE = 488 ; 2000+
#NOTIFYICONDATA_V3_SIZE = 504 ; XP+

you need to use sizeof(NOTIFYICONDATA_95) for #NOTIFYICONDATA_V1_SIZE
and

sizeof(NOTIFYICONDATA_2k) for #NOTIFYICONDATA_V2_SIZE

and
sizeof(NOTIFYICONDATA_XP for #NOTIFYICONDATA_V3_SIZE


Best
jpd

here the changed file...
SysTrayIconRes.pb:

Code: Select all


;-----------------------------------------------------------
;- Object:   NotifyIcon UserLibrary
;- Version:  1.1, May 2006
;-           
;- Requir.:  PureBasic 4.0
;-           TailBite 1.3 PR 1.0
;-           
;- Author:   flype - flype@altern.org
;-           
;- Descr.    Microsoft SHELL_NOTIFYICON
;-           Functions for Systray Icon (shellapi.h)
;-----------------------------------------------------------


;-----------------------------------------------------------
; Constants
;-----------------------------------------------------------

Enumeration ; #WM
  #WM_USER       = $400
  #WM_NOTIFYICON = $400 + $7258
EndEnumeration
Enumeration ; #NIF
  #NIF_MESSAGE = $01 ; 95+
  #NIF_ICON    = $02 ; 95+
  #NIF_TIP     = $04 ; 95+
  #NIF_STATE   = $08 ; 95+
  #NIF_INFO    = $10 ; 2000+
  #NIF_GUID    = $20 ; XP+ Reserved
EndEnumeration
Enumeration ; #NIIF
  #NIIF_NONE      = $00 ; 2000+
  #NIIF_INFO      = $01 ; 2000+
  #NIIF_WARNING   = $02 ; 2000+
  #NIIF_ERROR     = $03 ; 2000+
  #NIIF_USER      = $04 ; XPSP2+
  #NIIF_ICON_MASK = $0F ; XP+ Reserved
  #NIIF_NOSOUND   = $10 ; XP+ Reserved
EndEnumeration
Enumeration ; #NIM
  #NIM_ADD        = 0 ; 95+
  #NIM_MODIFY     = 1 ; 95+
  #NIM_DELETE     = 2 ; 95+
  #NIM_SETFOCUS   = 3 ; 2000+
  #NIM_SETVERSION = 4 ; 2000+
EndEnumeration
Enumeration ; #NIN
  #NINF_KEY             = 1
  #NIN_SELECT           = $400
  #NIN_KEYSELECT        = $401
  #NIN_BALLOONSHOW      = $402 ; XP+
  #NIN_BALLOONHIDE      = $403 ; XP+
  #NIN_BALLOONTIMEOUT   = $404 ; XP+
  #NIN_BALLOONUSERCLICK = $405 ; XP+
EndEnumeration
Enumeration ; #NIS
  #NIS_HIDDEN     = 1 ; 2000+
  #NIS_SHAREDICON = 2 ; 2000+
EndEnumeration

  #NOTIFYICON_VERSION     = 3   ; 2000+


Structure NOTIFYICONDATA_95
  cbSize.l
  hwnd.l 
  uID.l 
  uFlags.l 
  uCallbackMessage.l 
  hIcon.l 
  szTip.c[64] 
EndStructure 
Structure NOTIFYICONDATA_2K Extends NOTIFYICONDATA_95
  szTipEx.c[64] 
  dwState.l
  dwStateMask.l 
  szInfo.c[256] 
  StructureUnion 
  uTimeout.l 
  uVersion.l 
  EndStructureUnion 
  szInfoTitle.c[64]
  dwInfoFlags.l
EndStructure 
Structure NOTIFYICONDATA_XP Extends NOTIFYICONDATA_2K
  guid.GUID
EndStructure 


and the file SysTrayIconEx.pb:

Code: Select all

;------------------------------------------------------------------------------------------------
;- Object:   SysTrayIconEx UserLibrary
;- Version:  1.0, May 2006
;- Author:   flype - flype@altern.org
;- Requir.:  PureBasic 4.0 / TailBite 1.3 PR 1.2
;------------------------------------------------------------------------------------------------


;EnableExplicit


IncludeFile "C:\code\UserLib_PB40_SysTrayIconEx\UserLib_PB40_SysTrayIconEx\Source\\SysTrayIconRes.pb"


;------------------------------------------------------------------------------------------------
; AddSysTrayIconEx(uID.l, hWindow.l, hIcon.l [, tip.s])
; RemoveSysTrayIconEx(uID.l, hWindow.l)
; SysTrayIconToolTipEx(uID.l, hWindow.l, tip.s)
; HideSysTrayIconEx(uID.l, hWindow.l, state.l)
; SetActiveSysTrayIconEx(uID.l, hWindow.l)
; SysTrayIconBalloonEx(uID.l, hWindow.l, title.s, message.s, timeOut.l [, flags.l]) 
;------------------------------------------------------------------------------------------------


;------------------------------------------------------------------------------------------------
; Compatibility : Microsoft Windows 95+
;------------------------------------------------------------------------------------------------

ProcedureDLL.l AddSysTrayIconEx(uID.l, hWindow.l, hIcon.l)
  
  Protected nid.NOTIFYICONDATA_95
  
  nid\cbSize           = SizeOf(NOTIFYICONDATA_95)
  nid\uID              = uID
  nid\hwnd             = hWindow
  nid\hIcon            = hIcon
  nid\uFlags           = #NIF_MESSAGE | #NIF_ICON
  nid\uCallbackMessage = #WM_NOTIFYICON
  
  ProcedureReturn Shell_NotifyIcon_(#NIM_ADD, @nid)
  
EndProcedure
ProcedureDLL.l AddSysTrayIconEx2(uID.l, hWindow.l, hIcon.l, tip.s)
  
  Protected nid.NOTIFYICONDATA_2K
  
  nid\uID              = uID
  nid\hwnd             = hWindow
  nid\hIcon            = hIcon
  nid\uFlags           = #NIF_MESSAGE | #NIF_ICON | #NIF_TIP
  nid\uCallbackMessage = #WM_NOTIFYICON
  
  If OSVersion() >= #PB_OS_Windows_2000
    PokeS(@nid\szTip, tip, 128)
    nid\cbSize = SizeOf(NOTIFYICONDATA_2K)
  Else
    PokeS(@nid\szTip, tip, 64)
    nid\cbSize = SizeOf(NOTIFYICONDATA_95)
  EndIf
  
  ProcedureReturn Shell_NotifyIcon_(#NIM_ADD, @nid)
  
EndProcedure
ProcedureDLL.l RemoveSysTrayIconEx(uID.l, hWindow.l)
  
  Protected nid.NOTIFYICONDATA_95
  
  nid\cbSize = SizeOf(NOTIFYICONDATA_95)
  nid\uID    = uID
  nid\hwnd   = hWindow
  
  ProcedureReturn Shell_NotifyIcon_(#NIM_DELETE, @nid)
  
EndProcedure
ProcedureDLL.l SysTrayIconToolTipEx(uID.l, hWindow.l, tip.s)
  
  Protected nid.NOTIFYICONDATA_2K
  
  nid\uID    = uID
  nid\hwnd   = hWindow
  nid\uFlags = #NIF_TIP
  
  If OSVersion() >= #PB_OS_Windows_2000
    PokeS(@nid\szTip, tip, 128)
    nid\cbSize = SizeOf(NOTIFYICONDATA_2K)
  Else
    PokeS(@nid\szTip, tip, 64)
    nid\cbSize = SizeOf(NOTIFYICONDATA_95)
  EndIf
  
  ProcedureReturn Shell_NotifyIcon_(#NIM_MODIFY, @nid)
  
EndProcedure


;------------------------------------------------------------------------------------------------
; Compatibility : Microsoft Windows 2000+
;------------------------------------------------------------------------------------------------

ProcedureDLL.l HideSysTrayIconEx(uID.l, hWindow.l, state.l)
  
  Protected nid.NOTIFYICONDATA_2K
  
  If OSVersion() >= #PB_OS_Windows_2000
    
    nid\cbSize      = SizeOf(NOTIFYICONDATA_2K)
    nid\uID         = uID
    nid\hwnd        = hWindow
    nid\uFlags      = #NIF_STATE
    nid\dwStateMask = #NIS_HIDDEN
    
    If state
      nid\dwState = #NIS_HIDDEN
    EndIf
    
    ProcedureReturn Shell_NotifyIcon_(#NIM_MODIFY, @nid) 
    
  EndIf
  
EndProcedure
ProcedureDLL.l SetActiveSysTrayIconEx(uID.l, hWindow.l)
  
  Protected nid.NOTIFYICONDATA_2K
  
  If OSVersion() >= #PB_OS_Windows_2000
    
    nid\cbSize = SizeOf(NOTIFYICONDATA_2K)
    nid\uID    = uID
    nid\hwnd   = hWindow
    
    ProcedureReturn Shell_NotifyIcon_(#NIM_SETFOCUS, @nid) 
    
  EndIf
  
EndProcedure
ProcedureDLL.l SysTrayIconBalloonEx(uID.l, hWindow.l, title.s, message.s, timeOut.l) 
  
  Protected nid.NOTIFYICONDATA_2K
  
  If OSVersion() >= #PB_OS_Windows_XP
    nid\cbSize = SizeOf(NOTIFYICONDATA_XP)
  ElseIf OSVersion() >= #PB_OS_Windows_2000
    nid\cbSize = SizeOf(NOTIFYICONDATA_2K)
  Else
    ProcedureReturn #False
  EndIf
  
  nid\uVersion = #NOTIFYICON_VERSION 
  Shell_NotifyIcon_(#NIM_SETVERSION, @nid)
  
  nid\uID         = uID
  nid\hwnd        = hWindow
  nid\dwInfoFlags = #NIIF_INFO
  nid\uFlags      = #NIF_INFO
  nid\uTimeout    = timeOut
  
  PokeS(@nid\szInfo, message, 256) 
  PokeS(@nid\szInfoTitle, title, 64)
  
  ProcedureReturn Shell_NotifyIcon_(#NIM_MODIFY, @nid) 
  
EndProcedure
ProcedureDLL.l SysTrayIconBalloonEx2(uID.l, hWindow.l, title.s, message.s, timeOut.l, flags.l) 
  
  Protected nid.NOTIFYICONDATA_2K
  
  If OSVersion() >= #PB_OS_Windows_XP
    nid\cbSize = SizeOf(NOTIFYICONDATA_XP)
  ElseIf OSVersion() >= #PB_OS_Windows_2000
    nid\cbSize = SizeOf(NOTIFYICONDATA_2K)
  Else
    ProcedureReturn #False
  EndIf
  
  nid\uVersion = #NOTIFYICON_VERSION 
  Shell_NotifyIcon_(#NIM_SETVERSION, @nid)
  
  nid\uID         = uID
  nid\hwnd        = hWindow
  nid\dwInfoFlags = flags
  nid\uFlags      = #NIF_INFO
  nid\uTimeout    = timeOut
  
  PokeS(@nid\szInfo, message, 256) 
  PokeS(@nid\szInfoTitle, title, 64)
  
  ProcedureReturn Shell_NotifyIcon_(#NIM_MODIFY, @nid) 
  
EndProcedure


Posted: Thu Nov 20, 2008 10:49 pm
by Flype
thank you for the update ;)

Re: Flype UserLibraries for PureBasic 4.0

Posted: Thu Sep 17, 2009 9:01 am
by Kiffi
Hello Flype,

unfortunately PureStorage is down. :( Is there a chance to download your libs anywhere else?

TIA & Greetings ... Kiffi

Re: Flype UserLibraries for PureBasic 4.0

Posted: Sat Sep 19, 2009 5:15 pm
by Tomi
Please Update DL_Links :oops:
all is broken

Re: Flype UserLibraries for PureBasic 4.0

Posted: Sat Oct 17, 2009 3:11 am
by cas
Site had a blow out... trying to get everything back online... sorry all.
I'm waiting for new links, too.
Thanks

Re: Flype UserLibraries for PureBasic 4.0

Posted: Wed Jan 20, 2010 4:47 pm
by quasiperfect
any news on the links ?

Re: Flype UserLibraries for PureBasic 4.0

Posted: Fri Jan 22, 2010 1:36 am
by ruyi7952
:oops: can't download

Re: Flype UserLibraries for PureBasic 4.0

Posted: Sun Jan 24, 2010 4:21 pm
by SoS
The libs are online on http://code.google.com/p/rwrappers/ , http://rwrappers.googlecode.com/svn/trunk

Use an SVN-client , eg. (http://tortoisesvn.net/), to download.

Re: Flype UserLibraries for PureBasic 4.0

Posted: Wed Jan 27, 2010 4:34 am
by DoubleDutch
GitHub is nicer (for the downloader) - any chance of using that too?

Re: Flype UserLibraries for PureBasic 4.0

Posted: Fri Mar 07, 2014 11:08 pm
by Thunder93
Regards to SysTrayIconEx...
To have it support x64 and some other adjustments. Is working with PB 5.22 LTS Beta

SysTrayIconRes.pbi

Code: Select all

;-----------------------------------------------------------
;- Object:   NotifyIcon UserLibrary
;- Version:  1.1, May 2006
;-           
;- Requir.:  PureBasic 4.0
;-           TailBite 1.3 PR 1.0
;-           
;- Author:   flype - flype@altern.org
;-           
;- Descr.    Microsoft SHELL_NOTIFYICON
;-           Functions for Systray Icon (shellapi.h)
;-----------------------------------------------------------


;-----------------------------------------------------------
; Constants
;-----------------------------------------------------------

Enumeration ; #WM
  #WM_USER       = $400
  #WM_NOTIFYICON = $400 + $7258
EndEnumeration
Enumeration ; #NIF
  #NIF_MESSAGE = $01 ; 95+
  #NIF_ICON    = $02 ; 95+
  #NIF_TIP     = $04 ; 95+
  #NIF_STATE   = $08 ; 95+
  #NIF_INFO    = $10 ; 2000+
  #NIF_GUID    = $20 ; XP+ Reserved
EndEnumeration
Enumeration ; #NIIF
  #NIIF_NONE      = $00 ; 2000+
  #NIIF_INFO      = $01 ; 2000+
  #NIIF_WARNING   = $02 ; 2000+
  #NIIF_ERROR     = $03 ; 2000+
  #NIIF_USER      = $04 ; XPSP2+
  #NIIF_ICON_MASK = $0F ; XP+ Reserved
  #NIIF_NOSOUND   = $10 ; XP+ Reserved
EndEnumeration
Enumeration ; #NIM
  #NIM_ADD        = 0 ; 95+
  #NIM_MODIFY     = 1 ; 95+
  #NIM_DELETE     = 2 ; 95+
  #NIM_SETFOCUS   = 3 ; 2000+
  #NIM_SETVERSION = 4 ; 2000+
EndEnumeration
Enumeration ; #NIN
  #NINF_KEY             = 1
  #NIN_SELECT           = $400
  #NIN_KEYSELECT        = $401
  #NIN_BALLOONSHOW      = $402 ; XP+
  #NIN_BALLOONHIDE      = $403 ; XP+
  #NIN_BALLOONTIMEOUT   = $404 ; XP+
  #NIN_BALLOONUSERCLICK = $405 ; XP+
EndEnumeration
Enumeration ; #NIS
  #NIS_HIDDEN     = 1 ; 2000+
  #NIS_SHAREDICON = 2 ; 2000+
EndEnumeration

  #NOTIFYICON_VERSION     = 3   ; 2000+


Structure NOTIFYICONDATA_95 Align #PB_Structure_AlignC
  cbSize.l
  hwnd.i
  uID.l 
  uFlags.l 
  uCallbackMessage.l 
  hIcon.i
  szTip.c[128] 
EndStructure 
Structure NOTIFYICONDATA_2K Extends NOTIFYICONDATA_95
  szTipEx.c[128] 
  dwState.l
  dwStateMask.l 
  szInfo.c[256] 
  StructureUnion 
  uTimeout.l 
  uVersion.l 
  EndStructureUnion 
  szInfoTitle.c[128]
  dwInfoFlags.l
EndStructure 
Structure NOTIFYICONDATA_XP Extends NOTIFYICONDATA_2K
  guid.GUID
EndStructure 
SysTrayIconEx.pb

Code: Select all

;------------------------------------------------------------------------------------------------
;- Object:   SysTrayIconEx UserLibrary
;- Version:  1.0, May 2006
;- Author:   flype - flype@altern.org
;- Requir.:  PureBasic 4.0 / TailBite 1.3 PR 1.2
;------------------------------------------------------------------------------------------------


;EnableExplicit


IncludeFile "SysTrayIconRes.pbi"


;------------------------------------------------------------------------------------------------
; AddSysTrayIconEx(uID.l, hWindow.l, hIcon.l [, tip.s])
; RemoveSysTrayIconEx(uID.l, hWindow.l)
; SysTrayIconToolTipEx(uID.l, hWindow.l, tip.s)
; HideSysTrayIconEx(uID.l, hWindow.l, state.l)
; SetActiveSysTrayIconEx(uID.l, hWindow.l)
; SysTrayIconBalloonEx(uID.l, hWindow.l, title.s, message.s, timeOut.l [, flags.l]) 
;------------------------------------------------------------------------------------------------


;------------------------------------------------------------------------------------------------
; Compatibility : Microsoft Windows 95+
;------------------------------------------------------------------------------------------------

ProcedureDLL.l AddSysTrayIconEx(uID.l, hWindow.l, hIcon.l)
  
  Protected nid.NOTIFYICONDATA_95
  
  nid\cbSize           = SizeOf(NOTIFYICONDATA_95)
  nid\uID              = uID
  nid\hwnd             = hWindow
  nid\hIcon            = hIcon
  nid\uFlags           = #NIF_MESSAGE | #NIF_ICON
  nid\uCallbackMessage = #WM_NOTIFYICON
  
  ProcedureReturn Shell_NotifyIcon_(#NIM_ADD, @nid)
  
EndProcedure
ProcedureDLL.l AddSysTrayIconEx2(uID.l, hWindow.l, hIcon.l, tip.s)
  
  Protected nid.NOTIFYICONDATA_2K
  
  nid\uID              = uID
  nid\hwnd             = hWindow
  nid\hIcon            = hIcon
  nid\uFlags           = #NIF_MESSAGE | #NIF_ICON | #NIF_TIP
  nid\uCallbackMessage = #WM_NOTIFYICON
  
  If OSVersion() >= #PB_OS_Windows_2000
    PokeS(@nid\szTip, tip, 128)
    nid\cbSize = SizeOf(NOTIFYICONDATA_2K)
  Else
    PokeS(@nid\szTip, tip, 64)
    nid\cbSize = SizeOf(NOTIFYICONDATA_95)
  EndIf
  
  ProcedureReturn Shell_NotifyIcon_(#NIM_ADD, @nid)
  
EndProcedure
ProcedureDLL.l RemoveSysTrayIconEx(uID.l, hWindow.l)
  
  Protected nid.NOTIFYICONDATA_95
  
  nid\cbSize = SizeOf(NOTIFYICONDATA_95)
  nid\uID    = uID
  nid\hwnd   = hWindow
  
  ProcedureReturn Shell_NotifyIcon_(#NIM_DELETE, @nid)
  
EndProcedure
ProcedureDLL.l SysTrayIconToolTipEx(uID.l, hWindow.l, tip.s)
  
  Protected nid.NOTIFYICONDATA_2K
  
  nid\uID    = uID
  nid\hwnd   = hWindow
  nid\uFlags = #NIF_TIP
  
  If OSVersion() >= #PB_OS_Windows_2000
    PokeS(@nid\szTip, tip, 128)
    nid\cbSize = SizeOf(NOTIFYICONDATA_2K)
  Else
    PokeS(@nid\szTip, tip, 64)
    nid\cbSize = SizeOf(NOTIFYICONDATA_95)
  EndIf
  
  ProcedureReturn Shell_NotifyIcon_(#NIM_MODIFY, @nid)
  
EndProcedure


;------------------------------------------------------------------------------------------------
; Compatibility : Microsoft Windows 2000+
;------------------------------------------------------------------------------------------------

ProcedureDLL.l HideSysTrayIconEx(uID.l, hWindow.l, state.l)
  
  Protected nid.NOTIFYICONDATA_2K
  
  If OSVersion() >= #PB_OS_Windows_2000
    
    nid\cbSize      = SizeOf(NOTIFYICONDATA_2K)
    nid\uID         = uID
    nid\hwnd        = hWindow
    nid\uFlags      = #NIF_STATE
    nid\dwStateMask = #NIS_HIDDEN
    
    If state
      nid\dwState = #NIS_HIDDEN
    EndIf
    
    ProcedureReturn Shell_NotifyIcon_(#NIM_MODIFY, @nid) 
    
  EndIf
  
EndProcedure
ProcedureDLL.l SetActiveSysTrayIconEx(uID.l, hWindow.l)
  
  Protected nid.NOTIFYICONDATA_2K
  
  If OSVersion() >= #PB_OS_Windows_2000
    
    nid\cbSize = SizeOf(NOTIFYICONDATA_2K)
    nid\uID    = uID
    nid\hwnd   = hWindow
    
    ProcedureReturn Shell_NotifyIcon_(#NIM_SETFOCUS, @nid) 
    
  EndIf
  
EndProcedure
ProcedureDLL.l SysTrayIconBalloonEx(uID.l, hWindow.l, title.s, message.s, timeOut.l) 
  
  Protected nid.NOTIFYICONDATA_2K
  
  If OSVersion() >= #PB_OS_Windows_XP
    nid\cbSize = SizeOf(NOTIFYICONDATA_XP)
  ElseIf OSVersion() >= #PB_OS_Windows_2000
    nid\cbSize = SizeOf(NOTIFYICONDATA_2K)
  Else
    ProcedureReturn #False
  EndIf
  
  nid\uVersion = #NOTIFYICON_VERSION 
  Shell_NotifyIcon_(#NIM_SETVERSION, @nid)
  
  nid\uID         = uID
  nid\hwnd        = hWindow
  nid\dwInfoFlags = #NIIF_INFO
  nid\uFlags      = #NIF_INFO
  nid\uTimeout    = timeOut
  
  PokeS(@nid\szInfo, message, 256) 
  PokeS(@nid\szInfoTitle, title, 64)
  
  ProcedureReturn Shell_NotifyIcon_(#NIM_MODIFY, @nid) 
  
EndProcedure
ProcedureDLL.l SysTrayIconBalloonEx2(uID.l, hWindow.l, title.s, message.s, timeOut.l, flags.l) 
  
  Protected nid.NOTIFYICONDATA_2K
  
  If OSVersion() >= #PB_OS_Windows_XP
    nid\cbSize = SizeOf(NOTIFYICONDATA_XP)
  ElseIf OSVersion() >= #PB_OS_Windows_2000
    nid\cbSize = SizeOf(NOTIFYICONDATA_2K)
  Else
    ProcedureReturn #False
  EndIf
  
  nid\uVersion = #NOTIFYICON_VERSION 
  Shell_NotifyIcon_(#NIM_SETVERSION, @nid)
  
  nid\uID         = uID
  nid\hwnd        = hWindow
  nid\dwInfoFlags = flags
  nid\uFlags      = #NIF_INFO
  nid\uTimeout    = timeOut
  
  PokeS(@nid\szInfo, message, 256) 
  PokeS(@nid\szInfoTitle, title, 64)
  
  ProcedureReturn Shell_NotifyIcon_(#NIM_MODIFY, @nid) 
  
EndProcedure