The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Biterider on March 21, 2005, 04:26:57 PM

Title: StartBar Version 1.0
Post by: Biterider on March 21, 2005, 04:26:57 PM
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]
Title: Re: StartBar Version 1.0
Post by: Phoenix on March 21, 2005, 08:52:20 PM
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.

Title: Re: StartBar Version 1.0
Post by: P1 on March 21, 2005, 11:00:09 PM
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)

Title: Re: StartBar Version 1.0
Post by: Biterider on March 22, 2005, 06:58:39 AM
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
Title: Re: StartBar Version 1.0
Post by: P1 on March 22, 2005, 06:23:23 PM
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)
Title: Re: StartBar Version 1.0
Post by: Biterider on March 22, 2005, 08:33:21 PM
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
Title: Re: StartBar Version 1.0
Post by: P1 on March 22, 2005, 09:22:59 PM
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)
Title: Re: StartBar Version 1.0
Post by: Phoenix on March 22, 2005, 09:35:40 PM
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

Title: Re: StartBar Version 1.0
Post by: Phoenix on March 22, 2005, 09:56:45 PM
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
Title: Re: StartBar Version 1.0
Post by: Biterider on March 23, 2005, 07:19:48 AM
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
Title: Re: StartBar Version 1.0
Post by: Phoenix on March 23, 2005, 09:11:04 AM
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
Title: Re: StartBar Version 1.0
Post by: Biterider on March 23, 2005, 03:41:54 PM
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
Title: Re: StartBar Version 1.0
Post by: Phoenix on March 23, 2005, 06:49:22 PM
Hi Biterider!

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

--> Access violation when reading [00000125]

Regards, phoenix

Title: Re: StartBar Version 1.0
Post by: Biterider on March 23, 2005, 08:48:23 PM
Hi Phoenix!
New upload on first post.   :U

Regards,
Biterider
Title: Re: StartBar Version 1.0
Post by: Phoenix on March 23, 2005, 09:44:24 PM
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

Title: Re: StartBar Version 1.0
Post by: P1 on March 23, 2005, 11:46:50 PM
Biterider,

Let us know when you have updated the source on your website.

Regards,  P1  :8)
Title: Re: StartBar Version 1.0
Post by: Biterider on March 24, 2005, 07:44:26 AM
Hi,
Sources are updated. Current version in the about dialog is 1.0.2

Regards,
Biterider
Title: Re: StartBar Version 1.0
Post by: Biterider on March 24, 2005, 08:20:55 AM
Hi Phoenix!
To manage a bigger number of buttons, I suggest to split them in more StartBars. On my desktop I have running 4, MS-Office, General, Firm and Private.

About the button size, I can add an edit box to adjust the button width, but the height is given by the icon size. StartBar is using 32x32 icons, the next smaller size is 16x16 which is, in my eyes, too small...

Regards,

Biterider
Title: Re: StartBar Version 1.0
Post by: Biterider on March 25, 2005, 04:27:04 PM
Hi!
I have added new features to the StartBar:


I uploaded the .exe file into the first post. It has the version number 1.0.4.  :8)

Regards,

Biterider
Title: Re: StartBar Version 1.0
Post by: Phoenix on March 25, 2005, 08:10:46 PM
Hi Biterider,

I like the new features  :thumbu !!!

Regards, phoenix
Title: Re: StartBar Version 1.0
Post by: Biterider on March 28, 2005, 12:22:24 PM
Hi!
Some new features added to the StartBar (Version 1.0.5)


The .exe file was updated in the above post and all sources with remarks are available on the ObjAsm32 homepage (http://objasm32.tripod.com).

Enjoy it,   :bg

Biterider
Title: Re: StartBar Version 1.0
Post by: Biterider on March 29, 2005, 12:00:38 PM
Hi!
In first instance I write this app to fulfil my own needs, but I was asked if I can add new features like scheduled tasks and delayed launch after startup.

If somebody is interested in enhanced features of the StartBar, please don't hesitate to post the suggestions here.  :8)

Regards,

Biterider
Title: Re: StartBar Version 1.0
Post by: Biterider on March 30, 2005, 09:50:43 AM
Hi
Does somebody know how to use the drag and drop functionality to pass an internet address from the Internet Explorer address combobox to an own application?  ::)

Regards,

Biterider
Title: Re: StartBar Version 1.0
Post by: P1 on March 30, 2005, 04:45:08 PM
Quote from: Biterider on March 30, 2005, 09:50:43 AMDoes somebody know how to use the drag and drop functionality to pass an internet address from the Internet Explorer address combobox to an own application?  ::)
AFAIK, That Combo Text Box does not support that functionality, But I do know, the Clipboard functions work there with the cut-n-paste.

But you can also output a link from the Send menu item, which will work with the drag and drop, at that point.

Regards,  P1  :8)
Title: Re: StartBar Version 1.0
Post by: Biterider on March 30, 2005, 08:05:40 PM
Hi P1
Thanks for your replay! When I try to drag and drop a link from the IE Link ComboBox to the desktop or MS-Word it works, but with any other app it denies to drop the link. I guess that it should be a registration issue or something like this, but I don't know it... Any ideas?

Regards, Biterider
Title: Re: StartBar Version 1.0
Post by: thomasantony on March 31, 2005, 02:58:37 AM
Hi,
  Add someway to stop multiple instances of the program from running.

Thomas :U
Title: Re: StartBar Version 1.0
Post by: Biterider on March 31, 2005, 07:13:35 AM
Hi tomasantony
I added an initialization check that looks if a previous instance is running that uses the same .ini file. By this way, you can have multiple bars running but not using the same configuration file.
If you are sharing a bar with others in a LAN and you don't want that it was changed, set the bit 4 of the Flags key in the App section of the .ini file to 1.

New version 1.0.6 uploaded

Regards,

Biterider
Title: Re: StartBar Version 1.0
Post by: P1 on March 31, 2005, 02:39:38 PM
Quote from: Biterider on March 30, 2005, 08:05:40 PMWhen I try to drag and drop a link from the IE Link ComboBox to the desktop or MS-Word it works, but with any other app it denies to drop the link. I guess that it should be a registration issue or something like this, but I don't know it... Any ideas?
In MASM32, under EXAMPLE3, is a drag & drop handler, it was be in place before a app, can process the drag&drop from the shell.  Not all apps have this functionality.

Regards,  P1  :8)
Title: Re: StartBar Version 1.0
Post by: Biterider on March 31, 2005, 07:22:11 PM
Hi P1
Thanks fort he hint, but the approach used in Example3 is basically the same I use for drag & drop of files from the Shell or the Explorer into the StartBar and can also be found in the Windows documentation. In the case of the IE, MS is using somewhat different to implement the drag & drop of links and I don't know what the trick is...
Regards,
Biterider
Title: Re: StartBar Version 1.0
Post by: P1 on March 31, 2005, 07:40:41 PM
Biterider,

I just tried tried to drag&drop from IE6 address box to Word2K on W2Kpro, it would let me.

What are you doing?  I'm curious now.

Regards,  P1  :8)
Title: Re: StartBar Version 1.0
Post by: Biterider on March 31, 2005, 09:59:55 PM
P1,
Simple, take the IE6 and your (own written) application and you will see that if you drop a link taken from the IE, it will not be accepted by the app using the approach I'm using or the one described in Example3. Try it with the StartBar.exe or Example3.exe and you will see that you can't drop it.
I know that it is possible to do since as you have seen, all MS-Products accept the dropping of links.

Regards, Biterider
Title: Re: StartBar Version 1.0
Post by: Biterider on April 01, 2005, 06:40:31 AM
Hi Pi!
I think I found the way to do it. I need the OLE implementation of Drag and Drop. Check
this (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_programming/transferring/datascenarios.asp).

Regards,
Biterider
Title: Re: StartBar Version 1.0
Post by: P1 on April 01, 2005, 03:33:14 PM
Biterider,

Interesting, very interesting!  Keep us posted on your progress.  There are two different drops:

1.  OLE
2.  The older DDE.

From your link, I noticed this could be a clipboard drop as well.

Regards,  P1  :8)

Title: Re: StartBar Version 1.0
Post by: Biterider on April 03, 2005, 07:53:23 AM
Hi!
I found the solution using the IDropTarget COM interface.  :dance:
StartBar now implements a component with this interface. By this way I get access to the Ole Drag and Drop information (previous RegisterDragDrop registration in the Init method). The clue about IE links is that they are passed in CF_TEXT and not in CF_HDROP format as usual for other files. The IDropTarget.DragEnter interface method shows how to handle each situation using the IDataObject interface.  :8)

I updated the sources on the ObjAsm32 homepage (http://objasm32.tripod.com) and the .exe file at the first post of this thread.

Regards,

Biterider
Title: Re: StartBar Version 1.0
Post by: P1 on April 04, 2005, 05:26:31 PM
Biterider,

Thanks for the Research!   :U   I will look forward to looking at your implementation of the COM interface.

Regards,  P1  :8)
Title: Re: StartBar Version 1.0
Post by: ToutEnMasm on October 27, 2005, 07:23:38 AM
Hello,
Trying to run the samples , i only get errors messages like
Debug center cannot be open

                  ToutEnMasm
Title: Re: StartBar Version 1.0
Post by: Biterider on October 27, 2005, 07:28:44 AM
Hi
What version are you trying to run?
About DebugCenter, you have to register it before using it. You can do it by running it one time. It registers itself.
If you have compilation problems, then I suggest to rename the old ObjAsm32 folder and reinstall the package.

I hope it helps, if not please tell me!  :wink

Regards,

Biterider