🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Can reverse video in edit control be shut off?

#16213
From: Bill Carson
Date: Tue, 27 May 2003 15:34
37 lines
2352 bytes
> Whoops. Apparently the OS selects all the text in an edit control
> whenever it gives it focus, so your efforts in WM_INITDIALOG are futile.
> The trick seems to be to clear the selection *after* the OS has set it,
> which you may do in an EN_SETFOCUS notification handler.
>
>    case WM_COMMAND:
>      if (LOWORD(wparam) == 199)
>      {
>        if (HIWORD(wparam) == EN_SETFOCUS)
>        {
>          SendMessage(reinterpret_cast<HWND>(lparam), EM_SETSEL, -1, 0);
>        }
>      }
>

Your good, that was the answer that worked. Here is the code I used:

 HWND hwndEdit;
 hwndEdit = GetDlgItem(hwndDlg, 199);
      switch (message)
      {
        case WM_INITDIALOG:
         SetWindowText(hwndDlg, szFileName);
         SetDlgItemText(hwndDlg, 199, (LPCSTR) pConv);
        return TRUE;
        case WM_COMMAND:
        if (LOWORD(wParam) == 199)
        {
         if (HIWORD(wParam) == EN_SETFOCUS)
         {
         SendMessage(hwndEdit, EM_SETSEL, -1, 0);
         }
        }

Thanks for your help,

Bill
Technical Details
Message-ID: <3ed385b7$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-08!supernews.com!newsswitch.lcs.mit.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!worldnet.att.net!216.166.71.14!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3ed13bd7@newsgroups.borland.com> <3ED14414.2040904@directnet.com> <3ed23788@newsgroups.borland.com> <3ED23C01.80906@domain.invalid> <3ed25e24@newsgroups.borland.com> <3ED28C29.40106@domain.invalid>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,a52495bb3fc3f3b6
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-05-27 09:19:48 PST
From: "Bill Carson" <bcarson892003atyahoodotcom>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3ed13bd7@newsgroups.borland.com> <3ED14414.2040904@directnet.com> <3ed23788@newsgroups.borland.com> <3ED23C01.80906@domain.invalid> <3ed25e24@newsgroups.borland.com> <3ED28C29.40106@domain.invalid>
Subject: Re: Can reverse video in edit control be shut off?
Date: Tue, 27 May 2003 08:34:57 -0700
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
NNTP-Posting-Host: 66.119.208.209
Message-ID: <3ed385b7$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1054049719 66.119.208.209 (27 May 2003 08:35:19 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-08!supernews.com!newsswitch.lcs.mit.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!worldnet.att.net!216.166.71.14!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail