這是BCB用API的程式碼而且還利用GetCursorInfo()取得游標資訊,加入游標,這部分在.NET還找不到程式碼
PHP 語法:
ShowWindow(Application->Handle,SW_HIDE);
ShowWindow(Handle,SW_HIDE);
// Application->ProcessMessages();
DWORD bt;
bt=GetTickCount();
do {
Application->ProcessMessages();
} while (GetTickCount()-bt<(Edit2->Text.ToInt()*1000));
HDC ScrDC;
TRect R;
HWND Wnd=GetDesktopWindow();
ScrDC=GetWindowDC(Wnd);
GetWindowRect(Wnd, &R);
ImageBmp->Width = R.right;
ImageBmp->Height = R.bottom;
BitBlt(ImageBmp->Canvas->Handle, 0, 0, R.right, R.bottom, ScrDC, 0, 0, SRCCOPY);
if(CheckBox1->Checked){
CURSORINFO ci;
ci.cbSize=sizeof(CURSORINFO);
GetCursorInfo(&ci);
POINT pt;
GetCursorPos(&pt);
DrawIcon(ImageBmp->Canvas->Handle, pt.x, pt.y, ci.hCursor);
}
ReleaseDC(Wnd, ScrDC);
float sf=(float)ImageBmp->Width/(float)ScrollBox1->ClientRect.right;
Image1->Width=ImageBmp->Width/sf;
Image1->Height=ImageBmp->Height/sf;
Image1->Picture->Assign(ImageBmp);
Image1->Refresh();
ShowWindow(Application->Handle,SW_NORMAL);
ShowWindow(Handle,SW_NORMAL);