What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Can anybody develop this simple thing?

Can anybody develop this simple thing?
Author: Message:
spokes
Full Member
***

Avatar
I <3 Rollerblading

Posts: 423
Reputation: 10
34 / Male / Flag
Joined: May 2004
RE: Can anybody develop this simple thing?
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);
}


This post was edited on 02-24-2005 at 06:51 PM by spokes.

[Image: sig15ws.png]
02-24-2005 06:43 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Can anybody develop this simple thing? - by Jhrono on 02-24-2005 at 01:10 PM
RE: Can anybody develop this simple thing? - by Ash_ on 02-24-2005 at 01:14 PM
RE: Can anybody develop this simple thing? - by toddy on 02-24-2005 at 01:17 PM
RE: Can anybody develop this simple thing? - by Jhrono on 02-24-2005 at 01:22 PM
RE: Can anybody develop this simple thing? - by Mike on 02-24-2005 at 01:52 PM
RE: Can anybody develop this simple thing? - by Jhrono on 02-24-2005 at 02:43 PM
RE: Can anybody develop this simple thing? - by TheBlasphemer on 02-24-2005 at 03:07 PM
RE: Can anybody develop this simple thing? - by Jhrono on 02-24-2005 at 03:10 PM
RE: Can anybody develop this simple thing? - by segosa on 02-24-2005 at 06:33 PM
RE: Can anybody develop this simple thing? - by spokes on 02-24-2005 at 06:43 PM
RE: Can anybody develop this simple thing? - by segosa on 02-24-2005 at 07:08 PM
RE: Can anybody develop this simple thing? - by L. Coyote on 02-24-2005 at 08:32 PM
RE: Can anybody develop this simple thing? - by spokes on 02-24-2005 at 09:47 PM
RE: Can anybody develop this simple thing? - by L. Coyote on 02-24-2005 at 10:17 PM
RE: Can anybody develop this simple thing? - by Zephyr on 02-24-2005 at 10:46 PM
RE: Can anybody develop this simple thing? - by .blade// on 02-24-2005 at 10:48 PM
RE: Can anybody develop this simple thing? - by Jhrono on 02-24-2005 at 10:51 PM
RE: Can anybody develop this simple thing? - by segosa on 02-25-2005 at 06:56 AM
RE: Can anybody develop this simple thing? - by L. Coyote on 02-25-2005 at 07:26 AM
RE: Can anybody develop this simple thing? - by Jhrono on 02-25-2005 at 08:03 AM
RE: Can anybody develop this simple thing? - by segosa on 02-25-2005 at 08:19 AM
RE: Can anybody develop this simple thing? - by user27089 on 02-25-2005 at 09:18 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On