Powerbasic Museum 2020-B

IT-Consultant: Patrice Terrier => GDImage => Of The Bay => Topic started by: Patrice Terrier on October 22, 2008, 08:43:14 PM

Title: "Of The Bay" Version 2.00
Post by: Patrice Terrier on October 22, 2008, 08:43:14 PM
This is a GDImage project to emulate the MAC OS X dockbar in Windows VISTA and XP.

It is a rather complex project, however i like the result:

(http://www.zapsolution.com/pictures/OTBsorayama.jpg)

Note: You must use at least a 1280x1024 resolution and your display must run in 32-bit mode.

I did put many tricks in this code, and the most trivial is that there is absolutly no API child controls  ;D

Looking forward for your feedback.

8)

Added:
To close the DockBar and restore the default Windows desktop, select the AERO DockBar and press the ESCAPE key.


History:


Title: Re: OS X leopard DockBar alike
Post by: Carlo Pagani on October 22, 2008, 09:46:18 PM
Always like your demos Patrice!
16 - 20% on P4 3GHz and GForce 2
Title: Re: OS X leopard DockBar alike
Post by: Patrice Terrier on October 22, 2008, 10:59:12 PM
I have updated the zip file, to further reduce the CPU %.

Now if the mouse is outside of the DockBar or if it is not moving hover it, then CPU % should be close to zero.

Thanks for your feedback.

...
Title: Re: OS X leopard DockBar alike
Post by: James C. Fuller on October 22, 2008, 11:00:40 PM
Very little cpu usage 0-6%.
====================
CPU
====================
Number of CPU(s)   One Physical Processor / One Core / 2 Logical Processors
Vendor   GenuineIntel
CPU Full Name   Intel Pentium 4 HT
CPU Name   Intel(R) Pentium(R) 4 CPU 3.00GHz
CPU Code Name   Prescott
Technology   0.09µ
Platform Name   Socket 478
Type   Original OEM processor
FSB Mode   QDR
Platform ID   2
Microcode ID   17
Type ID   0
CPU Clock   2957.27
System Bus Clock   -1.0
System Clock   197.15
Multiplier   15.00
Original Clock   3000.00
Original Bus Clock   800.00
Original System Clock   200.00
Original Multiplier   15.00
L2 Cache Speed   2957.27 MHz
L2 Cache Speed   Full
CPU Family / Model / Stepping   F / 3 / 4
HyperThreading   2
Cache   12 KµOps L1 T-Cache, 16 KB L1 D-Cache, 1024 KB L2 Cache
Instructions   MMX, SSE, SSE2, SSE3, HT, HTT, MSR
Architecture   x86
=====================================
Video
=====================================
Property   Value
Number of GPUs   2
Number of GPUs in SLI mode   206
Display Adapter   RADEON X850 Series
Video Processor   ATI display adapter AGP (0x4B4B)
Video memory size   256 MBytes
Adapter DAC Type   Internal DAC(400MHz)
BIOS Date   02/08/05
Display Drivers   ati2dvag.dll
Driver Version   6.14.10.6505
Driver Date   2004-12-22 02:33:13
Inf File Name   oem0.inf
Inf Section   ati2mtag_R481
   
Display Adapter   RADEON X850 Series - Secondary 
Video Processor   ATI display adapter AGP (0x4B4B)
Video memory size   256 MBytes
Adapter DAC Type   Internal DAC(400MHz)
Display Drivers   ati2dvag.dll
Driver Version   6.14.10.6505
Driver Date   2004-12-22 02:33:13
Inf File Name   oem0.inf
Inf Section   ati2mtag_R481
   
   
Name   RADEON X850 Series
Chip Type   ATI display adapter AGP (0x4B4B)
DAC Type   Internal DAC(400MHz)
Memory   256 MBytes


James

Title: OS X leopard DockBar alike (status)
Post by: Patrice Terrier on October 23, 2008, 05:10:10 PM
DockBar project status

- I am able to hide all the desktop icons while the DockBar is visible and restore them once the DockBar is closed.

I am trying to figure the best way to retrieve the existing desktop icons to show them on the Dockbar.
I am not sure if the ExtractIconEx API is the best way to do that (on VISTA some icons are indeed PNG).
If you have any suggestions they are welcomed.
Title: Re: OS X leopard DockBar alike
Post by: Patrice Terrier on October 23, 2008, 06:11:31 PM
Looks like the best solution is to retrieve the Desktop Listview handle, doing that:

vHandle& = FindWindow("Progman", "Program Manager")
vHandle& = FindWindowEx(vHandle&, 0, "SHELLDLL_DefView", "")
vHandle& = FindWindowEx(vHandle&, 0, "SysListView32", "FolderView")

'// Here we display the number of icons shown onto the desktop
msgbox str$(SendMessage(vHandle&, %LVM_GETITEMCOUNT, 0, 0))

The problem now is to retrieve each icon using the %LVM_GETIMAGELIST and to figure which icon match a specific shortcut.lnk ...
Title: Re: OS X leopard DockBar alike
Post by: Petr Schreiber on October 24, 2008, 10:04:57 AM
Hi Patrice,

example runs fine on AMD Sempron 3400+ @ onboard GeForce6, CPU usage is usually 0% with maximum of 14% when I click on it like mad.


Petr
Title: Re: OS X leopard DockBar alike
Post by: Emil Weiss on October 24, 2008, 11:38:26 AM
On XP Professional svp2
GForce 7800 AMD64 4000+ running with 0 to 3% when click on a entry

greets Emil
Title: Re: OS X leopard DockBar alike
Post by: Patrice Terrier on October 24, 2008, 11:40:53 AM
Thanks to those who gave me a feedback.

I am still working on it, and i am learning several "under the hood" things about the desktop.

Example:


LOCAL hListView, dwProcessId, hProcess, dwSize, lpData AS DWORD
LOCAL nItemCount AS LONG

hListView = FindWindow("Progman", "Program Manager")
hListView = FindWindowEx(hListView, 0, "SHELLDLL_DefView", "")
hListView = FindWindowEx(hListView, 0, "SysListView32", "FolderView")

CALL GetWindowThreadProcessId(hListView, dwProcessId)
hProcess = OpenProcess(%PROCESS_VM_OPERATION OR %PROCESS_VM_READ OR %PROCESS_VM_WRITE, %FALSE, dwProcessId)
IF hProcess THEN
  '// Compute the size of our reserved memory buffer
  dwSize = sizeof(POINTAPI) + sizeof(LVITEM) + %MAX_PATH * 2

  lpData = VirtualAllocEx(hProcess, BYVAL %NULL, dwSize, %MEM_COMMIT, %PAGE_READWRITE)
  IF lpData THEN
     '// Setup pointers
     LOCAL lpPosition, lpItem, lpText AS LONG  
     lpPosition = lpData
     lpItem = lpData + sizeof(POINTAPI)
     lpText = lpData + sizeof(POINTAPI) + sizeof(LVITEM)

     DIM lvi AS LVITEM
     LOCAL szText AS ASCIIZ * (%MAX_PATH * 2)  ' Allow room for unicode
     LOCAL i AS LONG
     nItemCount = SendMessage(hListView, %LVM_GETITEMCOUNT, 0, 0)
     FOR i = 0 TO nItemCount - 1
         '// Init LVITEM structure and copy it to our reserved memory buffer
         lvi.mask       = %LVIF_TEXT
         lvi.iItem      = i
         lvi.iSubItem   = 0
         lvi.pszText    = lpText
         lvi.cchTextMax = %MAX_PATH * 2
         CALL WriteProcessMemory(hProcess, lpItem, lvi, sizeof(LVITEM), 0)
         '// Get text label and x,y location
         CALL SendMessage(hListView, %LVM_GETITEMTEXT, i, lpItem)
         CALL SendMessage(hListView, %LVM_GETITEMPOSITION, i, lpPosition)
         '// Copy from process memory to local variables
         szText = ""
         CALL ReadProcessMemory(hProcess, lpText, szText, %MAX_PATH * 2, 0)
         LOCAL p AS POINTAPI
         CALL ReadProcessMemory(hProcess, lpPosition, p, SIZEOF(POINTAPI), 0)

         Af$ += str$(p.X)+str$(p.Y) + " " + szText + $CR          
   
     NEXT
   
     '// Freeup memory
     CALL VirtualFreeEx(hProcess, lpData, 0, %MEM_RELEASE)
  END IF  

  '// Close process
  CALL CloseHandle(hProcess)
END IF

msgbox Af$


Title: AERO DockBar (version 1.0 has been released)
Post by: Patrice Terrier on October 26, 2008, 07:41:37 PM
I have updated the first post of this thread with version 1.0 of the GDImage AERO DockBar.

8)
Title: Re: AERO DockBar
Post by: Patrice Terrier on October 26, 2008, 08:06:47 PM
I found a problem that would not fire the target at the first click, I am working on it...

Added:
I think i have fixed it, the zip file has been updated.

If you want to see what i am doing under the hood to fire the shorcuts, then REM out this part of the code

          '// Hide desktop icons 
          'CALL ShowDesktopIcons(%FALSE)

          CALL ShowWindow(hMain, %SW_SHOW)

          CALL SetTimer(hMain, 1, %TIMER_Speed, %NULL)
          WHILE GetMessage(Msg, %NULL, 0, 0)
                CALL TranslateMessage(Msg)
                CALL DispatchMessage(Msg)
          WEND
          CALL KillTimer(hMain, 1)

          '// Show desktop icons
          'CALL ShowDesktopIcons(%TRUE)


And to understand what i am doing look at FireApplication:

SUB FireApplication(BYVAL nItem AS LONG)
    'IF ISFILE(gS(nItem).ShellTo) THEN
    '   LOCAL sShellTo, sCmdLine, sFullPath AS STRING
    '   sShellTo = gS(nItem).ShellTo
    '   sFullPath = gS(nItem).WorkDir
    '   IF LEN(sFullPath) = 0 THEN
    '      sFullPath = RTRIM$(PATHNAME$(PATH, gS(nItem).ShellTo), "\")
    '   ELSE
    '      CALL SetCurrentDirectory((sFullPath))
    '   END IF
    '   CALL ShellExecute(0, "open", (sShellTo), (sCmdLine), (sFullPath), gS(nItem).ShowCmd)
    'END IF
   
'   // Here is the magic part!
    CALL PostMessage (ghListView, 513 , 0, gS(nItem).focusXY) '// WM_LBUTTONDOWN
    CALL PostMessage (ghListView, 514 , 0, gS(nItem).focusXY) '// WM_LBUTTONUP

    CALL PostMessage (ghListView, 515 , 0, gS(nItem).focusXY) '// WM_LBUTTONDBLCLK

END SUB

Title: AERO DockBar (with popup menu)
Post by: Patrice Terrier on October 27, 2008, 06:02:39 PM
Version 1.01 with popup menu has been released (ZIP file attached to the first post of this thread).

By the way this version will show you how to create an ownerdrawn popup menu with text and icon bitmap (png).

1 - %WM_MEASUREITEM
Note: itemWidth must be large enough to hold the largest popup menu string.

CASE %WM_MEASUREITEM                     
     LOCAL lpmis AS MEASUREITEMSTRUCT PTR
     lpmis = lParam                     
     IF wParam = 0 THEN                 
        @lpmis.itemWidth = 120           
        @lpmis.itemHeight = 18           
        FUNCTION = 1: EXIT FUNCTION     
     END IF                             


2 - %WM_DRAWITEM
Note: The %ODT_MENU constant is the place to draw our Menu

CASE %WM_DRAWITEM                                                                                     
     LOCAL lpdis AS DRAWITEMSTRUCT PTR                                                                 
     lpdis = lParam                                                                                   
     SELECT CASE LONG @lpdis.CtlType                                                                   
                                                                                                       
     CASE %ODT_MENU     ' 1 Owner-drawn menu item                                                     
          LOCAL zTxt AS ASCIIZ * 128, nDrawIt, Img, imgW, imgH, graphics AS LONG                       
                                                                                                       
          zTxt = GetMenuTxt(@lpdis.ItemID, Img)                                                       
          nDrawIt = -1                                                                                 
          IF (@lpdis.itemState AND %ODS_SELECTED) THEN                                                 
             CALL SetTextColor(@lpdis.hDC, 0)                                                         
             CALL SetBkColor(@lpdis.hDC, RGB(218,235,243))                                             
          ELSE                                                                                         
             CALL SetTextColor(@lpdis.hDC, 0)                                                         
             CALL SetBkColor(@lpdis.hDC, RGB(240,240,240))                                             
          END IF                                                                                       
                                                                                                       
          IF (@lpdis.itemState AND %ODS_GRAYED) THEN                                                   
             CALL SetTextColor(@lpdis.hDC, RGB(128,128,128))                                           
             nDrawIt = 0                                                                               
          END IF                                                                                       
                                                                                                       
          CALL ExtTextOut(@lpdis.hDC, 6 + 16 + @lpdis.rcItem.nleft, _                                 
                          @lpdis.rcItem.nTop + 3, %ETO_OPAQUE, _                                       
                          @lpdis.rcItem, zTxt, LEN(zTxt), BYVAL 0)                                     
                                                                                                       
          IF nDrawIt AND GdipCreateFromHDC(@lpdis.hDC, graphics) = 0 THEN                             
             CALL zGetImageSize(Img, imgW, imgH)                                                       
             CALL GdipDrawImageRectRectI(graphics&, Img, _                                             
                                         @lpdis.rcItem.nleft + 1, @lpdis.rcItem.nTop + 1, ImgW, ImgH, _
                                         0, 0, ImgW, ImgH, %UnitPixel, _                               
                                         0)                                                           
             CALL GdipDeleteGraphics(graphics)                                                         
          END IF                                                                                       
                                                                                                       
          FUNCTION = 1: EXIT FUNCTION                                                                 
                                                                                                       
     END SELECT                                                                                       


3 - %WM_RBUTTONDOWN
This is the place to create the popup menu.
Note: Currently there is only one item in the menu to "Close DockBar".

CASE %WM_RBUTTONDOWN                                                                 
     LOCAL hMenu, nChoice AS LONG                                                     
     hMenu = CreatePopupMenu() '// The bitmap popup menu                             
     IF hMenu THEN                                                                   
        CALL AppendMenu(hMenu, %MF_OWNERDRAW, %IDM_Close          , "")               
        'CALL AppendMenu(hMenu, %MF_SEPARATOR, 102                , "")               
        CALL GetCursorPos(p)                                                         
        nChoice = TrackPopupMenuEx(hMenu, %TPM_RETURNCMD, p.X, p.Y, hWnd, BYVAL %NULL)
        CALL DestroyMenu(hMenu)                                                       
        IF nChoice THEN CALL SendMessage(hWnd, %WM_COMMAND, MAKLNG(nChoice, 0), 0)   
                                                                                     
     END IF                                                                           


4 - GetMenuTxt
This is the place where we read the string to display and we load its matching icon.
Note: GetMenuTxt is able to handle multi-languages, at this time English and French.

FUNCTION GetMenuTxt(BYVAL ItemId AS LONG, Img AS LONG) AS STRING
    LOCAL sItem AS STRING
    IF IsFrench() THEN
       SELECT CASE ItemId
       CASE %IDM_Close             : FUNCTION = "Fermer DockBar"

       END SELECT
    ELSE
       SELECT CASE ItemId
       CASE %IDM_Close             : FUNCTION = "Close DockBar"

       END SELECT
    END IF

    SELECT CASE ItemId
    CASE %IDM_Close                : sItem = "Close.png"

    END SELECT
    Img = zAddResource(EXE.Path$ + "Resource\" + sItem)

END FUNCTION


That's all for now.

8)
Title: Re: AERO DockBar
Post by: Emil Weiss on October 27, 2008, 07:53:13 PM
patrice

thanks for the information
i have test it and can show nothing on the Dockbar.. only menu with "Close Dockbar" are shown

greets Emil
Title: Re: AERO DockBar
Post by: Patrice Terrier on October 27, 2008, 10:48:20 PM
Quotei have test it and can show nothing on the Dockbar.. only menu with "Close Dockbar" are shown

That's very strange, i just checked it on a computer runing XP SP2 and it works the same than on my VISTA Premium laptop.
???
Title: Re: AERO DockBar
Post by: Bud Meyer on October 28, 2008, 12:37:55 AM
Great job, Patrice. Runs fine here on WinXP SP3. :)
Title: AERO DockBar (Script file)
Post by: Patrice Terrier on October 28, 2008, 08:05:19 AM
Thank you Bud!

I am glad to read that it runs also on your XP SP3 computer.

I did it, because i like to use a nice picture for my desktop background, but with all these icons spread out over it, it looks more like a teenager bed room than my wife's lounge. But now with DockBar, everything has been clean up to please her. ;D

The idea behind Dockbar is to use it also like a super-menu to start your own applications without resorting on shortcuts, and reading what to do from a disk file working like a playlist.

Example of script file:
(ApplicationFullPathName, WorkingDir, CmdLine, IconToUse)
Quote"C:\MyApplications\BassBox24\BassBox.exe","","D:\Audio\PlayList.bbp","C:\MyApplications\DockBar\FolderIcon\BassBox.png"
"C:\MyApplications\MovieBox\MovieBox.exe","","","C:\MyApplications\DockBar\FolderIcon\MovieBox.png"
"D:\SED\SED_116.exe","","",C:\MyApplications\DockBar\FolderIcon\PowerBASIC.png"
"C:\WinDev12\Programmes\WinDev12.exe","@EXEPATH@","","@EXEICON@"
etc.

Title: AERO DockBar (changing icon frame)
Post by: Patrice Terrier on October 28, 2008, 08:23:45 AM
In AERO DockBar, each icon (32x32) is being drawn on a frame (48x48) named "Back.png" located in the "Resource" sub-folder.

Thus you can use your own frame if you replace "Back.png" with another PNG using a size of 48x48.

See the attached example (save first the current "Back.png" to later restore it)

Title: Re: AERO DockBar
Post by: Patrice Terrier on October 28, 2008, 06:29:03 PM
Then add a few more shortcuts  ;D

...
Title: AERO DockBar (new version 1.02)
Post by: Patrice Terrier on October 28, 2008, 08:26:00 PM
This new version allows you to change on the fly (from the poup menu) the icon's frame background.

It is provided with several PNG files that are stored in the \Resource\IconFrame sub-folder.

The new ZIP file is attached to the first post of this thread.

8)
Title: AERO DockBar (new version 1.03)
Post by: Patrice Terrier on October 29, 2008, 08:39:43 PM
The shortcut detection has been enhanced to resolve missing virtual lnk files.


FUNCTION ResolveShortcutName(zLnk AS ASCIIZ) AS STRING
    LOCAL sUseIcon AS STRING

    IF zLnk = ShortCutDisplayName(%CSIDL_BITBUCKET) THEN sUseIcon = "RecycleBin.png":          GOTO ExitLnk
    IF zLnk = ShortCutDisplayName(%CSIDL_DRIVES)    THEN sUseIcon = "MyComputer.png":          GOTO ExitLnk
    IF zLnk = ShortCutDisplayName(%CSIDL_NETWORK)   THEN sUseIcon = "NetworkNeighborhood.png": GOTO ExitLnk
    IF zLnk = ShortCutDisplayName(%CSIDL_PERSONAL)  THEN sUseIcon = "MyDocuments.png":         GOTO ExitLnk
    IF zLnk = ShortCutDisplayName(%CSIDL_MYVIDEO)   THEN sUseIcon = "MyVideo.png":             GOTO ExitLnk
    IF zLnk = ShortCutDisplayName(%CSIDL_MYMUSIC)   THEN sUseIcon = "MyMusic.png":             GOTO ExitLnk
    EXIT FUNCTION

ExitLnk:
    FUNCTION = sUseIcon
END FUNCTION


You can even change the related icons and use your own as a replacement for those provided in the resource folder, the only mandatory is to respect the file name for the PNG files, or to edit the ResolveShortcutName function to use the new name.

I have also added .cpl file extension detection because the ISHellFolder interface is unable to handle them correctly.

Now Emil, you should see something...

:o

Title: AERO DockBar (new version 1.04)
Post by: Patrice Terrier on October 30, 2008, 06:46:42 PM
This new version introduces a new flare effect and some new menu options

The shorcut firing has been also reworked for better differentiation between EXE and virtual links.

The latest version is attached to the first post of this thread.

8)

Title: "Of The Bay" has been released to replace the DockBar project
Post by: Patrice Terrier on October 31, 2008, 08:44:00 PM
"Of The Bay" is the successor of the DockBar project with these new features:
- Enhanced flare effect.
- Hability to change the layer being used to display the icons.
- And further CPU % reduction.

The new ZIP file is attached to the first post of this thread
Title: Re: "Of The Bay"
Post by: Petr Schreiber on November 02, 2008, 03:01:09 PM
Hi Patrice,

great job as usual - works well on my PC ( AMD Sempron 3400+, 1GB RAM, GeForce 6150LE, WinXP SP2+Updates CZ ).
One thing - it would be nice if I could drag some file on the dockbar ( document, program, ... ) from Windows Explorer for example.

This way it would not double desktop and it would add new dimension of usability.

The CPU usage is exemplary - 0 to 2%.


Thanks,
Petr
Title: Re: "Of The Bay"
Post by: Patrice Terrier on November 02, 2008, 05:20:48 PM
Quoteit would be nice if I could drag some file on the dockbar
Hi Petr,

That's a good suggestion.

Here are a few guidances if anybody wants to do it ;D

Step 1: declaration section

%WM_DROPFILES = &H233
DECLARE SUB DragAcceptFiles LIB "SHELL32.DLL" ALIAS "DragAcceptFiles" (BYVAL hwnd AS DWORD, BYVAL fAccept AS LONG)
DECLARE SUB DragFinish LIB "SHELL32.DLL" ALIAS "DragFinish" (BYVAL hDrop AS DWORD)
DECLARE FUNCTION DragQueryFile LIB "SHELL32.DLL" ALIAS "DragQueryFileA" (BYVAL hDrop AS DWORD, BYVAL uiFile AS DWORD, lpStr AS ASCIIZ, BYVAL cch AS DWORD) AS DWORD


Step 2 To put in the main code section before entering the message pump

          CALL DragAcceptFiles(hMain, %TRUE)


Step 3 To put in the window proc

    CASE %WM_DROPFILES '// Drag & drop
         nFilesDropped = DragQueryFile(wParam, -1, "", 0)
         szFileName = ""
         nCount = 0
         IF nFilesDropped > 0 THEN
'            Put your code there
         END IF
         CALL DragFinish(wParam)

Title: "Of The Bay" (released of version 1.10)
Post by: Patrice Terrier on November 03, 2008, 06:17:56 PM
There are several new icon frames and backgrounds + subtile changes.

Latest ZIP file is attached to the first post of this thread.

8)
Title: "Of The Bay" (I heard you!)
Post by: Patrice Terrier on November 04, 2008, 07:07:28 PM
Petr, Dominique,

I heard you!

Here is "Of The Bay" version 1.20, with drag and drop and smooth scrolling.

Now you can start BassBox and MovieBox just as you did with the standard desktop icon.
Starts when the mouse hover either the left or right arrow, if you click on the arrow you scroll the content either from the start or to the end.

The new zip file is attached to the first post of this thread.


8)
Title: Re: "Of The Bay"
Post by: Petr Schreiber on November 04, 2008, 10:40:03 PM
Hi Patrice,

good job! ;)
Works well here, CPU usage still at 0 to 2%...


Petr
Title: "Of The Bay" (updated to version 1.21)
Post by: Patrice Terrier on November 09, 2008, 02:53:51 PM
Under request of Laurence Jackson,

I have added detection of embedded desktop subfolders:

FUNCTION ResolveShortcutName(zLnk AS ASCIIZ) AS STRING
    LOCAL sUseIcon AS STRING

    IF zLnk = ShortCutDisplayName(%CSIDL_BITBUCKET) THEN sUseIcon = "RecycleBin.png":             GOTO ExitLnk
    IF zLnk = ShortCutDisplayName(%CSIDL_DRIVES)    THEN sUseIcon = "MyComputer.png":             GOTO ExitLnk
    IF zLnk = ShortCutDisplayName(%CSIDL_NETWORK)   THEN sUseIcon = "NetworkNeighborhood.png":    GOTO ExitLnk
    IF zLnk = ShortCutDisplayName(%CSIDL_PERSONAL)  THEN sUseIcon = "MyDocuments.png":            GOTO ExitLnk
    IF zLnk = ShortCutDisplayName(%CSIDL_MYVIDEO)   THEN sUseIcon = "MyVideo.png":                GOTO ExitLnk
    IF zLnk = ShortCutDisplayName(%CSIDL_MYMUSIC)   THEN sUseIcon = "MyMusic.png":                GOTO ExitLnk
    IF (GetFileAttributes(FolderGet(%CSIDL_DESKTOP) + zLnk) AND 16) THEN sUseIcon = "Folder.png": GOTO ExitLnk
    EXIT FUNCTION

ExitLnk:
    FUNCTION = sUseIcon
END FUNCTION


The lattest ZIP project is attached to the first post of this thread.
Title: Re: "Of The Bay"
Post by: Laurence Jackson on November 09, 2008, 06:16:00 PM
Great! Thank you!
Title: Re: "Of The Bay"
Post by: Patrice Terrier on November 13, 2008, 06:18:05 PM
updated to version 1.22.
Title: "Of The Bay" (Official logo + OTB icon + minor changes)
Post by: Patrice Terrier on November 15, 2008, 07:44:56 PM
Updated to version 1.23
Title: Re: "Of The Bay" (Official logo + OTB icon + minor changes)
Post by: Emil Weiss on November 15, 2008, 09:04:34 PM
Quote from: Patrice Terrier on November 15, 2008, 07:44:56 PM
Updated to version 1.23
fantastic work Patrice i love it..
one problem i have found ;)
Dialog too deep

should be over the Bar.

greets Emil
Title: Re: "Of The Bay"
Post by: Patrice Terrier on November 15, 2008, 10:26:21 PM
Quoteshould be over the Bar.
That's another difference between XP and VISTA, i shall fix it in the next build.

...
Title: "Of The Bay" version 1.24 (Center common dialog in multiple display mode)
Post by: Patrice Terrier on November 16, 2008, 07:23:54 PM
I have been able to work arround the Microsoft bug that exists in all Windows version, when trying to set the location of a common FileOpen/FileSave dialog on a second monitor in multiple display mode.

You can't imagine what i had to do to solve this "simple" problem ...

By the way i have also added a new GDImage function named "ZI_CenterDialog" to center the dialog to the display instead of the default GDImage's parent window.

If ever you have a multiple display and a slower PC than mine, you can adjust in the main WndProc the dlgSleep parameter to a longer delay (millisecond), see below:
'   // This is to force a correct placement of the FileOpen/FileSave common dialog
'   // when using multiple display mode and working on the second display.
    STATIC dlgWnd, dlgX, dlgY AS LONG, dlgSleep AS DWORD
    IF dlgWnd THEN
       IF GetTickCount() > dlgSleep THEN
          CALL SetWindowPos(dlgWnd, dlgWnd, dlgX, dlgY, 0, 0, %SWP_NOZORDER OR %SWP_NOSIZE)
          dlgWnd = 0: dlgSleep = 0
       END IF
    END IF

    SELECT CASE LONG Msg

    CASE %ZM_CENTER_DIALOG
         dlgWnd = wParam: dlgX = LO(INTEGER, lParam): dlgY = HI(INTEGER, lParam)
         dlgSleep = GetTickCount() + 10 ' 100
Title: "Of The Bay" version 1.25 (WindowAnimate + new text location)
Post by: Patrice Terrier on November 17, 2008, 08:42:59 PM
Updated to version 1.25

With new open/close WindowAnimate effect, and new icon text location.

By the way, did you see that somebody is sitting on the dock  ;D

...
Title: Re: "Of The Bay"
Post by: Patrice Terrier on November 18, 2008, 07:16:49 PM
For those experiencing Doctor Watson on XP when closing "OfTheBay" using the AnimateWindow

Try changing

         CASE %IDM_CLOSE ' %ID_CLOSE
              CALL AnimateWindow(hWnd, 500, %AW_CENTER OR %AW_HIDE)
              CALL SendMessage(hWnd, %WM_CLOSE, 0, 0)


to this

         CASE %IDM_CLOSE ' %ID_CLOSE
              CALL AnimateWindow(hWnd, 500, %AW_CENTER OR %AW_HIDE)
              CALL apiSleep(500)
              CALL PostMessage(hWnd, %WM_CLOSE, 0, 0)


Other solution "move on to VISTA"... or remove AnimateWindow ;)
Title: "Of The Bay" version 1.30 (major revision)
Post by: Patrice Terrier on November 19, 2008, 08:00:43 PM
Version 1.30 is a major revision.


...
Title: Re: "Of The Bay"
Post by: Emil Weiss on November 20, 2008, 05:24:36 AM
you are a hard working Developer
thanks for the update patrice...

nothing crash here on XP when close the Bar ;)
all work fine now.

nice Effect :)

greets Emil
Title: Re: "Of The Bay"
Post by: Patrice Terrier on November 20, 2008, 09:08:36 AM
Emil,

Thank you for the feedback.

Next step i plan to add the hability to customize the dockbar with a shorcut list (kind of playlist) on the same model i have done for the *.zsk file but with the *.OTB extension.

In this OTB file you will be able to specify the icon you want to use, either 32x32 or 48x48, and the shorcut properties.
If there is already an existing shortcut (same target) then the OTB properties will take preseance.

...
Title: Version 1.50 - Another major revision with full customization (OTB file).
Post by: Patrice Terrier on November 20, 2008, 09:25:29 PM
This one is another big step forward with the introduction of the "OfTheBay.OTB" file, that allows you to fully customize the dockbar.

OfTheBay.OTB is a plain ASCII text file that looks like this:


'+--------------------------------------------------------------------------+
'|                               Of The Bay                                 |
'|                                                                          |
'|                         User shorcut definition                          |
'|                                                                          |
'+--------------------------------------------------------------------------+
'|                                                                          |
'|                         Author Patrice TERRIER                           |
'|                            copyright(c) 2008                             |
'|                           www.zapsolution.com                            |
'|                         support@zapsolution.com                          |
'|                                                                          |
'+--------------------------------------------------------------------------+
'|                  Project started on : 11-20-2008 (MM-DD-YYYY)            |
'|                        Last revised : 11-20-2008 (MM-DD-YYYY)            |
'+--------------------------------------------------------------------------+

'Use @PATH@ to match either the OfTheBay.EXE path or the ShellTo target path

'Icon:
'Use either 32x32 or larger (will be converted to 48x48)
'in case of 32x32 the program adds the active icon background else not.

'"ShellTo, UseLabel, IconName, WorkDir, CmdLine"

'"C:\travail\sdk\template\BassBox24\BassBox.exe, BassBox24, @PATH@UserIcon\Solid edge.png,     @PATH@,  "
"C:\travail\sdk\template\BassBox24\BassBox.exe, BassBox24, @PATH@UserIcon\Woofer256x256.png,   @PATH@,  "
"C:\travail\sdk\template\MovieBox2\MovieBox.exe, MovieBox, @PATH@UserIcon\MovieProjector.png,  @PATH@,  "


Each line defines a specific shortcut with five parameters:
1 - "ShellTo" is the shorcut target.
2 - "UseLabel" is the name to display below the icon.
3 - "IconName" is the full path name to the image you want to use as icon (any supported graphic format).
4 - "WorkDir" is the working directory to use for the shortcut, @PATH@ means use EXE's folder.
5 - "CmdLine" an optional command line to pass to the shortcut.

About the image being used to create the icon, PNG is the best format because it has built-in alpha channel.
You can use image of any size, but the rule is:
IF the size of the image is larger than 32x32 then
   it will be resized to 48x48 and shown without the icon frame background.
ELSE IF the size is 32x32 then
   it will be drawn the standard way with a frame background.

The program allows you to redefine a shorcut that already exists on the Windows desktop, then it will use the parameters of the OTB file.

NOTE: Better to put all the image you want to use into a dedicated folder, i am using myself a subfolder named: UserIcon

Here is an example of the result you can get:

(http://www.zapsolution.com/pictures/OTB150.jpg)

As you can see, i have replaced both the "BassBox" and "MovieBox" icon with larger one, that are stored in the "UserIcon" folder.

The OTB file could also be used as "super menu" to navigate between the different popup windows of a large project.

That's all for now.

...

Title: "Of The Bay" has a new menu option to change the desktop wallpaper
Post by: Patrice Terrier on November 21, 2008, 07:12:28 PM
Under request of Emil Weiss,

I have added a new menu option to change the desktop wallpaper.

The background image will be resized to match the primary desktop size, while preserving the ratio aspect of the original picture.

Added:
The Wallpaper icon was missing from the zip file, it has been added to the resource folder.

...

Title: Re: "Of The Bay"
Post by: Patrice Terrier on November 22, 2008, 11:25:38 AM
While working on the problem to center a common DIALOG OPEN/SAVE on multiple display,
i found that the best solution to detect the size of the monitor hover by the hMainWindow application is to use this code:


LOCAL hMonitor AS LONG, tmi AS MONITORINFO
hMonitor = MonitorFromWindow(hMainWindow, %MONITOR_DEFAULTTONEAREST)
tmi.cbSize = SIZEOF(tmi)
IF GetMonitorInfo(hMonitor, tmi) THEN
   msgbox str$(tmi.rcWork.nLeft)+str$(tmi.rcWork.nRight)+str$(tmi.rcWork.nTop)+str$(tmi.rcWork.nBottom)
END IF
Title: "Of The Bay" version 1.54 (with custom icon set)
Post by: Patrice Terrier on November 23, 2008, 03:09:11 PM
Updated to version 1.54

This one allows you to substitute your own icon set, to replace the default extracted from the shorcut targets.

Note: My custom icon set is stored in the "UserIcon" subfolder.

To use a custom icon set, you must have a valid OTB file in the same folder than "OfTheBay.exe", and it must be named "OfTheBay.OTB".

Here is an example of OTB file, that must be customized according to your own shortcuts:


'+--------------------------------------------------------------------------+
'|                               Of The Bay                                 |
'|                                                                          |
'|                         User shorcut definition                          |
'|                                                                          |
'+--------------------------------------------------------------------------+
'|                                                                          |
'|                         Author Patrice TERRIER                           |
'|                            copyright(c) 2008                             |
'|                           www.zapsolution.com                            |
'|                         support@zapsolution.com                          |
'|                                                                          |
'+--------------------------------------------------------------------------+
'|                  Project started on : 11-20-2008 (MM-DD-YYYY)            |
'|                        Last revised : 11-20-2008 (MM-DD-YYYY)            |
'+--------------------------------------------------------------------------+

'Use @PATH@ to match either the OfTheBay.EXE path or the ShellTo target path

'Icon:
'Use either 32x32 or larger (will be converted to 48x48)
'in case of 32x32 the program adds the active icon background else not.

'"ShellTo, UseLabel, IconName, WorkDir, CmdLine"

"Ordinateur, Ordinateur, @PATH@UserIcon\Computer_48x48.png, , "
"C:\program files\cc hyper file\cc120hf.exe, Centre de Contrôle HF, @PATH@UserIcon\Control_48x48.png, @PATH@, "
"C:\Program Files\Google\Picasa3\Picasa3.exe, Picasa 3, @PATH@UserIcon\Picasa48x48.png, @PATH@,  "
"D:\SED\SED_116.exe, PBWin9, @PATH@UserIcon\PowerBASIC_48x48.png, @PATH@, "
"D:\Disque_P\AssignDsk.bat, Promotech, @PATH@UserIcon\Param1_48x48.png,  D:\Disque_P,  "
"C:\Program Files\Phoenix\Bin\PHOENIX.EXE, Phoenix, @PATH@UserIcon\Phoenix_48x48.png, , "
"C:\travail\sdk\template\BassBox24\BassBox.exe, BassBox24, @PATH@UserIcon\Woofer48x48.png,   @PATH@,  "
"C:\Program Files\HP\QuickPlay\QP.exe, QuickPlay, @PATH@UserIcon\QuickPlay_48x48.png, @PATH@, "
"D:\wd11-us\programs\windev11.exe, WD11 US, @PATH@UserIcon\WD11_48x48.png, @PATH@, "
"C:\travail\sdk\template\MovieBox2\MovieBox.exe, MovieBox, @PATH@UserIcon\MovieProjector.png,  @PATH@,  "
"C:\windev 12\programmes\windev12.exe, WinDev 12, @PATH@UserIcon\WD12_48x48.png, @PATH@, "
"C:\program files\vahelp\vahelp73.exe, HelpMaker, @PATH@UserIcon\Vizacc_48x48.png, @PATH@, "
"C:\windev 12\zoleigest.bat, Z oleigest, @PATH@UserIcon\Run_48x48.png, @PATH@, "
"Corbeille, Corbeille, @PATH@UserIcon\Trash_48x48.png, , "
"C:\windows\installer\{e4ddba93-769b-49d8-ba33-8814e45ed0c1}\_40c4cb6f6690400fa04ba2.exe, HP Help and Support, @PATH@UserIcon\HP_48x48.png, C:\Windows\Help\OEM\scripts\, "
"C:\windev 10\programmes\windev10.exe, WinDev 10, @PATH@UserIcon\WD10_48x48.png, @PATH@, "
"C:\windev11\programmes\windev11.exe, WinDev 11, @PATH@UserIcon\WD11_48x48.png, @PATH@, "
"C:\WinDev 10\disquez.bat, Disque Z, @PATH@UserIcon\HD_48x48.png, C:\WinDev 10,  "
"C:\Windows\System32\cmd.exe, Prompt, @PATH@UserIcon\Prompt_48x48.png, C:\travail,  "
"Son - Raccourci, Son - Raccourci, @PATH@UserIcon\Sound_48x48.png, , "
"C:\Windows\installer\{5c82dae5-6eb0-4374-9254-be3319ba4e82}\skype.ico, Skype, @PATH@UserIcon\Skype_48x48.png, C:\Program Files\Skype\,  "
"C:\VS2005\zMoviePlayer\bin\Debug\zMoviePlayer.exe, zMoviePlayer, @PATH@UserIcon\MediaPlayer_48x48.png, @PATH@, " 
"C:\program files\acronis\trueimagehome\trueimage.exe, Acronis True Image Home 10.0, @PATH@UserIcon\Acronis_48x48.png, @PATH@, "
"C:\Program Files\FileZilla Client\filezilla.exe, FileZilla, @PATH@UserIcon\FileZilla_48x48.png, @PATH@, "
"C:\travail\PhotoComposer\PhotoCompo.exe, PhotoComposer, @PATH@UserIcon\PhotoComposer_48x48.png, @PATH@, "
"C:\program files\blender foundation\blender\blender.exe, Blender, @PATH@UserIcon\Blender_48x48.png, @PATH@, "
"C:\travail\sdk\template\goldfish\xpaero\ofthebay\ofthebay.exe, Of The Bay, @PATH@UserIcon\OTB_48x48.png, @PATH@, "
"D:\Photosetup\PhotoSetup.exe, PhotoSetup, @PATH@UserIcon\PhotoSetup48x48.png,  @PATH@,  "


And here is the result of the customization:

(http://www.zapsolution.com/pictures/CustomIcon.jpg)

...
Title: Re: "Of The Bay"
Post by: Patrice Terrier on November 27, 2008, 11:13:46 AM
Version 1.55

A new parameter has been added to the OTB file:
'"ShellTo, UseLabel, IconName, WorkDir, CmdLine, EnableShortcutTrueFalse"

EnableShortcutTrueFalse = 0, means do not show this shortcut.
EnableShortcutTrueFalse = 1, means show this shortcut.
EnableShortcutTrueFalse = 2, means this shortcut refers to the "Recycle Bin"

"Recycle Bin" is a special shortcut case, because the icon can represent a full or empty recycle bin, thus you must provide two custom icons for it, and they must be named "RecycleBinEmpty.png" and "RecycleBinFull.png".

Example of version 1.55 custom OTB file:


'+--------------------------------------------------------------------------+
'|                               Of The Bay                                 |
'|                                                                          |
'|                         User shorcut definition                          |
'|                                                                          |
'+--------------------------------------------------------------------------+
'|                                                                          |
'|                         Author Patrice TERRIER                           |
'|                            copyright(c) 2008                             |
'|                           www.zapsolution.com                            |
'|                         support@zapsolution.com                          |
'|                                                                          |
'+--------------------------------------------------------------------------+
'|                  Project started on : 11-20-2008 (MM-DD-YYYY)            |
'|                        Last revised : 11-20-2008 (MM-DD-YYYY)            |
'+--------------------------------------------------------------------------+

'Use @PATH@ to match either the OfTheBay.EXE path or the ShellTo target path

'Icon:
'Use either 32x32 or larger (will be converted to 48x48)
'in case of 32x32 the program adds the active icon background else not.

'"ShellTo, UseLabel, IconName, WorkDir, CmdLine, EnableShortcutTrueFalse"
'EnableShortcutTrueFalse = 2 '// To inform OTB that this one refers to the "Recycle Bin"

"Ordinateur, Ordinateur, @PATH@UserIcon\48x48\Computer.png, , ,1"
"C:\program files\cc hyper file\cc120hf.exe, Centre de Contrôle HF, @PATH@UserIcon\48x48\Control.png, @PATH@, ,1"
"C:\Program Files\Google\Picasa3\Picasa3.exe, Picasa 3, @PATH@UserIcon\48x48\Picasa.png, @PATH@, ,1"
"D:\SED\SED_116.exe, PBWin9, @PATH@UserIcon\48x48\PowerBASIC.png, @PATH@, ,1"
"D:\Disque_P\AssignDsk.bat, Promotech, @PATH@UserIcon\48x48\Param1.png, @PATH@, ,1"
"C:\Program Files\Phoenix\Bin\PHOENIX.EXE, Phoenix, @PATH@UserIcon\48x48\Phoenix.png, , ,1"
"C:\travail\sdk\template\BassBox24\BassBox.exe, BassBox24, @PATH@UserIcon\48x48\Woofer.png, @PATH@, ,1"
"C:\Program Files\HP\QuickPlay\QP.exe, QuickPlay, @PATH@UserIcon\48x48\QuickPlay.png, @PATH@, ,1"
"D:\wd11-us\programs\windev11.exe, WD11 US, @PATH@UserIcon\48x48\WD11.png, @PATH@, ,1"
"C:\travail\sdk\template\MovieBox2\MovieBox.exe, MovieBox, @PATH@UserIcon\48x48\MovieProjector.png, @PATH@, ,1"
"C:\windev 12\programmes\windev12.exe, WinDev 12, @PATH@UserIcon\48x48\WD12.png, @PATH@, ,1"
"C:\program files\vahelp\vahelp73.exe, HelpMaker, @PATH@UserIcon\48x48\Vizacc.png, @PATH@, ,1"
"C:\windev 12\zoleigest.bat, Z oleigest, @PATH@UserIcon\48x48\Run.png, @PATH@, ,1"
"Corbeille, Corbeille, @PATH@UserIcon\48x48\RecycleBinEmpty.png, , ,2" '// This one refers to the "Recycle Bin"
"C:\windows\installer\{e4ddba93-769b-49d8-ba33-8814e45ed0c1}\_40c4cb6f6690400fa04ba2.exe, HP Help and Support, @PATH@UserIcon\48x48\HP.png, C:\Windows\Help\OEM\scripts\, ,1"
"C:\windev 10\programmes\windev10.exe, WinDev 10, @PATH@UserIcon\48x48\WD10.png, @PATH@, ,1"
"C:\windev11\programmes\windev11.exe, WinDev 11, @PATH@UserIcon\48x48\WD11.png, @PATH@, ,1"
"C:\WinDev 10\disquez.bat, Disque Z, @PATH@UserIcon\48x48\HD.png, C:\WinDev 10, ,1"
"C:\Windows\System32\cmd.exe, Prompt, @PATH@UserIcon\48x48\Prompt.png, C:\travail, ,1"
"Son - Raccourci, Son - Raccourci, @PATH@UserIcon\48x48\Sound.png, , ,1"
"C:\Windows\installer\{5c82dae5-6eb0-4374-9254-be3319ba4e82}\skype.ico, Skype, @PATH@UserIcon\48x48\Skype.png, C:\Program Files\Skype\, ,1"
"C:\VS2005\zMoviePlayer\bin\Debug\zMoviePlayer.exe, zMoviePlayer, @PATH@UserIcon\48x48\MediaPlayer.png, @PATH@, ,1" 
"C:\program files\acronis\trueimagehome\trueimage.exe, Acronis True Image Home 10.0, @PATH@UserIcon\48x48\Acronis.png, @PATH@, ,1"
"C:\Program Files\FileZilla Client\filezilla.exe, FileZilla, @PATH@UserIcon\48x48\FileZilla.png, @PATH@, ,1"
"C:\travail\PhotoComposer\PhotoCompo.exe, PhotoComposer, @PATH@UserIcon\48x48\PhotoComposer.png, @PATH@, ,1"
"C:\program files\blender foundation\blender\blender.exe, Blender, @PATH@UserIcon\48x48\Blender.png, @PATH@, ,1"
"C:\travail\sdk\template\goldfish\xpaero\ofthebay\ofthebay.exe, Of The Bay, @PATH@UserIcon\48x48\OTB.png, @PATH@, ,0" ' <-- Hide OTB
"D:\Photosetup\PhotoSetup.exe, PhotoSetup, @PATH@UserIcon\48x48\PhotoSetup.png, @PATH@, ,1"


Note: If there is no "OfTheBay.OTB" file into the EXE's folder, then the program uses the default 32x32 icon embedded into the shorcut target.

The "UserIcon" folder has a subfolder named "48x48" to store large icon, but you can add a new "32x32" subfolder to store your custom icons if you want them to be surrounded with the icon frame background.

I have attached to this post the latest public version 1.55.
It is provided with a "OfTheBay.OTB.txt" file, that must be renamed "OfTheBay.OTB" after it has been customized to match your own need.

.

Title: "Of The Bay" source code utility to create a custom OTB file
Post by: Patrice Terrier on November 27, 2008, 07:06:40 PM
Here is the DoOTB utility that creates a default OTB file that you can customize to match your specific needs.


Source code:


'+--------------------------------------------------------------------------+
'|                                 DoOTB                                    |
'|                                                                          |
'|   Create a "Default.OTB" to be used as template to create a customized   |
'|                          "OfTheBay.OTB" file.                            |
'|                                                                          |
'+--------------------------------------------------------------------------+
'|                                                                          |
'|                         Author Patrice TERRIER                           |
'|                            copyright(c) 2008                             |
'|                           www.zapsolution.com                            |
'|                        pterrier@zapsolution.com                          |
'|                                                                          |
'+--------------------------------------------------------------------------+
'|                  Project started on : 11-27-2008 (MM-DD-YYYY)            |
'|                        Last revised : 11-27-2008 (MM-DD-YYYY)            |
'+--------------------------------------------------------------------------+

#COMPILE EXE "DoOTB.exe"

#INCLUDE "Win32API.inc"
#INCLUDE "GDImage.inc"
#INCLUDE "OfTheBay.inc"

'------------------------------------------------------------------------------------------
' LOCAL section
'-----------------------------------------------------------------------------------------

TYPE gSpriteArrayStruct
    ShellTo   AS ASCIIZ * 260
    IconPath  AS ASCIIZ * 260
    WorkDir   AS ASCIIZ * 260
    UseLabel  AS ASCIIZ * 128
    CmdLine   AS ASCIIZ * 260
    ShowCmd   AS LONG
END TYPE

''''''''''''''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''''''''''''''''''''

SUB WriteOTB(BYVAL sMsg AS STRING) STATIC
    DIM szFileName AS ASCIIZ * %MAX_PATH
    DIM hDebug AS LONG
    DIM NeverBeenThere AS LONG
    IF hDebug AND LEN(sMsg$) = 0 THEN
       CALL zsFClose(hDebug)
       NeverBeenThere = 0
       EXIT SUB
    END IF
    IF NeverBeenThere = 0 THEN
       NeverBeenThere = -1
       szFileName = "Default.OTB"
       CALL zsKillFile(szFileName)
       CALL zsFOpen(szFileName, 2, 4, hDebug)
    END IF
    CALL zsFPut(hDebug, sMsg + $CRLF)
END SUB

'// Main entry point
FUNCTION WINMAIN (BYVAL hInstance     AS LONG, _
                  BYVAL hPrevInstance AS LONG, _
                  BYVAL lpCmdLine     AS ASCIIZ PTR, _
                  BYVAL iCmdShow      AS LONG) AS LONG

    DIM gS(1 TO 1) AS gSpriteArrayStruct

    LOCAL hProgMan, hListView AS DWORD
    LOCAL K, nCount, nItemCount AS LONG, sLink, sEnableShortcutTrueFalse AS STRING

    hProgMan  = FindWindow("Progman", "Program Manager")
    hListView = FindWindowEx(hProgMan, 0, "SHELLDLL_DefView", "")
    hListView = FindWindowEx(hListView, 0, "SysListView32", "FolderView")
    nItemCount = SendMessage(hListView, %LVM_GETITEMCOUNT, 0, 0)
    IF nItemCount THEN
       LOCAL dwProcessId, hProcess, dwSize, lpData AS DWORD
       CALL GetWindowThreadProcessId(hListView, dwProcessId)
       hProcess = OpenProcess(%PROCESS_VM_OPERATION OR %PROCESS_VM_READ OR %PROCESS_VM_WRITE, %FALSE, dwProcessId)
       IF hProcess THEN
          '// Compute the size of our reserved memory buffer
          dwSize = SIZEOF(POINTAPI) + SIZEOF(LVITEM) + %MAX_PATH * 2

          lpData = VirtualAllocEx(hProcess, BYVAL %NULL, dwSize, %MEM_COMMIT, %PAGE_READWRITE)
          IF lpData THEN

             LOCAL pWsh AS IWshShell
             pWsh = NEWCOM "WScript.Shell"
             LOCAL pLnk AS IWshShortcut

             LOCAL sDeskTopPub, sDeskTopAdm AS STRING
             sDeskTopAdm = zsFolderGet(%CSIDL_DESKTOP)
             sDeskTopPub = zsFolderGet(%CSIDL_COMMON_DESKTOPDIRECTORY)
             '// Setup pointers
             LOCAL lpPosition, lpItem, lpText AS LONG
             lpPosition = lpData
             lpItem = lpData + SIZEOF(POINTAPI)
             lpText = lpData + SIZEOF(POINTAPI) + SIZEOF(LVITEM)

             LOCAL lvi AS LVITEM
             LOCAL szTxt AS ASCIIZ * 128, szLnk AS ASCIIZ * (%MAX_PATH * 2)  ' Allow room for unicode
             LOCAL DoLnk AS LONG
             FOR K = 0 TO nItemCount - 1
                 '// Init LVITEM structure and copy it to our reserved memory buffer
                 lvi.mask       = %LVIF_TEXT
                 lvi.iItem      = K
                 lvi.iSubItem   = 0
                 lvi.pszText    = lpText
                 lvi.cchTextMax = %MAX_PATH * 2
                 CALL WriteProcessMemory(hProcess, lpItem, lvi, sizeof(LVITEM), 0)
                 '// Get text label and x,y location
                 CALL SendMessage(hListView, %LVM_GETITEMTEXT, K, lpItem)
                 CALL SendMessage(hListView, %LVM_GETITEMPOSITION, K, lpPosition)
                 '// Copy from process memory to local variables
                 szTxt = ""
                 CALL ReadProcessMemory(hProcess, lpText, szTxt, SIZEOF(szTxt), 0)
                 LOCAL p AS POINTAPI
                 CALL ReadProcessMemory(hProcess, lpPosition, p, SIZEOF(POINTAPI), 0)
                 IF LEN(szTxt) THEN szLnk = szTxt + ".lnk"

                 IF ISFILE(sDeskTopAdm + szLnk) THEN
                    sLink = sDeskTopAdm + szLnk
                 ELSEIF ISFILE(sDeskTopPub + szLnk) THEN
                    sLink = sDeskTopPub + szLnk
                 ELSE
                    sLink = ""
                 END IF

                 sTarget$ = ""
                 IF LEN(sLink) THEN
                    DoLnk = -1
                    pLnk = pWsh.CreateShortcut(UCODE$(sLink))
                    sTarget$ = RTRIM$(ACODE$(pLnk.TargetPath))
                    IF LEN(sTarget$) = 0 THEN sTarget$ = ResolveLnk((sLink))
                 ELSE
                    DoLnk = 0
                    sTarget$ = ResolveShortcutName(szTxt)
                 END IF
                 IF LEN(sTarget$) THEN
                    INCR nCount
                    REDIM PRESERVE gS(1 TO nCount)
                    gs(K).IconPath = "@PATH@UserIcon\48x48\????.png"
                    IF DoLnk THEN gS(nCount).ShellTo = LCASE$(ACODE$(pLnk.TargetPath))
                    IF DoLnk THEN gS(nCount).WorkDir = ACODE$(pLnk.WorkingDirectory)
                    gS(nCount).UseLabel = szTxt
                    IF DoLnk THEN gS(nCount).ShowCmd = pLnk.WindowStyle
                 END IF
             NEXT

             '// Freeup memory
             CALL VirtualFreeEx(hProcess, lpData, 0, %MEM_RELEASE)

          END IF

          '// Close process
          CALL CloseHandle(hProcess)
         
          LET pWsh = NOTHING
         
       END IF
    END IF
   
    IF nCount THEN
   
       WriteOTB "'+--------------------------------------------------------------------------+"
       WriteOTB "'|                               Of The Bay                                 |"
       WriteOTB "'|                                                                          |"
       WriteOTB "'|                         User shorcut definition                          |"
       WriteOTB "'|                                                                          |"
       WriteOTB "'+--------------------------------------------------------------------------+"
       WriteOTB "'|                                                                          |"
       WriteOTB "'|                         Author Patrice TERRIER                           |"
       WriteOTB "'|                            copyright(c) 2008                             |"
       WriteOTB "'|                           www.zapsolution.com                            |"
       WriteOTB "'|                         support@zapsolution.com                          |"
       WriteOTB "'|                                                                          |"
       WriteOTB "'+--------------------------------------------------------------------------+"
       WriteOTB "'Use @PATH@ to match either the OfTheBay.EXE path or the ShellTo target path"
       WriteOTB "'"
       WriteOTB "'Icon:"
       WriteOTB "'Use either 32x32 or larger (will be converted to 48x48)"
       WriteOTB "'in case of 32x32 the program adds the active icon background else not."
       WriteOTB "'"
       WriteOTB "'""ShellTo, UseLabel, IconName, WorkDir, CmdLine, EnableShortcutTrueFalse"""
       WriteOTB "'EnableShortcutTrueFalse = 2 '// To inform OTB that this one refers to the ""Recycle Bin"""
       WriteOTB "'"
       WriteOTB "'Replace ""@PATH@UserIcon\48x48\????.png"" with a custom PNG file."
       WriteOTB "'"
       FOR K = 1 TO nCount
           sEnableShortcutTrueFalse = ", 1"""
           IF LEN(gS(K).ShellTo) = 0 THEN
              gS(K).ShellTo = gS(K).UseLabel
           ELSE
              IF INSTR(gS(K).ShellTo, "ofthebay.exe") THEN sEnableShortcutTrueFalse = ", 0""" ' Don't show it
              IF PATHNAME$(PATH, gS(K).ShellTo) = RTRIM$(LCASE$(gS(K).WorkDir), "\") + "\" THEN gS(K).WorkDir = "@PATH@"
           END IF
           WriteOTB """" + gS(K).ShellTo + ", " + gS(K).UseLabel + ", " + gs(K).IconPath + ", " + gS(K).WorkDir + ", " + gS(K).CmdLine + sEnableShortcutTrueFalse
       NEXT
       WriteOTB "'"
       WriteOTB "'End of file."
       WriteOTB ""
    END IF

    MsgBox """Default.OTB"" file, has been created." + $cr + $cr + _
           "You must edit and save it under the name of:" + $cr + _
           """OfTheBay.OTB""", , "Of The Bay"

END FUNCTION


Instructions for use are provided into the resulting OTB file.
...
Title: "Of The Bay" version 1.56 (close to full completion)
Post by: Patrice Terrier on November 28, 2008, 12:04:38 PM
I think with version 1.56 we are close to full completion.

The new ZIP file (attached to the first post of this thread) is provided with both "OfTheBay.exe" and "DoOTB.exe" source code.

DoOTB allows you to create a "Default.OTB" file that you can customize with any ASCII text editor and save under the name of "OfTheBay.OTB".

If ever you download this new version, i would be glad to know if you have been able to setup your own OTB file, if not ask me there what to do.

Thank you!

...

Title: "Of The Bay" version 1.57
Post by: Patrice Terrier on December 15, 2008, 07:45:57 PM
Under request of Martin Francom, the "shorcut target path" is now shown on the dock, when you hold down the right mouse button, while hover a DockBar icon.

The lattest ZIP file with source code is attached to the first post of this thread.

The public version without source code and without "nag screen" is there. (http://www.powerbasic.com/support/pbforums/showpost.php?p=304731&postcount=42)

...
Title: "Of The Bay" version 1.60 (with embedded OTB file generator)
Post by: Patrice Terrier on December 17, 2008, 08:08:27 PM
OfTheBay has been enhanced with a new menu option to create/update the "OfTheBay.OTB" file,
that would let you customize the shorcuts with your own set of icons, or hide existing shorcut(s), and/or add new OTB shortcut(s).


Example of "OfTheBay.OTB" file:


'+--------------------------------------------------------------------------+
'|                               Of The Bay                                 |
'|                                                                          |
'|                         User shorcut definition                          |
'|                                                                          |
'+--------------------------------------------------------------------------+
'|                                                                          |
'|                         Author Patrice TERRIER                           |
'|                            copyright(c) 2008                             |
'|                           www.zapsolution.com                            |
'|                         support@zapsolution.com                          |
'|                                                                          |
'+--------------------------------------------------------------------------+
'| Build on: 12-17-2008                                                     |
'+--------------------------------------------------------------------------+
'
'Use @PATH@ to match either the OfTheBay.EXE path or the ShellTo target path
'
'Icon:
'Use either 32x32 or larger (will be converted to 48x48)
'in case of 32x32 the program adds the active icon background else not.
'
'"ShellTo, UseLabel, IconName, WorkDir, CmdLine, EnableShortcutTrueFalse"
'
'EnableShortcutTrueFalse = 0 // Disable this shorcut
'EnableShortcutTrueFalse = 1 // Enable this shorcut
'EnableShortcutTrueFalse = 2 // To inform OTB that this one refers to the "Recycle Bin"
'                            // you must also provide 2 icons named:
'                            // "RecycleBinEmpy.png" and "RecycleBinFull.png"
'
'Replace "@PATH@UserIcon\48x48\????.png" with a custom PNG file.
'
'****************************************************************************
"Ordinateur, Ordinateur, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Computer.png, , , 1"
"c:\program files\cc hyper file\cc120hf.exe, Centre de Contrôle HF, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Control.png, @PATH@, , 1"
"c:\program files\google\picasa3\picasa3.exe, Picasa 3, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Picasa.png, @PATH@, , 1"
"d:\sed\sed_116.exe, PBWin9, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\PowerBASIC.png, @PATH@, , 1"
"d:\disque_p\assigndsk.bat, Promotech, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Param1.png, @PATH@, , 1"
"c:\program files\phoenix\bin\phoenix.exe, Phoenix, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Phoenix.png, , , 1"
"c:\travail\sdk\template\bassbox24\bassbox.exe, BassBox24, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Woofer.png, @PATH@, , 1"
"c:\program files\hp\quickplay\qp.exe, QuickPlay, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\QuickPlay.png, @PATH@, , 1"
"d:\wd11-us\programs\windev11.exe, WD11 US, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\WD11.png, @PATH@, , 1"
"c:\travail\sdk\template\moviebox2\moviebox.exe, MovieBox, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\MovieProjector.png, @PATH@, , 1"
"c:\windev 12\programmes\windev12.exe, WinDev 12, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\WD12.png, @PATH@, , 1"
"c:\program files\vahelp\vahelp73.exe, HelpMaker, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Vizacc.png, @PATH@, , 1"
"c:\windev 12\zoleigest.bat, Z oleigest, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Run.png, @PATH@, , 1"
"Corbeille, Corbeille, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\RecycleBinFull.png, , , 1"
"c:\windows\installer\{e4ddba93-769b-49d8-ba33-8814e45ed0c1}\_40c4cb6f6690400fa04ba2.exe, HP Help and Support, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\HP.png, C:\Windows\Help\OEM\scripts\, , 1"
"c:\windev 10\programmes\windev10.exe, WinDev 10, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\WD10.png, @PATH@, , 1"
"c:\windev11\programmes\windev11.exe, WinDev 11, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\WD11.png, @PATH@, , 1"
"c:\windev 10\disquez.bat, Disque Z, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\HD.png, @PATH@, , 1"
"c:\windows\system32\cmd.exe, Prompt, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Prompt.png, C:\travail, , 1"
"Son - Raccourci, Son - Raccourci, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Sound.png, , , 1"
"c:\windows\installer\{5c82dae5-6eb0-4374-9254-be3319ba4e82}\skype.ico, Skype, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Skype.png, C:\Program Files\Skype\, , 1"
"c:\vs2005\zmovieplayer\bin\debug\zmovieplayer.exe, zMoviePlayer, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\MediaPlayer.png, @PATH@, , 1"
"c:\program files\acronis\trueimagehome\trueimage.exe, Acronis True Image Home 10.0, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Acronis.png, @PATH@, , 1"
"c:\program files\filezilla client\filezilla.exe, FileZilla, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\FileZilla.png, @PATH@, , 1"
"c:\travail\photocomposer\photocompo.exe, PhotoComposer, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\PhotoComposer.png, @PATH@, , 1"
"c:\program files\blender foundation\blender\blender.exe, Blender, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\Blender.png, @PATH@, , 1"
"c:\users\administrateur\appdata\local\google\chrome\application\chrome.exe, Google Chrome, @PATH@UserIcon\48x48\????.png, @PATH@, , 1"
"d:\photosetup\photosetup.exe, PhotoSetup, C:\travail\sdk\template\GoldFish\XPAERO\OfTheBay\UserIcon\48x48\PhotoSetup.png, @PATH@, , 1"
'
'End of file.


...

Title: Re: "Of The Bay"
Post by: Patrice Terrier on December 18, 2008, 09:35:05 AM
To help you customize "Of The Bay" with PNG icons, here are a few links:

http://www.crystalxp.net/galerie/en.cat.1.html
http://www.iconspedia.com/
http://www.customxp.net/PngFactory/les-icones-png.html?langid=1
http://www.iconexperience.com/?gclid=CIzF3-LfyZcCFRMcQgodwXIZTA
http://www.vistaicons.com/

etc.


Title: "Of The Bay" and 64-bit OS
Post by: Patrice Terrier on January 10, 2009, 01:40:55 PM
You are advised that because the current version of "Of The Bay" is being written in 32-bit, it can't be used with VISTA 64-bit.

...
Title: Re: "Of The Bay"
Post by: Patrice Terrier on January 13, 2009, 01:35:10 PM
I am looking for volunteer(s) using a Windows 64-bit and wanting to check a dedicated version of OfTheBay ?

...
Title: Re: "Of The Bay"
Post by: Patrice Terrier on January 19, 2009, 05:48:57 PM
I have a new version of "Of The Bay" running on both 32 and 64-bit OS.

This version allows you to define the icon order, from the OTB file.

If interrested, then let me know.

...
Title: Re: "Of The Bay" Version 2.00
Post by: Patrice Terrier on August 06, 2011, 06:29:02 PM
Lattest version 2.00 has been attached to the first post of this thread, to fix the ZIP file corruption caused by the "Server Collapse".

Version 2.00 is compatibles with either 32 or 64-bit OS.

...