Drawing on another window or above them all

Just starting out? Need help? Post your questions and find answers here.
roachofdeath
User
User
Posts: 78
Joined: Sun Apr 24, 2005 3:22 am

Drawing on another window or above them all

Post by roachofdeath »

Hello,

I was trying to figure out how to draw a shape above all windows, or at least just on one.

StartDrawing with DesktopOutput worked at first, but then I brought up the other windows, the shape flickered, and it needs to be solid.

This is what I had:

Code: Select all

#wMem=0
Global Mem.l
Mem = AllocateMemory(1024)
Procedure.l DesktopOutput()
  PokeL(Mem, 1)
  ProcedureReturn Mem
EndProcedure
repeat
StartDrawing(DesktopOutput())
Circle(55,55,32,RGB(255,10,5))
StopDrawing()
forever
Any ideas on how to accomplish this?[/code]
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Re: Drawing on another window or above them all

Post by va!n »

hi!
what version of PB you are using? btw, DesktopOutput() is a PB command so you cant use the same name for your procedure!
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
roachofdeath
User
User
Posts: 78
Joined: Sun Apr 24, 2005 3:22 am

Post by roachofdeath »

Hm, lemme check....


it's 3.92
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

Why would he be using 3.92?
Maybe because that's the only pirated full version he found? (just wild guessing here, don't take it personal)
But I remember a guy in this forum also using 3.92 because he "didn't know how to update"...
Sorry if I sound very negative now, but I was only thinking out loud...
I like logic, hence I dislike humans but love computers.
roachofdeath
User
User
Posts: 78
Joined: Sun Apr 24, 2005 3:22 am

Post by roachofdeath »

No, but I think I figured it out, thanks ;) I threw in some API and it seemed to work good enough.
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

Joakim Christiansen wrote:Why would he be using 3.92?
Maybe because that's the only pirated full version he found? (just wild guessing here, don't take it personal)
But I remember a guy in this forum also using 3.92 because he "didn't know how to update"...
Sorry if I sound very negative now, but I was only thinking out loud...
Heh, you're getting closer and closer to be the most negative guy on the forum (I'm still the god on there) :wink: :lol: Keep it up! :P One day you'll be like me! (Don't you dare commit suicide) :? :D
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

Post by localmotion34 »

Joakim Christiansen wrote:Why would he be using 3.92?
Maybe because that's the only pirated full version he found? (just wild guessing here, don't take it personal)
But I remember a guy in this forum also using 3.92 because he "didn't know how to update"...
Sorry if I sound very negative now, but I was only thinking out loud...
hey. i have 4 SEPARATE folders of PB. 3.80, 3.90, 3.93, and 3.94. i ALWAYS do a clean install of PB when updating. and i remember when maybe 3.90 came out, i was using 3.8x for a long long time because of compatibility with a very large project i was working on.

dont jump to conclusions so fast. while you guys were using 3.92, i was still using 3.8x, and a full paying customer.

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
roachofdeath
User
User
Posts: 78
Joined: Sun Apr 24, 2005 3:22 am

Post by roachofdeath »

Hold on, it didnt work after all :( I'm still looking for a solution.
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

localmotion34 wrote:
Joakim Christiansen wrote:Why would he be using 3.92?
Maybe because that's the only pirated full version he found? (just wild guessing here, don't take it personal)
But I remember a guy in this forum also using 3.92 because he "didn't know how to update"...
Sorry if I sound very negative now, but I was only thinking out loud...
hey. i have 4 SEPARATE folders of PB. 3.80, 3.90, 3.93, and 3.94. i ALWAYS do a clean install of PB when updating. and i remember when maybe 3.90 came out, i was using 3.8x for a long long time because of compatibility with a very large project i was working on.

dont jump to conclusions so fast. while you guys were using 3.92, i was still using 3.8x, and a full paying customer.
Yup, and even sometimes you might rollback to see if one of your older projects still compiles on the version it was meant to compile on (I usually comment on my headers "pb version X.XX) so I know which I used while I was working on that project. then I check if it compiles fine on there, and do the needed changes so it compiles in the newer version (of course, having a backup of the sources previously made).

I remember.. was it on 3.8x (or close to) that exes were a little smaller? and then got a little biggie because of some aditions to the libs?
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
roachofdeath
User
User
Posts: 78
Joined: Sun Apr 24, 2005 3:22 am

Post by roachofdeath »

Is there a way to simply draw on the window from a givin HWND?

(i'm trying to get the topic back on topic from PB versions and who's the biggest a-hole ;))
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Why would he be using 3.92?
Maybe because that's the only pirated full version he found? (just wild guessing here, don't take it personal)
But I remember a guy in this forum also using 3.92 because he "didn't know how to update"...
Sorry if I sound very negative now, but I was only thinking out loud...
Sounds familiar. This particular user seems to mostly make dlls for gamemaker...
Last edited by netmaestro on Wed Feb 22, 2006 6:30 am, edited 3 times in total.
BERESHEIT
roachofdeath
User
User
Posts: 78
Joined: Sun Apr 24, 2005 3:22 am

Post by roachofdeath »

how about no dude, i'm actually making an aimer for my friend for a FPS game, and you know very well I stopped that shinanigan, heres the source:

Code: Select all

#wMem=0
Global Mem.l
Mem = AllocateMemory(1024)

Procedure.l DesktopOutput()
  PokeL(Mem, 1)
  ProcedureReturn Mem
EndProcedure

Maus.Point

ExamineDesktops() 

tx.l = DesktopWidth(0) / 2
ty.l = DesktopHeight(0) / 2
go.l = 0
ra.l = 5
colr.l = 255
colb.l = 0
colg.l = 0

OpenWindow(0,10,10,225,120,0,"Aimer")
  CreateGadgetList(WindowID(0))
    Frame3DGadget(1, 10, 10, 100, 100, "Preview",#PB_Frame3D_Double)
    TextGadget(2,145,10,100,12,"Aimer Size")
    TrackBarGadget(3, 120, 23, 100, 16, 1, 20) : SetGadgetState(3,10)
    ButtonGadget(4,120,70,100,20,"Start")
    ButtonGadget(5,120,90,100,20,"Exit")
    ButtonGadget(6,120,50,100,20,"Color")

Repeat

  If go.l = 0
   StartDrawing(WindowOutput()) 
   Circle(60,60,ra.l,RGB(colr.l,colg.l,colb.l))
   StopDrawing()
  EndIf
  
  If go.l = 1
    ValidateRect_(WindowID(0), 0)
    StartDrawing(DesktopOutput())
    Circle(tx.l,ty.l,ra.l,RGB(colr.l,colg.l,colb.l))
    StopDrawing()
    InvalidateRect_(WindowID(0), 0, 0)
  EndIf
  
  Select WaitWindowEvent()
  Case #PB_EventCloseWindow : InvalidateRect_(WindowID(0), 0, 0) : End
  Case #PB_EventGadget
    Select EventGadgetID()
      Case 3
        If go.l = 0
        ra.l = GetGadgetState(3)
        InvalidateRect_(WindowID(0), 0, 0)
        EndIf
      Case 5
        End
      Case 4
        go.l = 1
      Case 6
        Color = ColorRequester()
          colr.l = Red(Color)
          colb.l = Blue(Color)
          colg.l = Green(Color)
        InvalidateRect_(WindowID(0), 0, 1)
    EndSelect
  EndSelect
ForEver

so ha, stick that up your ass
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

so ha, stick that up your ass
Well, that's going a bit far. I would have left it there but this level of rudeness isn't tolerated on this forum. As I said, I didn't hear you assert that you are a registered user of PB, so I'm sending an email to Fred quoting what you just said and identifying you as a possible user of a pirated version of PureBasic. If you're indeed paid up, all you have to worry about is getting banned for rudeness, if not...[/quote]
Last edited by netmaestro on Wed Feb 22, 2006 6:27 am, edited 3 times in total.
BERESHEIT
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

netmaestro wrote:
so ha, stick that up your ass
Well, that's going a bit far. I would have left it there but this level of rudeness isn't tolerated on this forum. As I said, I didn't hear you assert that you are a registered user of PB, so I'm sending an email to Fred quoting what you just said and identifying you as a possible user of a pirated version of PureBasic. If you're indeed paid up, all you have to worry about is getting banned for rudeness, if not...
Follow his advice. For your information: I have never heard that you asserted that you are a registred user either, does that mean that you aren't? And I don't like that you are, without the faintest slice of proof, accusing someone of stealing values for 69 dollars. I'll email Fred about that.
roachofdeath
User
User
Posts: 78
Joined: Sun Apr 24, 2005 3:22 am

Post by roachofdeath »

Well, i'm not getting an answer, but i'm also leaving this forum anyways -- all i do is get harrassed. Anyways, i'm going to be gone for like 8 months because I got my computer and internet privilages taken away.

Bye
Post Reply