NO

Author Topic: AutoHide Toolbar  (Read 3014 times)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
AutoHide Toolbar
« on: September 20, 2015, 11:50:28 AM »
Is this enought
Code: [Select]
void OnMouseMove(HWND hwnd, int x, int y, UINT keyFlags)
{
if (y <= 2 && !IsWindowVisible(hToolbar))
ShowWindow(hToolbar, SW_SHOW);
if (y > 20 && IsWindowVisible(hToolbar))
ShowWindow(hToolbar, SW_HIDE);
}
any known problems with it?

With timer
Code: [Select]
void OnMouseMove(HWND hwnd, int x, int y, UINT keyFlags)
{
if (y <= 2 && !IsWindowVisible(hToolbar))
ShowWindow(hToolbar, SW_SHOW);
else if (y > 20 && IsWindowVisible(hToolbar))
SetTimer(hwnd, 100, 1000, 0);
}
void OnTimer(HWND hwnd, UINT id)
{
ShowWindow(hToolbar, SW_HIDE);
KillTimer(hwnd, 100);
InvalidateRect(hwnd, NULL, FALSE);
}
« Last Edit: September 21, 2015, 04:50:41 PM by TimoVJL »
May the source be with you