UPDATE: Callbacks & User Defined Button Text

in order to use this you need to edit windows.h.

im not sure why they did this but..

Code:
long WINAPI GetCurrentThreadId(long);


needs to be (it will crash if you dont change this)

Code:
 
long WINAPI GetCurrentThreadId(void);



then... the code.


Code:
typedef void *HHOOK;
HHOOK hHook;

#define WH_CBT     5

LPCSTR lpString = "Lite-C";

LRESULT CALLBACK CBT_Proc(int nCode, WPARAM wParam, LPARAM lParam)
{
	HWND hButton;

	switch(nCode)
	{
	    case HCBT_ACTIVATE:
             {
		   hWnd = (HWND)wParam;

	  	   hButton = GetDlgItem(hWnd, IDOK);
	  	   
		   SetDlgItemText(hWnd, IDOK, lpString);
	    }
	    break;
	}

return CallNextHookEx(hHook, nCode, wParam, lParam);
}


int _MessageBox_Hook(HWND hWnd, LPCSTR lpszText, LPCSTR lpszCaption, UINT uType)
{
	hHook = SetWindowsHookEx(WH_CBT, CBT_Proc, NULL, GetCurrentThreadId());

	int _cbt = _MessageBox(hWnd, lpszText, lpszCaption, uType | MB_USERICON, IDI_ICON);
	
//	int _cbt = MessageBox(hWnd, lpszText, lpszCaption, uType);  // if you want to use the regular messagebox.

	UnhookWindowsHookEx(hHook);

return _cbt;
}



then call it. (use this instead of calling MessageBox or _MessageBox)

Code:
_MessageBox_Hook(NULL, "MessageBox Hooks, Callbacks, User Defined Buttons & Icons", "Lite-C", MB_OK);