The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: xiahan on April 14, 2012, 02:52:07 PM

Title: will the handle in multiple instances(same executable file) keep the same
Post by: xiahan on April 14, 2012, 02:52:07 PM


case WM_INITDIALOG:
         ::SetTimer( hDlg, 101, 300, NULL );
         return true;

// if running more instances of HookInjEx,
// keep their interface consistent
case WM_TIMER:
          bChecked = (IsDlgButtonChecked( hDlg, IDC_BUTTON ) == BST_CHECKED);
          if( g_bSubclassed && !bChecked) {
              ::CheckDlgButton( hDlg, IDC_BUTTON, BST_CHECKED );
              ::SetDlgItemText( hDlg, IDC_BUTTON, "Unmap Dll" );
                }
          else if (!g_bSubclassed && bChecked) {
              ::CheckDlgButton( hDlg, IDC_BUTTON, BST_UNCHECKED );
              ::SetDlgItemText( hDlg, IDC_BUTTON, "Inject Dll" );
               }
          break;





i start several times of the program , and the just behaves the same , but how can it be ?
Title: Re: will the handle in multiple instances(same executable file) keep the same
Post by: qWord on April 14, 2012, 03:13:51 PM
what handle?
If you create the dialog, you will create a new object instance and handle.
Title: Re: will the handle in multiple instances(same executable file) keep the same
Post by: dedndave on April 14, 2012, 03:22:19 PM
Quotewill the handle in multiple instances(same executable file) keep the same

no   :P

it acts the same because you reference the hDlg parameter
for example...
              ::CheckDlgButton( hDlg, IDC_BUTTON, BST_CHECKED );
Title: Re: will the handle in multiple instances(same executable file) keep the same
Post by: xiahan on April 14, 2012, 03:35:04 PM
Thanks you two, i have forgot the magic power of variable that its just a mnemonic and have different values in certain circumstance

X = X + 1

hahahaha :lol
Title: Re: will the handle in multiple instances(same executable file) keep the same
Post by: MichaelW on April 14, 2012, 05:45:12 PM
xiahan,

MASM Forum is the wrong place to be seeking help on DLL injection. Thread locked.