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

Listing long list in LISTBOX

rtsmith
Beginner
347 Views
I have a problem listing a list of 402 lines in a LISTBOX having selected an option using a right-mouse-click menu. The problem is explained in the attached zip file which containsthe Word document ListBoxProblem.doc.
I have now been able to reproduce the problem as a small program. Attached is a zip file containing the fortran source, the .rc, .fd and .h files and the .dsw and .dsp files. They will assemble straight into an executable. To show the problem, firstly left-click on a line and click on the button. The line clicked will duplicate across the box. Now right click on a line and left-click the only item in the drop-down menu. Watch the screen grey out and the vertical scrolling cursor go mad for about 10 seconds. Has anyone any idea what is happening and how to prevent it happening.

Message Edited by rtsmith on 02-23-2005 11:52 AM

Message Edited by rtsmith on 02-23-2005 11:55 AM

0 Kudos
2 Replies
rtsmith
Beginner
347 Views
The zip file would not add to the message so I have added it here (ListBoxScrollProblem.zip).
0 Kudos
anthonyrichards
New Contributor III
347 Views
Hi there again!
The solution I have found isshown below. I have commented out the call to lstall that results from a right-click and selection of the menu item (idal_allocate) and replaced it with a command sent to the button that works (IDC_ALLOCATE) usingSendMessage:
CASE (WM_COMMAND)
c process other TOMS dialog messages
SELECT CASE(IAND(wParam,#FFFF))
case (idal_allocate)
c call lstall(dlg)
SubclassListShow = SendMessage(dlg%hWnd, wm_command,
1 idc_allocate, getdlgitem(dlg%hwnd,idc_allocate))
CASE DEFAULT
SubclassListShow = DefDlgProc(hWnd, Msg, wParam, lParam)
END SELECT
END SELECT
END FUNCTION SubclassListShow

I am not sure what the interaction was before, but this gets the response you want.
0 Kudos
Reply