Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Hide Window - No input detected...

Author
Message
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 23rd Apr 2010 12:28
Hi,

I have made a simple chat program for work, and it is possible to hide the window with the MMB when a teacher or someone of higher rank appears, but I would also like to make the window reappear when you push the MMB again. Unfortunately, the hidden window does not detect the input from the mouse or from the keyboard once hidden... How can I change this?

TheComet

baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 23rd Apr 2010 12:44
I haven't tried it but you could use something like this if you have IanM's Matrix1 utilities:


mouseclick()=4 for middle mouse button right?

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 23rd Apr 2010 14:11
Quote: "mouseclick()=4 for middle mouse button right?"


I found that mouseclick()=4 doesn't work in windowed mode, so I use the user32 dll to call the check.

As to the code you posted, that is exactly what I have (without the focus, what does that do?), and it doesn't show any input when the window is hidden.

TheComet

baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 23rd Apr 2010 14:43
Quote: "
Focus = HAS FOCUS()

Returns a result of 1 if the DBPro window has the current focus, or 0 if it doesn't.
"


I just tried the following code:


I think using mouseclick() you only ever get a result if you click on the screen...

Maybe if you added your user 32 code? If you get it working could you post the code? I'd love to see how to do this!

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Apr 2010 15:21 Edited at: 23rd Apr 2010 15:21
When your window does not have focus, you don't get messages from the input devices, otherwise your keypresses would affect every program you have open.

When your window is reduced, then the only messages that matter are close, restore and maximise messages (plus other 'housekeeping' messages) and windows won't send you input messages.

That's why it isn't working - there's nothing you can do to change this, except to write a program to register a hotkey that does the job. That can't currently be done in DBPro.

basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 23rd Apr 2010 15:49
you have to use the comand window to front or close all other windows then you will be abcle to use the mouse as the window will be activated
Liopriwo
16
Years of Service
User Offline
Joined: 2nd Dec 2009
Location:
Posted: 23rd Apr 2010 16:18 Edited at: 23rd Apr 2010 16:21
Actually you can check the input without having focus:



For a list of all key codes (4 is the code for the MMB) look here:
http://msdn.microsoft.com/en-us/library/dd375731%28v=VS.85%29.aspx
Sepnon
16
Years of Service
User Offline
Joined: 7th Feb 2010
Location: Brazil
Posted: 23rd Apr 2010 19:33
keylogger?!
Liopriwo
16
Years of Service
User Offline
Joined: 2nd Dec 2009
Location:
Posted: 23rd Apr 2010 21:29 Edited at: 23rd Apr 2010 21:31
Quote: "keylogger?! "


Well, it's pretty easy to make a keylogger with this (hint:although check wether shift is pressed or not ), but you can although do some other nice stuff like a statistics programm, which checks how often you pressed a specific key/button.
And if you know how to get the high and low bytes in DBP (unforunatly I don't) you can easily check if a button has just been pressed, is holding down or is released, and so there's no need of makeing an array to store these values.
Sepnon
16
Years of Service
User Offline
Joined: 7th Feb 2010
Location: Brazil
Posted: 24th Apr 2010 00:13
yup, but i bet that norton will think your app is a virus..
Liopriwo
16
Years of Service
User Offline
Joined: 2nd Dec 2009
Location:
Posted: 24th Apr 2010 00:53 Edited at: 24th Apr 2010 00:55
I don't have Norton installed, but I'm pretty sure that it won't, because calling the GetAsyncKeyState function isn't something abnormal.
By the way: I think we should stop here, before we're completly off topic.

Login to post a reply

Server time is: 2026-07-26 04:27:21
Your offset time is: 2026-07-26 04:27:21