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.

DLL Talk / a anti end message to the window?

Author
Message
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 23rd Apr 2005 13:06
well i have a lot of power but not sure on how to stop window from closing i can figure out if the person clicked the x button but not sure on what use it is if it ends as soon as they click so now im wondering if there is a call or something to stop the message from going to the window or a way to cancel the message

X-Patch x-patch.exe(gui):75% make.exe:5% x-patch.dll(runtime dll):0% developed on win xp home sp2
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 23rd Apr 2005 13:11
I don't understand a word of that. Though it could be bacause I am sleepy

Quote: "Location: isnt it obvous?"

No it's not.

Cryptoman
20
Years of Service
User Offline
Joined: 24th Nov 2003
Location: Utah Mountains
Posted: 23rd Apr 2005 13:14
You have to intercept the Process Messages callback, filter out the wm_destroy, then pass the remaining messages to the original callback.


Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 23rd Apr 2005 13:15 Edited at: 23rd Apr 2005 13:16
ok here it is basically

how could i keep the program from getting the wm_end message or is there a msg that i could send the window that would cancel out the wm_end

btw i can get what the window gets or well wait let me review my api docs(no ive not memorized them yet) and look at my dll again.

edit wow u beat me

hmmm wm_destory i thought it was something besides end

X-Patch x-patch.exe(gui):75% make.exe:5% x-patch.dll(runtime dll):0% developed on win xp home sp2
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 23rd Apr 2005 19:11
It is the WM_CLOSE message that you need to filter out.

I'm not exactly sure how you would do this from within DarkBASIC code. One way would be to find IanM and ask him about his code for getting pointers to DarkBASIC functions. You could then set up a function for processing these messages, and ignoring the WM_CLOSE one.

I do know how it can be done if you have my GUI plugin though.


BlueGUI Windows Plugin
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 23rd Apr 2005 19:29
Subclassing is your best friend...

Visit http://homepages.nildram.co.uk/~nickk
Vote Nicholas J. Kingsley BSc for benevolent dictator.
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 23rd Apr 2005 23:25
hmmm
wonder how i could go about doing that
is there a way to get the hinstace of the dbpro app thru a dll also

X-Patch x-patch.exe(gui):75% make.exe:5% x-patch.dll(runtime dll):0% developed on win xp home sp2
Cryptoman
20
Years of Service
User Offline
Joined: 24th Nov 2003
Location: Utah Mountains
Posted: 24th Apr 2005 01:15
If you just filter wm_close sometimes the pro window still gets the destroy message. So I just look for the wm_destroy.

Pro has a processmessages function stored in a structure. You can get address, replace it with your message pump adress, filter what you need, then pass the remaining messages on to the original.

As long as you dll has not opened a window, you can call in user32.dll "GetActiveWindow". That function returns the hwnd of the most recent window opened by a module. So if your dll has not opened any windows then you will get the hwnd of your DBpro Parent window. Same with dc for gdi.

You can also set a hook, but that is left up to practice, as you could cause a system wide hook, which would possibly require a reboot.

I just looked over the source of my hooks and Rob is right, you have to catch wm_close also with Pro, but also wm_destroy as windows strangely sends that message randomly when you click X.

The process messages function is in the Globstruct.h at the sticky in this forum. But I'm not sure if this is still the window message callback in 5.8, but I don't see why it would change.


Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 24th Apr 2005 01:53
hmmm
sounds a bit complicated and i am an ameture in c/c++
another thing i would like to know is how u could put controls on the dbp window

X-Patch x-patch.exe(gui):75% make.exe:5% x-patch.dll(runtime dll):0% developed on win xp home sp2
Cryptoman
20
Years of Service
User Offline
Joined: 24th Nov 2003
Location: Utah Mountains
Posted: 24th Apr 2005 02:01
Well first you get the Hwnd of the pro window. Set the style of the window to clip children, then pass the hwnd to the control you are calling. It will appear.


Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 24th Apr 2005 03:35
well what do i do about the hinstance

X-Patch x-patch.exe(gui):75% make.exe:5% x-patch.dll(runtime dll):0% developed on win xp home sp2
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 24th Apr 2005 05:38
The function pointer stuff is very unstable - it wouldn't be worth the effort to try and debug code that uses it for something as simple as this.

You can intercept the message relatively easily:

Intercept.cpp


resource strings


DBPro code


*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk

Login to post a reply

Server time is: 2024-11-23 21:13:06
Your offset time is: 2024-11-23 21:13:06