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

control id number

gfr1
Beginner
701 Views
How can I get the edit control number during program execution. I want to determine if the current focus is a button.
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
701 Views
You weren't very precise, but I guess you need something like:
USE DFWIN
...
IF (GetFocus() .EQ. GetDlgItem(hParent, IDC_MYBUTTON)) THEN
   !Do something

The key is GetDlgItem function -- it returns handle of the control on the basis of its ID. Also, the code could be rewriten to use GetDlgCtrlID instead (which does the reverse). hParent is handle of the control's parent window -- if it's a dialog, use Dlg%hWnd.

Jugoslav
0 Kudos
Reply