Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Sat, 23 Aug 2008 04:04:15 -0700 (PDT),    group: microsoft.public.win32.programmer.ui        back       


Edit control does not display border, only after WM_PAINT called again   
Hi,
I need to create a simple EDIT control on a window application,
without using MFC.
This is the code adding the EDIT control, with the WS_BORDER:

	HWND hwndEdit = CreateWindow("EDIT",
						NULL,
						WS_CHILD | WS_VISIBLE | ES_LEFT | ES_AUTOHSCROLL | WS_BORDER,
						650,3,120,23,
						hwndTB,
						(HMENU) SEARCH_EDIT_ID,
						(HINSTANCE)(GetWindowLong(hwndTB,GWL_HINSTANCE)),
						NULL);

       SendMessage(hwndEdit, EM_SETLIMITTEXT, (WPARAM) 30, (LPARAM)
0);

But yet, the edit control has no border.
Only if I minimize & maximize the window (hence calling WM_PAINT) the
border is drawn.

help??
Thanks!!
Gabi
date: Sat, 23 Aug 2008 04:04:15 -0700 (PDT)   author:   Gabriela

Re: Edit control does not display border, only after WM_PAINT called again   
>I need to create a simple EDIT control on a window application,
>without using MFC.
>This is the code adding the EDIT control, with the WS_BORDER:
>
>	HWND hwndEdit = CreateWindow("EDIT",
>						NULL,
>						WS_CHILD | WS_VISIBLE | ES_LEFT | ES_AUTOHSCROLL | WS_BORDER,
>						650,3,120,23,
>						hwndTB,
>						(HMENU) SEARCH_EDIT_ID,
>						(HINSTANCE)(GetWindowLong(hwndTB,GWL_HINSTANCE)),
>						NULL);
>
>       SendMessage(hwndEdit, EM_SETLIMITTEXT, (WPARAM) 30, (LPARAM)
>0);
>
>But yet, the edit control has no border.
>Only if I minimize & maximize the window (hence calling WM_PAINT) the
>border is drawn.

That seems odd.

Have you tried using SetWindowPos with SWP_DRAWFRAME?

Dave
date: Sat, 23 Aug 2008 16:30:59 +0100   author:   David Lowndes lid

Re: Edit control does not display border, only after WM_PAINT called again   
I tried
SetWindowPos(hwndEdit,HWND_TOP,650,3,120,23,SWP_DRAWFRAME);
- but it didn't help...
Any more ideas?
Gabi
date: Sat, 23 Aug 2008 09:44:30 -0700 (PDT)   author:   Gabriela

Re: Edit control does not display border, only after WM_PAINT called again   
Gabriela wrote:
> I tried
> SetWindowPos(hwndEdit,HWND_TOP,650,3,120,23,SWP_DRAWFRAME);
> - but it didn't help...
> Any more ideas?
> Gabi
> 
The border is normally painted when a window receives a WM_NCPAINT 
message. Have you done anything that might have prevented this message 
from reaching the control?

-- 
Norm

To reply, change domain to an adult feline.
date: Sat, 23 Aug 2008 15:16:31 -0700   author:   Norman Bullen

Re: Edit control does not display border, only after WM_PAINT called again   
>I tried
>SetWindowPos(hwndEdit,HWND_TOP,650,3,120,23,SWP_DRAWFRAME);
>- but it didn't help...

Gabi,

I've tried your code snippet by adding it to the WM_INITDIALOG handler
of the About dialog of the generic SDK Windows application generated
by Visual Studio, and I don't see any problem (tested under XP).

You're not by any chance expecting to see the beveled type border that
you normally get when you place an edit control on a dialog are you?

If you are, change your code to:

 hwndEdit = CreateWindowEx( WS_EX_CLIENTEDGE,
			_T("EDIT"),
			...


Dave
date: Mon, 25 Aug 2008 10:28:18 +0100   author:   David Lowndes lid

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us