Getting window handle on active control

Nosta
Member Posts: 31
Hi all,
I need to get an window handle of currently active control in NAV. For example, when the user opens Item Card form and put the input focus on field "No." I need to get the window handle of field "No." edit box. So far, I analyzed the NAV forms with Spy++ and found that form Item Card has no child controls. I can't believe that NAV draws all forms in run-time as a picture and handle&process all messages with its own engine, instead of using standard windows controls.
Does anyone got stuck with this before?
I need dynamically highlight some fields and prefer using standard windows drawing procedures instead of using Border (and related) properties.
Would be thankful for any ideas.
I need to get an window handle of currently active control in NAV. For example, when the user opens Item Card form and put the input focus on field "No." I need to get the window handle of field "No." edit box. So far, I analyzed the NAV forms with Spy++ and found that form Item Card has no child controls. I can't believe that NAV draws all forms in run-time as a picture and handle&process all messages with its own engine, instead of using standard windows controls.
Does anyone got stuck with this before?
I need dynamically highlight some fields and prefer using standard windows drawing procedures instead of using Border (and related) properties.
Would be thankful for any ideas.
0
Answers
-
By "Window Handle" are you referring to the field ID or Name?
What do you want to do? Encompass the field with a red rectangle when a field is activated?0 -
By "window handle" I'm referring to a handle "hWnd" of edit box (check box) control where field is displayed. if you look through Win32API, you see that every control in Windows has its own handle. For example, Find dialog box in Notepad consists of 8 controls (see attach) and each of them has its own handle. But in NAV you cannot access to any of the form controls.
As a matter of fact, I need to dynamically activate (switch on proper tab if tab control is used) and highlight an active field. I mean a field with input focus (if we are using WinAPI terminology).
For these purposes I prefer to use GetDC, CreateSolidBrush, Rectangle, etc. standard WinAPI functions instead of playing around Border, Border Color and Border Width form properties (especially when these properties are not available in run-time)
0 -
I can't believe that NAV draws all forms in run-time as a picture and handle&process all messages with its own engine, instead of using standard windows controls.0
-
2 MBerger: Obviously, you are right. I've tried a lot of tools to get the handle of field edit box, but was not lucky
Don't want to believe, but have to
0 -
I've played around with this in the past and I was unable to find a simple and elegant solution to manage tab activiation, but each control on a form has an ACTIVATE function that you can use to control which control is the active control.
In the past I've built controls that were designed for quick entry so a mouse wasn't used and I found that using the ACTIVATE function in conjunction with defining the tab order (set the Next Control property of each field) that I could accomplish that task.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions