Why buttons are displayed in xp but hidden in windows 7?


  1. Posts : 1
    windows 7 64 bit prof
       #1

    Why buttons are displayed in xp but hidden in windows 7?


    The question is : Why buttons are displayed in xp but hidden in windows 7?
    The code that I use for the buttons is createwindow. The buttons are child control.

    I run win32 program on windows 7 64 bit.
    The program is running prefect on win xp.
    On win7 the buttons are hidden and if I click the button position, it is flashing for a mili sec.
    So the buttons are created and responding but hidden behind the parent window.

    The code that I use is : CreateWindow (TEXT("button"), ctrlText, WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_BITMAP, 250, 110, 100, 25, hwnd,(HMENU)ctrlID, hInstance, NULL);

    I don't know how to solve this problem. Tried to change the style, use createwindowex instead of createwindow, call InitCommonControls but failed to solve the problem.

    Thank you,
    Rachel
      My Computer


  2. Posts : 5,092
    Windows 7 32 bit
       #2

    In Remarks section for CreateWindow I see:

    If the created window is a child window, its default position is at the bottom of the Z-order. If the created window is a top-level window, its default position is at the top of the Z-order (but beneath all topmost windows unless the created window is itself topmost).
    To me that implies you have to do something like calling SetForegroundWindow on the handle. Maybe they changed the API since XP.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 13:31.
Find Us