HideMouse()
HideMouse()
For OpenWindowedScreen() it would be nice to hide the mouse.
Yeepy...
Indeed, PB does hide Mouse Pointer, but not exactly the way I told you before. The mouse will be hidden not after InitMouse() but after the first call to ExamineMouse(). After that, mouse pointer will be trapped into the Windowed Screen. You'll see this behavior when you run the following code (press <ESC> to exit the loop):
Hope it helps 
Indeed, PB does hide Mouse Pointer, but not exactly the way I told you before. The mouse will be hidden not after InitMouse() but after the first call to ExamineMouse(). After that, mouse pointer will be trapped into the Windowed Screen. You'll see this behavior when you run the following code (press <ESC> to exit the loop):
Code: Select all
InitSprite()
OpenWindow(0,0,0,640,480,#PB_Window_SystemMenu, "Mouse Pointer Test")
OpenWindowedScreen(WindowID(0),0,0,640,480,0,0,0)
CreateSprite(1,16,16,#PB_Sprite_Memory)
If StartDrawing(#SpriteOutput(1))
Box(0,0,16,16,RGB(255,255,255))
StopDrawing()
EndIf
InitMouse()
InitKeyboard()
Repeat
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Escape)
Break
Else
ExamineMouse()
DisplaySprite(1,MouseX(),MouseY())
FlipBuffers()
EndIf
ForEver

Derlidio Siqueira
Funny....
On my code it doesn't work so... (maybe because i create the main-window-loop in a diffrent thread)
....
Yes, because of the thread...
But the thread is the only method, to use menus, without stopping drawing the window...
i found a methode:
Create a empty Cursor.cur
before
...
after
On my code it doesn't work so... (maybe because i create the main-window-loop in a diffrent thread)
....
Yes, because of the thread...
Code: Select all
Global MainWindow
Global Quit
Procedure MainWindow(flag)
a=OpenWindow(0,0,0,640,480,#PB_Window_SystemMenu, "Mouse Pointer Test")
MainWindow=a
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
Quit=#True
EndProcedure
CreateThread(@MainWindow(),flag)
While MainWindow=0:Wend
InitSprite()
OpenWindowedScreen(MainWindow,0,0,640,480,0,0,0)
CreateSprite(1,16,16,#PB_Sprite_Memory)
If StartDrawing(SpriteOutput(1))
Box(0,0,16,16,RGB(255,255,255))
StopDrawing()
EndIf
InitMouse()
InitKeyboard()
Repeat
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Escape)
Break
Else
ExamineMouse()
DisplaySprite(1,MouseX(),MouseY())
FlipBuffers()
EndIf
Until Quit
i found a methode:
Create a empty Cursor.cur
before
Code: Select all
;nocursor=load a cursor
GetCursorPos_(OldPos.POINT)
OldClassCursor=SetClassLong_(MainWindow,#GCL_HCURSOR,NoCursor)
OldCursor=SetCursor_(NoCursor)
ShowCursor_(#False)
ReleaseMouse(#False)
after
Code: Select all
ReleaseMouse(#True)
ShowCursor_(#True)
SetCursor_(OldCursor)
SetClassLong_(MainWindow,#GCL_HCURSOR,OldClassCursor)
SetCursorPos_(OldPos\x,OldPos\y)
I'm not sure if this is a good idea.
The windowed screen is a childwindow your Window, and it needs to have
access to the message queue.
By moving the window into a different thread, you also have it's message queue
attached to a different thread.
That's the reason for the mouse-thing.
And it might also have other impacts in the WindowedScreen, but i don't really
know, because i never tried it.
To be on the save side, i would try to keep both in the same thread.
Timo
The windowed screen is a childwindow your Window, and it needs to have
access to the message queue.
By moving the window into a different thread, you also have it's message queue
attached to a different thread.
That's the reason for the mouse-thing.
And it might also have other impacts in the WindowedScreen, but i don't really
know, because i never tried it.
To be on the save side, i would try to keep both in the same thread.
Timo
quidquid Latine dictum sit altum videtur
But i really need this. It is a really necassary, when you work with openwindowedscreen, because the only reason for the windowedscreen is, that i want to use the Menus, requesters, and so on.freak wrote:I'm not sure if this is a good idea.
But how do this, when all is in the same thread? Then the animations in the screen stop, when the menu popup or when i open a requester (and when you move the requester, it destroy the screen and turn it to grey).
And it is also not a good idea to use directX in a other thread...
So how should i solve the Problem. How can i get the Window-Messages without threads (and without thousends API-Commands).
Is it possible to create a thread, so that windows don't make any diffrent in the messagesystem.
(in German: Ist es irgendwie möglich, einen Thread so zu erstellen, daß Windows hinsichtlich der Nachrichtenverwaltung keinerlei Unterschiede macht? Wie gesagt: Irgendwie ist es einfach bei WindowedScreen pflicht, das *gleichzeitig* sowohl die Windows-Nachrichten und auch das Neuzeichnen der Fenster abläuft und das eine nicht das andere binhindern darf)