Commonly used DuiLib message types

1. Commonly used DuiLib message types

  • DUI_MSGTYPE_WINDOWINIT: Window initialization message, used to perform initialization operations after the window is created. DUI_MSGTYPE_WINDOWINIT is a message type used to send messages when the window is initialized. This message type can be used to perform some initialization when the window is created and ready to be displayed.
  • DUI_MSGTYPE_CLICK: Mouse click message, used to handle the left mouse button click event. DUI_MSGTYPE_CLICK is another message type, which is used to handle mouse click events. When the user clicks a certain control or area in the window, this message type can be used to trigger the corresponding processing logic.
  • DUI_MSGTYPE_SELECTCHANGED: Selection change message, used to handle selection control (such as list box, drop-down box) option change event.
  • DUI_MSGTYPE_ITEMCLICK: Subitem click message, used to handle subitem (such as list box, tree list) click event.
  • DUI_MSGTYPE_TEXTCHANGED: Text change message, used to handle the content change event of the text box.
  • DUI_MSGTYPE_TIMER: Timer message, used to execute timing tasks at specified time intervals.
  • DUI_MSGTYPE_KEYDOWN and DUI_MSGTYPE_KEYUP: keyboard key messages, used to handle keyboard key events.
  • DUI_MSGTYPE_COMMAND: Custom command message, used to process custom message types.
  • DUI_MSGTYPE_SCROLL: Scroll message, used to handle the scroll bar scroll event.
  • DUI_MSGTYPE_SETFOCUS and DUI_MSGTYPE_KILLFOCUS: Focus messages, used to handle control gain or lose focus events.

These are just some examples of common DuiLib message types. In fact, DuiLib also provides more message types, which can be selected and used according to specific needs.

void CContainerDlg::Notify(TNotifyUI& msg)
{
    
    
	//
	if (msg.sType == DUI_MSGTYPE_CLICK)
	{
    
    
		if (msg.pSender == m_pCloseBtn)
		{
    
    
			CefModule::CefManager::GetInstance()->PostQuitMessage(0);
			m_pCefControl->CloseAllBrowser();
			m_pSDOLogin->CloseLoginDialog();
			this->Close();
		}
		else if (msg.pSender == m_pSettingBtn)
		{
    
    
			wstring strExe = GAME_DIR L"wooolcfg.exe";
			PROCESS_INFORMATION pi = {
    
     0 };
			STARTUPINFO si = {
    
     0 };
			si.cb = sizeof(si);
			BOOL ret = CreateProcess(nullptr, (LPWSTR)strExe.c_str(), nullptr, nullptr, FALSE, 0, nullptr, nullptr, &si, &pi);
			if (ret)
			{
    
    
				CloseHandle(pi.hProcess);
				CloseHandle(pi.hThread);
			}
		}
		else if (msg.pSender == m_pHideLoginDialogBtn)
		{
    
    

			//MessageBox(NULL, L"1", L"1", MB_OK);
			m_pSDOLogin->SetLoginDialogState(2);
			//MessageBox(NULL, L"2", L"2", MB_OK);
		}
		else if (msg.pSender == m_pShowLoginDialogBtn)
		{
    
    
			//MessageBox(NULL, L"3", L"3", MB_OK);
			m_pSDOLogin->SetLoginDialogState(1);
			//MessageBox(NULL, L"4", L"4", MB_OK);
		}
	}
	else if (msg.sType == DUI_MSGTYPE_WINDOWINIT)
	{
    
    
		if (m_pSDOLogin != nullptr && m_pLoginFrameArea != nullptr)
		{
    
    
			m_pSDOLogin->ShowLoginDialog(LoginCallback, 0, 0);
			MoveLoginFrame();
		}
	}

	if (m_pAreaTypeSwitch != nullptr)
	{
    
    
		m_pAreaTypeSwitch->Notify(msg);
	}
}

2. Define all message types

  • #define DUI_MSGTYPE_MENU (_T(“menu”))

  • #define DUI_MSGTYPE_LINK (_T(“link”))

  • #define DUI_MSGTYPE_TIMER (_T(“timer”))

  • #define DUI_MSGTYPE_CLICK (_T(“click”))

  • #define DUI_MSGTYPE_RETURN (_T(“return”))

  • #define DUI_MSGTYPE_SCROLL (_T(“scroll”))

  • #define DUI_MSGTYPE_DROPDOWN (_T(“dropdown”))

  • #define DUI_MSGTYPE_SETFOCUS (_T(“setfocus”))

  • #define DUI_MSGTYPE_KILLFOCUS (_T(“killfocus”))

  • #define DUI_MSGTYPE_ITEMCLICK (_T(“itemclick”))

  • #define DUI_MSGTYPE_TABSELECT (_T(“tabselect”))

  • #define DUI_MSGTYPE_ITEMSELECT (_T(“itemselect”))

  • #define DUI_MSGTYPE_ITEMEXPAND (_T(“itemexpand”))

  • #define DUI_MSGTYPE_WINDOWINIT (_T(“windowinit”))

  • #define DUI_MSGTYPE_BUTTONDOWN (_T(“buttondown”))

  • #define DUI_MSGTYPE_MOUSEENTER (_T(“mouseenter”))

  • #define DUI_MSGTYPE_MOUSELEAVE (_T("mouseleave"))

  • #define DUI_MSGTYPE_TEXTCHANGED (_T(“textchanged”))

  • #define DUI_MSGTYPE_HEADERCLICK (_T(“headerclick”))

  • #define DUI_MSGTYPE_ITEMDBCLICK (_T(“itemdbclick”))

  • #define DUI_MSGTYPE_SHOWACTIVEX (_T(“showactivex”))

  • #define DUI_MSGTYPE_ITEMCOLLAPSE (_T(“itemcollapse”))

  • #define DUI_MSGTYPE_ITEMACTIVATE (_T(“itemactivate”))
    -#define DUI_MSGTYPE_VALUECHANGED (_T(“valuechanged”))

  • #define DUI_MSGTYPE_SELECTCHANGED (_T(“selectchanged”))

Guess you like

Origin blog.csdn.net/qq_44918090/article/details/131718750