Announcement

Collapse
No announcement yet.

Key Code of Printscreen?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lorne
    replied
    The virtual key code for the PrintScreen key (VK_SNAPSHOT) is 0x2C, or 44 in decimal (as pointed out above).

    You might also want to check for the Ctrl key modifier, since PrintScreen is actually Ctrl+SysRq on standard keyboards.

    Leave a comment:


  • Tone
    replied
    I opened DLL Export Viewer and dragged and dropped the winmm.dll file into it.
    I'm clear on what to do with the Filename and FunctionName but unclear on where i can get a list of Parameters for each .dll file.
    In the AMS helpfile/example it lists the Parameter as "Set CDAudio Door Open\", and after copying and pasting it into my project and seeing it work, was delighted at using my first ever .dll, and i'd love to know where he found the option to use that particular Parameter.
    Oh, and after some trials and errors i've noticed you have to end the Parameter with a \ (backslash) is that true, or am i inventing things again?

    Leave a comment:


  • Tone
    replied
    Originally posted by Centauri Soldier View Post
    I use a little tool called dllexp.exe to get the functions of dll files. Try googleing (do I take off the "e" when adding "ing".,...hmmm) KeyCode.dll, maybe that'll get you better results.
    Thank you my friend.
    I'm not sure if the "e" is supposed to be there or not.
    I'll get Googl'ing right away for that helper.
    Thanks again mate.

    Leave a comment:


  • Centauri Soldier
    replied
    I use a little tool called dllexp.exe to get the functions of dll files. Try googleing (do I take off the "e" when adding "ing".,...hmmm) KeyCode.dll, maybe that'll get you better results.

    Leave a comment:


  • Tone
    replied
    Originally posted by Centauri Soldier View Post
    Like I said, the key code is there but AMS just does not recognize it. No matter how you check for it, AMS will not detect it. If you could use a dll or something of the like you might be able to work around that.
    Thank you Centauri Soldier, i am now investigating .dll's and call function choices. like W O W - does this ever end?
    I wonder if there's such a thing as a full list of what each .dll has to offer?
    I Googled for a PrintScreen .dll but no luck, but in the doing so i've realised what you said a while ago about this subject. Every night now i'm getting my mind blown away. It keeps touching parts of me i've never experienced before. No i'm not smoking anything, and i don't care what people say, i'm just sharing my thoughts as they happen, after all these magic moments were inspired by you lot.
    God i'm loving it!

    Leave a comment:


  • Tone
    replied
    I've realised this code doesn't work because because a, " ) " was missing from line 01. I got it to work and changed the capture window to "Desktop" but like you i got a black screen. I don't wanna teach my granny how to suck eggs but sometimes turning down hardware acceleration in system properties fixes black screens whilst capturing, but sorry for my bad suggestion, cause it doesn't fix things at all.
    Not that i'm really bothered, i've learned a lot more than i already knew because of your work and me experimenting with it and i'm very grateful for that.
    With regards to reading helpfiles to see a full list of commands, what a great idea! Infact i love it so much i've created a new folder and have a collection on the go
    These 5 lines of code are the longest i've been able to decipher, fully, 100%.
    So thanks man, NOW i am a programmer

    Code:
    Window.Hide(Application.GetWndHandle());
    screen = WinApi.GetDesktopWindow();
    WinApi.CaptureWindow(screen, _DesktopFolder.."\\screenshot.bmp");
    WinApi.ImageConvertTo(_DesktopFolder.."\\screenshot.bmp", _DesktopFolder.."\\screenshot.jpeg");
    File.Delete(_DesktopFolder.."\\screenshot.bmp", false, false, false, nil);

    Leave a comment:


  • Centauri Soldier
    replied
    Please do. I'd love to see a work-around for that key.

    Leave a comment:


  • .74
    replied
    The codes that I posted are working perfectly for me. I'll post an example when I get home.

    Leave a comment:


  • Centauri Soldier
    replied
    Originally posted by Tone View Post
    ...
    Neither did;
    Code:
    if System.IsKeyDown(44) then
    Dialog.Message("Worked", "It sure did.");
    end
    ...
    Like I said, the key code is there but AMS just does not recognize it. No matter how you check for it, AMS will not detect it. If you could use a dll or something of the like you might be able to work around that.

    Leave a comment:


  • Dermot
    replied
    Originally posted by Tone View Post
    Try turning down your hardware acceleration in display properties.
    Thanks for the tip regarding GetDesktopWindow. How did you know that command? I can't see it listed as an option.

    Edited:spoke too soon, it didn't work.

    Neither did;
    Code:
    if System.IsKeyDown(44) then
    Dialog.Message("Worked", "It sure did.");
    end
    nor did:
    Code:
    Window.Hide(Application.GetWndHandle();
    screen = WinApi.GetForegroundWindow();
    WinApi.CaptureWindow(screen, _DesktopFolder.."\\screenshot.bmp");
    WinApi.ImageConvertTo(_DesktopFolder.."\\screenshot.bmp", _DesktopFolder.."\\screenshot.jpeg");
    File.Delete(_DesktopFolder.."\\screenshot.bmp", false, false, false, nil);
    Not to sound harsh, but why are you posting code that doesn't work

    It's confusing to a n00b like me.
    Why don't you look at the Winapi plugin help file that list all the functions.

    Leave a comment:


  • Tone
    replied
    Originally posted by .74 View Post
    Yea, I'm only using WinApi.GetForegroundWindow(); because WinApi.GetDesktopWindow(); keeps returning me a black screen. Let's hope retests can fix that.
    Try turning down your hardware acceleration in display properties.
    Thanks for the tip regarding GetDesktopWindow. How did you know that command? I can't see it listed as an option.

    Edited:spoke too soon, it didn't work.

    Neither did;
    Code:
    if System.IsKeyDown(44) then
    Dialog.Message("Worked", "It sure did.");
    end
    nor did:
    Code:
    Window.Hide(Application.GetWndHandle();
    screen = WinApi.GetForegroundWindow();
    WinApi.CaptureWindow(screen, _DesktopFolder.."\\screenshot.bmp");
    WinApi.ImageConvertTo(_DesktopFolder.."\\screenshot.bmp", _DesktopFolder.."\\screenshot.jpeg");
    File.Delete(_DesktopFolder.."\\screenshot.bmp", false, false, false, nil);
    Not to sound harsh, but why are you posting code that doesn't work

    It's confusing to a n00b like me.
    Last edited by Tone; 08-16-2010, 10:07 PM.

    Leave a comment:


  • .74
    replied
    PHP Code:
    if System.IsKeyDown(44then
    Dialog
    .Message("Worked""It sure did.");
    end 
    <3 Thanks man.

    Leave a comment:


  • Centauri Soldier
    replied
    Well, technically there is a VK code for that key. In Windows it's 44; however, if you put this script on a page and press the Print Screen key, nothing happens. This tells me that AMS does not list the key.

    PHP Code:
    if e_Key then
    Dialog
    .Message("e_Key"e_Key);
    end 

    Leave a comment:


  • .74
    replied
    Yea, I'm only using WinApi.GetForegroundWindow(); because WinApi.GetDesktopWindow(); keeps returning me a black screen. Let's hope retests can fix that.

    Leave a comment:


  • Tone
    replied
    Originally posted by .74 View Post
    @Centauri Soldier:
    I am using that plugin. It's a great one but I need to make it so It screenshots at the moment that the user presses Print Screen.

    @ Tone:
    Code:
    Window.Hide(Application.GetWndHandle();
    screen = WinApi.GetForegroundWindow();
    WinApi.CaptureWindow(screen, _DesktopFolder.."\\screenshot.bmp");
    WinApi.ImageConvertTo(_DesktopFolder.."\\screenshot.bmp", _DesktopFolder.."\\screenshot.jpeg");
    File.Delete(_DesktopFolder.."\\screenshot.bmp", false, false, false, nil);
    My eyes are closing it's 11 oclock in the morning, just been through all of retesets examples - your example didn't work 100% but the convert image code did. I thought that was great. Catchya l8r, thanks mate. :yes

    Leave a comment:

Working...
X