🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1366

How to determine active edit control in Windows API

#1366
From: Renald Yazmir
Date: Tue, 04 Sep 2007 19:44
38 lines
1493 bytes
Hello



I am using Windows API. I have 2 edit controls in the dialog box.

I get HWND for each edit control using:

  edit_1_hwnd = GetDlgItem(parent_hwnd,  3);
  edit_1_hwnd = GetDlgItem(parent_hwnd, 4);



The cursor can be in any edit box at any position.



I need to know where the cursor is in edit 1 or in edit 2.

Then I will use

SendMessage (edit_1_hwnd, EM_GETSEL, (UINT)&start, (UINT)&end);

or

SendMessage (edit_2_hwnd, EM_GETSEL, (UINT)&start, (UINT)&end);

to get cursor position.



I tried GetFocus() unsuccessfully



Thank you

Rony
Technical Details
Message-ID: <46dda78f@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d9430da384cdfa71,start
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Renald Yazmir" <renald@partmaker.com>
From: "Renald Yazmir" <renald@partmaker.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: How to determine active edit control in Windows API
Date: Tue, 4 Sep 2007 14:44:28 -0500
Lines: 40
Organization: IMCS Inc
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 66.106.28.123
Message-ID: <46dda78f@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1188931471 66.106.28.123 (4 Sep 2007 11:44:31 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail