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 


WM_COMMAND Message from TabControl

 
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: Thu Feb 03, 2011 8:24 am    Post subject: WM_COMMAND Message from TabControl Reply with quote

Hello,

My problem is that the WM_COMMAN message is nto called when I click a button at my tab control. I'll show you some code.

To create the tabcontrol
Code:
hTab = CreateWindowEx(NULL, WC_TABCONTROL, L"",WS_CHILD | WS_VISIBLE,3, 3,490,360,hWnd, NULL,g_hInstance, NULL);
   TCITEM tab_info;
   memset(&tab_info, 0, sizeof(tab_info));
   tab_info.mask = TCIF_TEXT;
   tab_info.pszText = L"Send";
   tab_info.cchTextMax = 5;
   SendMessage(hTab, TCM_INSERTITEM, 0, (LPARAM)&tab_info);
   tab_info.pszText = L"Recv";
   SendMessage(hTab, TCM_INSERTITEM, 1, (LPARAM)&tab_info);
   ApplyCalibri(hTab);

   hTabSend = CreateStatic(L"", true, 4,26, 480, 330, hTab, ID_TABSEND, g_hInstance);   
   hCurrentTab = hTabSend;
   hTabRecv = CreateStatic(L"", false, 4,26, 480, 330, hTab, ID_TABRECV, g_hInstance);

        //ccreatestatic Function
         HWND CreateStatic(LPCWSTR lpcwszText, bool fVisible, CONST INT iX, CONST INT iY, CONST UINT uWidth, CONST UINT uHeight, HWND hWnd, CONST UINT uId, HINSTANCE hInstance)
{
   HWND hStatic = CreateWindowEx(WS_EX_LEFT, L"Static", lpcwszText, (fVisible ? WS_VISIBLE : NULL) | WS_CHILD | SS_CENTER, iX, iY, (int)uWidth, (int)uHeight, hWnd, (HMENU)uId, hInstance, NULL);
   ApplyCalibri(hStatic);
   return hStatic;
}


When I make a button like this
Code:
hSend = CreateButton(true,L"Send", 432, 291, 48, 20, hTabSend, ID_SEND, g_hInstance, 0);


It's look normal etc, but when I click there is no message been sent to the WM_COMMAND from hWnd parent window. Any ideas how I can solve this?

Regards
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 Feb 03, 2011 1:34 pm    Post subject: This post has 1 review(s) Reply with quote

Try sub-classing the wndproc for the tab control.
_________________
- 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 Feb 03, 2011 2:55 pm    Post subject: Reply with quote

Thanks fixed it:) + rep
Back to top
View user's profile Send private message
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