Adblock breaks this site

Windows Live 2011 auto-screenshot taker

Discussion in 'Archives' started by Govind, Dec 17, 2010.

Thread Status:
Not open for further replies.
  1. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    Windows Live 2011 auto-screenshot taker

    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 :)
     
  2. nonamekiller

    nonamekiller Grand Master

    Joined:
    Dec 21, 2007
    Posts:
    2,266
    Referrals:
    0
    Sythe Gold:
    1
    Two Factor Authentication User DIAF Lawrence Extreme Homosex
    Windows Live 2011 auto-screenshot taker

    Sounds pretty cool. Good shit SMR!

    How long did you work on this?
     
  3. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    Windows Live 2011 auto-screenshot taker

    5 minutes :p
     
  4. Nick

    Nick ♬♩ Young Forever ♪ ♫

    Joined:
    Feb 12, 2007
    Posts:
    7,204
    Referrals:
    40
    Sythe Gold:
    80
    Windows Live 2011 auto-screenshot taker

    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?
     
  5. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    Windows Live 2011 auto-screenshot taker

    Certainly possible. Or I could just make the interval user-defined.

    Thanks for the suggestion.
     
  6. HamJam

    HamJam Grand Master

    Joined:
    Jul 8, 2008
    Posts:
    3,433
    Referrals:
    1
    Sythe Gold:
    12
    Heidy
    Windows Live 2011 auto-screenshot taker

    Where are all the screenshots saved? And won't this take alot of memory because most trades like Nick pointed out take 30mins+.
     
  7. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    Windows Live 2011 auto-screenshot taker

    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.
     
  8. £eon

    £eon Newcomer
    Banned

    Joined:
    Dec 10, 2010
    Posts:
    4
    Referrals:
    0
    Sythe Gold:
    0
    Windows Live 2011 auto-screenshot taker

    &#32;&#32;&#32;&#32;&#32;
     
  9. Aroxez

    Aroxez Guest

    Referrals:
    0
    Windows Live 2011 auto-screenshot taker

    This is crazy. Thanks! Teach me how to do this sort of stuff?
     
  10. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    Windows Live 2011 auto-screenshot taker

    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);
    		}
    	
    }
     
  11. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    Windows Live 2011 auto-screenshot taker

    Updated again; removed redundant Sleep() call.
     
  12. FireZ 2

    FireZ 2 Newcomer

    Joined:
    Nov 4, 2010
    Posts:
    7
    Referrals:
    0
    Sythe Gold:
    0
    Windows Live 2011 auto-screenshot taker

    Wow nice SMR. Might give this a try later. Having a huge hardrive is a +.
     
  13. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    Windows Live 2011 auto-screenshot taker

    Awesome FireZ :)
     
  14. X O

    X O Forum Addict
    Do Not Trade

    Joined:
    Jul 22, 2010
    Posts:
    305
    Referrals:
    1
    Sythe Gold:
    0
    Windows Live 2011 auto-screenshot taker

    Nice work here SMR.
     
  15. Determinate

    Determinate Legend
    Banned

    Joined:
    Mar 7, 2010
    Posts:
    10,394
    Referrals:
    3
    Sythe Gold:
    0
    Windows Live 2011 auto-screenshot taker

    Looks useful enough, I'll give it a shot.
     
  16. FoxTek

    FoxTek Guru
    Banned

    Joined:
    Mar 1, 2010
    Posts:
    1,637
    Referrals:
    4
    Sythe Gold:
    0
    Windows Live 2011 auto-screenshot taker

    I think I have an easier way than this - maybe I should make a guide for it.
     
  17. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    Windows Live 2011 auto-screenshot taker

    Sure, want to outline it here, too?
     
  18. sheymyster

    sheymyster Guru
    $5 USD Donor New

    Joined:
    Jul 1, 2010
    Posts:
    1,549
    Referrals:
    1
    Sythe Gold:
    61
    Windows Live 2011 auto-screenshot taker

    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!
     
  19. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    Windows Live 2011 auto-screenshot taker

    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.
     
  20. FoxTek

    FoxTek Guru
    Banned

    Joined:
    Mar 1, 2010
    Posts:
    1,637
    Referrals:
    4
    Sythe Gold:
    0
    Windows Live 2011 auto-screenshot taker

    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.
     
< Uptime | What bars to Superheat? >
Thread Status:
Not open for further replies.


 
 
Adblock breaks this site