Page 8 of 8

Posted: Wed Dec 31, 2008 1:36 pm
by yrreti
Go figure? I can see the camera icon is generated in the data of the source, but I couldn't get it to run.
So I used a program to extract the icon from the exe file in the zip and saved as camera.ico. Now it runs.
I'm confused as to why the source part won't work for me.
PS, using PB4.3

Posted: Wed Dec 31, 2008 9:45 pm
by idle
un check use icon in the compiler options.

Posted: Thu Jan 01, 2009 5:19 am
by yrreti
Thanks idle, your right.
I forgot all about that check, :oops: and was looking for it in the code at the end.
Thanks for taking the time to help me out.

Posted: Thu Jan 01, 2009 2:45 pm
by Michael Vogel
Hmm,
interesting, that the quick help of the PB4.3 shows wrong parameters for PtInRect_() and WindowFromPoint_() in the status line.
Took some seconds for me, to recognize, that a the coordinates have to be used as a point structure...

Code: Select all

	xy.point
	With xy
		\x=DesktopMouseX()
		\y=DesktopMouseY()
		If \x<=Width-216
			winx=\x+16
		Else
			winx=\x-216
		EndIf
		If \y<=Height-48
			winy=\y+16
		Else
			winy=\y-32
		EndIf
		ResizeWindow(#wWindowMode,winx,winy,#PB_Ignore,#PB_Ignore)
		w=WindowFromPoint_(@xy)

Posted: Thu Jan 01, 2009 2:59 pm
by netmaestro
Fred recommends:

Code: Select all

GetCursorPos_(@cp.POINT)
w = WindowFromPoint_(cp\x|(cp\y<<32))
I have a set of macros that I compile and keep in PureBasic\Residents, this is one of them:

Code: Select all

Macro MAKEPT(x,y)
  x | (y<<32)
EndMacro
So I've been using

Code: Select all

WindowFromPoint_( MAKEPT(cp\x, cp\y) ) 
in my work.