OLE,response,yesterdays,submission,timer,SetR
Quick Search for:  in language:    
OLE,response,yesterdays,submission,timer,SetR
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
RentACoder Stats

 Code:  lines
 Jobs: 0 postings

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for RentACoder.
Wrapping Scrolling Text
By Paranoid_Androi d on 7/2


Create A Dummy File
By AML on 7/2


Click here to see a screenshot of this code!Captionbar manipulation!
By Peter Hebels on 7/2

(Screen Shot)

A Game Of War
By Co0nest on 7/2


Click here to see a screenshot of this code!KeyGen Example
By Bengie|NET on 7/2

(Screen Shot)

Click here to see a screenshot of this code!OpenBrowser v1.9
By Orlando Jerez on 7/2

(Screen Shot)

SendMessageBySt ring() Example
By Jaime Muscatelli on 7/2


Click here to see a screenshot of this code!FirstSunday
By Jan Paul Penning on 7/2

(Screen Shot)

Click here to see a screenshot of this code!Ikonz v1.0
By Gaurav Creations on 7/2

(Screen Shot)

Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Hyperlink Sample (one API function used:-)

Print
Email
 
winzip icon
Submitted on: 2/7/2002 6:10:05 AM
By: Vlad Vissoultchev 
Level: Intermediate
User Rating: By 79 Users
Compatibility:

Users have accessed this code 4921 times.
 
(About the author)
 
     This is in response to a yesterday's submission. No timer. No Set/Release capture (almost). The trick is that windowless controls ARE capturing mouse events upon mousedown BY DESIGN. So every label, image, or custom windowless control has the capture ability build-in. Thank you VB, I just figured out how to use this. Purely as an excercise you can encapsulate this code in a windowless usercontrol. Anyway, this implementation has at least two flaws. Can you find them? :-)) UPDATED: By popular demand now supports right click context menu, OLE drag&drop; (good enough), "hand" mouse cursor (with shadow on win2k!), WM_CANCELMODE (pretty decently). More API's used but still under 160 lines of code. 10x for the votes

 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!

    //**************************************
    //     
    //Windows API/Global Declarations for :H
    //     yperlink Sample (one API function used:-
    //     )
    //**************************************
    //     
    Private Declare Sub mouse_event Lib "user32"( _
    ByVal dwFlags As Long, ByVal dx As Long, _
    ByVal dy As Long, ByVal cButtons As Long, _
    ByVal dwExtraInfo As Long)
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzipto decompress it.

Virus note:All files are scanned once-a-day by Planet Source Code for viruses,but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:
1)Re-scan downloaded files using your personal virus checker before using it.
2)NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for langauges that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 3 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
2/7/2002 9:02:25 AM:Niknak!!
There's me sitting there wondering how 
you got 4 excellent votes for this, the 
link only does one thing doesnt it 
hmm??  maybe you want to change it from 
"http://www.planet-source-code.com" to 
vote for my code!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/7/2002 5:35:27 PM:Vlad Vissoultchev
:-))) yeah, you are right. "users can't 
read! -- joel spolsky"... sure, you 
don't think this will get to be the 
code of the month!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/8/2002 10:07:34 AM:LCensoni
Alright, i'm giving up... what are the 
flaws? :)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/11/2002 1:27:02 PM:Gary Choma
Actually, I found 3 flaws:
1. Mouse 
cursor should change to a hand when 
cursor is over the link.
2. 
Right-clicking on the link should not 
activate it.
3. On mouse-down, hold 
it and drag off the link, underline 
goes away, but link stays red until you 
let the mouse button up.
I have a 
cursor (.cur) file that I can send to 
anyone interested in fixing problem #1. 
 You just set the MouseIcon property of 
the label control to that file.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/11/2002 1:45:26 PM:Gary Choma
Replace similar call in project with 
this one to fix problem 
#3:
Label1.ForeColor = 
IIf(m_bPressed And m_bOver, vbRed, 
IIf(m_bOver, vbBlue, vbButtonText))
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/11/2002 1:46:52 PM:Gary Choma
Here's 2 modified procedures to fix 
problem #2:
Private Sub 
Label1_MouseDown(Button As Integer, 
Shift As Integer, X As Single, Y As 
Single)
    If Button = 1 Then
 If m_bEatMouseEvent Then
m_bEatMouseEvent = False
Exit Sub
        End If
        '--- 
press the link
        ChangeLinkState 
m_bOver, True
    End If
End 
Sub
Private Sub 
Label1_MouseUp(Button As Integer, Shift 
As Integer, X As Single, Y As Single)
   '--- eat mouse event if signalled
  If m_bEatMouseEvent Then
m_bEatMouseEvent = False
        Exit 
Sub
    End If
    '--- fire click if 
mouse released over the link
    If 
Button = 1 Then
        If m_bOver 
Then
            FireClick
End If
        '--- change link 
color
        ChangeLinkState False, 
False
    End If
End Sub
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/11/2002 1:47:02 PM:Vlad Vissoultchev
1. Well i have this .cur file too. 
(Though it does not have shadow on 
win2k, what about yours?:-))
2. 
Yeah, probably. Should change a line to 
fix this :-)) Line 81 should be "If 
Button = vbLeftButton Then 
FireClick"
3. I thought that this 
would be more interesting. So this is 
BY DESIGN (i.e. i meant it to be like 
this). If you want the behaviour your 
describe change Line 31 to 
"Label1.ForeColor = IIf(m_bOver, 
IIf(m_bPressed, vbRed, vbBlue), 
vbButtonText)"
HTH,
</wqw>
p.s. 
What i meant as flaws was:
1. 
WM_CANCELMODE is not handled. Demo: 
press and hold the link. Press 
Ctrl+Esc. Move out ot the link. It 
stays "pressed" (red)
2. It depends 
ot mouse clicks to function. Demo: Open 
Form1. Start Notepad (restored state). 
Focus Notepad. Move mouse pointer over 
the hyperlink (so a part of it should 
be visible below the Notepad). Voilla: 
Form1 has the focus. This is because 
it's sending an extra mouse click to 
windows mouse queue :-)) this is a 
"design flaw" :-))
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/11/2002 1:51:08 PM:Gary Choma
After my enhancements, I'd give this 
code 5 globes ;)
And if you really 
want to get picky, there's no support 
for drag-and-drop of the link (like if 
you wanted to drag the link to your 
desktop as a shortcut).
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/12/2002 11:13:34 AM:Vlad Vissoultchev
check out the new updated version
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/22/2002 1:50:57 PM:vbmaster
sorry, I think this doesn't deserve to 
be code of the month :[
If code 
verification thanks to PSC for add vote 
verification :)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | RentACoder Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.