![]() |
|
#1
|
|||
|
|||
Finding DialogBox handle...Hello there,
I'm new here ! Hello! I'm a student currenlty working on a project (Very rushed) in C++ (i only had JAVA and command-line C programming experience..) Excuse me if the following question sounds trivial, I really need URGENT HELP! Many thanks in advance. The only window created in my program uses DialogBoxIndirectParam. Is there anyway I can point the WSAAsyncSelect method to send messages to the DialogBox? Following are snippets of the code: CPP / C++ / C Code:
And the CALLBACK method: CPP / C++ / C Code:
Basically, I want EditorProc to handle both the dialog loop and the Sockets..is it possible? Many thanks! Jyc. |
|||
|
#2
|
||||
|
||||
Re: Finding DialogBox handle...This is easier than it sounds. In your WM_INITDIALOG, you simply use the dwInitParam (that you're not currently using) to pass the "hwndDlg" member of the DialogProc...
CPP / C++ / C Code:
Here's the general idea. Create a static variable: CPP / C++ / C Code:
...in your DialogBoxIndirectParam call you PASS THE PARAM (note the "Param" part of the function name?) to it. CPP / C++ / C Code:
...in your WM_INITDIALOG message you: CPP / C++ / C Code:
--OR-- CPP / C++ / C Code:
And, then, when you need to use it, you cast it to the appropriate type and use it. CPP / C++ / C Code:
...or something like that. "Qualifier" I wrote this from my MacBook without a Windows box around. Consider this stupid simple example as an example of using casting for the types that you will likely see as opaque pointers in Win32 code. CPP / C++ / C Code:
MxB |
|
#3
|
|||
|
|||
Re: Finding DialogBox handle...many thanks!
|
Recent GIDBlog
Toyota - 2009 May Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Joystick handle | cgillopez | .NET Forum | 0 | 23-Mar-2009 12:23 |
| How to get a handle to a derived class? | Futterama | MS Visual C++ / MFC Forum | 1 | 29-Jan-2007 10:47 |
| ARG! Dialogbox of doom! | The_Inferno | C++ Forum | 2 | 12-Mar-2006 17:44 |
| Help with syntax errors | PeteGallo | C Programming Language | 7 | 08-Aug-2005 21:30 |
| What is a Handle in Device Context | Janakiraman | MS Visual C++ / MFC Forum | 1 | 12-May-2005 05:09 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The