Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29235 Discussions

Message processing in dialog based application

michael_green
Beginner
612 Views

Hi All,

I don't understand how to process messages in a dialog based application. Specifically, I want to pick up and work with a WM_NOTIFY message from a list view control and go on to use the lparam of that message. It's the sort of thing that's done easily in a pure Win32 application, but I can find no examples and no hints as to how it should be done in a simple dialog based application.

Many thanks in advance for any help,

Mike

0 Kudos
4 Replies
tropfen
New Contributor I
612 Views
Hello,

uselly a source like the one below will help.

integer*4 function DataInputProc( hDlg, message, uParam, lParam )
integer hDlg ! window handle of the dialog box integer message ! type of message integer uParam ! message-specific information integer lParam
include 'resource.fd' select case (message)
case(WM_NOTIFY)
if( lParam == IDC_DataInputList) then
.....
DataInputProc = 0 return
end if ! or if( loword(lParam) == IDC_DataInputList) then
.....
DataInputProc = 0 return
end if end select

DataInputProc = 0 ! Didn't process the message return end
Frank
0 Kudos
Jugoslav_Dujic
Valued Contributor II
612 Views
I assume Mike asked about IFLOGM-based applications. In that case, your options are:

1) Subclass the dialog, as in MenuDialog sample, and proceed with a combination of Frank's and my code in the dialog procedure.

2) Download and install Xeffort, and replace USE IFLOGM with USE XFLOGM; the rest of the code should be compilable and running, possibly with minor tweaks. It has native support for list-view controls (see the docs), and, even if it's not enough, you can easily install all WM_COMMAND/WM_NOTIFY callbacks (e.g. for a TreeView) using XSetCommand.
0 Kudos
michael_green
Beginner
612 Views

Thanks Guys, that stuff about Subclassing was exactly what I needed to know. My program now works fine.

But this kind of thing highlights a frequent problem of mine - how do I find out about these more esoteric functions and is there a book or online resource where I can actually learn about the way Windows works?

Thanks again

Mike

0 Kudos
Jugoslav_Dujic
Valued Contributor II
612 Views
Well, it's a huge topic, and there's plenty of code and tutorials around the net, so it's difficult to see the forest from the trees. Apart from MSDN (or whatever they call it these days), I'd recommend the basic tutorial on winprog, as well as a number of topic-specific ones at Catch-22. They're mostly in C, of course.
0 Kudos
Reply