• Welcome to Valhalla Legends Archive.
 

Stay on Top

Started by Networks, April 09, 2004, 02:12 PM

Previous topic - Next topic

Tuberload

Why re-invent the wheel? Give credit where it is due, and move on.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Fr0z3N

I didn't write it, I got it off pscode.

Dyndrilliac

Code doesn't work, gives a Type Mismatch RunTime error for me.
Quote from: Edsger W. DijkstraIt is practically impossible to teach good programming to students that have had a prior exposure to BASIC; as potential programmers they are mentally mutilated beyond hope of regeneration.

Networks


'**************************************
'Windows API/Global Declarations for
'Always On Top
'**************************************

Declare Function SetWindowPos Lib "user32" _
   (ByVal hwnd As Long, _
   ByVal hWndInsertAfter As Long, _
   ByVal X As Long, _
   ByVal Y As Long, _
   ByVal cx As Long, _
   ByVal cy As Long, _
   ByVal wFlags As Long) As Long

Public Sub AlwaysOnTop(myfrm As Form, SetOnTop As Boolean)


   If SetOnTop Then
       lFlag = HWND_TOPMOST
   Else
       lFlag = HWND_NOTOPMOST
   End If
   SetWindowPos myfrm.hwnd, lFlag, _
   myfrm.Left / Screen.TwipsPerPixelX, _
   myfrm.Top / Screen.TwipsPerPixelY, _
   myfrm.Width / Screen.TwipsPerPixelX, _
   myfrm.Height / Screen.TwipsPerPixelY, _
   SWP_NOACTIVATE Or SWP_SHOWWINDOW
End Sub
'Well, if your for example in a form cal
'    led 'Form1' then you'd simply type:
AlwaysOnTop Form1, True


SetWindowPos myfrm.hwnd, lFlag, _ had two lines underneath it making it not work this is the correct one ^

Grok

Way too much code for just TOPMOST.  Send a message instead?

Adron

Quote from: Tuberload on April 11, 2004, 02:08 PM
Why re-invent the wheel? Give credit where it is due, and move on.

I mostly give "credit" when I take code from a site and post it here. The most important reason isn't to credit them though, but in case of:

Quote from: Dyndrilliac on April 11, 2004, 10:08 PM
Code doesn't work, gives a Type Mismatch RunTime error for me.

So, that way they know that I'm not to be blamed if the code doesn't work on all computers.... :P

Tuberload

Quote from: Adron on April 12, 2004, 05:31 AM
Quote from: Tuberload on April 11, 2004, 02:08 PM
Why re-invent the wheel? Give credit where it is due, and move on.

I mostly give "credit" when I take code from a site and post it here. The most important reason isn't to credit them though, but in case of:

Quote from: Dyndrilliac on April 11, 2004, 10:08 PM
Code doesn't work, gives a Type Mismatch RunTime error for me.

So, that way they know that I'm not to be blamed if the code doesn't work on all computers.... :P

Never thought of it like that. Hey their not bugs their features, remember. ;)
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Adron

Quote from: Tuberload on April 12, 2004, 09:43 AM
Quote from: Adron on April 12, 2004, 05:31 AM
So, that way they know that I'm not to be blamed if the code doesn't work on all computers.... :P

Never thought of it like that. Hey their not bugs their features, remember. ;)

Perhaps it's a difference in attitude...

I like my code. It's mostly just the way I want it, and it's good. I wouldn't want to take someone else's code and put my name on it, because then their lousy code could put a smear on my name.

And yes, sometimes my code has more features than I intended, but it's my code, and I'm proud of it! :P

Tuberload

Quote from: Adron on April 12, 2004, 10:36 AM
Quote from: Tuberload on April 12, 2004, 09:43 AM
Quote from: Adron on April 12, 2004, 05:31 AM
So, that way they know that I'm not to be blamed if the code doesn't work on all computers.... :P

Never thought of it like that. Hey their not bugs their features, remember. ;)

Perhaps it's a difference in attitude...

I like my code. It's mostly just the way I want it, and it's good. I wouldn't want to take someone else's code and put my name on it, because then their lousy code could put a smear on my name.

And yes, sometimes my code has more features than I intended, but it's my code, and I'm proud of it! :P

I have my own style, well an adopted style anyways. I never directly use anyone's code, if I do I re-write it to satisfy my needs, and then give credit to the original author.

It's definitely my code, but I wouldn't go as far as to say it's any good. :) I'll leave that one up to the critics. Kp does an excellent job of pointing out improvements for me.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Grok

I use other people's code "snippets" all the time without giving credit, if it's something I could've done just by sitting down and doing it.  If it's something that took a significant investment in time or skill, then I'll give credit in my source code.

If I purchase license to use code in libraries (such as ActiveX controls), or in source form, I never give credit and don't feel any is due.

Tuberload

#25
Quote from: Grok on April 12, 2004, 03:32 PM
I use other people's code "snippets" all the time without giving credit, if it's something I could've done just by sitting down and doing it.  If it's something that took a significant investment in time or skill, then I'll give credit in my source code.

If I purchase license to use code in libraries (such as ActiveX controls), or in source form, I never give credit and don't feel any is due.

I think that's a very good point. Simple code snippets, as you pointed out, are not original in my opinion so why give credit. I think it is the design and logic behind certain pieces of code that deserves credit.

[Edit: grammar]
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Adron

Quote from: Tuberload on April 12, 2004, 04:45 PM
I think that's a very good point. Simple code snippets, as you pointed out, are not original in my opinion so why give credit. I think it is the design and logic behind certain pieces of code that deserves credit.

[Edit: grammar]

Bugs is what might make them unique and original... :P

Tuberload

Quote from: Adron on April 12, 2004, 06:58 PM
Quote from: Tuberload on April 12, 2004, 04:45 PM
I think that's a very good point. Simple code snippets, as you pointed out, are not original in my opinion so why give credit. I think it is the design and logic behind certain pieces of code that deserves credit.

[Edit: grammar]

Bugs is what might make them unique and original... :P

Then I will fix them, and notify the original author. From that point on he will have to give me credit. :)
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Networks

If anyone cares um.. The code fr0z3n provided didn't work any other help?

Tuberload

Quote from: Networks on April 12, 2004, 07:33 PM
If anyone cares um.. The code fr0z3n provided didn't work any other help?

http://forum.valhallalegends.com/phpbbs/index.php?board=2;action=display;threadid=6269

This thread might be able to help you find what you are looking for.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

|