Problem with SetWindowLongA

forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
Fernando Cerca

Problem with SetWindowLongA

Post by Fernando Cerca » 15 Jan 2009, 08:21

 Posted by:  Fernando Cerca 

Hi to all:

I have a problem:
I create a window with no title bar using the function
Call SetWindowLongA( hWndForm, GWL_STYLE,
GetWindowLongA( hWndForm, GWL_STYLE ) - ( WS_THICKFRAME | WS_VSCROLL |
WS_HSCROLL ) )

, thist works fine in Windows XP, but in Windows 2003 the app crashes. Can
anybody provide with and example with the needed arrangements to avoid this
behavior?

I'm using CTD 2.0

Thanks in advance.

Fernando.

Gerhard Achrainer

Re: Problem with SetWindowLongA

Post by Gerhard Achrainer » 15 Jan 2009, 09:34

 Posted by:  g.achrainer 

Hi,

as we don't know the styles that your form has, I suggest the following:

Call SetWindowLongA( hWndForm, GWL_STYLE,
( GetWindowLongA( hWndForm, GWL_STYLE ) | WS_THICKFRAME | WS_VSCROLL |
WS_HSCROLL ) - ( WS_THICKFRAME | WS_VSCROLL | WS_HSCROLL ) )

This will add the styles before you actually remove them. If you, for
example, do not have "WS_HSCROLL" set and try to remove it, you get an
invalid style otherwise.

If this does not help, you will need to provide an example.

Regards,

Gerhard

Fernando Cerca

Re: Problem with SetWindowLongA

Post by Fernando Cerca » 20 Jan 2009, 05:06

 Posted by:  Fernando Cerca 

Hi Gerhard

I took this piece of code many years ago in order to avoid the system menu
and the title bar. This has been unchanged for about 9 year. Suddenly, as
we moved from a Ctrix NT Server to a Citrix Windows 2003 Server, our app
stopped doing what it's supposed to do.

After some tries, I noticed that if I change the atribute "System Menu =
NO", The app behaves the way I wanted, without using that function call
anymore.
(I still wonder why this happens).

Regards

Fernando Cerca

Return to “td.sourcecode”

Who is online

Users browsing this forum: [Ccbot] and 0 guests