Jump to content
  • Advertisement
Sign in to follow this  
toony

making a minimised dialog box work in the background

This topic is 2998 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i made a small dialog box to simulate some keys but it only works when the dialog box window is selected. when it is minimised the keys cease to simulate.

i have never had this problem with console key simulation; i need to use a gui for this c project but the fact that it only simulates when the dialog window is active has left me puzzled.

some commands must exist to solve this, i just dont know which.

here is the most important code:


BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static int nextptr;
static int status = -1;

if (autom) {
readmem(nextptr+up, &status, sizeof(int));
if (status > 0)
keysim('8');
}

switch(uMsg)
{
case WM_CLOSE:
EndDialog(hwndDlg, 0);
return TRUE;

case WM_COMMAND:
switch(LOWORD(wParam))
{
case BTN_START:
autom = (autom ? FALSE : TRUE);
ghwndDlg = hwndDlg;
if (autom) {
//get pointer that points to what we need!
readmem(ptr, &nextptr, sizeof(int));
if (!autopot)
break;
}
return TRUE;

case BTN_ZSP:
zsprot = (zsprot ? FALSE : TRUE);
return TRUE;
}
}

return FALSE;
}

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
// The user interface is a modal dialog box
return DialogBox(hInstance, MAKEINTRESOURCE(DLG_MAIN), NULL, (DLGPROC)DialogProc);
}

Share this post


Link to post
Share on other sites
Advertisement
This is probably a stupid idea, but try to make it a topmost window and position it to the edge of the screen.

Share this post


Link to post
Share on other sites
Quote:
Original post by CastorX
This is probably a stupid idea, but try to make it a topmost window and position it to the edge of the screen.


lol very!!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!