|
|
|
|
|
|
|
|
SGT_FW
by Aku_Aku. 05/31/26 11:05
|
|
|
|
|
XTB
by pr0logic. 05/18/26 12:27
|
|
|
1 registered members (TipmyPip),
3,688
guests, and 3
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Masking error messages
#421260
04/14/13 12:51
04/14/13 12:51
|
Joined: Sep 2009
Posts: 1,035 Budapest
Aku_Aku
OP
Serious User
|
OP
Serious User
Joined: Sep 2009
Posts: 1,035
Budapest
|
Based on this page of the manual: on_messagei would like to try handling the E1115 error, so the engine wouldn't pop up nothing, furthermore it wouldn't exit. Please tell me what constant should i use instead of WM_SIZE? I browsed the windows.h but was not able to figure out the correct value.
|
|
|
Re: Masking error messages
[Re: Aku_Aku]
#421278
04/14/13 17:28
04/14/13 17:28
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
He is probably talking about using something like Detours to reroute the underlying API function. If you ask me, this is unbelievable dirty. Fixing software problems by throwing more software at them rarely turns out to be a good idea, so I would rather like to see a possibility to tell Gamestudio that you want to handle a certain error and have the engine then ask you at runtime to handle the error.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Masking error messages
[Re: WretchedSid]
#421280
04/14/13 17:35
04/14/13 17:35
|
Joined: Sep 2009
Posts: 1,035 Budapest
Aku_Aku
OP
Serious User
|
OP
Serious User
Joined: Sep 2009
Posts: 1,035
Budapest
|
Thanks JustSid. In my opening post i told what i would like to handle. Maybe one day, i will get a correct answer (no offense just praying...). (Furthermore, i suspect is not enough to hook the MessageBoxa, because it will not save from exit.)
Last edited by Aku_Aku; 04/14/13 17:38. Reason: append a remark
|
|
|
Re: Masking error messages
[Re: jcl]
#421315
04/15/13 13:17
04/15/13 13:17
|
Joined: Oct 2011
Posts: 1,082 Germany
Ch40zzC0d3r
Serious User
|
Serious User
Joined: Oct 2011
Posts: 1,082
Germany
|
typedef INT (WINAPI *MessageBoxAt)(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType);
MessageBoxAt oMessageBoxA;
//Sample hooked function
INT WINAPI hkMessageBox(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType)
{
if(strcmp(lpCaption, "Error E1513") == 0) //Compares the title of the msgbox
{
iCount++;
add_log("[%i] - %s", iCount, lpText);
return 0;
}
#ifdef _USE_DEFAULT_RETURN_MSGBOXA
return oMessageBoxA(hWnd, lpText, lpCaption, uType);
#else
return 0;
#endif
}
oMessageBoxA = (MessageBoxAt)DetourFunction((BYTE*)(DWORD)GetProcAddress(GetModuleHandle("user32.dll"), "MessageBoxA"), (BYTE*)hkMessageBox);
If you return 0, the engine will NOT exit. Works perfectly. But if its a program crash as JCL pointed out, the engine will freeze too.
Last edited by Ch40zzC0d3r; 04/15/13 13:26.
|
|
|
|