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.

Dark GDK / Windows message processing

Author
Message
Ian G
16
Years of Service
User Offline
Joined: 3rd Jun 2008
Location: SSM, Canada
Posted: 18th Jul 2009 06:45
Hello, I was wondering if there was any way of 'hijacking' the windows message loop in DGDK to allow me to call the "IsDialogMessage" in order to process tab events for my modeless dialog boxes. I'm not sure if it is possible to add this call to the message loop (I suppose this could be simply put into another thread) however it would be great if there was a way.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 18th Jul 2009 09:04
you can get a handle to the main window with g_pGlob->hWnd.

include globstruct.h to be able to access the globals for GDK.

Once you have your main window handle, you can do anything you want to it with the api, send messages etc, you can setup your own callback to put a menu in or use modal and modeless dialogs.

There are some good tutorials inthe forums about using GDK with windowsAPI... a search should get u what you are after.

If it ain't broke.... DONT FIX IT !!!
Ian G
16
Years of Service
User Offline
Joined: 3rd Jun 2008
Location: SSM, Canada
Posted: 19th Jul 2009 01:00
Thanks for the reply, however I was already aware of the ability to create callbacks for the main window . I think I solved this for now by using dbFastSync which skips the message processing and allows me to create my own loop similar to

I don't believe this is the safest way to handle things as it could become backed up with tonnes of messages, however it works for now. I would appreciate any more insight into how GDK handles its message processing as I essentially need to recreate this
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 19th Jul 2009 03:03
Oh I see..... Use "PeekMessage" instead of getmessage...

The difference is that GetMessage will remove a message to process from the pile, and WAIT till its processed.... so you will get some serious hangup using it.... plus I have no idea exactly how TGC coded their winmain, or how they handle messages, so removing one with getmessage may screw it up(cause it to seemingly hang)..
PeekMessage will continue the process its attached to, rather than stop it, while working with messages.

You can spefcify "PM_NOREMOVE" I think, to stop peekmessage removing the message from the queue, but it can still process it as though it had...

If it ain't broke.... DONT FIX IT !!!
Ian G
16
Years of Service
User Offline
Joined: 3rd Jun 2008
Location: SSM, Canada
Posted: 20th Jul 2009 23:25
In case anyone is wondering how to do this I got it working well with fastsync as it causes GDK to ignore all windows messages. By using PeekMessage with PM_REMOVE, I am able to loop through and process the messages like any other Win32 app.

It still needs some revising as I'm still concerned about messages getting backed up, however it runs like a dream on my comp. Thanks for the help

Login to post a reply

Server time is: 2024-10-01 08:14:45
Your offset time is: 2024-10-01 08:14:45