- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can I get the edit control number during program execution. I want to determine if the current focus is a button.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You weren't very precise, but I guess you need something like:
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
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

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page