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

RachelIsr

New member
Local time
6:45 PM
Messages
1
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 My Computer

At a glance

windows 7 64 bit prof
Computer type
PC/Desktop
OS
windows 7 64 bit prof
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 My Computer

At a glance

Windows 7 32 bitAMD 5200+ dual core2 GBNVidia GeForce 6150SE 128 MB
Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
Back
Top