|
-
Dec 9th, 2004, 05:05 PM
#1
Thread Starter
KING BODWAD XXI
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
-
Dec 9th, 2004, 05:24 PM
#2
Ex-Super Mod'rater
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
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Dec 9th, 2004, 06:23 PM
#3
Thread Starter
KING BODWAD XXI
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
-
Dec 9th, 2004, 06:34 PM
#4
Ex-Super Mod'rater
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.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Dec 9th, 2004, 06:47 PM
#5
Thread Starter
KING BODWAD XXI
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
www.btinternet.com/~clanger_moon/Ants.zip
-
Dec 9th, 2004, 07:10 PM
#6
Ex-Super Mod'rater
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.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Dec 10th, 2004, 02:26 AM
#7
Thread Starter
KING BODWAD XXI
Re: DX input exclusive to my app
-
Dec 10th, 2004, 06:33 AM
#8
Ex-Super Mod'rater
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 .
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Dec 10th, 2004, 07:28 AM
#9
Thread Starter
KING BODWAD XXI
-
Dec 10th, 2004, 04:50 PM
#10
Thread Starter
KING BODWAD XXI
Re: DX input exclusive to my app
EUREKA
Dont unload the DDraw or DX objects just set them again (Dont ask)
How can you do a complete screen refresh though because my screen keeps the image until another app is show
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|