{"id":81,"date":"2009-04-02T18:20:40","date_gmt":"2009-04-02T23:20:40","guid":{"rendered":"http:\/\/www.e-consystems.com\/blog\/hiding-the-ras-dial-status-popup-window-and-wi-fi-zero-configuration-utility-popup-window\/"},"modified":"2023-08-15T12:34:55","modified_gmt":"2023-08-15T07:04:55","slug":"hiding-popup-window","status":"publish","type":"post","link":"https:\/\/www.e-consystems.com\/blog\/system-on-module-som\/hiding-popup-window\/","title":{"rendered":"How to remove Pop-up windows in Kiosk mode"},"content":{"rendered":"<p style=\"text-align: justify;\">Windows CE is a customizable OS and custom application has been executed on the top of the OS. Majority of the customers won\u2019t prefer to use the windows CE standard utilities embed on the control panel. Instead they develop their own applications using the standard APIs. During these cases, customer won\u2019t like the standard utility windows popping up on the top of their application.<\/p>\n<p style=\"text-align: justify;\">This is a major requirement from the customers, who are developing custom applications for Kiosks and point of sale terminals. Status window during active sync connection over serial using auto RAS dial application and Wi-Fi zero configuration utility pop up window are typical examples.<\/p>\n<p style=\"text-align: justify;\"><strong>Hiding RAS dial status popup window<\/strong><\/p>\n<p style=\"text-align: justify;\">Usually this window will be popped up while perform the dial up connection over serial modem and connecting the PC through active sync using the auto RAS application to show the connection status. It will disappear after establish the connection. Following procedure hides the popup window.<\/p>\n<p style=\"text-align: justify;\">1)\t<em>Rnaapp.exe<\/em> is used to create and maintain the RAS connection and it is a part of the connection manager. Source code is available on <em>wince600\/public\/common\/oak\/drivers\/netsamp\/rnaapp<\/em> as a library. It is not preferable to change the source code in the public directory.<\/p>\n<p style=\"text-align: justify;\">2)\tCopy the source code <em>RNAAPP <\/em>directory to your BSP, perform sysgen capture to find the dependencies and change the sources accordingly. To perform Sysgen capture for RNAAPP read my latest blog Cloning the Rnaapp application using Sysgen_Capture tool<\/p>\n<p style=\"text-align: justify;\">3)\tActually the status window is a dialog box and as you know that every dialog box should have a callback function that handles the message for the dialog box. <em>WndProc <\/em>is a callback function handling the message for the status dialog box and the messages are handled in a <em>switch ()<\/em> case format.<\/p>\n<p style=\"text-align: justify;\">4)<em> IDM_START_RASDIAL<\/em> is the message, which is responsible for popping up the status window. Here is the code to disable the popup window.<\/p>\n<p style=\"text-align: justify;\"><em>case IDM_START_RASDIAL<\/em><em>:<br \/>\ncxScreen = GetSystemMetrics(SM_CXSCREEN);<br \/>\n\/\/ Start a RAS Session<br \/>\nmemset( (char *)&amp;v_RasDialParams, 0, sizeof( RASDIALPARAMS ) );<br \/>\nv_RasDialParams.dwSize = sizeof(RASDIALPARAMS);<br \/>\n_tcscpy( v_RasDialParams.szEntryName, EntryName );<br \/>\nRasGetEntryDialParams( NULL, &amp;v_RasDialParams, &amp;v_fPassword );<br \/>\n\/\/ If this is a dial-up entry, show them the user params<br \/>\n\/\/ (Username\/Password, etc) to modify before continuing.<br \/>\n\/\/ Is this a dial-up entry? (and secret no-password not specified)<br \/>\n\/\/ ShowWindow( hWnd, SW_SHOW );\t\/\/Change this to hide the window.<br \/>\nShowWindow( hWnd, SW_HIDE );<\/em><\/p>\n<p style=\"text-align: justify;\">5)\t  In the <em>ShowWindow()<\/em> function, change the SW_SHOW to SW_HIDE option.<\/p>\n<p style=\"text-align: justify;\">This will hide the pop up window.<\/p>\n<p style=\"text-align: justify;\"><strong>Hiding the Wi-Fi zero configuration (WZC) utility pop up window<\/strong><\/p>\n<p style=\"text-align: justify;\">This window will be popped up to configure the SSID and other related parameters to establish the Wi-Fi connection.  NETUI.dll and ETHMAN.dll is responsible for adding and maintaining the network connections, adding and removing the connections from system tray etc. Source code for the WZC popup window is the part of the NETUI component. Following procedure hides the popup window.<\/p>\n<p style=\"text-align: justify;\">1)\twzcpopup.c is the source file contains the code to enable and disable the popup window. This file is available on wince600\/public\/common\/oak\/drivers\/ NETUI dir. NETUI will be generated as a DLL during the sysgen phase. It is not preferable to change the source code in the public directory.<\/p>\n<p style=\"text-align: justify;\">2)\tCopy the NETUI directory to your BSP, perform sysgen capture to find the dependencies and change the sources accordingly.<\/p>\n<p style=\"text-align: justify;\">3)\tGetDialogPopup(BOOL* pfPopup, DWORD* pdwTimeoutSecs) is the function used by the NETUI and the decision to popup the dialog box has been taken based on the ETHMAN registry settings.<\/p>\n<p style=\"text-align: justify;\">Following registry settings are ETHMAN driver registry settings.<\/p>\n<p style=\"text-align: justify;\"><em>#define HKEY_ETHMAN_POPUP\t\t_T(&#8220;Drivers\\Builtin\\Ethman\\Popup&#8221;)<br \/>\n#define REGVAL_ETM_POPUP_TIMEOUT\t_T(&#8220;Timeout&#8221;)<br \/>\n#define REGVAL_ETM_POPUP\t\t\t_T(&#8220;Popup&#8221;)<\/em><\/p>\n<p style=\"text-align: justify;\">Based on the <em>REGVAL_ETM_POPUP<\/em> value,*pfPopup value is passed to the calling function. This value is changed in two places. If the registry is not exist, it has been created and the *pfPopup value is assigned as TRUE and if the registry is already available, this value is read from the registry. Assigning FALSE to *pfPopup will not allow the WZC window to popup.  Here is the partial code to disable the popup window.<\/p>\n<p style=\"text-align: justify;\"><em>\/\/ Is the popup check box on ethman suppose to be enabled<br \/>\nDWORD GetDialogPopup(BOOL* pfPopup, DWORD* pdwTimeoutSecs)<br \/>\n{<br \/>\n\u2026..<br \/>\n\u2026\u2026<br \/>\n\/\/ If this was a new key then let&#8217;s set up the values and<br \/>\n\/\/ return the default value<br \/>\nif(dwDisp == REG_CREATED_NEW_KEY)<br \/>\n{<br \/>\n\u2026\u2026<br \/>\n\u2026\u2026<br \/>\n\u2026\u2026<br \/>\n\/\/ Set popup value<br \/>\n\/\/\tdwValue = TRUE;\t\t\/\/Actual value<br \/>\ndwValue = FALSE;\t\/\/Changed value<br \/>\ndwErr = RegSetValueEx(hKeyEtm,<br \/>\nREGVAL_ETM_POPUP,<br \/>\n0,<br \/>\nREG_DWORD,<br \/>\n(PBYTE)&amp;dwValue,<br \/>\nsizeof(DWORD));<br \/>\nif(dwErr != ERROR_SUCCESS)<br \/>\n{<br \/>\ngoto exit;<br \/>\n}<br \/>\nif(pfPopup)<br \/>\n{<br \/>\n*pfPopup = (BOOL) dwValue;<br \/>\n}<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\n\u2026\u2026.<br \/>\n\u2026\u2026..<br \/>\n\u2026\u2026..<br \/>\nif(pfPopup)<br \/>\n{<br \/>\ncdwValue = sizeof(DWORD);<br \/>\n\/\/ Get popup value<br \/>\ndwErr = RegQueryValueEx(hKeyEtm,<br \/>\nREGVAL_ETM_POPUP,<br \/>\n0,<br \/>\nNULL,<br \/>\n(PBYTE)&amp;dwValue,<br \/>\n&amp;cdwValue);<br \/>\nif(dwErr != ERROR_SUCCESS)<br \/>\n{<br \/>\ngoto exit;<br \/>\n}<br \/>\n\/\/\t*pfPopup = dwValue;  \/\/Actual code<br \/>\n*pfPopup = FALSE;\t\/\/ Changed value<br \/>\n}<\/em><\/p>\n<p style=\"text-align: justify;\">This will hide the pop up window.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows CE is a customizable OS and custom application has been executed on the top&#8230;<\/p>\n","protected":false},"author":12,"featured_media":1394,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[213],"tags":[32,33],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.e-consystems.com\/blog\/system-on-module-som\/wp-json\/wp\/v2\/posts\/81"}],"collection":[{"href":"https:\/\/www.e-consystems.com\/blog\/system-on-module-som\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.e-consystems.com\/blog\/system-on-module-som\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.e-consystems.com\/blog\/system-on-module-som\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.e-consystems.com\/blog\/system-on-module-som\/wp-json\/wp\/v2\/comments?post=81"}],"version-history":[{"count":1,"href":"https:\/\/www.e-consystems.com\/blog\/system-on-module-som\/wp-json\/wp\/v2\/posts\/81\/revisions"}],"predecessor-version":[{"id":2961,"href":"https:\/\/www.e-consystems.com\/blog\/system-on-module-som\/wp-json\/wp\/v2\/posts\/81\/revisions\/2961"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.e-consystems.com\/blog\/system-on-module-som\/wp-json\/wp\/v2\/media\/1394"}],"wp:attachment":[{"href":"https:\/\/www.e-consystems.com\/blog\/system-on-module-som\/wp-json\/wp\/v2\/media?parent=81"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.e-consystems.com\/blog\/system-on-module-som\/wp-json\/wp\/v2\/categories?post=81"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.e-consystems.com\/blog\/system-on-module-som\/wp-json\/wp\/v2\/tags?post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}