Page 1 of 1
Windows API integration
Posted: Sat Feb 25, 2006 10:05 am
by Michael Vogel
Hi,
I was searching for some equivalents of commands I've often used with GFA Basic, but I didn't find them (maybe I missed something?)
I would be happy, if such things could be implemented with its own commands, so every user could use them in an identically way...
Code: Select all
; Which constant can be used in OpenWindows to create a windows without a titlebar but with a normal border?
OpenWindow(1,20,20,400,400,#PB_Window_Border | #PB_Window_TitleLess,"")
Delay (1000)
; How to hide and display a mouse cursor easily? This would be fine for screen savers, etc.
HideMouse()
ShowMouse()
; Is there also a command for setting a certain mouse cursor symbol? (Arrow, Hourglass, etc.)
DefMouse(#PB_IDC_WAIT)
Posted: Sat Feb 25, 2006 4:14 pm
by Jan Vooijs
Yeah,
The 'mouse' commands you mention are indeed missing?!?! Will need them very soon in my application..
Fred couls you please add them in PB4, prety please??
And for the windows problem:
Code: Select all
#PB_Window_Thickframe = $00040000
#PB_Window_Border = $00800000
#PB_Window_Popup = $80000000
Posted: Wed Mar 01, 2006 11:54 am
by Michael Vogel
Jan Vooijs wrote:Yeah,
And for the windows problem:
Code: Select all
#PB_Window_Thickframe = $00040000
#PB_Window_Border = $00800000
#PB_Window_Popup = $80000000
Thanks for your help, but I'm still not able to do use it correctly...
Code: Select all
If OpenWindow(0,100,100,492,180,#PB_Window_Border,"")
...
EndIf
...again adds a caption bar at the top of the window. Sometimes a window without any title bar is needed. What did I wrong?
Michael
Posted: Wed Mar 01, 2006 1:34 pm
by Trond
Window:
Code: Select all
OpenWindow(1,20,20,400,400, #WS_POPUP | #WS_DLGFRAME,"")
Hide/show cursor:
Posted: Wed Mar 01, 2006 3:39 pm
by Michael Vogel
Trond wrote:Window:
Code: Select all
OpenWindow(1,20,20,400,400, #WS_POPUP | #WS_DLGFRAME,"")
Hide/show cursor:
Hey ! So easy, when you know it - so hard to find for me...
Do you also know the right command to change a cursor?
I tried SetCursor_(LoadCursor_(0,#IDC_WAIT)), but that does not work...
Posted: Wed Mar 01, 2006 4:05 pm
by Trond
Code: Select all
OpenWindow(0, 0, 0, 400, 300, #PB_Window_ScreenCentered | #PB_Window_SystemMenu, "")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
EndSelect
SetCursor_(LoadCursor_(0, #IDC_CROSS))
ForEver
Posted: Wed Mar 01, 2006 4:14 pm
by Flype
Jan Vooijs wrote:Yeah,
The 'mouse' commands you mention are indeed missing?!?! Will need them very soon in my application..
Fred couls you please add them in PB4, prety please??
You are right, this might be implemented in future version for all OS,
shouldn't be too hard for Fred as all OS have this features i think...
Posted: Wed Mar 01, 2006 8:18 pm
by PB
I've found the ShowCursor API to be totally useless. Never works for me.
I've resorted to just moving the pointer to the bottom-right corner of the
screen, where it is not so visible; but I know this is not an ideal solution.
BTW, I note that the MSDN docs state that the ShowCursor API is related
to DirectShow 9.0 anyway -- so maybe that has something to do with it?
The actual description for it states: The ShowCursor method makes the
cursor visible when the MSWebDVD object is in full-screen mode.
So maybe it's not meant for general hiding/showing of the mouse?
Posted: Wed Mar 01, 2006 8:24 pm
by srod
Unless the class cursor is set to null, the cursor is 'refreshed' everytime the mouse is moved. One way around this is to use SetCursor_(0) in your event loop etc.
Posted: Wed Mar 01, 2006 8:29 pm
by Trond
Example:
Code: Select all
OpenWindow(0, 0, 0, 400, 300, #PB_Window_ScreenCentered | #PB_Window_SystemMenu, "")
ShowCursor_(0)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
The ShowCursor function displays or hides the cursor.
int ShowCursor(
BOOL bShow // cursor visibility flag
);
Parameters
bShow
Specifies whether the internal display counter is to be incremented or decremented. If bShow is TRUE, the display count is incremented by one. If bShow is FALSE, the display count is decremented by one.
Return Values
The return value specifies the new display counter.
Remarks
This function sets an internal display counter that determines whether the cursor should be displayed. The cursor is displayed only if the display count is greater than or equal to 0. If a mouse is installed, the initial display count is 0. If no mouse is installed, the display count is -1.