How can I create and use the ITaskbarList interface
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/itaskbarlist/itaskbarlist.as
I have absolutely no idea how to do this, and I would appreciate your help

Thanks!

Re: Interfaces by alpine

alpine
Thu Apr 29 19:10:46 CDT 2004

On Thu, 29 Apr 2004 16:01:05 -0700, "John Lee"
<anonymous@discussions.microsoft.com> wrote:

>How can I create and use the ITaskbarList interface ?
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/itaskbarlist/itaskbarlist.asp
>I have absolutely no idea how to do this, and I would appreciate your help.
>
>Thanks!


A search for "ITaskbarList vb -.net" at the following URL....

http://groups.google.com/advanced_group_search?num=100&

Turns up the following....

http://www.msjogren.net/dotnet/eng/samples/vb6_taskbarlist.asp


HTH,
Bryan
____________________________________________________________
New Vision Software "When the going gets weird,"
Bryan Stafford "the weird turn pro."
alpine_don'tsendspam@mvps.org Hunter S. Thompson -
Microsoft MVP-Visual Basic Fear and Loathing in LasVegas

Re: Interfaces by anonymous

anonymous
Thu Apr 29 19:36:01 CDT 2004

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
Here is an example of how it's done in Delphi: http://www.delphi3000.com/articles/article_3230.as
I've already asked someone who knows delphi to try and transforn this to VB6 for me, but he couldn't do it
I'm starting to wonder if it's even possible to do in VB6, as no one (so far) seems to know how...

Thanks for your help, and more ideas will be welcome...

Re: Interfaces by alpine

alpine
Thu Apr 29 20:11:05 CDT 2004

On Thu, 29 Apr 2004 17:36:01 -0700, "John Lee"
<anonymous@discussions.microsoft.com> wrote:

>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.
>Here is an example of how it's done in Delphi: http://www.delphi3000.com/articles/article_3230.asp
>I've already asked someone who knows delphi to try and transforn this to VB6 for me, but he couldn't do it.
>I'm starting to wonder if it's even possible to do in VB6, as no one (so far) seems to know how....
>
>Thanks for your help, and more ideas will be welcome...


In other words, you want the HRESULT returns from the method calls?
If so, you will need to replace the Vtable entries for that method
calls with your own BAS module functions. You can find more info on
this in Hardcore VB (http://www.mvps.org/vb/hardcore/) and an example
and explanation in the CSuperCollection project at
http://www.mvps.org/vbvision/
(http://www.mvps.org/vbvision/Super_Collections.htm)


HTH,
Bryan
____________________________________________________________
New Vision Software "When the going gets weird,"
Bryan Stafford "the weird turn pro."
alpine_don'tsendspam@mvps.org Hunter S. Thompson -
Microsoft MVP-Visual Basic Fear and Loathing in LasVegas

Re: Interfaces by anonymous

anonymous
Fri Apr 30 04:21:04 CDT 2004

I'm sorry, but I couldn't find anything useful. It seems like it's there, but I just can't find it. Maybe because I don't know exactly what I'm looking for, being totally new to this and all..
Could you perhaps point me directly to the examples

Thanks!!

Re: Interfaces by Peter

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



Re: Interfaces by anonymous

anonymous
Fri Apr 30 13:46:02 CDT 2004

I want the return values.... (I need the return values)

Re: Interfaces by Peter

Peter
Fri Apr 30 14:17:56 CDT 2004

"Gilad" <anonymous@discussions.microsoft.com> wrote in message
news:26A5CA42-AC4E-4ADF-B5B6-87D462FC7072@microsoft.com...
> I want the return values.... (I need the return values)

The return values are error codes. If the method succeeds, the return value is always 0. If it fails, then Err.Number
and Err.Description will tell you what the problem was.

-Pete



Re: Interfaces by Zoury

Zoury
Fri Apr 30 14:36:34 CDT 2004

what about the Err.LastDllError value? is it set by the Inteface? (usually
APIs set this value instead the whole Err object)

--
Best Regards
Yanick Lefebvre
"Gilad" <anonymous@discussions.microsoft.com> wrote in message
news:2CC71C3C-5667-4D10-BA21-C946275C1E8E@microsoft.com...
> I'm afraid it doesn't work... vb doesn't generate errors fot this
interface.
> is there no way i can get the return value directly?



Re: Interfaces by Peter

Peter
Fri Apr 30 15:20:19 CDT 2004

"Gilad" <anonymous@discussions.microsoft.com> wrote in message
news:2CC71C3C-5667-4D10-BA21-C946275C1E8E@microsoft.com...
> I'm afraid it doesn't work... vb doesn't generate errors fot this interface.
> is there no way i can get the return value directly?

I find that hard to believe. If you want to get the return value directly, then change the return type in the typelib
from an HRESULT into a Long.



Re: Interfaces by alpine

alpine
Fri Apr 30 15:52:50 CDT 2004

On Fri, 30 Apr 2004 11:46:02 -0700, "Gilad"
<anonymous@discussions.microsoft.com> wrote:

>I want the return values.... (I need the return values)

You can just change the IDL for the typelib to return long values
instead of HRESULT values and then recompile the typelib if you don't
need to override the functions themselves.

HTH,
Bryan
____________________________________________________________
New Vision Software "When the going gets weird,"
Bryan Stafford "the weird turn pro."
alpine_don'tsendspam@mvps.org Hunter S. Thompson -
Microsoft MVP-Visual Basic Fear and Loathing in LasVegas

Re: Interfaces by Gilad_r

Gilad_r
Fri Apr 30 18:36:03 CDT 2004

hello everyone

Zoury
nope, doesn't work..

Peter Young, alpine
doesn't work either... i'm constantly getting 0's
here is a link to my project: http://www.avissoft.com/download.php?id=9
could you please take a look and tell me if i did something wrong

i truly appreciate your help guys!

Re: Interfaces by Peter

Peter
Sat May 01 08:43:35 CDT 2004

"Gilad" <Gilad_r@hotmail.com> wrote in message news:247A56D8-5F72-406B-BCD5-0471FA41AF46@microsoft.com...
> hello everyone,
>
> Zoury:
> nope, doesn't work...
>
> Peter Young, alpine:
> doesn't work either... i'm constantly getting 0's.
> here is a link to my project: http://www.avissoft.com/download.php?id=96
> could you please take a look and tell me if i did something wrong?

I can't see the project. I get a message:
"Sorry but you are not authorized to view or download this Attachment"



Re: Interfaces by anonymous

anonymous
Sat May 01 09:26:03 CDT 2004

sorry about that, this should work
http://wmh.walla.co.il/community/2004/5/1/9158039/EnumTB.zip

Re: Interfaces by Peter

Peter
Sun May 02 09:47:39 CDT 2004

"Gilad" <Gilad_r@hotmail.com> wrote in message news:247A56D8-5F72-406B-BCD5-0471FA41AF46@microsoft.com...
> Peter Young, alpine:
> doesn't work either... i'm constantly getting 0's.

Because the calls are not failing. 0 means success. Again, you do not need to retrieve the HRESULT yourself. VB handles
this for you. If there were an error code returned, VB's error handling mechanism would alert you to it.


> here is a link to my project: http://www.avissoft.com/download.php?id=96
> could you please take a look and tell me if i did something wrong?

The only thing I can see that might be wrong is your comment regarding SetActiveAlt:
"should be NOERROR(0) only for windows that have a taskbar button"

I see nothing in the MSDN documentation that states this. Why do you believe this to be true?

-Pete



Re: Interfaces by anonymous

anonymous
Sun May 02 11:56:03 CDT 2004

http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/ifaces/itaskbarlist/setactivealt.as
"Returns NOERROR if successful, or an OLE-defined error code otherwise.
*** if successful **
how can it succeed in activating an item's taskbar button if it doesn't have one??
i really don't get this..

anyway, i appreciate your help, and will try to figure another way of doing what i want
Gilad