News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

StartBar Version 1.0

Started by Biterider, March 21, 2005, 04:26:57 PM

Previous topic - Next topic

Biterider

Hi!
I want to share a fun project I call StartBar. It is intended to replace the "MS-Launch bar" on my box. It uses ObjAsm32 classes and COM interfacing, so it can be seen as an example of how to use these techniques.
Attached is the zipped exe file and at our homepage you can find the full source code. To note is the small exe file size (~67kB)!

Enjoy!  :8)

Biterider


[attachment deleted by admin]

Phoenix

Great tool  :U to access all the help files i need every day...

I got an error "reading from memory" at following location:

00001420   FF77 14          PUSH DWORD PTR DS:[EDI+14]

but i dont know what i exactly did causing this error, and was not able to reproduce it yet.


P1

Getting it to finish, is a chore.

Start with downloading and installing latest OA32INST.ZIP

Added to Make.bat
Set MASM32_PATH=C:\Masm32
Set OA32_PATH=C:\Masm32\ObjAsm32

Missing LEFT_16x16_16.ICO, copied & rename an Exit ICO

GripI.bmp > Grip.bmp

We are up to the assemby errors.  Done for today.  Play some more tomorrow.

Assembling: StartBar.asm
DEBUG MODE  : INACTIVE
OOP LEVEL   : WINDOWS BASE
- ObjIDs.inc
- Primer.inc
- Steamable.inc
- WinPrimer.inc

Inheritance path: Primer
Inheritance path: Primer - Streamable
Inheritance path: Primer - Streamable - WinPrimer
StartBar.asm(24) : error A2006: undefined symbol : sIID_IShellLink
DefGUID(1): Macro Called From
  StartBar.asm(24): Main Line Code
StartBar.asm(25) : error A2006: undefined symbol : sIID_IPersistFile
DefGUID(1): Macro Called From
  StartBar.asm(25): Main Line Code
Inheritance path: Primer - IniFile
Inheritance path: Primer - Stream
Inheritance path: Primer - Stream - DiskStream
Inheritance path: Primer - Streamable - Collection
Inheritance path: Primer - Streamable - Collection - DataCollection
Inheritance path: Primer - Streamable - WinPrimer - Button
Inheritance path: Primer - Streamable - WinPrimer - Button - Hyperlink
Inheritance path: Primer - RegKey
Inheritance path: Primer - Streamable - WinPrimer - Dialog
Inheritance path: Primer - Streamable - WinPrimer - Dialog - DialogModal
Inheritance path: Primer - Streamable - WinPrimer - Dialog - DialogModal - DialogModalIndirect
Inheritance path: Primer - Streamable - WinPrimer - Dialog - DialogModal - DialogModalIndirect - DialogAboutIndirect
Inheritance path: Primer - Streamable - WinPrimer - Dialog - DialogModeless
Inheritance path: Primer - Streamable - WinPrimer - Dialog - DialogModeless - DialogModelessIndirect
Inheritance path: Primer - Streamable - SimpleImageList
Inheritance path: Primer - Streamable - SimpleImageList - MaskedImageList
Inheritance path: Primer - Streamable - WinPrimer - MsgInterceptor
Inheritance path: Primer - XMenuItem
Inheritance path: Primer - Streamable - WinPrimer - MsgInterceptor - XMenu
Inheritance path: Primer - Streamable - WinPrimer - MsgInterceptor - XMdiMenu
Inheritance path: Primer - Streamable - WinPrimer - WinControl
Inheritance path: Primer - Streamable - WinPrimer - WinControl - Toolbar
Inheritance path: Primer - Streamable - WinPrimer - WinControl - Rebar
Inheritance path: Primer - Streamable - WinPrimer - MsgInterceptor - RbIptor
Inheritance path: Primer - Streamable - WinPrimer - WinControl - BandFrame
Inheritance path: Primer - Streamable - WinPrimer - WinControl - Tooltip
Inheritance path: Primer - Streamable - WinPrimer - SdiApp
Inheritance path: Primer - Streamable - WinPrimer - SdiApp - StartBar
Inheritance path: Primer - Streamable - WinPrimer - Dialog - DialogModal - SetupAppDlg
Inheritance path: Primer - Streamable - WinPrimer - Dialog - DialogModal - SetupBtnDlg
StartBar.inc(436) : error A2006: undefined symbol : IID_IShellLink
StartBar.inc(436) : error A2114: INVOKE argument type mismatch : argument : 4
StartBar.inc(965) : error A2006: undefined symbol : IID_IShellLink
StartBar.inc(965) : error A2114: INVOKE argument type mismatch : argument : 4
StartBar.asm(24) : error A2052: forced error : DefGUID incorrect input string
DefGUID(2): Macro Called From
  StartBar.asm(24): Main Line Code
StartBar.asm(25) : error A2052: forced error : DefGUID incorrect input string
DefGUID(2): Macro Called From
  StartBar.asm(25): Main Line Code
StartBar.inc(440) : error A2052: forced error : Undefined object: IShellLink
ICall(11): Macro Called From
  StartBar.inc(440): Include File
StartBar.inc(444) : error A2052: forced error : Undefined object: IShellLink
ICall(11): Macro Called From
  StartBar.inc(444): Include File
StartBar.inc(445) : error A2052: forced error : Undefined object: IShellLink
ICall(11): Macro Called From
  StartBar.inc(445): Include File
StartBar.inc(446) : error A2052: forced error : Undefined object: IShellLink
ICall(11): Macro Called From
  StartBar.inc(446): Include File
StartBar.inc(455) : error A2052: forced error : Undefined object: IShellLink
ICall(11): Macro Called From
  StartBar.inc(455): Include File
StartBar.inc(456) : error A2052: forced error : Undefined object: IPersistFile
ICall(11): Macro Called From
  StartBar.inc(456): Include File
StartBar.inc(457) : error A2052: forced error : Undefined object: IPersistFile
ICall(11): Macro Called From
  StartBar.inc(457): Include File
StartBar.inc(459) : error A2052: forced error : Undefined object: IShellLink
ICall(11): Macro Called From
  StartBar.inc(459): Include File
StartBar.inc(969) : error A2052: forced error : Undefined object: IShellLink
ICall(11): Macro Called From
  StartBar.inc(969): Include File
StartBar.inc(972) : error A2052: forced error : Undefined object: IPersistFile
ICall(11): Macro Called From
  StartBar.inc(972): Include File
StartBar.inc(973) : error A2052: forced error : Undefined object: IShellLink
ICall(11): Macro Called From
  StartBar.inc(973): Include File
StartBar.inc(974) : error A2052: forced error : Undefined object: IPersistFile
ICall(11): Macro Called From
  StartBar.inc(974): Include File
StartBar.inc(994) : error A2052: forced error : Undefined object: IShellLink
ICall(11): Macro Called From
  StartBar.inc(994): Include File


Regards,  P1  :8)


Biterider

Hi Phoenix!
Can you say me under what circumstances you get the GPF? Thanks.

Hi P1!
I updated the download file with the correct files. About the compilation errors I think you haven't replaced the COM_Interfaces.inc file were the new interfaces were defined. The compilation paths you added to the make file should be added to your system on installation. It seems that something went wrong... Please add it manually to your OS. Thanks.

Regards,

Biterider

P1

Biterider,

Your updated file fixed everything except the path variables you have in the make file.  But I realize that is a setup preference.

Have you thought about making the bar dockable or at least movable to another anchor location?

Regards,  P1  :8)

Biterider

P1!
The current release (1.0) is capable to dock at any location on the right or left side of the primary monitor. To move the bar, press the control key and drag the bar to the location you want it. To select the right or left side, pop up the app menu by right clicking any area not covered by the buttons, i.e. the grip bmp. Select setup and the customization dialog appears.
By right clicking on the buttons, a button menu is popuped. There you can select setup to customize the button link.

As you can see in the header section of the Starbar.inc file, I've reserved some bits to dock the bar at the top or bottom of the screen, but it is not currently implemented... I have left something for the next release...  :8)  If you have more ideas, please let me know!  :thumbu

Regards,

Biterider

P1

Biterider,

I did look for a Help Menu Item.  They say, It's not done until the paperwork is finsih!

Great Job With the Program!!   :U

Regards,  P1  :8)

Phoenix

QuoteCan you say me under what circumstances you get the GPF? Thanks.

Biterider, this GPF didn't happen again. Maybe something else went wrong, i dont know. Great job, i like your program!!!

Regards, Phoenix


Phoenix

Biterider,

i've got it. Try the following:

- add a new (blank) item.
- move it to the right
- it appears a popup menu, select setup
- memory read error occurs

Running on AthlonXP64, W2K...

These are the registers contents:

EAX 000000C9
ECX 000000A4
EDX 0040D5F0 StartBar.0040D5F0
EBX 0040D65C StartBar.0040D65C
ESP 0012F99C
EBP 0012FAF0
ESI 0040D4E0 StartBar.0040D4E0
EDI 00000111
EIP 00402020 StartBar.00402020
C 0  ES 0023 32bit 0(FFFFFFFF)
P 1  CS 001B 32bit 0(FFFFFFFF)
A 0  SS 0023 32bit 0(FFFFFFFF)
Z 1  DS 0023 32bit 0(FFFFFFFF)
S 0  FS 0038 32bit 7FFDE000(FFF)
T 0  GS 0000 NULL
D 0
O 0  LastErr ERROR_SUCCESS (00000000)

               3 2 1 0      E S P U O Z D I
FST 0000  Cond 0 0 0 0  Err 0 0 0 0 0 0 0 0  (GT)
FCW 027F  Prec NEAR,53  Mask    1 1 1 1 1 1

Code disassembly (Part) from OllyDebug:

00401FE6   E8 691C0000      CALL <JMP.&user32.SendMessageA>
00401FEB   8BF8             MOV EDI,EAX
00401FED   47               INC EDI
00401FEE   8B56 04          MOV EDX,DWORD PTR DS:[ESI+4]
00401FF1   57               PUSH EDI
00401FF2   56               PUSH ESI
00401FF3   FF52 44          CALL DWORD PTR DS:[EDX+44]
00401FF6   8B56 04          MOV EDX,DWORD PTR DS:[ESI+4]
00401FF9   57               PUSH EDI
00401FFA   56               PUSH ESI
00401FFB   FF52 4C          CALL DWORD PTR DS:[EDX+4C]
00401FFE   8B56 04          MOV EDX,DWORD PTR DS:[ESI+4]
00402001   56               PUSH ESI
00402002   FF52 5C          CALL DWORD PTR DS:[EDX+5C]
00402005   33C0             XOR EAX,EAX
00402007   E9 10020000      JMP StartBar.0040221C
0040200C   3D C9000000      CMP EAX,0C9
00402011   75 43            JNZ SHORT StartBar.00402056
00402013   6A 00            PUSH 0
00402015   FFB6 84000000    PUSH DWORD PTR DS:[ESI+84]
0040201B   68 19040000      PUSH 419
;**** Here the error occurred ****
00402020   FF77 14          PUSH DWORD PTR DS:[EDI+14]
00402023   E8 2C1C0000      CALL <JMP.&user32.SendMessageA>
00402028   8BF8             MOV EDI,EAX
0040202A   8B56 04          MOV EDX,DWORD PTR DS:[ESI+4]
0040202D   57               PUSH EDI
0040202E   56               PUSH ESI
0040202F   FF52 4C          CALL DWORD PTR DS:[EDX+4C]
00402032   8B8E 98000000    MOV ECX,DWORD PTR DS:[ESI+98]
00402038   8379 14 00       CMP DWORD PTR DS:[ECX+14],0
0040203C   74 11            JE SHORT StartBar.0040204F
0040203E   F746 20 10000000 TEST DWORD PTR DS:[ESI+20],10
00402045   75 08            JNZ SHORT StartBar.0040204F
00402047   8B56 04          MOV EDX,DWORD PTR DS:[ESI+4]
0040204A   57               PUSH EDI
0040204B   56               PUSH ESI


Let me know if you need additional information.

Regards, phoenix

Biterider

Hi Phoenix!
I checked the button creation in the OnCommand method and I found an indexing problem related to the IDM_BTN_NEW command
The correct line should be
    Case IDM_BTN_NEW
      mov ecx, [esi].pToolbar
      mov edi, $invoke(SendMessage, [ecx].Toolbar.hWnd, TB_COMMANDTOINDEX, [esi].dSelBtnCmd, 0)


I uploaded the correct exe at the top post. Please, check if the error has gone... If yes, I'll upload the corrected source code.  :8)

Regards,

Biterider

Phoenix

Hi Biterider,

i just did a small check, the problem is gone, but the startbar also (!?)... as i'm at office now, i have no time to check more right now. I'll have a look this evenig.

Regards, phoenix

Biterider

Hi Phoenix!
I uploaded a new version (1.0.1) with 2 improvements:
1. The bar repositions when the screen resolution changes (it responds to the WM_DISPLAYCHANGE message).
2. It stops execution when the IniFile can not be fount at startup.

Regards,

Biterider

Phoenix

Hi Biterider!

Are you shure you did upload the new .exe? I have the same GPF again..

--> Access violation when reading [00000125]

Regards, phoenix


Biterider

Hi Phoenix!
New upload on first post.   :U

Regards,
Biterider

Phoenix

Hi Biterider,

:U :U :U :U :U :U :U :U :U :U

Perfect... I like this one, it will stay on my desktop.

Just a suggestion:

How about different button sizes? I think a smaller one would look nice, too.

Perhaps you could switch to more than one row if more buttons were added?

Good job, than you for sharing!

Regards, phoenix