PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Disabling the taskbar on HPC (Jornada 720)

I am in the process of adding HPC support to PocketFrog. Access to the display was easy: the frame buffer address is known. Now I need to disable the taskbar. I've tried this code from EasyCE:

Code:

void taskbar( bool show )
{
// The winCE 2.x way
#define TASKBAR_KEY _T("\\software\\microsoft\\shell")
HKEY hKey=0;
RegOpenKeyEx( HKEY_LOCAL_MACHINE, TASKBAR_KEY, 0, KEY_ALL_ACCESS, &hKey );
DWORD dwValue = 0;
unsigned long lSize = sizeof( DWORD );
DWORD dwType = REG_DWORD;
RegQueryValueEx( hKey, _T("TBOpt"), 0, &dwType, (BYTE*)&dwValue, &lSize );
if (show) dwValue &= 0xFFFFFFFF - 8;// reset bit to show taskbar
else dwValue |= 8; // set bit to hide taskbar
RegSetValueEx( hKey, _T("TBOpt"), 0, REG_DWORD, (BYTE*)&dwValue, lSize );
MSG msg;
msg.hwnd = FindWindow( _T("HHTaskBar"), NULL );
::SendMessage( msg.hwnd, WM_COMMAND, 0x03EA, 0 );
::SetForegroundWindow( m_hWnd );
}


This does a good job at hiding the taskbar, but it is still active. If I click on it, the application buttons reappears. I can even select the <start> menu.

Any idea how I could disable the taskbar?

Thanks!
Already found the solution, here it is:

Code:

HWND hwnd = FindWindow( _T("HHTaskBar"), 0 );
ShowWindow( hwnd, (bShow) ? SW_SHOW : SW_HIDE);


It was that simple... =)
You can create a window with the EX_TOPMOST (or something) flag set. This hides and deactivates the taksbar...(IE: You cant click the buttons...)
If you could figure out how to take controll of the buttons in the top row of a 720, that would be awsume. I played around with that for a little bit, but couldn't get it to work.
Got them on my J680. I suppose using them would be useful...
You can call EnableWindow(msg.hwnd, FALSE); after you hide the taskbar. Just make sure to re-enable it by calling EnableWindow(msg.hwnd, TRUE); when your program's exiting, otherwise the user won't be able to access anything on the taskbar until they do a soft-reset.
It seems the only safe way to do it is by using WS_EX_TOPMOST at window creation time. The other two methods (the one I suggested and the one with disabling the window) are both unnacceptable: if the game crash or exit without proper cleanup, the taskbar is not usable anymore.

With WS_EX_TOPMOST, the game can crash all it wants and the taskbar still works.

I will investigate hooking the special keys... Thanks for all the feedback!