Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - [SOLVED] Multiple Custom Context menus
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] Multiple Custom Context menus

 Post Reply Post Reply
Author
Message
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Multiple Custom Context menus
    Posted: 23 February 2009 at 7:25pm
Now that I have figured out to have a custom context menu appear in the web browser control, I also need to know how to have multiple custom context menus particulary one for text, links(urls), Images and what- not. Can anyone help me out a bit on this? maybe a code snippet or a sample? or maybe a workaround of some sort? please help!
Thanks in advance.
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 24 February 2009 at 12:30am
Hi Rey,
 
What do you mean by: "multiple custom context menus particulary one for text, links(urls), Images and what- not"
 
Even better to upload test project with info what you desire
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 24 February 2009 at 1:53am
Hey Aaron, Thanks for posting.
I'm not sure if I can upload a test project, simply because I cant access the multiple menus.
But I do have some screenshots.
These are taken from Firefox, on this page:

Normal:


Selected Text:


Active Link:


Well, When I figured out how to make my own custom menu using the MSHTML library. But it made it where you only had one menu for all.  I need separates just like shown.




Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 25 February 2009 at 3:12am
Hi Rey,
 
Creating context menu with Commandbars isn't that difficult but what you want is more to it than just catching right click event and display context menu. You have to know what you clicked: text, icon, hyperlink etc etc... I don't know anything about a webbrower control and how you would accomplish this. I believe you have to ask some webbrowser guru
 
I wish you luck.
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 25 February 2009 at 11:41pm
Yeah I aprecciate the help though Aaron, And I have yet to figure this one one. but thanks.
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 27 February 2009 at 1:51am
Well, is there anyone else here who might have an idea of how I can achieve this?
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 4:50am
Hi,
 
As I said before, I don't know anything about WebBrowser control. But reading another post about WebBrowser I created a sample (most of credits (about 95%) will go to Dentor )
 
 
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 5:15am
Aaron!!!! THANK YOU SO MUCH!!! 

That's the sample I need. But one last VERY IMPORTANT QUESTION So please try to answer.

What is the rest of the strings of the elements?
Please if you or someone else knows please tell me! 
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 5:25am
Hi,
 
Just Google it
 
 
 
I don't know if there are more...
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 5:33am
Well My friend, in the sample, is says both textboxes, and buttons are both INPUT, how can I get a way to differ the 2?
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
dentor View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2005
Location: France
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote dentor Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 5:39am
Good Job Aaron,
 
Shipwreck, if you want to get the href of the object clicked, you cant get it with .href property of Elem.
 
For Example:
 
Case "A"
   Set Popup = CommandBars.Add("PopupGroup", xtpBarPopup)
   Set Control = Popup.Controls.Add(xtpControlLabel, 1000, "URL's...")
   Set Control = Popup.Controls.Add(xtpControlButton, 1001, "Open")
   Set Control = Popup.Controls.Add(xtpControlButton, 1002, "Open in new tab")
   MsgBox "You clicked " & .href
   Popup.ShowPopup
 
 
 
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 5:51am
That's great information Dentor, Really, it is. But maybe you didn't understand my question.

Say I use this code:
                        Case "INPUT"
                    Set Popup = CommandBars.Add("PopupGroup", xtpBarPopup)
                    Set Control = Popup.Controls.Add(xtpControlLabel, 1000, "Blah")
                        Set Control = Popup.Controls.Add(xtpControlButton, 1001, "cut")
                        Set Control = Popup.Controls.Add(xtpControlButton, 1002, "copy")
                    Popup.ShowPopup


Alright, thats the right click menu  (Context menu)  Which should appear on textboxes. but it also appears on buttons like "Search" on the google.com page.
How can I have to either say something different when you right click the button, or change it to work better? Please help!
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
dentor View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2005
Location: France
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote dentor Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 6:04am
You can make a select case of .Type property:
 
Case "INPUT"
 
  Select case .Type
      case "Text": ' *** Input Field
      case "Submit": ' *** Submit Button
      case "Reset": ' *** Reset Button
      case "Radio": ' *** Radio Button
      case "Checkbox": ' *** Check Box
 
' *** and so on.
 
 
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 6:16am
Alright Dentor, How do I implement that into the code I have now? The sample is provided in a post above. Can you give me a sample or a more detailed post as to how to do this correctly, because I cant get it to display anything. with the added code. :(
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 6:20am
Originally posted by shipwreck shipwreck wrote:

Well My friend, in the sample, is says both textboxes, and buttons are both INPUT, how can I get a way to differ the 2?
 
Hi Rey,
 
I don't know what you mean? Can you explain a bit more what you are trying to accomplish?
 
I see you already have found a WebBrowser guru hehehe
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 6:23am
Well Aaron, the sample you provided finally enabled me to have multiple contextmenus and be able to align them to the proper element.
Well I aligned one to the element "INPUT" for textboxes. Well, google considers Buttons as INPUT also. so I was trying to figure out how to make the input context menu differ from text and button and such. 
Get what I'm saying?
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 6:26am
Or if I cant change them entirely, make it where items such as Cut copy and paste is disabled on a input button and such.
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 6:42am
Hi Rey,
 
I tried this and seems to work:
 
Case "A"
                    .......
 
Case "IMG"
                    ......
 
Case "INPUT"
                    Select Case .Type
                        Case "text": ' *** Input Field
                            Set Popup = CommandBars.Add("PopupGroup", xtpBarPopup)
                                Set Control = Popup.Controls.Add(xtpControlLabel, 1000, UCase$(.tagName))
                                Set Control = Popup.Controls.Add(xtpControlButton, 1001, "Copy")
                                Set Control = Popup.Controls.Add(xtpControlButton, 1002, "Paste")
                                Popup.ShowPopup
                   
                        Case "submit": ' *** Submit Button
                                Set Popup = CommandBars.Add("PopupGroup", xtpBarPopup)
                                Set Control = Popup.Controls.Add(xtpControlLabel, 1000, UCase$(.tagName))
                                Set Control = Popup.Controls.Add(xtpControlButton, 1001, .Type)
                                Popup.ShowPopup
                    End Select
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 6:50am
WORKED! Thank you Aaron. That pretty well solves this post, but one last question..
Is there a web page or can you give me a list of the elements and attributes of the html document?


P.S. BTW, I have another question that was never solved. But, you know how websites have their logo in that "Favicon" thing-  Commonly displayed in the address bar? Well, How can I have a control maybe a combobox display that? Please try to help me out a bit on this one also friends!

And remember, if you don't mind, give me your First and last names along with Email, so that I may be able to put you into the credits of my application.
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
dentor View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2005
Location: France
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote dentor Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 7:42am
Out to lunch and the problem is solved,
 
Good Job, Gentlemen
 
For the last question, the Favicon image is generally a file named 'favicon.ico' at the root of the web site.
You can test to fetch this file and show it if exist.
For this Forum, the link : https://forum.codejock.com/favicon.ico, show  this icon: 
 
Sometimes, you get in the html file, a line similar to:
 
<LINK REL="SHORTCUT ICON" HREF="http://www.dentor.fr/favicon.ico">
 
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 7:46am
Alright Dentor, thanks for the info, but I know how to retrieve the icon itself. But how do I Link it to a combobox or maybe use it as a form's icon. and to have it auto change to the active document's favicon?
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
dentor View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2005
Location: France
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote dentor Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 7:55am
For the list of the elements and attributes of the html document, Aaron give a good web page link:
http://www.web-source.net/html_codes_chart.htm, where you could find the HTML Tags Chart
 
with the tag and sometimes the type (if any) in the code examples column.
 
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 8:15am
Yes, I'll be sure to BookMark that page.
But, have you, Aaron, or anyone else figured out how to
Link an favicon from a site to a combobox or maybe use it as a form's icon. and to have it auto change to the active document's favicon?
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
dentor View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2005
Location: France
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote dentor Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 8:50am
Hello Shipwreck,
 
You'll find below a sample to load the favicon web site.
The sample try to load the Favicon and put it as the Form's icon.
It works with not true color icon (<=256 colors), for true color icon you may have to change the format.
It depends to where you want to place that icon.
 
You also have to cut the link of the page to the root of the website:
 
 
Here's the sample:
 
 
Good Luck.
 
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 9:05am
Yeah, that's a great way to get the favicon. problem is,  most sites favicon is at least 32bit :(
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
dentor View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2005
Location: France
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote dentor Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 9:21am
Hello Shipwreck,
 
Somes modifications for the sample:
  1. IsoleRoot sub to automatically get the root web name from the link,
  2. Use internet cache to load the icon for quicker loading or reloading.
 
I think the 32 bits icons won't be a problem to put them in a combo box.
 
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 9:55am
Back to the web browser control.
Now that I have multiple Context Menus, I was wondering
How can I get selected text? like in a textbox.
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
dentor View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2005
Location: France
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote dentor Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 10:51am
A sample to show how you can handle selection of text in Web browser control:
 
 
The program can be extended to better handle image selection.
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 11:45am
Thank you for the source Dentor, yet another great addition you have helped me with. I truly appreciate this. I want to put you in Credits man, Mind if I can have your full name, with your email address?
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2009 at 11:47am
Also Dentor, I'm working on a download manager also.
Got any idea how I can link it to my browser? You know, when some downloads a file it uses my manager rather than the default IE Download window.
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 02 March 2009 at 3:30am
Oh yeah, that sample. With the cut copy and paste. I need it to be able to know the difference between static text and what not.  and how disable and enable the commands accordinglly.
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
dentor View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2005
Location: France
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote dentor Quote  Post ReplyReply Direct Link To This Post Posted: 02 March 2009 at 9:05am
Hello Shipwreck,
 
I try to make a little sample to show how you can enable or not the Copy/Paste Buttons:
 
Two booleans CopyOk and PasteOk, put the enable property or not to the Copy/Paste Buttons.
 
You can Copy if some text is selected in the Web Browser.
 
You can Paste if you've got some text in the Clipboard and the TagName of the object clicked is : Textarea, Input (with Type = text, password).
Hoping, I haven't forget some Type.
 
 
 
 
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0 SP 6
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 03 March 2009 at 6:39am
Dentor, Your sample works, thank you for the code. I've searched for 3 months as how to do this, and I owe it all to you and Aaron. I'll be sure to include you both in the credits of my web browser. thank you. But while I'm at it, Could you tell me how I could load the favicon into the combobox as mentioned before?
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 03 March 2009 at 7:34am
Hi Rey,
 
Adding icons to a combobox (I'm not sure CJ combo can...) or commandbars dropdown list (this will work) isn't a problem. You will have icons on your computer with the code of @Dentor. 
 
Question: How do you save the links a user added to "Favorites"?
 
If these links are loaded during runtime (let's say into a combobox) and you want the icons in combo as well, you would have to download the icon (with @Dentor code or maybe your own...) and add it to that link at runtime... I don't know if this is what you want? I think it will take some time to "download" the images.
 
Other approach would be: Everytime you add a link (and "download" website image) this image and link (would be an ID that will be used for the image that you "downloaded" with the link) But this should be "saved" as for later use.
 
btw did you receive my email?
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 03 March 2009 at 9:06am
Hello Aaron, Sorry you haven't seen me online, as I don't use that MSN ID no more.
Please add these two IDs:
shipwrecked.software@live.com
deversole08@live.com
Talk to you soon.
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 03 March 2009 at 10:49am
Originally posted by Aaron Aaron wrote:

 
Question: How do you save the links a user added to "Favorites"?


Not sure if you are talking about CJ Commandbars, but the ToolTipContext sample shows how to read current IE favorites and add them to your own CJ Commandbars.


Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2009 at 8:51am
I got to bring this one back alive. lol.
Anyways, I got a Very Important question!
Dentor (Or anyone who knows how.)
when you showed me how to have multiple custom context menus, I made one for links.
It contains:
•Open
•Open in new tab.

How can I get the active link selected once I right click it? Please help.
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2009 at 10:41am
Come on people, desperate need of this!
Please help out. :p
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2009 at 11:04am
Hi Ray
 
Use .href inside:
 
With Elem
        If Doc.parentWindow.event.button = 2 Then
            Dim msg As String
            Select Case UCase$(.tagName)
               
                Case "A"
                    Set Popup = CommandBars.Add("PopupGroup", xtpBarPopup)
                    Set Control = Popup.Controls.Add(xtpControlLabel, 1000, "URL's...")
                        Set Control = Popup.Controls.Add(xtpControlButton, 1001, "Open")
                        Set Control = Popup.Controls.Add(xtpControlButton, 1002, "Open in new tab")
                        Set Control = Popup.Controls.Add(xtpControlButton, 1003, .href)
 
                        rightClickedURL = .href 'or something like that...
 
 
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2009 at 11:09am
Aaron, this is interesting but maybe your not understanding me.
Say you want to right click a link. When the menu comes up, you click "Open"
I need to be able to make the web browser navigate to the link that right clicked.
If that helps any.
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
dentor View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2005
Location: France
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote dentor Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2009 at 11:20am
Perhaps, you mean :
 
WB.Navigate .href
 
To make the Web Browser show the new web page ?
 
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0 SP 6
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2009 at 11:32am
Hi Ray,
 
I know what you mean. I said:
 
add:
 
  • global variable rightClickedURL 
 
add:
  • rightClickedURL = .href in (see previous post)
 
add Commandbars Execute event like this:
 
Private Sub CommandBars_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl)
    Select Case Control.id
        Case 1002 'this is ID of Open in another Tab in my sample project
            WB.navigate rightClickedURL 'this will navigate the right clicked URL
    End Select
End Sub
 
 
Ready..........
 
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2009 at 5:00pm
Alright, so I Dim as, or boolean, or what?
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2009 at 5:04pm
Maybe you can also upload a Sample Aaron, I would appreciate it. But, I will be sure to check back in about an Hour, I got a birthday party to go to. lol.
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2009 at 5:54pm
Hi Ray
 
Here is sample. I could not upload zip file so here's code:
 

Private WithEvents Doc As HTMLDocument
Dim rightClickedURL As Variant
Private Sub CommandBars_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl)
    Select Case Control.id
        Case 1001
            WB.navigate rightClickedURL
            rightClickedURL = ""
    End Select
End Sub
Private Sub Form_Load()
    WB.WebBrowserContextMenu = False
    WB.navigate "https://forum.codejock.com/forum_posts.asp?TID=13523"
End Sub
Private Sub Form_Resize()
    WB.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
End Sub
Private Sub WB_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    Set Doc = WB.document
End Sub
Private Sub Doc_onmousedown()
On Error Resume Next
    Dim Popup As CommandBar
    Dim Control As CommandBarControl
    Dim Controlpopup As CommandBarPopup
    Dim Controlbtn As CommandBarButton
    Dim Elem As IHTMLElement
    Set Elem = Doc.parentWindow.event.srcElement
    With Elem
        If Doc.parentWindow.event.button = 2 Then
            Dim msg As String
            Select Case UCase$(.tagName)
                Case "A"
                    Set Popup = CommandBars.Add("PopupGroup", xtpBarPopup)
                    Set Control = Popup.Controls.Add(xtpControlLabel, 1000, "URL's...")
                        Set Control = Popup.Controls.Add(xtpControlButton, 1001, "Open [" & .href & "]")
                        rightClickedURL = .href
                    Popup.ShowPopup
          End Select
      End If
  End With
End Sub
 
 
 
 
 
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2009 at 10:44pm
Alright, I get it now.
Works Great, in all functions used within.
Thanks, I appreciate it.
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2009 at 2:47am
Hi Ray,
 
Maybe you can use .Parameter property of Commandbar button (Parameter property accepts Strings)
 
Case "A"
    Set Popup = CommandBars.Add("PopupGroup", xtpBarPopup)
    Set Control = Popup.Controls.Add(xtpControlLabel, 1000, "URL's...")
    Set Control = Popup.Controls.Add(xtpControlButton, 1001, "Open [" & .href & "]")
          Control.Parameter = .href
    rightClickedURL = .href
    Popup.ShowPopup
 
And in Execute event change:
 
WB.Navigate rightClickURL
 
TO:
 
WB.Navigate Control.Parameter
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.250 seconds.