Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define fbc -s gui res\meme.rc
- #include "windows.bi"
- #include "win\mmsystem.bi"
- Dim as HDC hdc = CreateDC("DISPLAY", NULL, NULL, NULL)
- Dim as HBITMAP hBitmap
- 'Get screen width/height
- var iWidth = GetDeviceCaps(hdc, HORZRES)
- var iHeight = GetDeviceCaps(hdc, VERTRES)
- 'load bitmap
- hBitmap = LoadBitmap(GetModuleHandle(NULL), @"MEME_BITMAP")
- If hBitmap = NULL Then
- MessageBox(null, "Could not load MEME_BITMAP!", "Error", MB_ICONEXCLAMATION)
- End If
- 'Create GDI bitmap object
- Dim as BITMAP bm
- Dim as HDC hdcMem = CreateCompatibleDC(hdc)
- Dim as HBITMAP hbmOld = SelectObject(hdcMem, hBitmap)
- GetObject(hBitmap, SizeOf(bm), @bm)
- Dim as double AudioTimer
- Do
- 'Draw bitmap scaled fullscreen
- StretchBlt(hdc, 0, 0, iWidth, iHeight, hdcMem, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY)
- 'play audio
- if Abs(Timer-AudioTimer) >= 16 Then
- AudioTimer = Timer
- PlaySound("MEME_AUDIO", null, SND_RESOURCE OR SND_ASYNC)
- end if
- 'BitBlt(hdc, 0, 0, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY)
- Sleep 1,1
- Loop
- 'Clear GDI objects
- SelectObject(hdcMem, hbmOld)
- DeleteDC(hdcMem)
- DeleteDC(hdc)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement