Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Button black edge(should be white)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
NoMercy
Master Cheater
Reputation: 1

Joined: 09 Feb 2009
Posts: 289

PostPosted: Wed Nov 03, 2010 5:52 pm    Post subject: Button black edge(should be white) Reply with quote

Hello,

I'm trying to make a button in a tab control, it works all fine, but the button I created has a black edge, I would like it to be normal(white) but it isnt.

pic: http://img178.imageshack.us/i/sendr.png/
Code:
Code:
hButtSend = CreateWindowEx(WS_EX_LEFT,TEXT("BUTTON"), TEXT("Send"),WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON| ,463, 283, 55, 22,hWnd,(HEMNU)ID_M_SEND,hInstance,NULL);


hTabSend = the tab control HWND's, a lsitview + edit box worked fine so idk why this is not.

If i change hTabSend-> hWnd(windows HWND) it works, no black edge.

Any ideas how to fix this?

Grz

EDIT: When i hide the tabcontrol and make the button child from hWnd(main window), it keep spamming me the wParam of the button(ID_M_SEND'.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Thu Nov 04, 2010 8:49 am    Post subject: Reply with quote

Looks to me like the control is automatically inheriting the default control look. Try setting, say, the edit box next to it as the default control instead.

Look up DM_SETDEFID if you need help with how to do that.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
NoMercy
Master Cheater
Reputation: 1

Joined: 09 Feb 2009
Posts: 289

PostPosted: Thu Nov 04, 2010 12:32 pm    Post subject: Reply with quote

Code:
hButtSend = CreateWindowEx(WS_EX_LEFT,TEXT("Button"), TEXT("Send"),WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON,462, 282, 55, 25,hTabSend,(HMENU)ID_W_SEND,hInstance,NULL);

         #define DM_SETDEFID (ID_W_SEND);
//tried this to
SendMessage(hWnd,
                        DM_SETDEFID,
                        (WPARAM) ID_W_SEND,
                        (LPARAM) 0);




Still not working properly:(
Back to top
View user's profile Send private message
NoMercy
Master Cheater
Reputation: 1

Joined: 09 Feb 2009
Posts: 289

PostPosted: Sat Nov 06, 2010 8:33 am    Post subject: Reply with quote

Found out how to make it so, the button looks ok.
Code:

CreateWindowEx(0,L"STATIC", 0,WS_CHILD | WS_VISIBLE|SS_OWNERDRAW,5,25, 524,308,hWndTab,0,hInstance,0);


to

Code:
CreateWindowEx(0,L"STATIC", 0,WS_CHILD | WS_VISIBLE/, 5,25, 524,308,hWndTab,0,hInstance,0);


Now it does not respond if i click it?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Nov 06, 2010 2:25 pm    Post subject: Reply with quote

Well to start your CreateWindowEx call doesn't match your first post. So not really something we could have helped you with for the owner drawn issue.

As for not responding, you need to give the button an ID inside the hMenu param. When you click a button it sends the WM_COMMAND message to your window procedure with wParam being the id of the control.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites