Post Reply

[XAP] Screen capture program (Based on "The DllImport Project")

OP fiinix

23rd May 2011, 10:22 PM   |  #1  
fiinix's Avatar
OP Retired Recognized Developer
Flag Stockholm
Thanks Meter: 224
 
568 posts
Join Date:Joined: Oct 2010
Donate to Me
More
WP7 Screen capture program
[OBSOLETE, INSTEAD USE Screen Capturer v3]


Program structure

At application start Jaxbot's dehydrate hack, its enabled automatic by setting some registry values (that enables sort of multitasking). So that you can just run this app, go to home, enter the wanted app of you choice that you want to capture.

Brief info about how this app has functionality to take captures.: Uses The DllImport Project to talk to the system that enables C# code to call C++ for me.

The app is actually only an infinitive loop that listen for [Focus]-key.
As you can see below, a Sleep is enabled of 500ms to spare your battery so that is does not spam the system cpu with a while loop that runs forever, draining your battery fast.

Code:
public static void StartHook()
{
    Phone.Screen.init();

    bw = new BackgroundWorker();
    bw.DoWork += bw_DoWork;
    bw.RunWorkerAsync();
}

static void bw_DoWork(object sender, DoWorkEventArgs e)
{
    int key = (int)Phone.KeyboardHook.PhysicalKeys.Focus;
    while (true)
    {
        if (DllImportCaller.lib.GetAsyncKeyState7(key) != 0)
        {
            Phone.Screen.Capture cap = Phone.Screen.CaptureScreenToPictures();

            var str = string.Format("PictureName: {0}\nTimeElapsed: {1}ms\nPictureByteSize: {2}", 
                cap.PictureName, cap.TimeElapsed.TotalMilliseconds, cap.PictureByteSize);

            int res;
            DllImportCaller.lib.MessageBox7(str, "Screen Capture", (uint)MB.MB_OK, out res);
        }
        System.Threading.Thread.Sleep(500);
    }
}
In App instructions (Web)

[Checkbox] Jaxbot' Dehydrate hack (On / Off)
- This is for yourself, so you can toggle the "multitask" after capturing the app.
- Automatic activate on app launch (this)

"How to":
- Enter this app

- Navigate to the app you want to capture (no more than 2 apps in between (this app will be killed by "Watchdog"))

- Hold "focus" (not click, >focus), for at least 500ms
- Wait for messagebox to verify capture
- (SUCCESS) > Located under "Pictures > All > Saved Pictures"



Extras comments by me

(100% Verified to work (on mine lol))
Test pictures made at the moment: 460!

Fixed-list

- (1.0.1) Collision with real "Dll Import" when the guids are the same
- (1.0.2) GUI + Standalone + No collision with overwrite whats so ever (Same GUID)
- (1.0.3) "In-app dehydration toggler" + "better experience", EPIC release
- (1.0.4) Fail-safe, for sure no more multiple capture bug (2-4). (Test: I Can hold focus for 1 min and only one is captured).
- (1.0.4.0.0.0.1) For some random reason without debugger it took 1-6 captures, but WITH the debugger i could hold it for a minute and only one would be captured. Fixed now with a "Sleep()" to prevent 1+.
- (1.0.5) Now, problem with 2 msg box are 100000% GONE NOW! Ill pay you money else if 2 come up lol, jk
> Problem was located in "CSharp___DllImport.MainPage(); .ctor" that ALSO hooked to key-press.
- (1.0.5, HD2 edition) Now supports HD2, works now because its binded to "Search" instead of "Focus" -button; Aka "Search version".

Thanks for my time
Last edited by fiinix; 12th December 2011 at 12:40 AM.
The Following 36 Users Say Thank You to fiinix For This Useful Post: [ View ]
23rd May 2011, 10:41 PM   |  #2  
Heathcliff74's Avatar
Recognized Developer
Thanks Meter: 2,056
 
1,439 posts
Join Date:Joined: Dec 2010
Donate to Me
Thanks!

Feature request: disable / enable dehydration from within the app. Maybe an option to automatically reenable dehydration after the screenshot. I don't want to leave dehydration on, because of performance and batterylife.

Well done!
Heathcliff74
23rd May 2011, 10:46 PM   |  #3  
fiinix's Avatar
OP Retired Recognized Developer
Flag Stockholm
Thanks Meter: 224
 
568 posts
Join Date:Joined: Oct 2010
Donate to Me
More
Quote:
Originally Posted by Heathcliff74

Thanks!

Feature request: disable / enable dehydration from within the app. Maybe an option to automatically reenable dehydration after the screenshot. I don't want to leave dehydration on, because of performance and batterylife.

Well done!
Heathcliff74

Is there a good cross device that can toggle dehydrate? Because of how i see it its device specific (root access). Is there a basic lib out there that i know exist somewhere, ill implent it.
Thanks for criticism
23rd May 2011, 10:48 PM   |  #4  
contable's Avatar
Senior Member
Thanks Meter: 953
 
1,690 posts
Join Date:Joined: Oct 2009
Donate to Me
Fantastic ! Thanks for this app. Confirmed working on my HD7.

Attached some screenies.
Attached Thumbnails
Click image for larger version

Name:	ScreenDump_2011-31-23 1131227330 .jpg
Views:	1382
Size:	47.4 KB
ID:	605274   Click image for larger version

Name:	ScreenDump_2011-31-23 1131452420 .jpg
Views:	733
Size:	48.8 KB
ID:	605275   Click image for larger version

Name:	ScreenDump_2011-35-23 1135573090 .jpg
Views:	621
Size:	33.5 KB
ID:	605276  
The Following 2 Users Say Thank You to contable For This Useful Post: [ View ]
23rd May 2011, 10:58 PM   |  #5  
fiinix's Avatar
OP Retired Recognized Developer
Flag Stockholm
Thanks Meter: 224
 
568 posts
Join Date:Joined: Oct 2010
Donate to Me
More
Quote:
Originally Posted by contable

Fantastic ! Thanks for this app. Confirmed working on my HD7.

Attached some screenies.

Thanks for reporting (cross compiled anyways (device non-specific)).

> One "thanks" for you
23rd May 2011, 11:13 PM   |  #6  
Heathcliff74's Avatar
Recognized Developer
Thanks Meter: 2,056
 
1,439 posts
Join Date:Joined: Dec 2010
Donate to Me
Quote:
Originally Posted by fiinix

Is there a good cross device that can toggle dehydrate? Because of how i see it its device specific (root access). Is there a basic lib out there that i know exist somewhere, ill implent it.
Thanks for criticism

I'm not sure, but I believe the registry value that needs to be set can be changed with the normal registry api (no root access required). I could be wrong though. If it doesn't work, then the COM dll's from Samsung and HTC will work for sure. But you need to add the COM dll's for all the different brands and they have different interfaces. It isn't too hard though.

By the way, the criticism was meant as "constructive criticism" I appreciate your work.

Ciao,
Heathcliff74
23rd May 2011, 11:19 PM   |  #7  
fiinix's Avatar
OP Retired Recognized Developer
Flag Stockholm
Thanks Meter: 224
 
568 posts
Join Date:Joined: Oct 2010
Donate to Me
More
Quote:
Originally Posted by Heathcliff74

I'm not sure, but I believe the registry value that needs to be set can be changed with the normal registry api (no root access required). I could be wrong though. If it doesn't work, then the COM dll's from Samsung and HTC will work for sure. But you need to add the COM dll's for all the different brands and they have different interfaces. It isn't too hard though.

By the way, the criticism was meant as "constructive criticism" I appreciate your work.

Ciao,
Heathcliff74

Yep thats what i tried to say, "constructive criticism", forgot how to call if fully out
23rd May 2011, 11:35 PM   |  #8  
contable's Avatar
Senior Member
Thanks Meter: 953
 
1,690 posts
Join Date:Joined: Oct 2009
Donate to Me
Also working fine on my OMNIA 7. I can enable/disable dehydration with advanced config tool on both devices.

@Heathcliff:

After testing the HD7 for some weeks now I decided to go back to the OMNIA 7 when you have finished your work. The HD7 isnīt nearly as good as the OMNIA 7 but atm the best choice if you wanna do some customizations...
Attached Thumbnails
Click image for larger version

Name:	ScreenDump_2011-12-24 1212552060 .jpg
Views:	314
Size:	55.3 KB
ID:	605332  
24th May 2011, 03:14 AM   |  #9  
Senior Member
Thanks Meter: 8
 
166 posts
Join Date:Joined: Jul 2010
More
wow, thanks for the app! Here are some of my own screenshots
Attached Thumbnails
Click image for larger version

Name:	4460 PM.jpg
Views:	272
Size:	47.2 KB
ID:	605542   Click image for larger version

Name:	Photo_0994C899-D49A-508C-BE4B-BDFE976E9FB2.jpg
Views:	262
Size:	58.5 KB
ID:	605543  
24th May 2011, 05:47 PM   |  #10  
Ddriver's Avatar
Senior Member
Thanks Meter: 23
 
382 posts
Join Date:Joined: Mar 2005
More
Thanks for your work, but I have now the same problem like this tread.

Post Reply Subscribe to Thread

Tags
capture, screen, wp7
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes