I set a timer to check this every 90 ms.


invoke GetAsyncKeyState,VK_I
.if eax!=0
.if == FALSE
invoke DialogBoxParam,hInstance,IDD_DIALOG1,NULL,addr InfoProc,NULL
mov ,TRUE
.endif
.if == TRUE
mov ,FALSE
invoke EndDialog,hInfoProc,NULL
.endif
.endif


If "I" was pushed it then tests infokey to see if its false. If it is then it creates the dialog. No problem. But if its true its supposed to destroy the dialog. However, this isn't coming out too well. It creates the dialog fine just doesn't destroy it. Any ideas? I think it may be due to the fact that I may not have the right handle to the dialog box or something wrong with my algo. If my handle is wrong, anyone know how to retrieve it? Thanks for the help

RIF
Posted on 2005-07-09 19:15:12 by resistance_is_futile
Should be working.. Are you doing a :

invoke DialogBoxParam,hInstance,IDD_DIALOG1,NULL,addr InfoProc,NULL
mov hInfoProc, eax
mov,TRUE

somewhere?
Posted on 2005-07-09 20:28:55 by JimmyClif

invoke GetAsyncKeyState,VK_I
.if eax!=0
.if == FALSE
invoke DialogBoxParam,hInstance,IDD_DIALOG1,NULL,addr InfoProc,NULL
mov hInfoProc, eax
mov ,TRUE
.endif
.if == TRUE
mov ,FALSE
invoke  EndDialog,hInfoProc,NULL

.endif
.endif


Still not working...
Posted on 2005-07-09 20:33:24 by resistance_is_futile
DialogBoxParam creates a modal dialog. It does not return a handle. It returns an exit code. It returns only when the dialog is closed. It does not start a new thread.

Look into using CreateDialogParam and DestroyWindow. The topic is modeless dialogs.
Posted on 2005-07-10 00:22:33 by tenkey
Thanks guy got everything sorted out. Heres the finished product


invoke GetAsyncKeyState,VK_I
.if eax!=0
.if == FALSE
invoke CreateDialogParam,hInstance,IDD_DIALOG1,hWnd,addr InfoProc,NULL
mov hInfoProc, eax
mov ,TRUE
.else
mov ,FALSE
invoke  EndDialog,hInfoProc,NULL

.endif
.endif
Posted on 2005-07-10 13:50:30 by resistance_is_futile