• Log in or sign up for an account here: https://www.sythe.org/login

Windows Live 2011 auto-screenshot taker

Status
Not open for further replies.

Govind

The One Musketeer

Highly Respected
Mudkips
Retired Administrator
Joined
Apr 22, 2005
Sythe Gold
23
Messages
7,825
Le Monkey
PHP Shit Show 2k26
Potamus
Prove it!
Sythe Awards 2011 Winner
Tier 1 Prizebox
Tortoise Penis
Trole
UWotM8?
Wait, do you not have an Archer rank?
XShot is nice, but manually clicking to create a screenshot is annoying.

To this end, I have created an auto-screenshot taker for Windows Live 2011.

This may work with older versions of WL/MSN messenger, however, I strongly doubt it. Technical details and/or source code are available upon request.

http://www.mediafire.com/?6dwpaztimgh18un

Basically, if you have a conversation window open, it will save a bitmap of the conversation every 30000 milliseconds as m_<tickcountsincesystemstart>.bmp. If you press start then later open a conversation window, it will detect that too.

Happy screenshotting :)
 
Two Factor Authentication User
DIAF
Extreme Homosex
Lawrence
Sounds pretty cool. Good shit SMR!

How long did you work on this?
 
Le Monkey
PHP Shit Show 2k26
Potamus
Prove it!
Sythe Awards 2011 Winner
Tier 1 Prizebox
Tortoise Penis
Trole
UWotM8?
Wait, do you not have an Archer rank?
5 minutes :P
 
Hmm. Most trades take 30-60 minutes which would mean over a hundred screenshots. Think you could make it screenshot items right before you click out of the window?
 
Le Monkey
PHP Shit Show 2k26
Potamus
Prove it!
Sythe Awards 2011 Winner
Tier 1 Prizebox
Tortoise Penis
Trole
UWotM8?
Wait, do you not have an Archer rank?
Certainly possible. Or I could just make the interval user-defined.

Thanks for the suggestion.
 
Heidy
Where are all the screenshots saved? And won't this take alot of memory because most trades like Nick pointed out take 30mins+.
 
Le Monkey
PHP Shit Show 2k26
Potamus
Prove it!
Sythe Awards 2011 Winner
Tier 1 Prizebox
Tortoise Penis
Trole
UWotM8?
Wait, do you not have an Archer rank?
I've updated the executable so that the interval is now 30 seconds instead of 15. It should now be much half as much memory taken up, and I strongly doubt that an entire screen worth of information could be lost.

http://www.mediafire.com/?gx42hp4oc5erdl2

A 30 minute trade would now eat up about 50 MB for screenshots, down from 100.
 
Le Monkey
PHP Shit Show 2k26
Potamus
Prove it!
Sythe Awards 2011 Winner
Tier 1 Prizebox
Tortoise Penis
Trole
UWotM8?
Wait, do you not have an Archer rank?
Code:
#define _CRT_SECURE_NO_WARNINGS
#undef _UNICODE
#include <Windows.h>
#include <fstream>
using namespace std;

LRESULT CALLBACK WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK ChildFont(HWND hWnd, LPARAM lParam);
BOOL CALLBACK TLMSNWnd(HWND hWnd, LPARAM lParam);
VOID CALLBACK TimerProc(
  __in  HWND hwnd,
  __in  UINT uMsg,
  __in  UINT_PTR idEvent,
  __in  DWORD dwTime
);
void SaveBitmap(HWND hWnd, TCHAR *szName)
{
	BITMAPFILEHEADER bfHeader;
	BITMAPINFOHEADER biHeader;
	BITMAPINFO bInfo;
	HDC winDC, memDC;
	TCHAR filename[1024];
	int d_x, d_y, outBytes;
	RECT rsRect;
	HBITMAP hBitmap;
	ofstream file;
	BYTE* memory = 0;
	DWORD dwTC;
	GetWindowRect(hWnd, &rsRect);
	d_x = rsRect.right-rsRect.left;
	d_y = rsRect.bottom-rsRect.top;
	bfHeader.bfType = ('B' | ('M' << 8));
	bfHeader.bfSize = 0;
	bfHeader.bfReserved1 = 0;
	bfHeader.bfReserved2 = 0;
	bfHeader.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);
	
	biHeader.biSize = sizeof(biHeader);
	biHeader.biHeight = d_y;
	biHeader.biWidth = d_x;
	biHeader.biPlanes = 1;
	biHeader.biBitCount = 24;
	biHeader.biCompression = BI_RGB;
	biHeader.biSizeImage = 0;
	biHeader.biXPelsPerMeter = 0;
	biHeader.biYPelsPerMeter = 0;
	biHeader.biClrImportant = 0;
	biHeader.biClrUsed = 0;

	dwTC = GetTickCount();

	sprintf(filename, "%s%c%.8d.bmp", szName, '_', dwTC);
	
	file.open(filename, ios::binary);
	if(!file)
	{
		TCHAR mbBuf[500];
		sprintf(mbBuf, "Could not open %s for writing. Ensure that this application is running in a directory where it has permission to write files, and that the path, including the file name, does not exceed %d characters.", filename, MAX_PATH);
		MessageBox(0, mbBuf, "Error", MB_OK | MB_ICONSTOP);
		ExitProcess(0x0);
	}
	file.write((char*)&bfHeader, sizeof(bfHeader));
	file.write((char*)&biHeader, sizeof(biHeader));

	
	bInfo.bmiHeader = biHeader;
	winDC = GetDC(hWnd);
	memDC = CreateCompatibleDC(winDC);

	
	hBitmap = CreateDIBSection(winDC, &bInfo, DIB_RGB_COLORS, (void**) &memory, 0, 0);
	SelectObject(memDC, hBitmap);
	BitBlt(memDC, 0, 0, d_x, d_y, winDC, 0, 0, SRCCOPY);
	DeleteDC(memDC);
	ReleaseDC(hWnd, winDC);
	outBytes = (((24*d_x+31) & (~31))/8)*d_y;
	file.write((char*)memory, outBytes);
	DeleteObject(hBitmap);

}

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
	WNDCLASSEX WinCl;
	MSG Msg;
	HWND hWnd, hStart, hStop;

	WinCl.cbClsExtra = 0;
	WinCl.cbSize = sizeof(WNDCLASSEX);
	WinCl.cbWndExtra = 0;
	WinCl.hbrBackground = (HBRUSH) COLOR_WINDOW;
	WinCl.hCursor = LoadCursor(NULL, IDC_ARROW);
	WinCl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	WinCl.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
	WinCl.hInstance = hInstance;
	WinCl.lpfnWndProc = WndProc;
	WinCl.lpszClassName = "WlxSSWnd";
	WinCl.lpszMenuName = NULL;
	WinCl.style = 0;

	RegisterClassEx(&WinCl);
	
	hWnd = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, "WlxSSWnd", "MSN Screenshot Taker", WS_VISIBLE | WS_SYSMENU, 100, 100, 160, 60, NULL, NULL, hInstance, NULL);
	hStart = CreateWindowEx(0, "BUTTON", "Start", WS_VISIBLE | WS_CHILD | BS_TEXT, 0, 0, 75, 30, hWnd, NULL, hInstance, NULL);
	hStop = CreateWindowEx(0, "BUTTON", "Stop", WS_VISIBLE | WS_CHILD | BS_TEXT | WS_DISABLED, 75, 0, 75, 30, hWnd, NULL, hInstance, NULL);
	
	ShowWindow(hWnd, SW_SHOW);
	
	EnumChildWindows(hWnd, ChildFont, 0);
	
	UpdateWindow(hWnd);
	while(GetMessage(&Msg, NULL, 0, 0) > 0)
	{
		TranslateMessage(&Msg);
		DispatchMessage(&Msg);
	}
	return Msg.wParam;
}
BOOL CALLBACK ChildFont(HWND hWnd, LPARAM lParam)
{
	HFONT hfDefault = (HFONT) GetStockObject(DEFAULT_GUI_FONT);
	SendMessage(hWnd, WM_SETFONT, (WPARAM) hfDefault, MAKELPARAM(FALSE, 0));
	return TRUE;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
	switch(Msg)
	{
	case WM_CLOSE:
		DestroyWindow(hWnd);
		break;
	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	case WM_COMMAND:
		if((HWND)lParam==FindWindowEx(hWnd, NULL, "BUTTON", "Start"))
		{
			// button disabled = 0x58000000 enabled = 0x50000000
			//time_t s;
			EnableWindow(FindWindowEx(hWnd, NULL, "BUTTON", "Start"), FALSE);
			EnableWindow(FindWindowEx(hWnd, NULL, "BUTTON", "Stop"), TRUE);
			SetTimer(hWnd, 1001, 30000, TimerProc);
				EnumWindows(TLMSNWnd, 0);
			
		}
		else if((HWND)lParam==FindWindowEx(hWnd, NULL, "BUTTON", "Stop"))
		{
			EnableWindow(FindWindowEx(hWnd, NULL, "BUTTON", "Start"), TRUE);
			EnableWindow(FindWindowEx(hWnd, NULL, "BUTTON", "Stop"), FALSE);
			KillTimer(hWnd, 1001);
		}
	default:
		return DefWindowProc(hWnd, Msg, wParam, lParam);
		break;
	}
	return 0;
}

BOOL CALLBACK TLMSNWnd(HWND hWnd, LPARAM lParam)
{
	TCHAR cnBuf[256];
	GetClassName(hWnd, cnBuf, 255);
	if(strcmp(cnBuf, "TabbedHostWndClass")==0)
	{
		HWND wlx = FindWindowEx(hWnd, 0, "WLXDUI", NULL);
		if(wlx)
		{
			SaveBitmap(wlx, "m");
		}
	}
	return TRUE;
}

VOID CALLBACK TimerProc(
  __in  HWND hwnd,
  __in  UINT uMsg,
  __in  UINT_PTR idEvent,
  __in  DWORD dwTime
)
{
	
		if(idEvent==1001)
		{
			EnumWindows(TLMSNWnd, 0);
		}
	
}
 
Le Monkey
PHP Shit Show 2k26
Potamus
Prove it!
Sythe Awards 2011 Winner
Tier 1 Prizebox
Tortoise Penis
Trole
UWotM8?
Wait, do you not have an Archer rank?
Updated again; removed redundant Sleep() call.
 
Wow nice SMR. Might give this a try later. Having a huge hardrive is a +.
 
Le Monkey
PHP Shit Show 2k26
Potamus
Prove it!
Sythe Awards 2011 Winner
Tier 1 Prizebox
Tortoise Penis
Trole
UWotM8?
Wait, do you not have an Archer rank?
Awesome FireZ :)
 
Nice work here SMR.
 
Le Monkey
PHP Shit Show 2k26
Potamus
Prove it!
Sythe Awards 2011 Winner
Tier 1 Prizebox
Tortoise Penis
Trole
UWotM8?
Wait, do you not have an Archer rank?
Sure, want to outline it here, too?
 
Im not much for coding at all but Id like to learn, but an idea is to maybe do a user friendly interface if its possible, where the user can choose to either have the script take a screenshot every (insert amount here) seconds. Also, is it possible to have it only screenshot a portion of the screen? kind of like those free hypercams where u can drag a rectangle to record on the screen, this way you only take screenshots of your MSN conversations, and even open the program multiple times to record multiple MSN conversations, because I know I talk to multiple people at once most of the time. I know this is alot, especially coming from someone who couldn't program his way out of a cardboard box, just some suggestions that would be neat if it isnt alot of work. Great program already tho, great work man!
 
Le Monkey
PHP Shit Show 2k26
Potamus
Prove it!
Sythe Awards 2011 Winner
Tier 1 Prizebox
Tortoise Penis
Trole
UWotM8?
Wait, do you not have an Archer rank?
Im not much for coding at all but Id like to learn, but an idea is to maybe do a user friendly interface if its possible, where the user can choose to either have the script take a screenshot every (insert amount here) seconds. Also, is it possible to have it only screenshot a portion of the screen? kind of like those free hypercams where u can drag a rectangle to record on the screen, this way you only take screenshots of your MSN conversations, and even open the program multiple times to record multiple MSN conversations, because I know I talk to multiple people at once most of the time. I know this is alot, especially coming from someone who couldn't program his way out of a cardboard box, just some suggestions that would be neat if it isnt alot of work. Great program already tho, great work man!

It will only take a screenshot of the MSN conversation window and nothing else.

I may update it to add other things like user defined intervals, etc.
 
Sure, want to outline it here, too?

They I do it is that I just use SwiftKit. I drag the msn convo to the height of my screen and make swift kit as small as I can, take a screenshot, scroll in the chat and repeat til I have all that I want, then I open the screenshots taken window and edit them so it only shows the convo, save, then choose my uploader (imageshack/imgur). Easy as pie imo.
 
Status
Not open for further replies.
Runescape Gamblingrunescape gambling
Back
Top