DX input exclusive to my app
How do I make DX input 7 exclusive to my application.
I have F1 to maximise the screen but if I try it it starts VB into help mode because its not locking it to my application =(
Its the same for the mouse. Because its windowed it allows me to click apps behind my program even though its supposed to be in my application
:cry:
Re: DX input exclusive to my app
The keyboard isn't allowed to be exclusive its a security issue ;). As for the Mouse just add the Exclusive flag when you initialise it:
Code:
Keyboard.SetCooperativeLevel TargetHandle, DISCL_FOREGROUND Or DISCL_NONEXCLUSIVE
BTW the Foreground and background thing work like: If you use Foreground then you will only know about keys/mouse actions if your app is the active one when they happen. Background basically means no matter which program has focus your program will recieve the input as well.
The problem with the F1 key is because your running it in the IDE and the IDE is still in focus as your program runs. This won't happen when you run it compiled so I'd suggest chnaging the key to somethign else then when you release it change it back to F1 :)
Re: DX input exclusive to my app
Cheers that work great (Even F1)
I know have a problem switching from fullscreen to window. The primary surface cannot be set again. I unload all DX stuff and reload it but it still errors :(
Re: DX input exclusive to my app
Which version of Dx are you using? You'll have to recreate the device, most the stuff doesn't need recreating but things like the device and anything that relies on the device should be recreated.
Re: DX input exclusive to my app
Its direct draw7 so there is no device =(
Here is a link to the project if you are curious :afrog:
www.btinternet.com/~clanger_moon/Ants.zip
Re: DX input exclusive to my app
I couldn't run the project cos of a sound module not included. Mind whats the error your getting and which line is it on?
I can't remember if I ever got a program working in Dx7 that would let you switch back and forth from Windowed & Fullscreen.
Wonder why unloading everything then loading it again isn't working, mind don't think I've tried this before either. It could be possible you've missed something out the Unload and it wouldn't normally matter apart from this way the objects are being reused and then it causes probs....I can't spot anything wrong though.
Re: DX input exclusive to my app
DX7 can be a bit annoying at times :(
It is fine going from windowed to fullscreen but cant go from full screen to windowed for some reason. DX and DDraw seems to setup OK and the PS = Nothing before I try and run the command. Maybe if I only resetup the ddraw surface and see if that works :)
Code:
Set PS = DDraw.createsurface (ddsp)
Looks like this evening could be long :afrog:
Re: DX input exclusive to my app
Yea if you have had to recreate the DDraw then you'd have to recreate the PrimSurface cos its used to makle it :).....I think you will probabaly have to recreate your textures (offscreenDCs) too :).
Re: DX input exclusive to my app
:cry: :cry:
Just hope if I keep DX object open but close all else it will be ok :)
Re: DX input exclusive to my app
EUREKA
Dont unload the DDraw or DX objects just set them again (Dont ask) :rolleyes:
How can you do a complete screen refresh though because my screen keeps the image until another app is show :cry: