News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

inkey & no Dos Box

Started by herge, November 09, 2009, 10:38:12 AM

Previous topic - Next topic

herge

 
Hi *.*:

I am having problems with the inkey macro.
There is nothing wrong with the macro per se.
But if you link and Build WINDOWS exe I am
pretty sure the inkey macro is going to hang
because the EXE can't find the keyboard.
It does not crash, but it will not get to
ExitProcess.
You only find out if you go into Taskmgr and
count the number of Processes for your EXE.
Or you try to assembe your EXE and you get
an error that process is still running.

Is there any way to ask if EXE is a WINDOWS EXE
or another way to make sure you only run one
instance of EXE.

Regards herge
// Herge born  Brussels, Belgium May 22, 1907
// Died March 3, 1983
// Cartoonist of Tintin and Snowy

Slugsnack

I'm not sure what your question is, that macro uses kbhit() to determine if a key has been pressed.. This functions works correctly on 32 bit windows

I'm really not sure what you're asking except when you're saying later you want to make sure you only run one instance of an EXE.. Well that can be done with mutual exclusion, CreateMutex(), etc.

hutch--

It doesn't hang, its just waiting for a keystroke you cannot make because you don't have a console to do it with. The only solution is don't use it in a GUI app, its designed to use only in a console where you can input a keystroke.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

herge

// Herge born  Brussels, Belgium May 22, 1907
// Died March 3, 1983
// Cartoonist of Tintin and Snowy