Skip to main content
GameDev.net gamedev.net
🔒 Locked

Button showing

Started by Homer Simpson Jul 23, 2002 at 1:29 PM 7 replies 600+ views
Original Post
Homer Simpson
Homer Simpson
hwndbutton=CreateWindowEx(NULL,"button","asdas",WS_CHILD|WS_VISIBLE|BS_RADIOBUTTON,100,100,200,24,hwnd,(HMENU)(1112),hInstance,NULL); I am using this code but it isn´t chowing my button until i "guess" the local of it and click in it ... I can´t figure out what is wrong... Thanx in advance
______::Homer Simpson::
Homer Simpson
Homer Simpson
Oh i ''ve fixed the problem i have to use the parent hwnd instead of hwndbutton
______::Homer Simpson::
Homer Simpson
Homer Simpson
When resize the wondow it happens the samething as the first post what is the problem???????
______::Homer Simpson::
Homer Simpson
Homer Simpson
I´ve fixed it again puttin a UpdateWindow in the messageloop is that correct:???
______::Homer Simpson::
-Thork-
-Thork-
You definately shouldn''t be putting UpdateWindow in the message loop as that is sending loads of WM_PAINT messages and possible WM_NCPAINT messages too. It seems that something is drawing over the button. Make sure that in your code there is nothing that would draw a rectangle over the area that the button is contained in. Check the WM_PAINT message if you have one, or WM_SIZE message to see if something is drawing where it shouldn''t be.
Homer Simpson
Homer Simpson
no it haven´t nothing painting over the button...
______::Homer Simpson::
Oluseyi
Oluseyi
When you first create the button, make sure you call ShowWindow on the parent. Then, when you update the button (move/press/whatever), call InvalidateRect on it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.