# VBForums CodeBank > CodeBank - Visual Basic 6 and earlier >  Wokawidgets Component Suite

## Wokawidget

Attached is a collection of some of my better projects that are almost complete, POP3 Mail is way off yet, maybe in a week or so.

The suite as components for the following things:
Custom TooltipsSkinning A FormApplication LiveUpdate (AutoUpdate)SysTray IconAPI TimerAynchronous Download From WebMSN Messenger ClientSimple, but very effective, multipurpose graphSimple Selector Control. Very Handy.Winsock in a DLLXP ButtonMSN Messenger Style Popup MessagesPOP3 Email

More descriptions to come.

Woof

----------


## RobCrombie

I always keep things simple (for my sake).
So I -
- don't use MDI Forms
- Always have all related frm's, bas's etc in the same folder as the vbp 
- and I have never used Project groups

What is the impact (difference) when it comes time to -
- make exe
- use P&D
- and anything else that one might encounter with a vbg ?


Thanks for sharing your apps

----------


## Wokawidget

None really. 

I do keep things simple  :Big Grin: 
That's why I use a vpg and multiple projcts.

When you come to P&D your app, you just need to make sure that your DLLs are included in the package.

Splitting code off into DLL means that many apps can use the same DLL, and thus the same code.
Ie. If I changed the code behind the vbWinsock dll then my liveupdate, downloder and MSN client, would ALL automatically see the changes made. No need to update 3 applications. Just one.

Woka

----------


## RobDog888

Hey Woka, do you have individule DLs for each component project? Say if I just wanted the XP Button
project would you have a link for it somewhere?  :Big Grin:

----------


## sciguyryan

> Hey Woka, do you have individule DLs for each component project? Say if I just wanted the XP Button
> project would you have a link for it somewhere?



That would be very useful I agree  :Smilie: 


Cheers,

RyanJ

----------


## Wokawidget

hahaha...you both ganging up on me to cause me more work?  :Stick Out Tongue: 

Yea...I keep meaning to. Working on a few more "little" projects and getting other projects up to release level, then I will add them here.

My component suite now consists of 18 seperate components.

Woka

----------


## RobDog888

Just thought it would be easier for me to use if I only wanted XP Button for example and not all the msn stuff.

When can we expect to see individule DLs for each component?  :LOL:

----------


## Wokawidget

Errr...you can still use the XP Button on it's own.
Just copy the vbButton project.

Or do you mean you don't want to download it all when all you need is the XP Button project?

Woka

----------


## RobDog888

Yes, I was hoping for individule DLs so I dont have to DL all the projects, just the ones I want/need.

----------


## tbyrne

Newbie Question
I am using MS Visual Studio 2003 for my projects.  How do I use the Wokawidgets examples?

Tom

----------


## Wokawidget

You don't.
These are written in VB6 not .NET
You would have to convert them, but I'm not sure how well they would convert  :Frown: 

Woka

----------


## _Ci_

Hi,
I'm trying to use some of your great projects like MSN stype popups, systray and skinning.

It seems that when I have a visible skinned form, the MSN stype popups can't be correctly clicked (they are clickable and sticky) and they will not automatically close after being clicked.

If I keep the skinned form invisible, everything goes well.

Any idea?  :Confused: 

Many thanks,
C!

----------


## Wokawidget

Hmmm...Interesting... :Confused: 

Will have a look at that.

Woka

----------


## Wokawidget

> Hey Woka, do you have individule DLs for each component project? Say if I just wanted the XP Button
> project would you have a link for it somewhere?


Yea...just to clarify, they are all seperate projects, and thus seperate DLLs/OCXs.
They are just all zipped up in one folder for ease of downloading.
Or did you mean have a seperate thread on VBF for each project?

Woka

----------


## Wokawidget

> It seems that when I have a visible skinned form, the MSN stype popups can't be correctly clicked (they are clickable and sticky) and they will not automatically close after being clicked.
> 
> If I keep the skinned form invisible, everything goes well.


I couldn't replicate this  :Frown: 
Did you find the problem?

WOka

----------


## sciguyryan

Brillaint work, I love these and even better now they are seperated!

Cheers and thanks for this great component set!

Cheers,

RyanJ

----------


## _Ci_

> I couldn't replicate this 
> Did you find the problem?
> 
> WOka


No, I don't!

Honestly it does not happen all the time, sometimes when you click on the popup link it works, sometimes it doesn't (but if you just keep clicking it might work).

Cheers,
_Ci_

----------


## coniam22

Hi, I was wondering if there was a way to use the Live Update on an FTP server, I have tried it basically out of teh box but it trys to use html protocol. Thanks for any help that anybody can give.

-Ian

----------


## ..:RUDI:..

Sorry to drag out old thread!
I don't really get the POP3 demo! Is it now fully completed??? (The POP3 Section)

----------


## LeeT91

What do i do?
This is the error:
Private WithEvents mobjMSN          As MSNMessenger
User-Defined Type Not Defined
???

----------


## Wokawidget

U need to add the MSNMessenger.vbp to your project. U are trying to run the UI, but it has no ref as to what MSNMessenger is.
Alternatively you can compile MSNMessenger.vbp to MSNMessenger.dll, and then in your UI app click project--->references, then select MSGMessenger dll.

WOka

----------


## Malf

Great work on the XP Buttons.  :wave:  
Been waiting3yrs for that...

Have you the same for optionbutton and checkboxes?
I use them in pic mode, so they look like a button, but act like optionbutton and checkboxes, and of course doesnt show in XP style

 :LOL:   :Cry:

----------


## Wokawidget

Cheers.
It isn't 100% my code.
I took the code from a button that did way more stuff, like MAC look and feel.
I rewrote the code slightly, stripped out all the crap, like MAC look and feel  :Smilie: 

Woka

----------


## LeeT91

> U need to add the MSNMessenger.vbp to your project. U are trying to run the UI, but it has no ref as to what MSNMessenger is.
> Alternatively you can compile MSNMessenger.vbp to MSNMessenger.dll, and then in your UI app click project--->references, then select MSGMessenger dll.
> 
> WOka


Argh it doesnt matter, still doesnt work. anyway i did a full client, standalone, portable and powerful with Delphi. no DLLs, or anything and its about 300kb.
Delphi Owns VB, but i still like VB. Delphi is complicated.

----------


## Wokawidget

Well explian why it doesn't work and I may be able to help you.
U need a good understanding off how DLLs and windows work, then this becomes dead easy.

Woka

----------


## Malf

Hmm, is it possible to rip out the XP painting bit and apply to optionbutton and checkboxes?

Or, to make it so the button can stay down.  This can at least simulate a checkbox.
With some more work maintaining state even optionbuttons.
 :wave:  

Oh, I added this


VB Code:
Public Property Let Value(b As Boolean)
    If b = True Then RaiseEvent Click
End Property

----------


## Wokawidget

It did that originally, but I didn't want the code there, and it was messy, so I simply stripped it out  :Big Grin: 
U basically have to add an enum of the modes, then a public property to say what mode the button it in. then just change the draw function.

I would use:

VB Code:
Public Property Let Value(ByVal Value As Boolean)
    If Value Then 
        RaiseEvent Click
    End If
End Property

woka

----------


## Malf

> just change the draw function


You make it sound like it's easy   :Stick Out Tongue:  
I looked but duno how the code works, I dun even know XP shading works!

BTW, I found it draws in XP even on W2K!?  How come?  I thought u have to use the XP theme/colors which of course W2k doesn't have.
Anyway this becomes a small problem cuz not all my buttons are of this.  I think it'd be good to check whether XP themes were enabled or else draw in standard shape.  Even XP users sometimes turn themes off!  :Confused:

----------


## Malf

Also suggest adding to     ImageSizeConstants   lv_Full = 5
to display in full size centered.

v.small/v.large images don't scale well.

----------


## Wokawidget

It does use XP theme... :Smilie: 

It's draws the button manually using API commands...
so it will look xp on all OS's regardless of the theme used.

Woka

----------


## Malf

OK, I guess this means there's no way to switch it on/off by code for various OSs?

----------


## Wokawidget

not a chance...unless, like I said, you rewrite the Draw function  :Big Grin: 

Woka

----------


## Malf

I see.  Oh well.  I'm thinking aobut using the button state to simulate a pic checkbox.  But with timers and stuff going on I'm not sure if its a good idea.  Any ideas on potential pitfalls?

I'd like to contend that cback should writeproperty to Parent.BackColor.  vb's button also defaults to Parent.BackColor and doesn't write the value unless it changes.

I'd say the same about font, but it seems complicated and I don't know how to incorporate it.

----------


## Wokawidget

No pitfalls that I can see.

The rest of that post I didn't understasnd, sry  :Frown: 

Woka

----------


## Jack44

vbxpbuttons works great,
Question: Can I use this ocx in a shareware application.
Thanks,
Jack44

----------


## Wokawidget

yup. go for your life.
glad you like it.

Woka

----------


## myn01

hi Wokaidgets, I've tried your XP Buttons control and I liked so much.
My question is, do you think it will work on other Windows versions than XP? (98, Vista, etc)

----------


## Wokawidget

Thanks.

Not sure about 98, but Vista yes.

The XP button code was taken from someone else project on the web.
I tidied to the code up, and trimmed out all the other stuff I didn't want. So cannot take full credit for that. I thought I put a message to the persons code in my 1st link. Damn bad woka.

Woka

----------


## killl

thx 1st for your great work!

but I don't like all dll staff, so why i can't integrate "Asynchronous Web Download.vbg " into a single project?

would you like to help ?

when I put all file in that vbg into one project, IDE told me that "sckClosed " may be dim twice:

i can find both in "Socket.cls" and "clsSocket.cls"

is there any way to solve that?

thanks!





> ''The Socket state's constants as for
> ''the MS Winsock Control interface
> Public Enum StateConstants
>     sckClosed = 0
>     sckOpen
>     sckListening
>     sckConnectionPending
>     sckResolvingHost
>     sckHostResolved
> ...

----------


## wwwfk

the codes  is very well 
thank you !

----------


## Malf

> thx 1st for your great work!
> 
> but I don't like all dll staff, so why i can't integrate "Asynchronous Web Download.vbg " into a single project?
> 
> would you like to help ?
> 
> when I put all file in that vbg into one project, IDE told me that "sckClosed " may be dim twice:
> 
> i can find both in "Socket.cls" and "clsSocket.cls"
> ...


if you need to ask such a simple question and you don't have enough VB experience to be doing stuff like this.

----------


## Phoenix2003

hi
I have unloaded Wokawidgets Component Suite, and I have seen the client MSN.... I not to successful in adding AddContact function  :Cry:   it in the clien msn.
I not understend
mobjMSN.AddContact(pobjcommand as command)   :EEK!:  

'*******************************************************
Public Sub AddContact(ByRef pobjCommand As Command)
Dim strEmail        As String
Dim strDisplayName  As String
Dim lngListID       As Long
Dim lngGroupID      As Long
    strEmail = pobjCommand.Param(1)
    strDisplayName = URLDecode(pobjCommand.Param(2))
    lngListID = pobjCommand.Param(3)
    If pobjCommand.ParamCount = 4 Then
        lngGroupID = pobjCommand.Param(4)
    End If
    mstrLastAddedContactKey = mobjContacts.Add(strEmail, strDisplayName, lngGroupID, lngListID).Key
End Sub
'********************************************************
Please halp me
Sorry for My Bad English i am from Italy
Thank you for help

----------


## Wokawidget

This function should not be called by you. 
This is called when the MSN server sends a msg to the client with info of a group being added.

I don't have the code in front of me, but if I'm not mistaken if you look at the UI code for adding a group, I think it calls:

mobjGroups.AddGroup

*I think*

This function then sends a request off to the MSN servers, which in turn send a msg back, which is handled by that function you posted above.

Woka

----------


## Phoenix2003

thank you Wokawidget for answare me  :Wink:  
The function for create new Gruop is:

Private Sub CreateNewGroup()
Dim strDesc As String
    If GetDescription("New Group", "Description", strDesc) Then
        mobjMSN.Groups.Add strDesc
    End If
End Sub

This Function WORK ok....

But for add new contact i try:

mobjMSN.AddContact (pobjCommand As Command)

This ---> pobjCommand As Command ----> I not understend  :Frown: 

This is Funciont for addcontats
Public Sub AddContact(ByRef pobjCommand As Command)
Dim strEmail As String
Dim strDisplayName As String
Dim lngListID As Long
Dim lngGroupID As Long
strEmail = pobjCommand.Param(1)
strDisplayName = URLDecode(pobjCommand.Param(2))
lngListID = pobjCommand.Param(3)
If pobjCommand.ParamCount = 4 Then
lngGroupID = pobjCommand.Param(4)
End If
mstrLastAddedContactKey = mobjContacts.Add(strEmail, strDisplayName, lngGroupID, lngListID).Key
End Sub

i not undertend for add new contact  :Frown: .....

Thank you for help
and sorry for my Bad english...

----------


## Wokawidget

Like I said, that AddContact function is for use with data returned from MSN server, and not for you as a UI developer to call.

In fact, checking over ym code, I have not coded in the functionality to add contacts  :Big Grin:  haha. I am a muppet.


Woka

----------


## Wokawidget

i think the function you need to add to the contacts class would be something like:
[vbcode]
public sub AddNewContact(ByVal emailAddress As string)
   BadgerMessenger.Connection.SendCommand "ADC", "FL", "N=" & emailAddress, "F=" & emailAddress
End sub
[/vbcode]
Then from your UI you would do:

[vbcode]
mobjBadgerMessenger.Contacts.AddNewContact("Woof@bones.com")
[/vbcode]
I haven't tested this as my VB6 box no longer had interweb access, but I think that's right.

Steve

----------


## Phoenix2003

hi woka
thank you for answare me

exist:

mobjMSN.Contacts.Count
                         .Item
                         .MSNMessenger
                         .NewEnum

mobjMSN.Contacts.Add not exist in list

but if i write mobjMSN.Contacts.Add(...................
show
mobjMSN.Contacts.Add(ByVal pstEmail As String, ByVal pstrNickname As String, ByVal plngGroupID As Long, ByVal plngListID As Long) as contact

 :Cry:  

i try your code....

thank you for answare me
and sorry for my bad english
.........

----------


## Phoenix2003

ok my friend I have resolved with

[vbcode]
Public Sub AddNewContact(ByVal emailAddress As String)
mobjConn.SendCommand "ADC", "FL", "N=" & emailAddress, "F=" & emailAddress
End Sub
[/vbcode]
thank you very match

for view new contact add in my list
I disconnect and connects

----------


## Wokawidget

Sorry, I don't understand that bit.
You mean to see the new contact in the list you have to disconnect and then reconnect again?

WOka

----------


## Phoenix2003

yes  :Blush:  my friend

----------


## Phoenix2003

My Friend this command is ok for Adding a contact in list

public sub AddNewContact(ByVal emailAddress As string)
BadgerMessenger.Connection.SendCommand "ADC", "FL", "N=" & emailAddress, "F=" & emailAddress
End sub

but for delete contact what is the command?   :Confused: 

do I think that not all the contacts I can be cancelled because it depends if the other contact has made the same thing, is true??

thank you for you help
and sorry for my bad english.....

----------


## Wokawidget

```
public sub RemoveContact(ByVal emailAddress As string)
BadgerMessenger.Connection.SendCommand "REM", "FL", emailAddress
End sub
```

However, I never wrote the full code to handle this  :Big Grin: 
This was never meant to be a full complete project.

You need to look at the class BadgerMessenger, and the function HandleCommand.
In there you will see a large Select Case statement and near the bottom there is:

Case "REM"

Ignore the comments under here, they are wrong.
When the case is "REM" this means the svr send a msg to you that the removal of the contact was ok.
You will need to add code here to remove the contact from the contacts list.

I think it's pobjCommand.Param(3) that contains the email of the contact removed.

WOka

----------


## Phoenix2003

Thank you my Friend  :Wink:  
i try this command

public sub RemoveContact(ByVal emailAddress As string)
BadgerMessenger.Connection.SendCommand "REM", "FL", emailAddress
End sub

thank you  :Blush:

----------


## ashly

i'm using the XP Button part coding...

but it gives me an error msg while i load an image for the XPButton from ImageList during run time... 

example:
XPButton1.Picture = ImageList1.ListImages(1).Picture

any guide on this?

----------


## Wokawidget

An error msg would help  :Wink: 
but I am assuming it's because you haven't done:


```
Set XPButton1.Picture = ImageList1.ListImages(1).Picture
```

Woof

----------


## ashly

> An error msg would help 
> but I am assuming it's because you haven't done:
> 
> 
> ```
> Set XPButton1.Picture = ImageList1.ListImages(1).Picture
> ```
> 
> Woof


I tried adding the "Set" commad and it works... thanks  :Big Grin:  

May I know the reason why the "Set" command is needed also?  :Confused:

----------


## Wokawidget

Beacuse thats what you use in VB when setting an object. 
Basic VB knowledge and coding here.

Woka

----------


## ashly

> Beacuse thats what you use in VB when setting an object. 
> Basic VB knowledge and coding here.
> 
> Woka


oh i see... 

thanks for the lesson  :Wink:

----------


## PMad

Im trying to load up the msn messenger client, and im getting all kinds of errors!

All of the references to the class modules in vbMSNMessenger dont work, so i put "vbMSNMessenger." without the quotes in front of it, and it passes those errors up, but now im getting errors on 'vbMSNStatusConstants'... How do i fix that one? I dont know where thats at?

----------


## Wokawidget

The errors are simply down to yourself not really knowing what you're doing when dealing with multi layers apps, that reference each other, in Visual Studio.

Delete all the stuff you've done.
Re-unzip the Messenger zip file.
Then load the VPG file.

Woka

----------


## Wokawidget

how many projects have you got open in VB? 1? The main MSN client I bet.
Have you compiled the other 3-4 or so projects that the client uses? I bet not.
If yes, then have you added a new referenc eto the compiled dll, and REMOVED the old project reference.

Woka

----------


## PMad

> The errors are simply down to yourself not really knowing what you're doing when dealing with multi layers apps, that reference each other, in Visual Studio.
> 
> Delete all the stuff you've done.
> Re-unzip the Messenger zip file.
> Then load the VPG file.
> 
> Woka



You are absolutely correct!  Ive never dealt with multi layered apps, never even seen one until now.

Ive fixed all the other issues except that one, i referenced all the others by putting in the project its using, but this one doesnt have one, so im kinda lost, is there a post # in here, or a thread you know of i could look at that could explain more on this so i can learn more about this, and get the MSN app working?




> how many projects have you got open in VB? 1? The main MSN client I bet.
> Have you compiled the other 3-4 or so projects that the client uses? I bet not.
> If yes, then have you added a new referenc eto the compiled dll, and REMOVED the old project reference.
> 
> Woka


i started with a new instance of VB6, and loaded the MSN Messenger Client.vpg file, but received error upon error, all the same thing, its all references.. As ive said, i fixed all of them except the ones that reference something outside of a class or layered project already within the group.

----------


## Wokawidget

can u post a screen shot of the error msg...and a screen shot of the references in the project when the error occurs.

Cheers,

Woka

----------


## ashly

I have some question regarding the XP button...

I don't know what is the reason:

After I make the project group, I getting some error msg like "version 15.0 of ... \vbXPButton.ocx is not registered. The control will be upgraded to version 17.0".

Althought I clicked OK, it still show me the same error msg next time when I open the project group

Beside this, I'm using vbXPButton.ocx at another project, when I press F5 to run the project, I goes to IE with address "C:\Program Files\Microsoft Visual Studio\VB9\XPButton.html"... I have no idea on how to solve this...

Any help please?

Thanks

----------


## Wokawidget

VB9?

VB6 = VS 6
VB7 = VS 2001
VB8 = VS 2003
VB9 = VS 2005

I think :s

From that I am assuming that you are using a control built in VB6 in VS 2005?
I am afraid I have never tested this, and I have no idea at all why F5 is redirecting you to vbXPButton.html...that's nothing to do with the code I wrote. Are you trying to use this in a web project at all????

Woka

----------


## ashly

> VB9?
> 
> VB6 = VS 6
> VB7 = VS 2001
> VB8 = VS 2003
> VB9 = VS 2005
> 
> I think :s
> 
> ...


I'm using it in VB6.

umm... is it I just use the vbXPButton.ocx, then add it in under Project -> References?

or I need to create a vbg?

----------


## techgnome

Check to make sure that your app is set as the startup... and not the control's project... 

-tg

----------


## Wokawidget

Open up vbXPButton.vbp in VB6. Click build/compile.
Then open your blank project and go to Components and browse to the newly compiled OCX.

Regarding having a previous app using it and getting it to use the newly compiled version, without needing to recompile your app, you need to set binay compatibility on the build options for vbXPButton.vbp and point it at the old OCX. This keeps means the registered OCS keeps the same GUID.


Woka

----------


## ashly

> Open up vbXPButton.vbp in VB6. Click build/compile.
> Then open your blank project and go to Components and browse to the newly compiled OCX.
> 
> Regarding having a previous app using it and getting it to use the newly compiled version, without needing to recompile your app, you need to set binay compatibility on the build options for vbXPButton.vbp and point it at the old OCX. This keeps means the registered OCS keeps the same GUID.
> 
> 
> Woka


OK, let's said I compiled the ocx, then I put it inside "C:\Testing" folder, this folder will have my vb project files as well.

Then I go to Components and browse to the OCX. Click apply & ok button.

But when I move the whole folder "C:\Testing" to "D:\Testing", then I open the vb project again, the refering ocx file location changed  :Confused:  

sorry... can explain to me what are the differences  between binay compatibility & project compatibility?  :Blush:

----------


## Wokawidget

Errrr....well the OCX gets registered in the registry with C:\Testing\vbXPButton.ocx

Open up regedit and do a search for this.

So when you move your folder and then run the exe it's going to check the registry and then look for the folder c:\Testing...which you have removed.

Copying the folder is essentially as doing an app deployment manually...so you would also need to call RegSvr32 to register the OCX. Open a CMD prompt and type:

RegSvr32 "D:\testing\vbXPButton.ocx"

But this is a VERY bad idea. If you indend to move things around, or put them on a different machine then you really should use an installer for this as that's what they are designed for...copying the files, and then registering the ocx's and dlls.

VB6 ships with the Package and Deployment wizard for this.

Woka

----------


## Wokawidget

Just because a DLL or OCS has the same name, woof.dll, doesn't means it's the same thing, and each time you build it a new GUID is assigned to it for the registry.
If you compile the OCX into a folder ..\BinCompat\vbXPButton.ocx and use this as the "base" ocx, and then set this OCX for binary compatibility, and then compile the OCX to a diff folder ..\ReleaseOCX\ then this one will be used by your PC, but when compiling it looks at ..\BinCompat\vbXPButton.ocx and uses the same GUID...so you can keep compiling the OCX and your EXE file will still run as the GUID stays the same in the registry.

Woka

----------


## Wokawidget

Here's some links on the compatibility subject:

http://support.microsoft.com/kb/161137
http://www.visibleprogress.com/vb_bi...patibility.htm

Hope this helps.

WOka

----------


## techgnome

In my sig there's a short walkthrough on setting & using the compatibility, along with a brief description on why it works the way itdoes.

-tg

----------


## dee-u

Hey Woka, the menu for your vbSysTray does not support sub-menus?  :Frown:

----------


## Wokawidget

That's right. I don't think I added that functionality in.

Woka

----------


## dee-u

> That's right. I don't think I added that functionality in.
> 
> Woka


Will you have time to add such functionality then?  :Smilie:

----------


## Wokawidget

Hi,

Sorry, I have no intention of modifying any of my VB6 code in the near future I am afraid. Very busy.
I have supplied the source so I don't have to do things like this, which gives other developers free reign to add functionality of their choice. Why don't you code the functionality?

Woka

----------


## jonathana91

Newb
im trying to copy it to my project,but i need to add something... like a reference?
how do i copy the buttons? what do i need to do?

----------


## Wokawidget

That makes no sense  :Smilie: 
Can you explain in more detail.

Cheers,

Woof

----------


## jonathana91

i want to use the winXP buttons on your Zip file..
how do i do it?

----------

