Windows Live 2011 auto-screenshot taker

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

Thread Status:
Not open for further replies.
Windows Live 2011 auto-screenshot taker
  1. Unread #1 - Dec 17, 2010 at 12:57 PM
  2. Govind
    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

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    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 :)
     
  3. Unread #2 - Dec 17, 2010 at 1:03 PM
  4. nonamekiller
    Joined:
    Dec 21, 2007
    Posts:
    2,266
    Referrals:
    0
    Sythe Gold:
    1
    Two Factor Authentication User DIAF Lawrence Extreme Homosex

    nonamekiller Grand Master

    Windows Live 2011 auto-screenshot taker

    Sounds pretty cool. Good shit SMR!

    How long did you work on this?
     
  5. Unread #3 - Dec 17, 2010 at 1:06 PM
  6. Govind
    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

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Windows Live 2011 auto-screenshot taker

    5 minutes :p
     
  7. Unread #4 - Dec 17, 2010 at 1:17 PM
  8. Nick
    Joined:
    Feb 12, 2007
    Posts:
    7,204
    Referrals:
    40
    Sythe Gold:
    80

    Nick ♬♩ Young Forever ♪ ♫

    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?
     
  9. Unread #5 - Dec 17, 2010 at 1:21 PM
  10. Govind
    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

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Windows Live 2011 auto-screenshot taker

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

    Thanks for the suggestion.
     
  11. Unread #6 - Dec 17, 2010 at 1:22 PM
  12. HamJam
    Joined:
    Jul 8, 2008
    Posts:
    3,433
    Referrals:
    1
    Sythe Gold:
    12
    Heidy

    HamJam Grand Master

    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+.
     
  13. Unread #7 - Dec 17, 2010 at 1:35 PM
  14. Govind
    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

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    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.
     
  15. Unread #8 - Dec 17, 2010 at 1:52 PM
  16. £eon
    Joined:
    Dec 10, 2010
    Posts:
    4
    Referrals:
    0
    Sythe Gold:
    0

    £eon Newcomer
    Banned

    Windows Live 2011 auto-screenshot taker

    &#32;&#32;&#32;&#32;&#32;
     
  17. Unread #9 - Dec 17, 2010 at 2:03 PM
  18. Aroxez
    Referrals:
    0

    Aroxez Guest

    Windows Live 2011 auto-screenshot taker

    This is crazy. Thanks! Teach me how to do this sort of stuff?
     
  19. Unread #10 - Dec 17, 2010 at 2:43 PM
  20. Govind
    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

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    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);
    		}
    	
    }
     
  21. Unread #11 - Dec 17, 2010 at 3:43 PM
  22. Govind
    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

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Windows Live 2011 auto-screenshot taker

    Updated again; removed redundant Sleep() call.
     
  23. Unread #12 - Dec 17, 2010 at 6:36 PM
  24. FireZ 2
    Joined:
    Nov 4, 2010
    Posts:
    7
    Referrals:
    0
    Sythe Gold:
    0

    FireZ 2 Newcomer

    Windows Live 2011 auto-screenshot taker

    Wow nice SMR. Might give this a try later. Having a huge hardrive is a +.
     
  25. Unread #13 - Dec 17, 2010 at 7:05 PM
  26. Govind
    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

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Windows Live 2011 auto-screenshot taker

    Awesome FireZ :)
     
  27. Unread #14 - Dec 17, 2010 at 9:11 PM
  28. X O
    Joined:
    Jul 22, 2010
    Posts:
    305
    Referrals:
    1
    Sythe Gold:
    0

    X O Forum Addict
    Do Not Trade

    Windows Live 2011 auto-screenshot taker

    Nice work here SMR.
     
  29. Unread #15 - Dec 17, 2010 at 10:02 PM
  30. Determinate
    Joined:
    Mar 7, 2010
    Posts:
    10,394
    Referrals:
    3
    Sythe Gold:
    0

    Determinate Legend
    Banned

    Windows Live 2011 auto-screenshot taker

    Looks useful enough, I'll give it a shot.
     
  31. Unread #16 - Dec 17, 2010 at 10:31 PM
  32. FoxTek
    Joined:
    Mar 1, 2010
    Posts:
    1,637
    Referrals:
    4
    Sythe Gold:
    0

    FoxTek Guru
    Banned

    Windows Live 2011 auto-screenshot taker

    I think I have an easier way than this - maybe I should make a guide for it.
     
  33. Unread #17 - Dec 18, 2010 at 7:33 PM
  34. Govind
    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

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Windows Live 2011 auto-screenshot taker

    Sure, want to outline it here, too?
     
  35. Unread #18 - Dec 18, 2010 at 7:56 PM
  36. sheymyster
    Joined:
    Jul 1, 2010
    Posts:
    1,549
    Referrals:
    1
    Sythe Gold:
    61

    sheymyster Guru
    $5 USD Donor New

    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!
     
  37. Unread #19 - Dec 18, 2010 at 8:33 PM
  38. Govind
    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

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    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.
     
  39. Unread #20 - Dec 18, 2010 at 8:45 PM
  40. FoxTek
    Joined:
    Mar 1, 2010
    Posts:
    1,637
    Referrals:
    4
    Sythe Gold:
    0

    FoxTek Guru
    Banned

    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? >

Users viewing this thread
1 guest
Thread Status:
Not open for further replies.


 
 
Adblock breaks this site