runtime style changing

This is a discussion on runtime style changing within the C Programming forums, part of the General Programming Boards category; I can add styles to a dialog runtime with GWL_STYLE,GetWindowLong so, Code: static DWORD oldStyle; oldStle=GetWindowLong(hwnd,GWL_STYLE); SetWindowLong(hwnd,GWL_STYLE,oldStyle|WS_MINIMIZEB OX); but I ...

  1. #1
    Unregistered
    Guest

    runtime style changing

    I can add styles to a dialog runtime with GWL_STYLE,GetWindowLong so,
    Code:
    static DWORD oldStyle;
    
    oldStle=GetWindowLong(hwnd,GWL_STYLE);
                                   SetWindowLong(hwnd,GWL_STYLE,oldStyle|WS_MINIMIZEB
                                  OX);
    but I can not remove styles with using ! operator prior to styles. For this instance,
    Code:
    oldStle=GetWindowLong(hwnd,GWL_STYLE);
                                   SetWindowLong(hwnd,GWL_STYLE,oldStyle & !WS_MINIMIZEBOX);
    what is the true way? I'm studying on a Propert Sheet dialog.

  2. #2
    Im back! shaik786's Avatar
    Join Date
    Jun 2002
    Location
    Bangalore, India
    Posts
    345
    Try ~ instead.

    Code:
    oldStle=GetWindowLong(hwnd,GWL_STYLE);
                                   SetWindowLong(hwnd,GWL_STYLE,oldStyle & ~WS_MINIMIZEBOX);

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Also, might I suggest you use the Windows forum for Windows specific questions....
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  4. #4
    Unregistered
    Guest
    Thank you very much shaik786. Btw, for Hammer, yep I tried it before...

  5. #5
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by Unregistered
    Thank you very much shaik786. Btw, for Hammer, yep I tried it before...
    You're missing the point entirely. Yes, you found your answer here. No, you should not post all of your Windows specific code questions here. Anwyay, I'm glad you've found your answer.

    Quzah.
    Hope is the first step on the road to disappointment.

  6. #6
    Unregistered
    Guest
    Hmm,
    No answer or help but you are not lazy to... You see I wrote my answer above

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Changing the style of a MDI child window
    By The Dog in forum Windows Programming
    Replies: 3
    Last Post: 05-07-2004, 05:44 PM
  2. Windows XP visual themes and style changing
    By bennyandthejets in forum Windows Programming
    Replies: 15
    Last Post: 10-03-2003, 10:49 AM
  3. How to change window style at runtime?
    By Mr. Bitmap in forum Windows Programming
    Replies: 5
    Last Post: 06-09-2002, 04:49 PM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  5. changing menu titles at runtime???
    By spike232 in forum C# Programming
    Replies: 1
    Last Post: 05-13-2002, 02:19 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21