Peter
Fri Apr 30 11:45:04 CDT 2004
"John Lee" <anonymous@discussions.microsoft.com> wrote in message
news:CBCE7F89-773C-496A-959E-5C7859060231@microsoft.com...
> I appreciate your help, but that's not what I'm asking. I already found this one earlier... =)
> I wouldn't mind using it, but it only exposes the methods as subs and I really really need the return values.
Why do you need the return values? These are error level indicators, which VB automatically handles for you. They are
there, you just don't have to deal with them.
> Here is an example of how it's done in Delphi:
http://www.delphi3000.com/articles/article_3230.asp
I don't see that this example is doing anything special with the return values either. The sample Bryan pointed you to
at msjogren.net allows you to do the same thing as your Delphi example.
> I've already asked someone who knows delphi to try and transforn this to VB6 for me, but he couldn't do it.
The interface is defined in the typelib included with the sample at:
http://www.msjogren.net/dotnet/eng/samples/vb6_taskbarlist.asp
You don't need to add code to define the interface like in the Delphi example, just add a reference to the typelib
through Project->References.
You need to declare the ITaskBar object in the Form's Declarations section. Again, the example demonstrates this:
Private oTaskbar As TaskbarList
Here's the form startup code:
Private Sub Form_Load()
Set oTaskbar = New TaskbarList
oTaskbar.HrInit
End Sub
That's equivalent to this:
procedure TForm1.FormCreate(Sender: TObject);
begin
FTaskbarList:= CreateComObject(CLSID_TaskbarList) as ITaskbarList;
FTaskbarList.HrInit;
end;
I'm not familiar enough with Delphi's form events, so I won't be able to translate those to corresponding VB form
events, but these are the methods that are called in your Delphi example's form events, converted to VB:
oTaskbar.AddTab Me.hwnd
oTaskbar.DeleteTab Me.hwnd
oTaskbar.ActivateTab Me.hwnd
> I'm starting to wonder if it's even possible to do in VB6, as no one (so far) seems to know how....
Again, the sample at msjogren.net demonstrates exactly this.
If this isn't what you're after, please be more specific.
-Pete