Shoutbox

Can anybody develop this simple thing? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Can anybody develop this simple thing? (/showthread.php?tid=39070)

Can anybody develop this simple thing? by Jhrono on 02-24-2005 at 01:10 PM

Right...can anybody develop a simple program that would make the PC think that your pressing a key but you're not there and the program is doing it?like i need to press enter while i'm sleeping...i'd like to have this prog that would automatticly press it from 2,5 to 2,5 mins...another thing...how do i prevent windows (xp) to go to the logon screen when you don't move it for a while?(and it goes black too)...Thanks for your answers...

Found this code : http://www.swissdelphicenter.ch/en/showcode.php?id=220
But i dont know if it's good nor to compile it


RE: Can anybody develop this simple thing? by Ash_ on 02-24-2005 at 01:14 PM

ok, your trying to cheat whatpulse. :P, i'd tell you but i should be in bed, and its a program, google it.
It requires some Basic Knowledge of API thats all i can say, and SendMessage API call pwnzorz.

and to disable the funky thing, just right click on your Desktop -> Screen Saver -> None ( on the drop-down list) and unclick the "On Resume, Password Protect" option (Y)


RE: Can anybody develop this simple thing? by toddy on 02-24-2005 at 01:17 PM

turn off screensaver :rolleyes:

control panel > display > screen saver > none


RE: Can anybody develop this simple thing? by Jhrono on 02-24-2005 at 01:22 PM

quote:
Originally posted by Ash_

ok, your trying to cheat whatpulse.


No i'm not trying to cheat Whatpulse my keys and clicks are enough! Look :
1,841,877 (keys)
531.606(clicks)
If you dont believe it got to whatpulse.com and look for Krak_johny username...:dodgy:....
quote:
Originally posted by Ash_

and its a program, google it.

I've googled all i get is crap:S...
RE: Can anybody develop this simple thing? by Mike on 02-24-2005 at 01:52 PM

quote:
Originally posted by johny
Right...can anybody develop a simple program that would make the PC think that your pressing a key but you're not there and the program is doing it?like i need to press enter while i'm sleeping...i'd like to have this prog that would automatticly press it from 2,5 to 2,5 mins...
Very easy to do ;)
However, it will not be so realible that means that the key might not get pressed (I will use sendkeys vb's built in function because I'm lazy too use the keyb_event api :P)
quote:
Originally posted by johny
how do i prevent windows (xp) to go to the logon screen when you don't move it for a while?(and it goes black too)...Thanks for your answers...
Easy ;)

Right click on desktop -> Propeties -> Screensaver -> Uncheck "On resume, display Welcome screen."
RE: Can anybody develop this simple thing? by Jhrono on 02-24-2005 at 02:43 PM

Mike add me to msn plz;)...thanks for your help :

My msn : putoalmeida:cheesy:gmail.com
(:cheesy: = @)


RE: Can anybody develop this simple thing? by TheBlasphemer on 02-24-2005 at 03:07 PM

Why don't you just make some mechanical thingie that keeps pressing your control key :P?


RE: Can anybody develop this simple thing? by Jhrono on 02-24-2005 at 03:10 PM

Didnt get u TB...if it's for me...forget it i dont know crap about programming...


RE: Can anybody develop this simple thing? by segosa on 02-24-2005 at 06:33 PM

I couldn't figure out how often you wanted it done so I assumed from '2,5' you meant 2.5 minutes, and so I've set that as the default. It can't be changed because that'd require extra work which is kind of over the top for such a simple app you'll probably only need once. If you need it at another interval, just tell me and I'll recompile.

Download (1.19KB)

Since I'm a fan of open-source software, here's the source too, if anyone wants to learn from it/etc.


RE: Can anybody develop this simple thing? by spokes on 02-24-2005 at 06:43 PM

segosa, as i don't have a c++ compiler, and im dumb at it, could you quickly edit one for me, so it presses enter (about 5 times), then f5? every 5 minutes?

(for surfjunky in the nights, lol)

is this right? if so all i need is someone to compile it

code:
#include <windows.h>
#include "resource.h"

#pragma comment(linker, "/NODEFAULTLIB")
#pragma comment(linker, "/ENTRY:NOCRT_ENTRY")
#pragma comment(linker, "/ALIGN:4096")

#define DEFAULT_TIMER_INTERVAL 300000
unsigned int nTimerId=0;
HWND hwndDlg;

VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
    if (uMsg==WM_TIMER)
    {
        if (GetActiveWindow() != hwndDlg)
            keybd_event(VK_RETURN,NULL,NULL,NULL);
            keybd_event(VK_RETURN,NULL,NULL,NULL);
            keybd_event(VK_RETURN,NULL,NULL,NULL);
            keybd_event(VK_RETURN,NULL,NULL,NULL);
            keybd_event(VK_RETURN,NULL,NULL,NULL);
            keybd_event(VK_F5,NULL,NULL,NULL);
    }
}

INT_PTR CALLBACK DialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
    switch (uMsg)
    {
        case WM_CLOSE:
            ExitProcess(0);
            break;
        case WM_COMMAND:
        {
            switch LOWORD(wParam)
            {
                case CMD_ONOFF:
                {
                    char *szText=(char*)GlobalAlloc(GPTR,256+1);
                    GetDlgItemText(hwndDlg,CMD_ONOFF,szText,256);
                    if (lstrcmp(szText,"Enable")==0)
                    {
                        if (nTimerId)
                            break;
                        nTimerId=(int)SetTimer(NULL,NULL,DEFAULT_TIMER_INTERVAL,TimerProc);
                        if (nTimerId)
                            SetDlgItemText(hwndDlg,CMD_ONOFF,"Disable");
                    }
                    else    //disable the timer
                    {   
                        if (!nTimerId)
                            break;
                        if (KillTimer(NULL,nTimerId))
                        {
                            SetDlgItemText(hwndDlg,CMD_ONOFF,"Enable");
                            nTimerId=0;
                        }
                    }
                    GlobalFree(szText);
                    break;
                }       
            }
        }
    }
    return 0;
}



int __stdcall WinMain(HMODULE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
{
    hwndDlg=CreateDialog(hInstance,MAKEINTRESOURCE(DLG_MAIN),NULL,DialogProc);
    ShowWindow(hwndDlg,SW_SHOWDEFAULT);
    MSG msg;
    BOOL bRet;
    while ((bRet = GetMessage( &msg, NULL, 0, 0 )) != 0)
    {
        if (bRet == -1)
            ExitProcess(0);
        else
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
    }
    return (int)msg.wParam;

}

void NOCRT_ENTRY(void)
{
    WinMain((HINSTANCE)GetModuleHandle(NULL),NULL,GetCommandLine(),SW_SHOWDEFAULT);
}


RE: Can anybody develop this simple thing? by segosa on 02-24-2005 at 07:08 PM

Your code was correct apart from a missing { } on the

if (GetActiveWindow() != hwndDlg)

statement (Y)

It's attached.


RE: Can anybody develop this simple thing? by L. Coyote on 02-24-2005 at 08:32 PM

What do the Enter's do? I understand F5 is for refreshing, but Enter?

And the keys get "caught" by the browser? Or you have to leave the browser window active (focused)?

I'm going to try that tonight! ;)


RE: Can anybody develop this simple thing? by spokes on 02-24-2005 at 09:47 PM

in opera, it brings upa message box if the server cant b found, i make it press enter to automatically close this box, enter 5 times is just incase, then f5 is for refreshin that page


RE: Can anybody develop this simple thing? by L. Coyote on 02-24-2005 at 10:17 PM

quote:
Originally posted by spokes
in opera, it brings upa message box if the server cant b found, i make it press enter to automatically close this box, enter 5 times is just incase, then f5 is for refreshin that page
Oh, I see. :o
RE: Can anybody develop this simple thing? by Zephyr on 02-24-2005 at 10:46 PM

quote:
Originally posted by TheBlasphemer
Why don't you just make some mechanical thingie that keeps pressing your control key :P?
quote:
Originally posted by johny
Didnt get u TB...if it's for me...forget it i dont know crap about programming...


Johny, i think TB meant something that physically presses the key on the keyboard, not programming. :P
RE: Can anybody develop this simple thing? by .blade// on 02-24-2005 at 10:48 PM

Why don't you just add a text box so people can define at what interval they want it to be pressed :P


RE: Can anybody develop this simple thing? by Jhrono on 02-24-2005 at 10:51 PM

I agree with blade...2.5 mins is too much...can anyone do something has segosas one but with a 30 scs interval?thanks...if you can fast please...


RE: Can anybody develop this simple thing? by segosa on 02-25-2005 at 06:56 AM

Happy now? :P You can choose the interval (in milliseconds!). The last one you used is saved in the registry (at HKEY_CURRENT_USER\Software\Segosa\F5 presser) when you close the program and read when you reopen it also.

The F5 key will never be sent if the application's own window is the active one so don't worry about that.

The 'U' key is to update it whilst it's already enabled. If it's disabled and you change the interval then you don't need to press it.


EDIT: wait, there seems to be a bug.. *-)

EDIT: fixed...

EDIT: source, including the project files.


RE: Can anybody develop this simple thing? by L. Coyote on 02-25-2005 at 07:26 AM

Yay! :D Finally I'll be able to refresh!

:bow: Thank you! Thank you! :bow:


RE: Can anybody develop this simple thing? by Jhrono on 02-25-2005 at 08:03 AM

quote:
Originally posted by Segosa
Attachment: F5 presser.zip (1.62 KB)


I wanted a enter presser :'(....i have autoreload at :dodgy: opera :S
RE: Can anybody develop this simple thing? by segosa on 02-25-2005 at 08:19 AM

quote:
Originally posted by johny
quote:
Originally posted by Segosa
Attachment: F5 presser.zip (1.62 KB)


I wanted a enter presser :'(....i have autoreload at :dodgy: opera :S

Eh, hold on then :dodgy:

EDIT: Attached... it does the exact same thing except presses a different key.
RE: Can anybody develop this simple thing? by user27089 on 02-25-2005 at 09:18 AM

Hmm, I thought that you already attached the enter presser, btw, won't it just turn off the enter presser at 2.5 minutes? I think that it should minimize to the system tray or something, no major logos, just something small...