Customizing Dialog Boxes and Message Boxes for Headless Systems 2/2


In the previous post we left the following question open: what if you want to link coredll to your own library with customized message and dialog boxes instead of the ‘standard’ messagedialogboxcustomize? Here’s the answer (or at least one of the possible ones):

  1. Create an empty subproject in your OS design using the ‘WCE static library’ template: we’ll call the project ‘mymessageboxcustomize’
  2. Modify the sources file changing RELEASETYPE to OAK
  3. Copy the _WINCEROOT%\PUBLIC\COMMON\OAK\DRIVERS\MESSAGEDIALOGBOXCUSTOMIZE\messagedialogboxcustomize.cpp file to the subproject folder and add it to the subproject itself
  4. Build it and verify that you get mymessageboxcustomize.lib in $(_PROJECTROOT)\oak\lib
  5. Modify the %_PROJECTROOT%\oak\misc\cesysgen.bat file so it looks like
@echo off
call %_PUBLICROOT%\cebase\oak\misc\cesysgen.bat %*
REM Add our custom message box implementation
if not "%COREDLL_REPLACE_COMPONENTS%" == "" set COREDLL_REPLACE_COMPONENTS=mymessageboxcustomize %COREDLL_REPLACE_COMPONENTS%
if "%COREDLL_REPLACE_COMPONENTS%" == "" set COREDLL_REPLACE_COMPONENTS=mymessageboxcustomize
REM Remove "messagedialogboxthunk" from %COREDLL_COMPONENTS%
for %%f in (%COREDLL_COMPONENTS%) do call :RemoveMessagedialogboxthunk %%f
set COREDLL_COMPONENTS=%TEMP_COREDLL_COMPONENTS%
goto :EOF
:RemoveMessagedialogboxthunk
if /i "%1"=="messagedialogboxthunk" goto :EOF
if not "%TEMP_COREDLL_COMPONENTS%" == "" set TEMP_COREDLL_COMPONENTS=%1 %TEMP_COREDLL_COMPONENTS%
if "%TEMP_COREDLL_COMPONENTS%" == "" set TEMP_COREDLL_COMPONENTS=%1
goto :EOF

The second part of the file is the same as the previous post: it removes the standard messagedialogboxthunk library to avoid multiple definitions for MessageBox/DialogBoxIndirectParam/CreateDialogIndirectParam.

The first part takes advantage of the COREDLL_REPLACE_COMPONENTS environment variable which is handled in %_WINCEROOT%\PUBLIC\COMMON\CESYSGEN\makefile.

Now, ‘all’ you have to do is filling the stubs in messagedialogboxcustomize.cpp with your desired implementation of MessageBox/DialogBoxIndirectParam/CreateDialogIndirectParam.

Advertisements
This entry was posted in Windows Embedded CE. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s