Windows Taskbar Tips&Tricks

, \t\t , Some "secrets" of Windows Taskbar ,,How to press a "Start" button from your program:,,, procedure TForm1.PressStart(Sender: TObject);,, var,, hTaskBar, hButton : HWND;,, hDCScreen : HDC;,, ScreenHeight : DWORD;,, begin,, //find "Start" button,, hDCScreen := GetDC(0);,, ScreenHeight :=GetDeviceCaps(hDCScreen,VERTRES);,, ReleaseDC(0, hDCScreen);,, hTaskBar := FindWindow('Shell_TrayWnd', nil);,, hButton := GetWindow(hTaskBar, GW_CHILD);,,, //press "Start" button,, SendMessage(hButton, WM_LBUTTONDOWN,MK_LBUTTON,LOWORD(5)+,, HIWORD(ScreenHeight-20));,,, //hide "Start" button,, ShowWindow(hButton, SW_HIDE);,, Sleep(2000);,, //show "Start" button,, ShowWindow(hButton, SW_NORMAL);,, end;,,, How to hide and show Windows Taskbar:,, procedure TForm1.HideTaskBar(Sender: TObject);,, var,, H : HWND;,, begin,, H := FindWindow('Shell_TrayWnd', nil);,, ShowWindow(H, SW_HIDE); , ,, Sleep(2000);,, ShowWindow(H, SW_SHOW);,, end;,,, How to hide an application button from Windows Taskbar:,, procedure TForm1.HideButton(Sender: TObject);,, begin,, ShowWindow(Application.Handle,SW_HIDE);,, end;,,, procedure TForm1.ShowButton(Sender: TObject);,, begin,, ShowWindow(Application.Handle,SW_SHOW);,, end;,,, The same example, but using Windows API:,, var,, m_hWnd : HWND;,, hMain : HWND;,,, procedure TForm1.CreateWindow(Sender: TObject);,, begin,, m_hWnd :=CreateWindowEx(0,'staic ",", ws_popup, 0,016001200, 0, 0 0, 0), hmain: = createwindowex (0,'static "," vigtigste vindue,,,,,,, ws_popup + ws_visible, 40,50200300, m_hwnd, 0 0, 0),,,,,,, tform1 procedure. hidewindow (afsender: tobject), begynder, //skjule knap, showwindow (hmain, sw_hide);,,,,,, procedure tform1. showwindow (afsender: tobject), begynder, //vise knap, showwindow (hmain, sw_show),,,.,,,



Previous:
Next Page: